Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About nlarooy

  • Rank
  1. Take a look at this: http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ It certainly helped me make some similar decisions for the game I am working on.
  2. This makes sense, but suppose you have a behaviour which you want performed after the unit arrives? You need to be able to decide when a unit has arrived at the target, and this will differ based on whether other units are in the way etc.
  3. Further thoughts... I'm going to try something like this: Move(units, target) { groups = groupUnitsByPosition(units) if (groups.Count > 1) { foreach group in groups { Move(group, target) } } else { MoveUnitsLikeBefore() } }
  4. I also considered having an abstract MoveOrder coordinating the whole group. There are a few things that scared me away though. It introduces additional "administrative" work like tracking all the members of the group, handling cases where units are given other orders/die etc. Maybe this is necessary, but I always try to find more lightweight solutions before bloating my code with additional "systems". Then there is quite some amount of cases that this approach still doesn't handle: 1. Units with different velocities/groups that get split up: When the units end up being spread out or forming multiple groups because of different velocities or because some might get stuck on something/attacked etc. you might end up calculating an average position that is just in the middle of nowhere between your units. Without trying it out this sounds like a source of glitchy behavior. 2. Also, how do they arrive if they get separated? Will the first ones just try to arrive separately and twitch out until the average position has converged? 3. It doesn't handle "implicit" groups. Think of say starcraft where you have different controlgroups for different types of units (infantry, air, spellcaster...). If you want to move your army, you just send all those groups to the same location but wit different commands. So the different groups might get into each others way at the destination. [/quote] Agreed... I just tested it. It works very nicely when the units are all together (close to the separation distance) and you move them to a new location. It works horribly when they start scattered around the map. Back to the drawing board...
  5. Yeah, I did read all of the search results I could find, but to no avail. However, I have an idea of how it might be done! You create an abstract "MovementGroup" object.This object provides a target for the group to head towards, and a steering which is the "arrival" from the average group position to the target.It also detects when the average position of the group is on the target, at which point the group will be considered to have arrived.If the group has not arrived, all of the units in the movement group behave as a flock, with "separation", "cohesion", "alignment" to the MovementGroup's steering and "arrival" towards the MovementGroup's target.Otherwise, all the units perform a "braking" behaviour. This should make the units stop scattered on top of the target.
  6. Hi there, I'm using a combination of separation, cohesion and arrival steering behaviours for units that I want to move towards a given point. In motion, the system works fine. However, when they group reaches the target, they all start jostling and bouncing off of eachother, and only a few actually stop at the target. Any ideas on what behaviours/techniques I should use for this situatuion? Thanks
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!