rts collision
-
- Posts: 19
- Joined: Wed Jan 23, 2008 7:10 am
rts collision
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?
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
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?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact:
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 )
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 )
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
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
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Sure, if the units are all homogeneous in size. Are there any RTSes written in the past 5 years where that's the case?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
What evidence leads you to that conclusion?Nova wrote:warcraft III utilizes such a way with various different sized units...
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 19
- Joined: Wed Jan 23, 2008 7:10 am
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: test
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.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way