bpred754 / Imperium

Real-Time Strategy game written with C# and Unity 3D Game Engine
1 stars 1 forks source link

Unit Movement #7

Open CurtisRose opened 9 years ago

CurtisRose commented 9 years ago

Flocking and Steering seem to be two main ways of having multiple units move together in a group and get to a target location without the fighting for position or running into each other on the way to the target location. I will look more into this.

Goal: Get Units to travel in groups from one location (or several) to another location (or possibly several) without bumping into each other or fighting for position.

Best Resource Found: Flocking: (Might be more relevant) http://harry.me/blog/2011/02/17/neat-algorithms-flocking/ Steering: http://gamedevelopment.tutsplus.com/tutorials/understanding-steering-behaviors-seek--gamedev-849

CurtisRose commented 9 years ago

Okay my goal for this will be easier than what was described above. I just want the units to point towards their destinations as they are moving. I don't want to make it to complicated but with a soldier they would basically turn pretty quickly and then head in that direction. A vehicle would sort of move in the direction it was pointing until it was pointing at the target and then continue moving towards it. A ship in space might actually act more like a unit in this regard except that its turn would be relatively slow but the movement wouldn't start until it was pointed at its target. So for now I will program how a ground soldier would act and we can worry about the others later. Maybe they would all act like the soldier and ship for simplicity.

CurtisRose commented 9 years ago

Alright, this was all not necessary so I am closing this issue. Unit movement isn't done yet but there is another issue with it open so I'll close this one and leave that one.

CurtisRose commented 9 years ago

I just realized units should be able to move up slopes and ladders etc. Right now they CANNOT change heights or anything. I don't even know how they would interact with the ground because they are not right now. They have a fixed height with no regard for what they are standing on. I don't really know how to change this to work.

CurtisRose commented 9 years ago

A new idea. The ability to create move orders that aren't completed until the user olays them. For example, user could hold alt and queue several unique orders that don't start until the user releases alt. 5 units go here, 6 here and 3 here all at the same time.

CurtisRose commented 9 years ago

Alright, unit height can change based on what layer the node they are on is at. You can add new layers for different floors and stuff. Presently, you cannot both have a ground floor and a second floor at the same X Z coordinate. So no having insides of buildings that also have roofs that units can stand on. Although, we can have roofs. The roof would not necessarily interact with the grid but that means a unit couldn't use it to stand on. I'll see what I can come up with for that.