Algorithms

Started by
4 comments, last by goober 23 years, 1 month ago
Does anyone know how to write a flowchart algorithm for a real-time strategy game? If so please tell me. thanks, Goober
On my cloud where I belong...Goober
Advertisement
Well, ok. Games with a fixed frame rate work like this:

get input
update game world
draw frame

however most games, particularly 3d games, have the frames seperate from the rest of the loop, so it is even less flowchartish. So really games don''t work that well in a flowchart, I hope you don''t have to do this for school.
Actually, it is because of school that I need it. If anyone can be more specific...

Goober
On my cloud where I belong...Goober
For an RTS''s game flow algorithm, you really have to consider the AI--at least in single player, that will make a big difference (and it will make the flowchart bigger than a 3-part loop). Maybe like this:

Get Input
|
Run AI
|
(branches out everywhere for hardcoded AI, maybe an entry for learned AI)
|
Update game world
|
draw frame

The AI branches will really be what makes a difference. You might also (at the top) add something for your initial game setup and such. Look at Ironblayde''s article GP Genesis--6 or 7, I think 7--because it has a flowchart for an RPG, and your RTS flowchart will have some things in common.

Hope that helps...
--


WNDCLASSEX Reality;
...
...
Reality.lpfnWndProc=ComputerGames;
...
...
RegisterClassEx(&Reality);


Unable to register Reality...what''s wrong?
---------
Dan Upton
Lead Designer
WolfHeart Software
WNDCLASSEX Reality;......Reality.lpfnWndProc=ComputerGames;......RegisterClassEx(&Reality);Unable to register Reality...what's wrong?---------Dan Uptonhttp://0to1.orghttp://www20.brinkster.com/draqza
If you need this for school, didn''t they give you books or whatever that describe this?



E:cb woof!
E:cb woof!
it''s probably one of those intial projects they give, before they get to the actual programming. Games just don''t translate that well. Oh and yeah, 4 steps makes more sense, AI and processing the input are the same step though, so:

getInput
determine what happens
have it happen
draw it

If you have a game with layers you could make that more steps, so you would draw the background, and then the characters, and then the stuff the characters can be under. Sure it''s grasping, but that''s kind of how you have to treat these things. Modern software is much less flow chart oriented, or in the case on non game software you have these things called "use cases", each of which leads to a flowchart, so your actual program would be multiple flowcharts.

This topic is closed to new replies.

Advertisement