- Joined
- Dec 3, 2011
- Messages
- 366
Oh no no. Almost modern maps now use no collisions doodad, flatform & blocker. I think it's not a small issue ^^!Causes too much overhead, for fixing a very small issue.


Oh no no. Almost modern maps now use no collisions doodad, flatform & blocker. I think it's not a small issue ^^!Causes too much overhead, for fixing a very small issue.
What does it has to do with pathing blockers?
static method onTerrain takes Missile this returns boolean
Flatforms are shoes. What you mean are platforms and I don't think they are used
that widespread, with some exceptions.
I also assume that z axis is set correctly over platforms, aslong as they are not hidden
via ShowDestructable native.
Edit:
I made a ingame test and invisible platforms are detected just fine.
In wc3, when moving a unit over a terrain higher than the units fly height itself
that unit gets elevated until it's fly height equals to the cliff + unit default fly height.
If you declare onTerrain in your sruct you can detect this special case and
change the Missiles in a way you wish ( destroy, bounce, deflect, do nothing... )
static method onTerrain takes Missile this returns boolean
debug static constant boolean DEBUG_MISSILE = true
at the top of struct Missile, else// What now??? infinity. I decide we do this math again!
call a.move(a.x + .0001, a.y, a.z)
return
endif
debug static constant boolean DEBUG_MISSILE = true
In debug mode Missile suffers great performance loss, because of multiple extra function calls.I ran one of my laggier spells with ~100 missles each with xyz-arc-curve and it seemed to lag about the same as it did before Dirac's.
Yes this version just compiles with Vexorians JassHelper not with Cohadars. I can change this in the next update.From the system standpoint, you have some copy and paste issues. You're not using the same compiler as the one used to comple Dirac's.
That's not true. onFinish returns in both systems a boolean, which is logical, becauseIn Dirac's system, the method "onFinish" has a return type of nothing
if a.x == b.x and a.y == b.y we have a distance of 0 between a and b.else// What now??? infinity. I decide we do this math again!
call a.move(a.x + .0001, a.y, a.z)
return
endif
library BugTester initializer onInit requires Missile
struct Arrow extends array
implement Alloc
implement MissileStruct
public static method launchEx takes nothing returns nothing
local Missile m
set m = Missile.create(0, 0, 50, 0, 1000, 50)
set m.model = "Abilities\\Weapons\\Arrow\\ArrowMissile.mdl"
set m.speed = 50
set m.collision = 75
set m.arc = 0
call launch(m)
endmethod
endstruct
private function onInit takes nothing returns nothing
call TimerStart(CreateTimer(), 0.02, true, function Arrow.launchEx)
endfunction
endlibrary
My memory jumps about 2mb every spell cast and I can't tell if its my spell or your system. I'll double check
if (GetUnitTypeId(dummy) == Missile_DUMMY_UNIT_ID) then
static if LIBRARY_MissileRecycler then
call RecycleMissile(dummy)
elseif Dummy.create.exists and LIBRARY_Dummy then
call Dummy[dummy].destroy()
elseif LIBRARY_xedummy and xedummy.release.exists then
call xedummy.release(dummy)
else
call RemoveUnit(dummy)
endif
endif
Yes it should be correct. I will check everything again.Are you sure you're recycling missiles properly?
Hard to say, which is best. At first I just used ExecuteFunc and TriggerSleepAction, then I switched to the stack + timer.2E/ im not entirely sure how effective your recycling system is...
Your snippet does not use the delayed recycling feature. To enable it for your struct, you have to declare onRemove and return true.
So I assume, that dummy units are simply don't get removed/recycled.
How it works:No..? If the delayed recycling feature is off than the missiles should simply get recycled immediately
How it works:
- Enable delayed recycling in the globals --> compiler doesn't ignore the static if
- delcare onRemove and return true ( otherwise dummies get recycled instantly )
- onRemove has no impact on the deallocation process, it just decided the future of the dummy unit.
External resources can be used optionally, but the Missile configuration is very well
documentated and explains everything.
I guess the problem is located in the CreateUnit native. It's very intense compare to other natives.
You can 'preload' some 'missiles', create it onInit or something, and just recycling the instance of the struct, them you prevent CreateUnit every time, maybe what? 100 unit? I don't know, maybe too much...
Edit: Or better, a optional module that you don't create unit dynamic, just reuse the system one, like I said, create 50-100 units for the system, and use them for missiles, 'recycling' it but don't removing it, if all the 50-100 units precreated is being used, then you createunit dynamic and remove it when that instance finish.
static method create takes x, y, z, angle, distance, endZ returns Missile
static method createXYZ takes x, y, z, endY, endY, endZ returns Missile
static method createEx takes unit, angle, distance, endZ returns Missile
Btw, there is an issue with the MissileRecycler sub-lib of Nestharus' Dummy:
It seems that it has problems allocating dummy units on the first uses of abilities that make use of a lot of missiles.
After I changed to the standalone MissileRecycler, I got it working. Before, I used only "Dummy" and the included MissileRecycler in Dummy, and frequently had dummies not showing correctly.
Nestharus' Dummy is bugged, same thing happens in my frozen spellpack as well when I was trying to import it somewhere else, forcing me to modify it to remove dummy completely (since I always had missile facing problem with these kind of dummy recycler). What's so important about Dummy libraries anyway? It can save times alright by avoiding dummy re-creations. But still, having more preloaded dummies means more memory is costed, it's not exactly win imo, and just causing terrible bugs a lot of times. Suggestion: remove it.
I will look into Dummy.Nestharus' Dummy is bugged, same thing happens in my frozen spellpack as well when I was trying to import it somewhere else, forcing me to modify it to remove dummy completely
Dummy libraries have proven useful, as the CreateUnit() native is a very heavy one.It can save times alright by avoiding dummy re-creations. But still, having more preloaded dummies means more memory is costed, it's not exactly win imo, and just causing terrible bugs a lot of times. Suggestion: remove it.
It's not dummy itself that is broken, it's just that the old MissileRecycler that was part of dummy seems to bug if you use it to fetch too many missiles with the same general direction at the same time (my cone-type spell only shot 1 or 2 missiles on the first cast instead of 10 as intended; after several more casts, it worked).@Zwiebelchen:
I have to check the combination of the two resources. I'm used Dummy without MissileRecycler and I don't experience that problem.
However when it comes to using a spell with uses a lot of dummies, I always
had spikes on the first cast. I always blamed UnitIndexer and the onIndex event.
( My opinion about UnitIndexer usage in Dummy at the end of the comment )
@Quilnez
I will look into Dummy.
Dummy libraries have proven useful, as the CreateUnit() native is a very heavy one.
I can't say anything about small leaks when using CreateUnit, but different
sources say they exist.
@Arhowk.
Yeah I head about the CreateUnit() problem, very often to be honest.
Can't say anything about it, except that it's not so heavy problem since the latest wc3 patch.
About UnitIndexer & Dummy.
I think it is a very bad idea to use/enable your UnitIndexer when creating Dummy units.
For the sake of squeezing Dummy into arrays, you have a lot of overhead and eventual
extra memory usage. Let's quickly combine two of Nestharus resources. Dummy & DDS.
For each unit allocated DDS creates triggers and ( iirc ) runs a bubble sort within TriggerRefresh,
Dummy units also go through this process, as there is no filter integrated.
Ergo every dummy unit uses a lot of extra memory and requires additional
computation time. However dummy units never deal or recieve damage.
Conclusion:
I will look into Dummy and eventually remove it from the optional requirements.
I will point out that MissileRecycler is best to use and very recommended. I will not make it mandatory.And imho, I think MissileRecycler should be specifically mentioned in the documentation to be absolutely recommended for this. You definitely do not want the user to heavily use this resource without MissileRecycler. Actually, I go a step further and say MissileRecycler should be mandatory, even if I generally dislike forced requirements. In this case, it makes a lot of sense.
Fair enough. Depends on the use-case scenario anyway, as always. After all, some people might possibly import missile as a requirement for a downloaded spell, not because they actually use it themselves.I will point out that MissileRecycler is best to use and very recommended. I will not make it mandatory.
I've updated the first page a bit. It's still not finished, but definitly better than before.
Will do. The problem is that I changed absolutely nothing about the code. I just updated both Missile and MissileRecycler.Can you try running it in debug mode and see if any errors are being spit out? I could also take a look at the map for you.
this is insane
it's been over 4 years and there's still a lot of love for these kind of libraries
i totally forgot about this
kinda sad to see my old lib graveyarded, but before that it achieved 11k views (crazy)
good work!
I forgot everything about jass too lol
I wrote this library based on yours. It was an inspiring example of using a struct id as an array index.this is insane
it's been over 4 years and there's still a lot of love for these kind of libraries
i totally forgot about this
kinda sad to see my old lib graveyarded, but before that it achieved 11k views (crazy)
good work!