1. Real-Time Battle System
- Posted by Andy <videogamefreak101 at hotmail.com>
Feb 21, 2005
-
Last edited Feb 22, 2005
I was wondering how you would program a real-time battle system for a rpg
(role playing game). It is where the character and the enemy do not take turns
battling each other.
2. Re: Real-Time Battle System
- Posted by Patrick Barnes <mrtrick at gmail.com>
Feb 21, 2005
-
Last edited Feb 22, 2005
DOS or Windows?
Regardless, you can't use a simple procedural design... Event-based is
the way to go.
On Mon, 21 Feb 2005 13:46:56 -0800, Andy <guest at rapideuphoria.com> wrote:
>
> posted by: Andy <videogamefreak101 at hotmail.com>
>
> I was wondering how you would program a real-time battle system for a rpg
> (role playing game). It is where the character and the enemy do not take turns
> battling each other.
>
>
>
>
--
MrTrick
3. Re: Real-Time Battle System
So I would have to program an event system and then include in the main
file?
4. Re: Real-Time Battle System
Well, the thing about a real-time RTS is that everything happens
concurrently. This is difficult of course, because classic programming
just does one thing at a time.
So you'd need an eventloop to be constantly running, querying each
component in the game to see if stuff is happening, and occasionally
updating the screen state and getting user input.
As a test, I suggest you create a screen of say 15 circles. By
clicking on a circle then clicking on another location, you can make
the circle 'move' to that location, not instantly, but slowly, over
several iterations. While that circle is still moving, you can do the
same with another, and another, and etc...
That should help wrap your head around what is required for real-time strategy.
Perhaps it would be beneficial in the game (not the above test though)
to have two programs - a graphics/interface program and a backend
program, and have the two communicate via IPC.
On Mon, 21 Feb 2005 17:58:09 -0800, Andy <guest at rapideuphoria.com> wrote:
> So I would have to program an event system and then include in the main
> file?
--
MrTrick
5. Re: Real-Time Battle System
Rob wrote a nice event timing system for his Langwar game (in
EUPHORIA\DEMO\LANGWAR folder). I used it to make a simple version of a
Matrix screen (search for Scrolling Demo). This timing system works
great on DOS and Linux and could probably be adapted for use in
Windows by using the Multimedia Timers (not Win32Lib's timers). Its
been a while since I've used it, but it may very well suit your
purposes.
~Greg
On Tue, 22 Feb 2005 13:05:39 +1100, Patrick Barnes <mrtrick at gmail.com> wrote:
>
> Well, the thing about a real-time RTS is that everything happens
> concurrently. This is difficult of course, because classic programming
> just does one thing at a time.
>
> So you'd need an eventloop to be constantly running, querying each
> component in the game to see if stuff is happening, and occasionally
> updating the screen state and getting user input.
>
> As a test, I suggest you create a screen of say 15 circles. By
> clicking on a circle then clicking on another location, you can make
> the circle 'move' to that location, not instantly, but slowly, over
> several iterations. While that circle is still moving, you can do the
> same with another, and another, and etc...
> That should help wrap your head around what is required for real-time
> strategy.
>
> Perhaps it would be beneficial in the game (not the above test though)
> to have two programs - a graphics/interface program and a backend
> program, and have the two communicate via IPC.
>
>
> On Mon, 21 Feb 2005 17:58:09 -0800, Andy <guest at rapideuphoria.com> wrote:
> > So I would have to program an event system and then include in the main
> > file?
>
> --
> MrTrick
>
>