1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. The 15th Mini-Mapping Contest came to an end. The Secrets of Warcraft 3 are soon to be revealed! Come and vote in the public poll for your favorite maps.
    Dismiss Notice
  4. The 12th incarnation of the Music Contest is LIVE! The theme is Synthwave. Knight Rider needs a song to listen to on his journey. You should definitely have some fun with this theme!
    Dismiss Notice
  5. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Spinning Black Hole [3D] v1.8

Submitted by AGD
This bundle is marked as approved. It works and satisfies the submission rules.
Credits:
iAyanami aka Ayanami
- StunSystem
Bribe
- SpellEffectEvent, Table
Flux
- DummyRecycler
TriggerHappy
- UnitDex
Rising_Dusk
- GroupUtils
Nestharus
- WorldBounds
Vexorian
- BoundSentinel, dummy.mdx
AGD
- ResourcePreloader


As of version 1.8, the black hole explosion knockback is now 3D. The latest 2D version (1.7) is still
included in the bundle but will no longer be updated. Only the 3D version will be given future updates.

Since the 3D version is still new, there might be some unexpected bugs that you might encounter. If
you did, don't hesitate to share it with me.

Click on the "Preview Triggers" button below to view the codes.


Spell Description:
[​IMG]



Changelogs

*v1.8
- The spell is now 3D
- The kinematics of the spell now uses a non-arbitrary formula for motion (this is acheived with the use of the included UnitMotion library)
- Other significant changes

v1.7
- Reorganized and optimized the code
- Now uses linked-list instead of dynamic indexing
- Restructured the configuration section
- Added more configuration
- Added some optional libraries
- Made StunSystem a required library
- Fixed a vulnerability for bugs regarding removed units causing FirstOfGroup() call to return null, causing the loop to exit prematurely
- Now uses a better algorithm for the thrown targets' motion
- Other changes

v1.6c
- Not uploaded

v1.6b
- Not uploaded

v1.6
- Added ResourcePreloader as an optional requirement
- Added WorldBounds as an optional requirement
- Now uses UnitAlive() native instead of not IsUnitType(unit, UNIT_TYPE_DEAD)
- Replaced local variables with global variables
- Other changes

v1.5c
- Added TimerUtils to the optional spell requirements
- Added to the configuration the option to account for the terrain walkability when moving units
- Used static ifs instead of normal ifs on constant booleans like PAUSE_UNITS
- Some other changes

v1.5b
- Added an optional spell add-on that ensures setting unit coordinates on walkable terrains
- Replaced Bribe's MissileRecycler with Flux's DummyRecycler
- Some small fixes

v1.5
- Added two additional optional libraries (StunSystem and MissileRecycler)
- Renamed variables to fit that of JPAG's naming conventions
- Stun duration is now fully configurable but only if StunSystem is found
- Removed the hashtable leftover
- Some other changes

v1.4c
- Added some optional libraries
- Replaced hashtables with dynamic indexing

v1.4b
- Replaced the all StringHash with integers
- Removed the configuration regarding to allow enemies as targets
- Replaced the 0.03 loop interval with 0.3125
- Removed the debug message leftover

v1.4
- Rewrote the code from GUI to Jass/vJass
- Replaced the periodic event with timer
- Added more configurations
- Replaced the configuration for Spinswitch with Spindirection where you can enter ANY POSITIVE integer for a clockwise spin direction, ANY NEGATIVE integer for a counter-clockwise spin direction, and a ZERO value to turn off the spin.
- Remade the configuration regarding the spell's formulas
- Combined the cast condition and action into one function
- Used some vJass features hence, now requires vJass Compiler

v1.3
- Pullspeed is now fully configurable ( base speed and acceleration )
- You can now configure if you want to use the default hardcoded motion formulas or if you want your own values
- Spin angle declination is also added to configuration
- Fixed the bug regarding allowing allies as targets
- added the abilities to configuration
- Fixed the bug regarding units being pulled out of map bounds
- You can now configure if you want the spell to pause targets or not
- Other changes

v1.2
- Added more configuration
- Other changes

v1.1
- Fixed some leaks
- Added more configurations
- Some minor changes

v1.0
- First upload
Contents

Spinning Black Hole v1.7 by AGD (Map)

Spinning Black Hole v1.8 [3D] by AGD (Map)

Reviews
Moderator
05:53, 25th May 2016 Tank-Commander: V1.3 - Some of the problems I raised in my previous posts (notably the lag issue) still occur, I'm also curious why you bother having two separate equations for the same things through if you want your own formula...
  1. 05:53, 25th May 2016
    Tank-Commander: V1.3 - Some of the problems I raised in my previous posts (notably the lag issue) still occur, I'm also curious why you bother having two separate equations for the same things through if you want your own formula or not - just make the normal formula configurable and set the default values to your one.

    Old Reviews

    00:00, 12th May 2016
    Tank-Commander: V1.2 - Did a full rundown of the updated version, I found a few problems (particularly when testing ingame) please see my post

    10:30, 4th May 2016
    Tank-Commander: V1.1 - Some of the issues from my previous post still persist, set back to needs fix

    17:13, 2nd May 2016
    Tank-Commander: V1.0 - Thanks for the submission to the spell section. There's a number of issues that need to be addressed - please see my post and update accordingly
     
  2. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,573
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
  3. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,543
    Resources:
    44
    Packs:
    1
    Spells:
    41
    Tutorials:
    2
    Resources:
    44
    I quickly went over your code and I noticed the following things:

    Major:
    - Please get rid of all the extra commenting, the configuration is 80% comments and would be significantly smaller if you didn't do that
    - The same goes for most of the loop and cast triggers
    - All the data calculated in the cast trigger could be put straight into the hashtable, you don't need the extra variables
    - Likewise they can be accessed straight from the hashtable, variable assignment is doubled by this and the previous point
    - When you pick a unit in a unit group always assign picked unit to a variable, you refer to it over 10 times

    Minor:
    - Timers should run every 0.03 seconds, not 0.02
    - Instead of units move unit to point it's advised to used co-ordinates and SetUnitX/Y instead as it generates less lag
    - Attacktype and Weapontype could be configurable
    - You really don't need to filter hidden or illusion units, it's safe to assume that the spell should hit them
    - Your learning tooltip doesn't have any level data; try to make your tooltips resemble other default tooltips (Level1 - information, Level2 - information or use a data: level1/level2/level3 format
     
  4. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,543
    Resources:
    44
    Packs:
    1
    Spells:
    41
    Tutorials:
    2
    Resources:
    44
    V1.2 - There's no major issues that I can see (though I'm currently unable to run ingame tests which I will do once I'm back on my main PC) but I've spotted a minor issue or two

    Edit: Tested ingame, here's a summary of my findings:

    Major:
    - While configured to not target allies, the spell affects allies
    - Multiple casts on nearby targets lags heavily due to the spell affecting both units
    - Allies are not stunned by the spell (may be related to my first issue
    - Pausing units is generally not advised, in this case it makes the ability rather overpowered in any setting - this should be configurable at least
    - The pulling can pull units out of the playable map bounds
    - units will still get knocked back even if they are exceptionally far from the spell so long as it affected them at some point
    - Last created unit is referenced a lot without going into a temporary variable at any point
    - There's a lot of hard coded numbers used in your calculations (such as in the line " Set SBH_SBHPullAngle = (SBH_PullAngle - ((Power((((Load (Key Radius) of SBH_Key from SBH_Hash) - SBH_TargetDistance) / 10.00), 2.25)) / 1600.00)) what are these hardcoded values for and why are they not configurable? The one I reference here is just an example, the point extends to all calculations using numbers like these

    Minor:
    - The ability itself could be a configurable just to avoid the need to go into and modify the other triggers
    - The DoT should be an optional feature for units being knocked back (as it doesn't make much sense, particularly with no effects)
    - The amount of effects created by the black hole should be controllable through the config
     
    Last edited: May 11, 2016
  5. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    Can I ask how can I reduce this lag problem?
     
  6. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,543
    Resources:
    44
    Packs:
    1
    Spells:
    41
    Tutorials:
    2
    Resources:
    44
    the easiest solution I can think of would be to prevent two active casts interacting with each other (meaning units pulled by cast A could not also be pulled by cast B) potentially after a giving point of pulling or simply done outright
     
  7. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    The reason I converted the spell from GUI to Jass is because of this lag issue. I can't think of another solution aside from yours. But since I think it will be more realistic if multiple black holes can interact with each other, I converted it to Jass to cut many function calls by using natives and also i used globals instead of constant functions in the configuration to minimize more function calls. And now the result is significantly less lag (Just don't target too many units lets say 80+ units which in this test map is 4 creep camps).
     
  8. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    StringHash is not a commonly used function, even though it could make the code mroe readable. Still, I would change all StringHash calls to an integer.

    The target filter logic is flawed. "If false == false" will return true and that will mess up the intended targets when combined with "or".

    You could try to find an alternative to PauseUnit. It pauses expiration timers for example.

    It might not be a good idea to damage units 33 times per second, especially if one was to use this with a damage displaying system.

    SetUnitScale
    Only requires the first parameter, the rest can be left to zero.

    There is a debug message in the code and it is not deactivated.

    It looks like the spell is not registered for neutral player.

    GetUnitState( picked, UNIT_STATE_LIFE ) > 0
    does not work correctly. 0.405 is the correct value.
    IsUnitType(unit, UNIT_TYPE_DEAD
    is a better solution.
     
  9. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    I can't find alternative to PauseUnit but you can turn off PauseUnits in the configuration.
     
  10. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
  11. Eagle XI

    Eagle XI

    Joined:
    Mar 9, 2012
    Messages:
    1,358
    Resources:
    117
    Models:
    2
    Icons:
    109
    Packs:
    4
    Skins:
    2
    Resources:
    117
    Im inclined to ask before use:
    is this multiplayer compatible or campaigns only ?
     
  12. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    Im not sure, how do I know if it is multiplayer compatible or campaign only?

    After removing the pause unit, the spell tends to lag a bit at the instance of cast for unknown reason. And also I tried using your pause concept - the channel ability used to pause units but one problem is that after the channel ability is removed from the units, they are able to move even if they are stunned( units should be stunned after the black hole's explosion ) .
     
    Last edited by a moderator: Jul 12, 2016
  13. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
  14. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,543
    Resources:
    44
    Packs:
    1
    Spells:
    41
    Tutorials:
    2
    Resources:
    44
    V1.4c - Firstly I'll apologize for my absence making this review a bit later than it ought to be
    Eitherway the restructured code is very good, the lag issue has been resolved, I only have these two small things that stuck out to me:

    Two nearby casts can interfere with the scaling of the other making it incorrect - a "shrink targets" configurable may be appropriate to resolve this though it's only minor
    GetWidgetLife is faster than GetUnitState(unit, UNIT_STATE_LIFE) sadly there is no equivelent for mana

    Since these are the two only real issues I could locate in the code I've decided to approve this - it's a good spell and I applaud the effort you took in re-coding the entire thing
     
  15. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    Thanks for the review. Maybe I'll update sometime.

    Btw, by setting these values to 0 (
    UNITSCALEREDUCTIONBASE
    and
    UNITSCALEREDUCTIONPERLEVEL
    ), the
    SetUnitScale
    will not run.
     
    Last edited: Jul 28, 2016
  16. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    Updated to v1.5
    - Added two additional optional libraries (StunSystem and MissileRecycler)
    - Renamed variables to fit that of JPAG's naming conventions
    - Stun duration is now fully configurable but only if StunSystem is found
    - Removed the hashtable leftover
    - Some other changes
     
  17. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    Updated to v1.5b
    - Added an optional spell add-on that ensures setting unit coordinates on walkable terrains
    - Replaced Bribe's MissileRecycler with Flux's DummyRecycler
    - Some small fixes
     
  18. hemmedo

    hemmedo

    Joined:
    Jun 13, 2008
    Messages:
    275
    Resources:
    0
    Resources:
    0
    this is the best ever done black hole simulation spell for wc3. But I think you should hide those absorbed units at the hole location, seeing them very small and colliding with each other kinda breaks the immersion imo.
     
  19. AGD

    AGD

    Joined:
    Mar 29, 2016
    Messages:
    396
    Resources:
    13
    Spells:
    7
    Tutorials:
    1
    JASS:
    5
    Resources:
    13
    Thanks for your feedback. I once tried implementing that, however, the
    ShowUnit(unit, true)
    is just a little less heavy than
    CreateUnit()
    and causes a brief lag at the instance of explosion.
    I might add the feature if I can find an alternative way though.