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.

Code Snippets / RTS Formations

Author
Message
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 6th Sep 2006 01:29
Here is some work I did a long time ago. It was part of a project, but I have not heard from the folks on that project for quite a long time now, so I figure this is free to post. Anyway, this is some of my older work, and I am sure I could do better now. I might revist this type of work if there is interest in this snippet.

1) Select a formation type (at the top)
2) Left-click and drag to select units. You can select as many as you want.
3) Right-click to select the disired destination.
4) Right-click and drag to select the desired destination and direction.




Open MMORPG: It's your game!
Mr Kohlenstoff
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 6th Sep 2006 18:46
Very cool... funny to watch the units fining their way.
Sixty Squares
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 7th Sep 2006 00:25
Amazing.

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 7th Sep 2006 14:54
Very interesting ..... and cool!

Do you think it could be ajusted for 3D formations?

Im talking about the kind of formations you'd expect in sci-fi RTS games where spaceships can be set into formations. Now that woould be cool!

WORLD - A free World editor, capable of creating the most complex of worlds (including physics, skies, water, shaders, terrain editing and more). Best of all, it's FREE!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 7th Sep 2006 21:13 Edited at: 7th Sep 2006 21:16
In the snippet I posted, you can rotate and zoom the camera view using the arrow keys. You can tell that this is truly a 3D selector. I use the ground (and some pretty bad code) to tell where to draw the 2D selector object. This could be converted to make a 3D selector (or a 2D selector object with a specified depth to tell how far to go to select. Here are the functions you want to change:




Open MMORPG: It's your game!
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 12th Sep 2006 15:06
Thanks for that RiiDii. This will definatly be useful code to me, since I am working on a Sci-Fi based RTS game.

Good Work!

WORLD - A free World editor, capable of creating the most complex of worlds (including physics, skies, water, shaders, terrain editing and more). Best of all, it's FREE!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Sep 2006 10:18
neato.

"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike
da power pwnerer
17
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 25th Oct 2006 04:32
u just gave me an idea for a game by modifying ur code. i can make teams and different attacks like charge, spells, gunners

I chink i know you but i could be wong

Login to post a reply

Server time is: 2024-04-25 22:14:08
Your offset time is: 2024-04-25 22:14:08