in reply to Game Events and Scripting

There are many good books about game/simulation design, although most are going to show their examples in other languages. I recommend you pick one up anyway - the concepts will be highly portable and it definitely looks like you need to do some research before starting this project!

On the other hand, maybe all you need is a hint. Here's one - most simulations use a global loop which increments every object once per pass and then updates the screen with the results. Something like:

my $ticks = 0; while (1) { $_->update($ticks) foreach (@objects); $screen->draw(@objects); $ticks++; }

Each object is responsible for updating its state and exposes some kind of standard interface used by $screen to do the output (x, y, color, texture, etc). I don't know why you'd bother with XML and log files, but you could consider outputting them similar to re-drawing the screen.

-sam

Replies are listed 'Best First'.
Re^2: Game Events and Scripting
by bladx (Chaplain) on Jun 15, 2007 at 23:11 UTC
    Thanks for the hint! I remember learning a little about that in a class a long while ago... but I didn't think about how it could still apply for this type of thing as well.

    The reason why I'd even be outputting something to some type of data file... is (like I mentioned in the reply above this,) because this isn't a simulation that both runs and shows a graphical display of what is going on all that same time. I'm purposely trying to break it up into "episodes" so that when the information/data is turned into a Flash movie (or whatever is doing the graphical display side of things...) it can be a manageable size.