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

[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 25
Joined
Feb 9, 2009
Messages
1,798
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: 30

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,398
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