Looking for suggestions/advice
Cubist at aol.com
Cubist at aol.com
Thu Aug 11 16:05:30 EDT 2005
sez rodneys at io.com:
>It seems to me that as the language grows it will get
>progressively slower if I'm just continually adding IF-THEN
>statements or adding to one large CASE statement.
Exactly how many language-tokens are you going to *need* for this thing?
Hmmm... in no particular order:
(1) RollDice
(2) MovePiece
(3) MoveManyPieces (can be implemented as a loop-wrapper around the
MovePiece handler)
(4) SetCondition (for instance, in Mille Bournes, playing a
"Punctureproof" card makes you immune to the "flat tire" hazard)
(5) GetCard
(6) ApplyCard
(7) TrashCard
(8) NextPlayer (the card game Uno has cards which explicitly stomp on the
normal order of play...)
Hmm... those are all for*playing* the game. There will also have to be
some language-tokens which define the game and set it up...
(9) DefineThing (i.e., cards, pieces, board sections (see also: Settlers
of Catan), players, etc)
(10) DefineRule (given a specific Thing, what sort of actions are allowed
for that Thing under which situations?)
(11) DefineCondition
(12) DefineVictory
That's twelve different language tokens you'll need, IMAO. Can anyone else
think of any others?
>As I've been typing this message it seems more and more that creating
>a library of commands, rather than a language itself, might be the
>better way to go about implementing this. If I do so, that might
>eliminate Revolution as a real consideration.
Naah. Rev is a consideration regardless, because somebody has to do the
hard work of writing the code which implements all the commands in the library.
Rev is way-cool for that hard work.
>If Rev could at least
>generate a script from a command file that I imported, then I could
>work around this. More sophisticated users would just use Transcript
>in DreamCard and call the scripts that implement those commands. Less
>sophisticated users would simply construct command files. I'm
>concerned that the 10 line limit on scripts created in standalones
>might be the real killer for me here.
Naah. The command file is just a list of character strings which trigger
various pre-written handlers. The 10-line limit isn't a factor, becuase *you*
(the developer) are the only one who ever has to deal with *scripts*.
Basically, load a command file into a field or variable, and let your handlers massage
said file; no problem.
>Without the way to generate
>scripts of arbitrary size from a command file, I don't see any way of
>connecting the two worlds. If someone wanted to go beyond the command
>language I provide, they would have to jump into the implementation
>language completely and ignore my cumbersome language parsing. I'm
>not sure how much of what I had already done could be made easily
>reusable for people who want to go beyond the basics.
German-type games are a *mess*, as far as conversion to a machine-friendly
form is concerned. There's far too many conditional rules and arbitrary
thises & thats.
More information about the use-livecode
mailing list