Archived

This topic is now archived and is closed to further replies.

Help With Basic RTS Concept

This topic is 5881 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m working on creating a game using assembly language(TASM 5, by choice). This is probably totally irrelevant, since I am focusing on the design at the moment, but I thought I should mention it. It is going to be a real-time strategy wargame. I have basic knowledge of assembly language, and I know how to plot pixels using memory access. The game will run under DOS, and will use 320x200x256 graphics resolution. It will use keyboard and 2-button mouse input. It will need to support units of all different descriptions, with their own abilities and associated graphics. What I have attempted to do is make lists of actions in the form of queues, to be added to the queue in response to input by the user, and processed instruction by instruction later in the main loop. eg I click on an enemy unit to attack, and the program adds to the queue that the unit must move to that location and attack it. The problems I encountered were as follows: -Each action on the queue consists of many smaller actions, and I need some way of grouping them together so that if the action is cancelled, parts of the action don''t remain on the queue. eg I click to attack a unit. A series of instructions(say, move-up move-left move-up slash-at-enemy) are added to the queue. Then I change my mind and tell it to stop. How do I make the program so that it removes all 4 actions from the queue, not just one? -A BIG problem is the fact that things on the queue that comprise a single large instruction may become obsolete and need to be removed/moved/added. eg I click to attack a unit. The unit is moving. As the unit moves, some, but not all, instructions on hte queue need to change/shuffle-about so that the unit doesn''t just slash at where the enemy unit was when the instruction was given, but rather follow it. How does one do this? Is this a reason not to use the queue idea, or do I just need to find a way of linking the queue to decisions in the program code? I have been reliably informed that rts games are very complex. All I need at the moment(and this is still a big task) is to know basically how actions are logged and processed. You, as the prospective answerer, may either: 1)answer the questions above, 2)give me a whole lot of information, 3)set my curiosity onto some other messageboard/resource, or 4)all of the above. Any and all responses are appreciated. Whether or not I reply with a message that shoots your reply out of the air, I still appreciate it, and respect your right to disagreement and your own opinions. Most importantly, if you want more information about something, please ask me, or I won''t know I have left something out. "Of all the things I''ve lost, I miss my mind the most." Goober

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I don''t know Assembly. I could help you if you were programming in C++ or something though.
Tell me, does Assembly have user defined data structures or anything like that?

Share this post


Link to post
Share on other sites
no such luck, I''m taking a Comp architecture class as we speak, and we have to write a program that does path finding. it''s absolutely horrid and unpleasing. do yourself a favor and write a few of the functions that you want to keep in ASM, but embed them in your C++ code for th unit AI. Otherwise you''re out of luck. My professor has advised me to write everything in C++ first, and then try to translate it.

George D. Filiotis

Share this post


Link to post
Share on other sites
One possibility would be to give each unit it''s own queue, and then as you step through all the units execute the current item in the units queue. If an action is cancelled, the unit deletes its own queue completely, replacing it with the new.

I would also recommend you use C++, but I guess you know everyone is going to say that

Share this post


Link to post
Share on other sites
Instead of adding x instructions to the queue use some form of FSM architecture. You grab the instruction at the top of the queue and that tells you the current state of the unit. The unit then jumps to an area of code that deals with that state, according to the current state of the world.
You grab the top of the queue, the state says "attack x", this causes a jump to an attack state function, which takes the parameter x, looks at the world (such as where x is, where it is and what''s in between) and decides upon the next action, such as move north or fire gun or abandon plan. This way, if the plan is changed or finished you merely pop "attack x" off the top of the queue and continue with the next state in the queue, such as move to y.
This way you don''t store multiple, related actions on the queue and removing one user defined action leaves the queue clean.

Mike

Share this post


Link to post
Share on other sites
Looks like you want the Game Programming forum, which is for discussion of code issues, rather than the Game Design forum, which is for the discussion of game concepts.

--------------------
Just waiting for the mothership...

Share this post


Link to post
Share on other sites
Sorry Wavinator, but Anonymous Poster didn''t leave any contact information, so I have to answer it here. I PROMISE it will be the last one.
quote:

Tell me, does Assembly have user defined data structures or anything like that?



Yes. In fact, it has very little or no discrimination between data types. You can basically tell the computer to save a byte/word/dword/etc (or string of) for your use, and then you must manipulate the data yourself.

If you are talking about records and stuff, there is the STRUC statement, used to group stuff together.

We had better not talk about this any more on this forum. And as I said above, I am only answering this here because you didn''t tell me how to contact you. >

"Of all the things I''ve lost, I miss my mind the most."
Goober

Share this post


Link to post
Share on other sites