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 / How do I make my units not go inside each other during similar destinations?

Author
Message
brajamine
16
Years of Service
User Offline
Joined: 1st May 2008
Location:
Posted: 3rd May 2008 22:04
How do I make my units not go inside each other during similar destinations?

I'm making an RTS in DarkGDK for a group project in my Modeling and Simulations class. However, I have come across a slightly large snag... When units are given the same destination, they go inside each other. What we want to do is when they are giving similar destinations, there is a minimum distance between each one of them while moving, and when they reach the destination. just like in an RTS.


I don't have any problem code, so I'll attach the whole program (I hope that's not a problem)

Attachments

Login to view attachments
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 5th May 2008 00:36 Edited at: 5th May 2008 00:36
you should look into collision. search this board for a sliding collision tutorial.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th May 2008 20:42 Edited at: 19th May 2008 20:43
You could define one as the 'group captain' when the move order is given and calculate all the other soldiers positions as an offset from the captain.

When moving them, position the captain at the required position and then position the rest of them at the offsets previously calculated.

TDK_Man

Login to post a reply

Server time is: 2024-11-25 23:40:10
Your offset time is: 2024-11-25 23:40:10