In article <Xns99DEDAD89B6F9antontxtgmailcom@[EMAIL PROTECTED]
>,
Anton <anton.txt@[EMAIL PROTECTED]
> wrote:
> Hello all.
>
> I have a somewhat general question about game architecture. I'm gonna
> make a squad-level isometric game. I have tiles, unit animations,..
> e.t.c. And the question is, how I should design the graphical subsystem.
>
> Options:
>
> I. The game screen is updated tile-by-tile, only changed tiles
> (including characters moving thereon) at a specified rate (anomation
> speed).
>
> GUIis treated separately. Once animation has stoppped, I poll input
> events and handle them until a unit has received an order. Then I call
> the animation loop.
>
> Such things as burning things, smoke e.t.c. should be animated only
> during this "interface" loop. Same go to scrolling.
>
> BTW: Remember, in XCOM all smoke and fire tiles freezed when units were
> acting, and came back alive after they had accomplished thier orders. I
> suppose they used this approach.
>
> II. Doing everithing synchronously.
> There's one main loop, which never stops polling, handling events (Game
> screen then GUI), and immediately updating the whole screen without any
> delay. The game mechnics is synchronised by virtue of some game-event
> queue wherein events are bound to their times, so that GFX (frames per
> second) are independant of the game speed.
>
> This latter method seems easier and more versatile, but is't too
> CPU-heavy (like using an oscilloscope to drive nails in, or to shoot at
> birds from a mortar)?
>
> Thanks in advance for feedback,
> Anton
Try to eliminate polling in favor of interrupts. If you need to create
an animation effect, have a timer do interrupts for that. Do not poll
for user input, make the appropriate events trigger interrupts.
Architect everything such that it responds appropriately to the
interrupts it receives. Do what you can to eliminate all variations of
this loop:
10 Is there anything to do?
20 No? go to 10
In addition, don't worry about CPU-heavy -- you're optimizing before
you've even written a single line of code! Write your code, optimize
after you've discovered that it runs too slowly. If you've taken the
other hints, above, this will be an easy task.
--
Please take off your pants or I won't read your e-mail.
I will not, no matter how "good" the deal, patronise any business which
sends
unsolicited commercial e-mail or that advertises in discussion newsgroups.


|