• 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.

Alternative for dummy.mdx for controling projectiles

Status
Not open for further replies.
Level 10
Joined
Apr 9, 2004
Messages
502
Hello all,

Been a long time and I find i'm wanting to try and play with wc3 modding once again. I have a new setup I'm playing around with. I've always been frustrated by the limitations of vex's dummy model and I wanted to see if it would be worthwhile to try another approach.

I have a simple test map to showcase what I think could be a fantastic way to use a wc3 exploit to create a much more versatile projectile dummy unit that could be set to move with any projectile attached in any way you want.

It was initially shown in this thread: http://www.wc3c.net/showthread.php?t=105830

but they stated that there were limits because of how it was setup, stating that you couldn't actively adjust the projectile during flight, only at the launch. But I've found a way to make it update constantly and all the time so that you can have realtime instant change in motion.

The catch: each projectile is actually 2 units. 1 provides the base and the other a direction to look at. Why is this important? Because for some reason they have a function that lets you control what UNIT another unit looks at. The test map shows that you can dynamically alter the facing direction of the missile almost instantaneously and much more responsively than setting unit facing or otherwise. The method works is by first locking the facing onto a second unit and then manipulating that unit. For some reason the tracking is locked on almost perfectly and you can test it out but even when you try for rotation with a pitch angle, the tracking is only limited by the model itself, or at least that seems to be what I've noticed as different models give better or worse tracking based on the model head bone.

The only thing I'd need would be a dummy unit with a "head" attachment at the origin.

Granted this may cut the amount of potential missiles present on the map by half but depending on your map's limitations, 4000 true projectiles at once is still a much higher cap than than you'l probably need. This, of course, assumes you trigger all projectiles. This could easily be used so simply make some spectacular missile effects all controlled within the WC3 editor itself.

Any thoughts?

[edit] Updated the map to better showcase the potential of this and to confirm a few things.

Test map shows 2 features.

1st feature allows you to play and see the realtime missile tracking in a smooth motion. This kind of motion could be used to make a projectile rotate in any sort of way you'd want it to (example, if your pitlord throws his weapon, you can make that weapon spin in any direction you want)

The second feature shows the responsiveness of the method. Click "start crazy" and a random location will be chosen and refeshed at 0.01 seconds. Pay attention to the movement of the projectile, there's no lag and freeze up time like what you would see if you tried animating this using the vex. dummy unit and setting unit facing. This is actually instant change in direction.

Based on this testing, to the untrained eye this seems fairly trivial BUT what this actually means is you can basically control 100% of a projectiles motion and facing all with triggers. AND it seems to show that it's the most responsive thing to date, way faster and more accurate than relying on constantly updating animations or unit facing.

So you want to make a currently stationary axe model rotate? No problem. You want to be able to adjust the rotation speed to whatever? Go nuts! This could have endless potential use!

Now this is all fine to submit this but I'd like some feedback from the community. Is this feasible as a map setup?

[Update 2 2016-01-18]

Modded the dummy unit such that it now works how I want it to. A few things to note, this now shows pretty much exactly the way I expected it to go. I'll be creating some interesting effects to showcase the utilities of this. Granted it'll be in .GUI so buggy to the max, but it should show some pretty cool effects.

[Update 3 2016-01-20]

Learned a few things and created a new dummy. Now has 4 attachment points that change the projectile orientation allowing for better manipulation of existing projectiles.

head attaches the projectile as normal, overhead creates a 90 degree twist, chest creates a 90 degree rotation towards the vertical, and origin creates a 90 degree rotation to the right.

Dummy built from scratch and only costs 1 KB, so yay!

Big limitation discovered, while super accurate this only works on -90 to +90 degrees towards any facing angle. You might think that's no big deal as the projectile can theoretically face any angle BUT it does mean some animations like rotations that have a roll or forward rolling abilities don't quite work. Forward roll can work if the projectile is symmetrical enough but otherwise you can't simulate a full frontal rotation. I did learn a few things and while it is possible to code the animations for this, if you actually want to capture the full motion you need 360X360X360 = 46,656,000 animations if you broke everything down into intervals of single degrees (so it's not worth it). This would allow the model animation to face any point in a sphere at any "screw" rotation. This is the only way to cover any possible projectile flight orientation. The facing method essentially lacks the rotation ability so it is always facing any point with a 0 degree angular offset from the horizontal. Again, for symmetrical objects this won't be noticeable but anything non-symmetric, like a unit, will be very limited.
 

Attachments

  • TestMap.w3x
    27.4 KB · Views: 87
Last edited:
So you want to solve the problem of having to preload a bunch of units to get the facing angles right by creating ANOTHER set of dummies just to adjust the look-at from the original dummy?

Sounds counter-productive to me.
Preloading projectiles is recommended anyway, as CreateUnit() is taxing. Sorting these preloaded projectiles by angle (like MissileRecycler does) is the obvious next step and solves the problem of facing angles elegantly.

It's not that your idea is bad; it sure is a different take on the problem. But imho this creates new exciting problems for the few ones that it fixes.
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
The SetUnitLookAt native has offset parameters. Cant those be used to only have one eye catching unit?

Afaik the vex model only allows for changing pitch and with wc3 facing angle (yaw) that leaves roll still missing. How about exponentiating the vex animations? How many animations are possible?
 
Level 10
Joined
Apr 9, 2004
Messages
502
Thanks for all the feedback, I'll try respond in the order of comments posted

@Wietlol: My point was that there are very few maps that would ever reach 4k simultaneous projectiles. Also the set facing is very slow and has limitations in terms of range of motion where this has quite a lot more options. You can easily outspin the current setup with this method (i.e. say you wanted to adjust the spin rate on a projectile, this doesn't have a cap whereas set unit facing does)

@Zwiebelchen: I don't want to solve that problem, I think preloaded projectiles makes sense in terms of setup so I'd totally go for that. What I'm trying to improve on to an extent is the responsiveness of the dummy unit that is used to make projectiles face the proper direction, but that is only 1 application. This can be used for all sorts of applications and spell effects and it gives you full control of the projectile within the wc3 editor and not by any outside animation or additional model. You can rotate an object, reflect it instantly, have it accurately travel in any path and any direction or orientation. It also isn't limited by turn rates, which setting unit facing is. It also isn't limited by animations available which the current dummy is. For instance, you can't do a frontward spin like on some of the axe projectiles with the current dummy unit but you can with this.

@WaterKnight: Interesting thought, I'll have to check on this as it would then only require 1 additional dummy units and essentially an aditional 3d point. I'll test it out and get back to you.
Also, you are correct with the current limitations and if we had an animation for each unique degree within a 3d sphere i think it's 360 X 360 # of unique animations to reference, my math might be off on that. However, with this method you could trigger a roll effect on rotation objects, which is the only time i'd say it would make a difference.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
I was trying to get to the point that you wont reach 500 missiles with double dummies.

However, with the offset, it might work... we could replace the current animations with the roll animations to make everything work... I suppose that this only changes the pitch and yaw of a missile.
 
Level 10
Joined
Apr 9, 2004
Messages
502
I'm a bit confused now @.@.

What I was implying is that while it's less efficient to use 2 dummies for a single projectile, you don't reach nearly that level in a map, it's not so bad of a trade-off for the versatility it creates. The less missiles that I would expect to be flying at the same time the better.

Also I tested out just updating the offset and it screws the facing up. I think every time you give the order it first resets the unit facing and then adjusts so it always looks weird. It looks like the main missile unit has to be set to face the other unit and that unit is the only thing you can manipulate, so no dice on all using 1 unit... :(

I was thinking today, perhaps the implication I hinted at is rather minute if you think about projectiles in the traditional sense (i.e. weapon projectiles and spell projectiles that travel in more or less the same direction). But what if we took a step back and applied this to any object manipulation instead.

If anyone has played tob version O you can see how they use the dummy units and tracking unit models to simulate some pretty flashy unit movements (for instance the pirate's jugling ability). So with this setup you could, for instance, have a suplex ability where the unit's head is implanted into the ground without having a special extra units to mimic the effect.

I'm gonna work on getting a proper dummy that I need to test this setup to show properly and afterwards I'll repost with as many interesting examples as I can. I think that the math is relatively easy and it makes a lot of really cool spells possible.
 
Level 10
Joined
Apr 9, 2004
Messages
502
Yeah...almost perfect. Turns out you can only keep the same orientation from 90 to -90 (assuming 0 is the horizontal line) before it automatically flips the projectile. For projectiles that are symmetric this isn't such a problem (i.e. arrows you won't notice) but if you want to do a front flip on a unit, no dice.
 
Level 10
Joined
Apr 9, 2004
Messages
502
[BUMP] Updated the map (see first post for other updates and new map link).

A few depressing discoveries, which makes this method less good. For any physical projectile with forward motion, this will work perfectly. For symmetrical along at least 2 axis projectiles, again useful for everything. This loses usefulness for projectiles that have only 1 symmetrical axis although there are workarounds to manipulate and control that axis so that this retains some additional usefulness (case and point, see the new ability in the map).

Also discovered that there's really no feasible way to achieve the level of projectile motion control that I wanted for everything, but this one is pretty darn close and with the upgrades to the dummy unit, you can do almost anything you want.
 
Status
Not open for further replies.
Top