Re: Just spent 5 hours bug fixing HLA Adventure (my head's about to roll off!)



On Wed, 08 Jun 2005 05:39:36 GMT
"Beth" <BethStone21@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

:They _WOULD_ have been entirely "trivial", if you'd used an "engine"
:design from the beginning...

Your advice, while correct, is a bit too general, and comes far too late.
Let me describe the problem, and its solution, in greater detail.

Paul chose to implement his parser with a string index function, which led
to such unexpected results as "welcome sailor" being interpreted as "go
west". He now understands that a string compare function is a better
choice, although it has pitfalls of its own.

Of course, this should have been a five minute change, but for Paul's
choice to code each and every word in the game's vocabulary in a separate
code block like this:

str.index(w,"bottle");
if((type int32 eax) >= 0) then
mov(11,s);
endif;

Instead, he should have placed the vocabulary words in an array of strings,
and written a procedure which used a single instance of
"str.index(w,p)", where 'p' is an index into the the string array.

He has a similar issue with the room descriptions. A number of people,
including myself, have a problem with Paul's choice of screen colors.
Unfortunately, the room descriptions, along with the associated color
settings, are implemented as a separate code block for each room. Again, he
should have placed the descriptions in an array of strings, and written a
single procedure to write the appropriate description to the screen.

On the other hand, the movement table has the correct design approach,
although the specific implementation is a bit too rigid. I have seen
adventure games where the movement rules also are written into separate
code blocks for each room.

-- Chuck

.



Relevant Pages

  • Re: Array assignment
    ... >> there's as far as I see it no technical reason for this to be impossible ... > required in a constant array before actually declaring the array. ... Then varying the length of a string is bad design? ...
    (comp.lang.pascal.delphi.misc)
  • Help in French|Spanish|German translation.
    ... I am also an author of User-defined string functions. ... WORDTRANEX (cSearched, cArExpressionSought | cExpressionSough, ... each string of the array is searched ... If the parameter nArStartOccurrence is -1 or omitted, the replacement starts ...
    (microsoft.public.fox.helpwanted)
  • Re: passing a string to a dll
    ... Joe, I really appreciate you taking the time to demonstrate this. ... sure how I would implement indexing it for random alphanumeric codes. ... I might handle the array. ... I actually have been wondering if I could use a second string ...
    (microsoft.public.vc.mfc)
  • Re: passing a string to a dll
    ... I might handle the array. ... I actually have been wondering if I could use a second string ... look at insertion cost, organization cost, and search cost. ...
    (microsoft.public.vc.mfc)
  • Re: Array Type Mismatch
    ... Dim resultAs String ... I am still somewhat confused as to why nothing is stored in the array. ... Public Function TextBoxGetLine(....arguments... ...
    (microsoft.public.access.formscoding)