• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Custom Movement System

Status
Not open for further replies.
Okay, that 522 max movement is killing me. I want to create a mount system that increases the hero's movement speed by a percentage. However, I encountered some problems as to what I would do when the hero is ordered to move.

a.) First solution would be to list all movement orders and calculate some mind burning things.

b.) Second solution would be moving ahead the unit's facing angle using SetUnitX/Y. (The unit would turn to where it wants to go)

It would be the easier solution B. However, there are cons. What if the hero is supposed to turn around 180 degrees.. and the movement system moved him in an arc instead of directly moving in the opposite direction, thus acquiring the aggro of nearby creeps.

What would be a solution?

Another question, if the movement speed is very high; let's say 1000(/33 = 30.30), and there was an impathable object within that 30 distance, how do I prevent the unit from going through that object?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
I have used Purge's system and while it is good, unless I don't remember correctly you'll have to trigger all slows in movement speed if the unit is over the 522 cap.

Might I recommend just scaling everything down to below 522?

It might be awful but...100 ms workers, 200 ms grunts, 300 ms heroes, 400+ mounted heroes? Although if you want a big disparity you'll have to do some pretty magical things to not use a system like purge's
 
For (b), instead of doing it based on facing angle you would just do it based on the angle between the new x/y and the old x/y (with a rapid interval, e.g. 0.04, 0.03125, 0.03, etc.). That is essentially how Jesus4Lyf's system works (the one mine is based off of), so if you want to make your own--that is how you would approach it. Technically it could be made in GUI, but it would actually be more work for a GUI user to use it because you can't use the default function to set the movement speed (which can be annoying to factor in when triggering an arbitrary movement bonus).

Although, 1000 seems to be a bit much. :p You should check out the test map and see just how fast it is (type "1000" in chat). The issue is that with the method, units tend to bounce around points when they need to cut a corner or turn a little--at least when you get to really high movement speeds (pretty much 1k or beyond).

The only alternative I can think of that would avoid those issues is to completely redo the movement system. In that case, you would have to look into pathing algorithms which can be pretty annoying/excessive, and may drag performance (unless it is only for a few units).

Good luck. Let me know if you need any more info.
 
Status
Not open for further replies.
Top