Re: real-time curses?



In article <47d6c339$0$36353$742ec2ed@xxxxxxxxxxxxxx>, bear@xxxxxxxxx
says...

The effect of calling halfdelay is that when Curses is waiting for input
(ie, most of the time) it never waits more than your set interval. After
that interval, your getch or whatever returns ERR. You'll need to
structure the game as a loop around input, but that's probably what you
were doing anyway if you wanted to make a real-time game.

To make a real-time game, I would structure it around a timer. In fact,
I would do that with any game, including my roguelike Lair of the Demon
Ape.

There are two possibilities for input - either act immediately, or cache
it and wait for the timer. Both work.

In Lair, player instructions, such as a mouse-up event signalling the
selection of a player action, are sent immediately to the game logic
class (called 'Level'). It processes the action, and sends messages
back to the rendering class (called LevelWnd); these typically include
'animation' objects such as a sequence of squares the player character
moved through, or text messages to be output.

(LevelWnd also looks after input - obviously it checks that Level is
waiting for player input before accepting any instructions.)

The LevelWnd processes and renders these animations every timer call (25
times per second). A given animation such as a long move might take a
number of frames. When the animation buffer is empty it signals the
Level to proceed - in this case the Level processes pets or monsters in
sequence, until one of them generates one or more animations. The
animations are sent to LevelWnd, and Level does no more until it
receives a 'process next creature' message from LevelWnd (which it will
send as soon as it has finished rendering them).

- Gerry Quinn
--
Lair of the Demon Ape (a coffee-break roguelike)
<http://indigo.ie/~gerryq/lair/lair.htm>

.



Relevant Pages

  • Re: Turnbasing 3DRL
    ... > RLs, but as an RL gamer, I found the gameplay experience to be ... Having the game run at the ... the animation short if the player chooses to not wait for it. ...
    (rec.games.roguelike.development)
  • Re: Turnbasing 3DRL
    ... >> 2) Run the game in ASCII. ... When the player dies or wins, ... > remove duplicate actions from the final animation. ... either a movie playback generator with Final-Fantasy-like CG rendered ...
    (rec.games.roguelike.development)
  • Re: Turnbasing 3DRL
    ... >>> 2) Run the game in ASCII. ... When the player dies or wins, ... beautiful animation of that character's life. ... history of everything the PC did. ...
    (rec.games.roguelike.development)
  • Re: Roguelike Interface
    ... Even the longest "bloodslide" animation is between levels, ... It might sound like I am asking for a bit of real-time in the game, ... If there are barrels exploding when the player decides ... while not enough time has passed for the next frame ...
    (rec.games.roguelike.development)
  • =?ISO-8859-1?Q?And_Finally=E2=80=A6_Everything_That_New_DC_Logo?= Has Been Registered For
    ... non-downloadable video games; Production of video and computer game ... works of others on-line featuring articles, novelizations, scripts, ... books featuring characters ... animation, and motion picture films for broadcast on television ...
    (rec.sport.pro-wrestling)