Page 1 of 1

rts collision

Posted: Mon Jun 23, 2008 11:28 pm
by chaotischerapostel
I would like to know how to go about setting up collision for a rts like game. I know to make triangle selectors, add them to meta and make a animator, and iv been trying several differnt ways like that. Currently i make a triangle selector for all nodes when they are created. Then i make a MetaSelector for every node and add all the triSelectors but its own and create a Animator, attach to the node and drop everything to be dropped. But I fear that this is a highly in-proper way of going about it and it is quite a pain to go through all of that. Is there a more proper way, or am i just missing the point of Irrlicht collision and doing it completely wrong?

Posted: Tue Jun 24, 2008 8:02 am
by rogerborg
That sounds reasonable. However, I'd imagine that bounding box collisions would be good enough for an RTS. Do you really need per-triangle collisions?

Posted: Tue Jun 24, 2008 12:23 pm
by omar shaaban
Well i think that for RTS tile based system is the best way and the faster for the computer and that the system used by most RTS games now like empire earth2 ,warcraft 3 , starcraft but by some advanced methods added as tile based system gives you to do this options easily:
1-path finding
2- collision
3-accurate estimation of the postion of the unit(very important in rts like the range property in units)
4-easier in making maps by tiles(as you will need many maps for RTS)
5-properties of tiles (like the ship cant move on ground but moves on water harder done if u used just a mesh for the map or landscape )

Posted: Tue Jun 24, 2008 3:09 pm
by Nova
i'd go with the tile based system, too...
that way you don't have to calculate bounding box collision or even triangle precise collision...

just have a 2D array of ints (or stucts if you need more options) which stores properties for each tiles
(walkable, is blocked by building / unit, is ressource etc.)

thatway collision is a simple if( MapArray[25][36] == 1 ) check,
with a system like this

0 - walkable
1 - unit / building build
2 - unwalkable

Posted: Tue Jun 24, 2008 5:49 pm
by rogerborg
Sure, if the units are all homogeneous in size. Are there any RTSes written in the past 5 years where that's the case?

Posted: Tue Jun 24, 2008 6:09 pm
by Nova
nope of course not, that doesn't mean you can't go with such a system
warcraft III utilizes such a way with various different sized units...
(worker -> unit -> hero -> siege tanks as an example)
adjust your tiles to the smallest possible unit and use multiple tiles for bigger ones...

Posted: Wed Jun 25, 2008 7:33 am
by rogerborg
Nova wrote:warcraft III utilizes such a way with various different sized units...
What evidence leads you to that conclusion?

test

Posted: Wed Jun 25, 2008 9:30 am
by gogo

Posted: Thu Jun 26, 2008 8:55 pm
by chaotischerapostel
Sorry i didnt mention that im using bounding boxes. Using presise tringleSelectors would be a bit much. The tile idea seems like an acceptable one, but arent tiles out dated a bit? Thanks for your help everyone!!!

Re: test

Posted: Thu Jun 26, 2008 9:45 pm
by rogerborg
I am so tempted to divert some of my precious bandwidth to finding out what's in there, but it turns out that the pr0n. Must. Flow.