• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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