• 🏆 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!

[Spell] Making an Efficient Projectile

Status
Not open for further replies.
Level 2
Joined
Apr 6, 2020
Messages
8
Hello everyone!
My problem is a little complicated but hear me out please!
I'm currently working on my map which I have there some custom abilities which shoots projectiles, these projectiles suppose to detect if there are enemies near them and trigger something.
Since the max speed in wc3 is pretty slow for a projectile i create them as followed:

Every 0.03 move the projectile and check for enemies to function accordingly.
But this implementation is quite heavy even after I take care of the leaks!
So my question is how to make this process more efficient?
Thanks for reading!
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
Some things off the top of my head:
- Swapping the "unit" projectile for a special effect. (a few of my majority of my resources do this.)
- Fast projectiles, or fast enough that missiles do not "linger" as to have more than a set number on screen.

But why not post what you have currently and we can discuss what might be giving you grief.
 
Level 14
Joined
Sep 28, 2011
Messages
968
If you want graphical projectiles that moves in a straight line you can make dummy units that shoots 0 dmg projectiles at points using the attack zone ability and since you know the speed of the projectiles you can know the position at each frame and check for opponents at the planned position.
Now the question is: is it as efficient as using "move projectile"
Remind yourself to use dummy recyclers for performances.
I do not know how performant it would be but the disadantage is low variability and no curved paths.
 
Level 2
Joined
Apr 6, 2020
Messages
8
Here is an example of how I implemented a spell, the two units i want to move are saved in the hashtable and move accordingly to the trigger.
But I found out that if this spell will have a low cooldown (such as 1 second) the fps of the game will drop drastically if i use it too many times.
By the way noob I don't know what is dummy recyclers so a brief explanation will be great :D
If you have a good answer for that i will be glad!
 

Attachments

  • Capture.PNG
    Capture.PNG
    107.9 KB · Views: 28

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,591
Here is an example of how I implemented a spell, the two units i want to move are saved in the hashtable and move accordingly to the trigger.
But I found out that if this spell will have a low cooldown (such as 1 second) the fps of the game will drop drastically if i use it too many times.
By the way noob I don't know what is dummy recyclers so a brief explanation will be great :D
If you have a good answer for that i will be glad!
Fixes:
1: You're leaking a lot of points
2: Use special effects instead of Dummy units

Fps drops are basically unavoidable if you're firing this many missiles at once. That being said, the system I linked above handles this stuff better than anything else we have on Hive.
 
Status
Not open for further replies.
Top