RTSUnit collision checks?
by Stephen Zepp · in RTS Starter Kit · 11/11/2004 (7:19 pm) · 6 replies
Currently, RTSUnits do not seem to have a collision box--they walk through each other, as well as walking through RTSBuildings.
Is that a design decision, simply lack of collision boxes on the example .dts's, or a bug or some sort?
Is that a design decision, simply lack of collision boxes on the example .dts's, or a bug or some sort?
#2
I've done a lot of work on AI in the past, before coming to GarageGames. Now, for this kit, I've actually put a lot of work into the kind of full-on, robust AI system I discussed above (there was just no way to justify putting it all into the pack itself at this point, nor spending enough time before launch to get it release-quality). At home, I have an AI / behavior system for this kit which I'm very proud of so far.
The system defines an easy to understand framework for attaching AI behaviors such as obstacle avoidance (eg steering behavior), target acquisition (eg identifying and targeting enemies), patrolling, waypoint following, group movement and cohesion behaviors, etc, etc, etc. I've implemented examples of the specific attachable behaviors above already. It's nice, and it's very efficient even with large numbers of units. Also, it's designed to be compatible with higher-level AI systems to control strategic decisions. For example, it could easily be used in the kinds of layered or hierarchical command systems which are so widely discussed in regard to RTS AI nowadays (eg AI Game Prog Wisdom 1 and 2).
However, it still needs quite a bit of love-- not near release quality stuff yet. I can only work on it in my spare time, and it seems I have less and less lately. Also, I'd love to get a full-on pathing system in there, but it's a very interesting problem for Torque in an RTS setting... efficiently and intelligently pathing on the kinds of terrains Torque can generate is an interesting problem in and of itself, and it gets complicated more by having potentially dozens or hundreds of units to path at the same time. It'll be a fun one to tackle. :) When I first looked into it, I tried about 6 commonly used approaches and none were good enough.
Okay, reason I go into all of this is, I'd like to poll people on whether they think someting like this would be worthwhile as a separte product. That'll help me decide whehter it's worthwhile to spend some serious personal time on it.
If I get time to finish this AI system up, I might release it as a separate (low-cost) product, since there's so much to it. Or, it might just be put in RTS Pack down the road a little ways. The way things are shaping up, it might even make sense as a general product for Torque, not just for RTS (though I don't want to step on the toes of the team that's already working on an AI Pack for Torque). Anyway, haven't decided yet, and the route this goes will probably depend on whether I get a full, performant pathing system in place or not, and if I do a layered strategic command system too. If not, I'll likely release it as a free extension.
Down the road a little ways, I could use a good white-box / capable beta-tester for this stuff. So, let me know via email if you're interested Stephen. :)
11/12/2004 (3:33 am)
Okay, now it's late at night, and I tend to get chatty late at night, so let me drone on a bit about some stuff I have at home. Please note when reading this... I make no promises at all about getting any of the stuff below into the RTS Pack. I don't even know if I'll get time to finish it all, and if I do, I might make it into something separate. :)I've done a lot of work on AI in the past, before coming to GarageGames. Now, for this kit, I've actually put a lot of work into the kind of full-on, robust AI system I discussed above (there was just no way to justify putting it all into the pack itself at this point, nor spending enough time before launch to get it release-quality). At home, I have an AI / behavior system for this kit which I'm very proud of so far.
The system defines an easy to understand framework for attaching AI behaviors such as obstacle avoidance (eg steering behavior), target acquisition (eg identifying and targeting enemies), patrolling, waypoint following, group movement and cohesion behaviors, etc, etc, etc. I've implemented examples of the specific attachable behaviors above already. It's nice, and it's very efficient even with large numbers of units. Also, it's designed to be compatible with higher-level AI systems to control strategic decisions. For example, it could easily be used in the kinds of layered or hierarchical command systems which are so widely discussed in regard to RTS AI nowadays (eg AI Game Prog Wisdom 1 and 2).
However, it still needs quite a bit of love-- not near release quality stuff yet. I can only work on it in my spare time, and it seems I have less and less lately. Also, I'd love to get a full-on pathing system in there, but it's a very interesting problem for Torque in an RTS setting... efficiently and intelligently pathing on the kinds of terrains Torque can generate is an interesting problem in and of itself, and it gets complicated more by having potentially dozens or hundreds of units to path at the same time. It'll be a fun one to tackle. :) When I first looked into it, I tried about 6 commonly used approaches and none were good enough.
Okay, reason I go into all of this is, I'd like to poll people on whether they think someting like this would be worthwhile as a separte product. That'll help me decide whehter it's worthwhile to spend some serious personal time on it.
If I get time to finish this AI system up, I might release it as a separate (low-cost) product, since there's so much to it. Or, it might just be put in RTS Pack down the road a little ways. The way things are shaping up, it might even make sense as a general product for Torque, not just for RTS (though I don't want to step on the toes of the team that's already working on an AI Pack for Torque). Anyway, haven't decided yet, and the route this goes will probably depend on whether I get a full, performant pathing system in place or not, and if I do a layered strategic command system too. If not, I'll likely release it as a free extension.
Down the road a little ways, I could use a good white-box / capable beta-tester for this stuff. So, let me know via email if you're interested Stephen. :)
#3
So good to hear that it was decided for the reasons you listed--as opposed to ones that would be much harder to correct/adjust!
AI: We have some things (including integrating this baby into our code) on the plate in the short term. The formation stuff is just "get to know the pack" stuff right now, but we plan on working on terrain deformation (when you place a building, give the player the capability to build a "level foundation" underneath it), and then a rather large design for making walls--basically, a mechanism to allow RTSBuildings to sense each other, and snap together like lego pieces.
Once these two tasks are moving well along/finished, I would love to help out with your AI stuff--I've got some background myself in simple state management (WAY back when I wrote semi-scriptable in game resource collecting, building placement, etc. for my MUD codebase, which was pretty complex for that time), so it would be fun to work with it with you.
Drop me a line (email in profile) when you're thinking about getting up to speed with it!
11/12/2004 (4:15 am)
General: The only thing I was worried about regarding collision being absent was that it was a performance decision--it seems that even now AAA games are blowing off unit collision against other units (Shadowbane, and it was HUGELY abused--"stacking" anyone?), and even WoW completely blew it off.So good to hear that it was decided for the reasons you listed--as opposed to ones that would be much harder to correct/adjust!
AI: We have some things (including integrating this baby into our code) on the plate in the short term. The formation stuff is just "get to know the pack" stuff right now, but we plan on working on terrain deformation (when you place a building, give the player the capability to build a "level foundation" underneath it), and then a rather large design for making walls--basically, a mechanism to allow RTSBuildings to sense each other, and snap together like lego pieces.
Once these two tasks are moving well along/finished, I would love to help out with your AI stuff--I've got some background myself in simple state management (WAY back when I wrote semi-scriptable in game resource collecting, building placement, etc. for my MUD codebase, which was pretty complex for that time), so it would be fun to work with it with you.
Drop me a line (email in profile) when you're thinking about getting up to speed with it!
#4
Of course, instead of bowing to a higher rank that happened to be an enemy, you'd want to hook in combat sensing/handling AI for the unit.
I'll try to track it down again, see if it helps, or maybe gives some suggestions.
P.S.: I did note btw that RTS units are superman, able to leap tall terrains in a single bound!
11/12/2004 (4:19 am)
P.S.: I can't remember the name of it (late night for you, early morning for me, just woke up!) but I saw a cooperative pathing algorithm that seemed logical to place into an RTS style game. Basically, whenever there was a predicted or discovered conflict, units would pause to allow a higher "ranked" (arbitary generated hierarchy) to continue on their path, and take their path back up after the conflict was resolved.Of course, instead of bowing to a higher rank that happened to be an enemy, you'd want to hook in combat sensing/handling AI for the unit.
I'll try to track it down again, see if it helps, or maybe gives some suggestions.
P.S.: I did note btw that RTS units are superman, able to leap tall terrains in a single bound!
#5
11/13/2004 (4:40 am)
Josh. The truth is that the collision detection and the other AI work would also be very useful. I'm just scratching the surface of the RTS tookit now. Being new to Torque means I'm learning right across the board right now. Notably with Kenneth Finney's book in tow - or rather it pulling me. However, I can see that this would be very useful for a great many projects and not just RTS at that.
#6
I'd love some feedback on the instructions and value of the resource!
11/13/2004 (4:46 am)
@K C: (shameless plug): You may want to check out my formation move resource--it's designed to get you in and looking at the code with some very obvious gameplay effects: Formation Movement in the RTS Starter KitI'd love some feedback on the instructions and value of the resource!
Torque Owner Josh Williams
Default Studio Name
It's not a bug, just a decision. This was my call, so let me explain the reasoning I used, and see what you think.
For the shipping version of this pack, Ben did provide a simple hook where people can input their own collision and obstacle avoidance behavior. It's commented in the script code, and you can either fill-in your own implementation and hook-in there, or define your own separate system.
I didn't put in a specific implementation for collision and obstacle avoidance for two reasons. First, we couldn't justify spending the time to do a full-on, robust AI system for this pack that'd work in the context of most any game design. Now, if we couldn't do something robust and generalized enough, we'd be stuck just doing a chintzy example implementation that any serious team would end-up needing to replace anyway. It's hard to justify spending time on something like that too.
Obstacle avoidance, like most AI stuff, is actually a fairly game-specific problem. Even amongst RTSs, different game designs would require wildly different approaches to an AI system like obstacle avoidance (eg does the game have large occluders like forests or is it set in sparesely populated areas? Can you build walls and large obstacles? How intelligently do you want your units to move-- should they just swarm around obstacles, or should they pick the cleanest, fastest long-term line?). Heck, even within a single game, you typically want different unit types to have different collision (eg gatherers vs troops), and obstacle avoidance (eg tanks vs airplanes).
In general, the goal with everything in the Starter Kit was to have it be robust and flexible enough to work in the widest variety of game designs. The camera, selection, command, networking, etc, etc are all robust and can easily work in a very wide variety of game designs-- perfect Starter Kit-type material. The simple obstacle avoidance / collision system we originally planned on doing would not have been at all.
I did try to get a simple example collision and obs avoidance implementation going, but I could justify spending only very, very limited amounts of time on it, entirely in my spare time. In the end, I didn't get it to release quality in the amount of time I could justify for myself.
All that said, whether an example implementation ends up in the kit in the future depends on two things: how well the kit sells, and how badly people want such a system (in relation to other potential stuff we could do.. eg more rendering optimizations, etc). So, if you want to see an example implementation using the simple hook we provided, certainly speak up and it could get into a future version (if we can justify continuing to work more on this thing). The simple collision and obs avoidance system I was working on is easily 95% of the way to release quality, but there are just a couple niggling little issues to work out. But again, that simple little example system really wouldn't be useful to a serious game.
Stephen, for you personally, if you're not sure how best to go about implementing this kind of stuff, please feel free to email me. I'd be happy to share a good approach with you.