[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pbmserv-dev] why is Init() recalled each time? (long)
Richard and others, I need to get some sleep but I just want to
throw out this question and ask for a way around this problem.
<rant on>
Why does the game engine run the function Abalone::Init()
(or for example Backgammon::Init(), etc...) *everytime* that
someone makes a move? I thought that the reason it was called
*Init* was that it meant that this function was an INITialization
routine that would only run *once* when the game was first started
with a 'challenge' command??? But it is not! This is frustrating!
What I wanted to do was add a few lines in the Abalone::Init()
routine so that all _new_ games that were started with *my* new
Abalone code would have a special parameter set that would allow
the Abalone game engine to recognize which games were still old
(using the previous programmer's code) and which games were started
with my new revised code. UHG!!! I can't do this because the
Abalone::Init() routine is run everytime a move is made and therefore
my special parameter is inserted even in the old games that were
started before any of my code changes.
I would think that if there were a special, easy, simple way of tracing
which code revision was used to start a particular game board number,
then programmers could make updates and changes to a gametype quicker and
easier and not have to worry about the new code crashing when dealing
with an old game file.
I first ran into this problem when I wished to update and enhance the
gametype Soccolot. I had originally programmed Soccolot but did not
make it "super flexable" nor "expandable". I was in the process of
writing some updated/enhanced code that would have made the game really
interesting/funny/bizarre including multiple player, fouls and injuries
on the field which would have meant that some would have to leave the
field, a referee on the field that was run by a simple AI, a variety of
announcers/sports casters (I was hoping to get this one in somehow),
as well as cheerleaders/spectators on the sidelines that would move
up and down the field following the location of the 'action' on the
field (but this would not have been too interesting with ascii graphics :-)
When I realized how different the two game files would have been between
old and new and how difficult it would have been to try to convert/adjust
between the two I considered simply writing a new gametype called
Soccolot2, but when I talked to Richard about it he said, "No". :-(
I canned that project and decided to move on to other games...
Oh well, I am way over-tired and need to sleep. Any suggestions? Hints?
Sorry if I sound like I'm whining. :-)
<rant off>
--
Douglas Zander