Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / starting a RTS

Author
Message
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 29th Jan 2004 00:38
Hola como estas
translation...
hello how are you?

Ok now on to the actuall post...

I have been planning an RTS fo weeks now, I have begun the process of making models for the game but I just realized something.... I cant program worth a crap , well atleast when it comes to RTS games.
I am unsure how to go about the RTS basics, you know unit selection, moving, attacking. MY first idea was to check for the mouse position and if it was the same position as a unit and the mouse was clicked then the that unit would be labeled "selected", the only problem with that is that my game is expected to have hundreds of units. I dont want to create an If then statement for 400 objects so my question is....

How do I go about making the basics for an RTS? how do I select units with a mouse click or by dragging a box? and how do I move units or make them attack the position that I click?

I know that is asking alot from yall and I am sorry if I seem like a compulsive question asker But this project is very inportant to me. Oh yeah and I have decided to include the names of everyone who as answered a quesion for me in the credits of my game so I am not going to forget about you kind souls. There may be many more questions to come so please dont get mad.

PS: some of you might be wondering "didnt you just ask a bunch of questions about an FPS" The answer is that yes I was going to make an FPS, but my idea was not very original so I cancelled developement, Also have you ever heard of a RTS games in wich you control ants you know the insects that bight you. Because that is the point of this RTS and I want to make sure it is an original Idea.

wow that was a pretty large post, I could write a novel worth of questions lol .

Thank you very much

Mr.Payn

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Douglass
21
Years of Service
User Offline
Joined: 28th Aug 2003
Location:
Posted: 29th Jan 2004 01:07
use a for loop to check all the objects and have a list that keeps track if they are selected.

Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 29th Jan 2004 02:06
I know what you are talking about and will try that, But I havent got that far . I still need to know how to "select" them and tell them to move,attack etc....

One other thing to keep in mind is that there will be hundreds of units, Is there a way to select a individual unit out of hundreds without programing an IF THEN statement for each object? Also I was just thinking that I do not want to load 400 objects, that would be to much code. Instead I thought that if the player decides to build a unit then he clickes on the button and a couple of seconds later it loads the object, how would I do this?

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Bishop
22
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 29th Jan 2004 02:39 Edited at: 29th Jan 2004 02:40
hey,
i just saw your post and thought that this code that i started may help you out.....it has multiple unit selection and movement....i started grouping, but didn't get very far on that...

about your question about the IF THENS for all your objects, use something like:
for x=100 to 500
if unit selected etc.etc.
next x


anywaym heres the code....it was coded in pro, but works in classic too.....btw, i did not do collision


hope i helped,
Bishop


p.s.-i suggest learning from this code and coding your own (thas the best way to do things), but the code is yours

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 29th Jan 2004 04:24
Oh thank you so much you really helped me out there. I will add a special thanks to you in the credits. I am learning alot from your code, once again thank you .

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 29th Jan 2004 04:28
There is one more thing that I want to know, How do I draw a box on to the screen and select all of the "players" units that fall within that box?

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Jan 2004 05:36
I think I can get you started a little bit.
Firstly, will there be a limit to number of units you can select at one time? That could greatly reduce calculations if you're going to have 500 units.

To select units, get the four corners of a selection box(sx,sy,etc.):




To assign group numbers is easy:



And finally, how to draw a box!




That about cover all your questions for now?

"eureka" - Archimedes
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 29th Jan 2004 08:07
hrm...ive been trying to make the drag/select thing for awhile now, keep getting an error, but im working on it
but i store weither an object is selected or not in an array. like so:

1800 being the max number of units in one game INCLUDING buildings, but that number will drop, i just chose 1800, because of some little simple math of mine (800 * 2 + a few, 8 players, 100 units/100 buildings, plus a few extra for fun )

Travis
21
Years of Service
User Offline
Joined: 9th Nov 2003
Location: West Aust.
Posted: 29th Jan 2004 09:57
iv seen a rts about ants, dunno what it wasa called prolly 'ants' or somthing, there were 2 teams the red and the black , they fought each other and collected food and stuff

so i dont think ur idea is 100% orig. but then its impossible to have a 100% orig idea nowadays
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Jan 2004 11:14
It was made by EA I think. Sim Ants? I used to have it somewhere. There was a trick where you could take control of the spider, hehe.

"eureka" - Archimedes
Cyberflame
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: Im not sure....
Posted: 29th Jan 2004 13:31
Ohh yeah! that game was cool...It was real easy to win tho. All you had to do was set the game speed on maximum and it auto takes over.

quad 10k terrahert cpu| 9k^9k terrabyte(tb) hd|stolen military graphics card capable of rendering all of the pixar movies in 5 secs|999^9k tb of ram

15in monitor with 13in veiwable screen
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 30th Jan 2004 00:39
Darn I thought I had an original Idea there. Oh well I am going to do it anyway.

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 30th Jan 2004 00:54
Phaelax I tried your code on drawing a box and I get an error it says something like "function decloration has unkown paremeter". I also got an error on the first snippet of code that said "unknown command" and pointed out the piece of code "select_unit(obj)". I am not sure if the code is going together with what I already have I have included what I have in the source code

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Jan 2004 04:16
The code isn't stand-alone. "select_unit(obj)" just represents where you would define your unit as being selected. In your case, that's where you would throw a flag up in your array. If you wanna check out the code in its entirety, check out the code snippets board for my rts barebone post.

"eureka" - Archimedes
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 31st Jan 2004 00:11
your RTS is for DBpro I am using DBC. Plus when I click on the link it is boken. will it work in DBC if so could you please put a working link up so I can download it with the media because it souded like you were using media.

Thanks alot

Mr.payn

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Jan 2004 12:47
The working link is on the last page. The project was originally started in DBC, along with a map editor I made as well. I'll have to dig it out.

"eureka" - Archimedes
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 31st Jan 2004 18:22
I clicked the link to the alien RTS engine but when I go to compile it, is says Unknown command and points to the command "depth# as float=498.0" what do I do?

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Travis
21
Years of Service
User Offline
Joined: 9th Nov 2003
Location: West Aust.
Posted: 1st Feb 2004 14:50 Edited at: 1st Feb 2004 14:50
you have to use dark edit and have some setting turned on so it will accept types...im sure someone will fill u in if u wait
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 2nd Feb 2004 04:15
As Float, As Integer, As Boolean, As String and As Byte don't work in DBC.

To fix it, simply change the line so that the As Float isn't there,
ie, so it is; depth# =498.0

Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2025-06-04 01:46:47
Your offset time is: 2025-06-04 01:46:47