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.

Newcomers DBPro Corner / Real Time Strategy Help

Author
Message
CSGames94
16
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 16th Jul 2008 07:21
My I am having problems with my game when it comes to selecting units
Nano brain
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 16th Jul 2008 09:41
Will you be a bit more specific? I might be able to help, but I'm not sure exactly what you mean by 'units'.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 17th Jul 2008 01:03
i would like to know how to make a rts game aswell but i dont think it is easy to know what you mean
eg what are the units like, how to select them..

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Torgoth
16
Years of Service
User Offline
Joined: 16th Dec 2007
Location:
Posted: 17th Jul 2008 07:25
If the units are objects you can select them by using the PICK OBJECT command.
CSGames94
16
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 18th Jul 2008 02:42
Well since you don't know what my Talking about, you can look at the code.

Nano brain
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 18th Jul 2008 08:30 Edited at: 18th Jul 2008 08:41
Master13,

Don't get impatient so quickly, especially with people who are trying to help you. If we don't understand...we don't understand. That's all there is to it. Just then take the small amount of effort it takes to clearly and definitively explain your problem to us. Good communication is key. There's some wisdom for your soul.

Now back to the going matter. I suppose your problem is trying to select 3d objects with a selection box. First, here's an example:



The key here is preciseness of the selection. Simply checking if an object's screen coordinate is within the selection box is not precise at all. This is because that coordinate is a single 2d point. Therefore, if your object takes up a large area of the screen, the box will still only select it if the object's origin(a single 2d point on the screen) is within the box. So, you can have the box covering half the object before it's ever selected.

So, whatda' we do? We use a series of pick object commands placed uniformly at several points throughout the box. The more the points covered the higher the precision of the selection box. In the example code above I have set the pickintegrity to 20. So the object check for loop will position the pick object command at 400 seperate points within the selection box...20 columns across and 20 rows down. This works quite well, and is very fast.

*Note:The selection box would probably be even more precise if every other row were offset on the x axis.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Jul 2008 20:26
Check these out Master13:
http://zimnox.com/?page=dbTutorials


CSGames94
16
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 19th Jul 2008 22:03
Thanks A lot everybody, this really helped me in making my game.

Login to post a reply

Server time is: 2024-09-27 18:20:19
Your offset time is: 2024-09-27 18:20:19