• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Zephyr Contest #9 - Assassination

Status
Not open for further replies.
the%20hive%20workshop.png

zephyr.png
competition.png
number.png
9.png


160036-albums4747-picture51408.jpg


160036-albums4747-picture51406.png


Contestants must create a skill that would fit an assassin. While the term "assassin" refers to lethality, it doesn't have to insta(ntly)-kill a target; it can vary from a single camouflage skill to the use of daggers. Use your imagination and machinate the effect it would most likely fit with this particular theme.

Notice the use of "skill"; skill or talent would accompany the assassination theme. A spellcaster would hardly be called 'assassin' in the fantasy world. Based on this, the concept might be defective the other way around.

contest%20rules%20and%20conditions.png


• No submission may violate any of the site rules.
• If a submission does not follow the spell submission rules, the creator will be disqualified.
• Your submission must be posted before the deadline. The post containing your final submission must also contain the following:
- An in game screenshot showing your submission in action.
- The file in the appropriate format.
• Your submission may not be started/made before the official launch of the contest.
• The spell can be of any type, active/passive/toggle/single target/area of effect (and any of the previous combined).
• Judges may not participate.
• Teamwork is not allowed; however, finding testers to help you with your submission is not considered teamwork.
• Imports may be used in the map, however they must all be credited.
• Any submission must follow a Work In Progress (WiP), before it is published and labelled as the final piece.
• The ability can be followed by a maximum of one (1) sub-ability, but the latter must not be more effective and/or powerful than the super-ability.
• Either GUI or JASS may be used to create your spell; you will not be penalized if you use GUI over JASS.
• Convenience over effort won't be an excuse to make use of third party programs (exception: Jass New Gen Pack). GUI actions that do not exist in the vanilla editor's database may lead to disqualification. WEU (World Editor Unlimited) and UMSWE fall into this category.
• All spells must have documentation, regarding the use of each variable and/or actions (if needed). This will ensure readability and easier configuration for testing purposes.
• You can use any enhancing system (xe, IsDestructableTree, Damage detection systems, etc.), as long as the judge(s) and/or host give(s) consent to its usage.


prizes.png


  • First Place: 45 reputation points and a special award icon
  • Second Place: 30 reputation points
  • Third Place: 15 reputation points

judges.png


Judge:

Magtheridon96

contest%20judging%20and%20voting.png



Concept
How creative and unique the skill is?/10

Coding
Is the skill bug free, leakless? Does it support multiple instances?/20

Visuals
How does the skill look? Is it too overloaded with special effects? How explanatory is the tooltip of its functionality?/10

Final Score/40

• 70% of the winner shall be determined by the contest's appointed judge(s).
• 30% of the winner shall be determined by the results of a public poll.


contest%20dates%20and%20deadline.png


All submissions must be complete and submitted within 4 (four) weeks, after the launch of the contest, which begins on 5th of July, 2012 and concludes on 2nd of August, 11:59 PM, 2012 +3 (2012 Event) = 5th of August UTC.
 
Last edited:
Level 16
Joined
Jun 17, 2008
Messages
550
I always find the term 'assassin' an interesting one, when it comes to the choice of weaponry that is. May I assume that the assassin's choice of weapon in this contest is free for imagination - from the sniper or crossbow, to the poison, or even one that uses mental attacks?

The end result must still befit a character that would immediately identified as an assassin of course.
 
Can I judge this contest?
This time, I actually agree with how the score is computed.
Good coding is a very high priority.

Oh and here are a few tips for JASS-men (=D) if you want a high score:

  • Use average-length variable names to assure readability. Something like playerId is much better than something like i.
  • Use comments and line-breaks every now and then. You don't really need to do this for every single line, but if you divide the code up into tiny
    blocks consisting of 2-5 lines each and add a comment above the block to explain your code, you'd be doing me a favor, and I would definitely
    give you bonus points.
  • Try to use the simplest and cleanest algorithms for your spells. Just because something has more code, doesn't mean it's better.
  • Make the spell configurable. Use a combination of functions and globals for decent configuration (Example: Use a function for damage/level
    configuration and a global for the ability raw code).
  • Use FirstOfGroup loops with null boolexprs instead of GroupEnumUnitsInRange calls with boolexprs and ForGroup calls.
    Meaning this:
    JASS:
    call GroupEnumUnitsInRange(bj_lastCreatedGroup, 0, 0, 500, Filter(function filter))
    call ForGroup(bj_lastCreatedGroup, function actions)
    Should be turned into this:
    JASS:
    call GroupEnumUnitsInRange(bj_lastCreatedGroup, 0, 0, 500, null)
    loop
        set tempUnit = FirstOfGroup(bj_lastCreatedGroup)
        exitwhen tempUnit == null
        call GroupRemoveUnit(bj_lastCreatedGroup, tempUnit)
    
        if filter(tempUnit, ...) then
            // actions here
        endif
    endloop

    This is about 3x more efficient and it will cause noticeable differences in an actual map.
  • If you want to destroy trees, tree detection could be a one-liner. I out-lined a trick for that:
    local boolean isTree = IssueTargetOrder(peasantDummy, "harvest", myDestructable) and IssueImmediateOrder(peasantDummy, "stop", myDestructable)
    It would be better if you were to use the order id's though. This would be much faster. (I only used the strings so you could understand what's going on.
  • Use bj_lastCreatedGroup instead of creating your own group for group enumeration. DON'T DO THIS. EVER.
  • Don't create handles like groups and locations dynamically.
  • Don't use locations at all unless you need to find the Z of a certain point on the terrain. You should be using coordinates for pretty much anything else.
  • Always null all agents and handles, even players and triggers (even though some people say those don't cause leaks)
  • Use comment delimiters (/* Comment */) for your documentation so you could avoid spamming double-slashes.
  • Keep your code clean and organized, and follow Jass convention. (GLOBAL_CONSTANTS, localVariables, StructDefinitions, ModuleDefinitions, TextMacros, globalVariables, structMembers, etc...)

I could go on and on about other speed quirks and GPPs, but I don't have time at the moment :p
(By the way, GPPs = Good Programming Practices)

edit
Oh, and for GUIers, just cache variables so you're not repeating function calls redundantly all the time, and use
dynamic indexing. Using hashtables will not decrease your score in any way, but if you have a spell that creates
a lot of special effects and starts lagging on the second cast, then dynamic indexing is the answer my friend ;)
Arrays reads are much faster than hashtable reads (Same for the writes).

Oh and don't use waits, don't leak locations, effects and groups, and if you need a loop within a loop, use custom
integers D:

That's pretty much all there is for excellent GUI.
 
Last edited:
Don't worry about that Adiktuz, you're a good coder :p

And to everyone in this thread, this is what a perfect spell-wrap model would look like IMO:

JASS:
struct Spell extends array
    private static constant integer ABILITY_RAWCODE = 'A000'

    private static method run takes nothing returns nothing
        call UnitDamageTarget(GetTriggerUnit(), GetSpellTargetUnit(), 270, false, false, null, DAMAGE_TYPE_MAGIC, null)
    endmethod

    private static method onInit takes nothing returns nothing
        call RegisterSpellEffectEvent(ABILITY_RAWCODE, function thistype.run)
    endmethod
endstruct

The below still have the potential to give you 20/20s though:

This is the best for public resources.
The struct model that I posted above is only for Map-making.
JASS:
library Spell requires TimerTools, UnitIndexer, DamageEvent, WorldBounds

    /*
    * Configuration
    */
    globals
        private constant integer ABIL_CODE = 'A000'
    endglobals

    private function GetDamage takes integer level returns real
    endfunction

    private struct Spell extends array

        private static method run takes nothing returns nothing
        endmethod

        private static method onInit takes nothing returns nothing
            call RegisterSpellEffectEvent(ABIL_CODE, function thistype.run)
        endmethod
    endstruct

endlibrary

Or:

Even though I hate scopes so much:
JASS:
scope Spell

    /*
    * Configuration
    */
    globals
        private constant integer ABIL_CODE = 'A000'
    endglobals

    private function GetDamage takes integer level returns real
    endfunction

    private struct Spell extends array

        private static method run takes nothing returns nothing
        endmethod

        private static method onInit takes nothing returns nothing
            call RegisterSpellEffectEvent(ABIL_CODE, function thistype.run)
        endmethod
    endstruct

endscope

There are some other good ones, but I don't want to spam :p
 
GUI triggers would have the 3 elementary GUI Spell Triggers :p
Actually, it depends. Timed spells need 3 triggers while instant ones need 2.

  • Configuration
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Set Damage = 90.00
  • Cast
    • Events
      • Unit - A unit starts the effects of an ability
    • Conditions
      • (Ability being cast) Equal to MyAbility
    • Actions
      • Indexing
      • Turning on periodic trigger if needed
      • Setting data
      • Removing leaks if any
  • Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Loop through all instances
        • Do stuff
        • Check if spell done
        • If done, deindex
        • If no more casts active, turn off trigger
This may seem like common knowledge to most of you, but sadly, some people don't follow this standard model.

edit
Oh, and I almost forgot about vanilla Jass:

JASS:
function MyAbility_AbilRawCode takes nothing returns integer
endfunction

function MyAbility_Damage takes integer level returns real
endfunction

function MyAbility_Run takes nothing returns boolean
    local unit caster
    local unit target

    if GetSpellAbilityId() == MyAbility_AbilRawCode() then
        set caster = GetTriggerUnit()
        set target = GetSpellTargetUnit()

        // Code

        set caster = null
        set target = null
    endif

    return false
endfunction

function InitTrig_MyAbility takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function MyAbility_Run))
    set t = null
endfunction

This isn't a requirement at all.
I hope you don't think I'm implying that :l
I'm only giving you tips ^.^
 
Level 33
Joined
Apr 24, 2012
Messages
5,113
Pharaoh,Can i Join???
By the way,can a hashtable action be included for the indexing or not????
Like:[trigger=Example]Set Variable = (Load 0 of Handle from Hash)[/trigger]
Cause Magetheridon said a unit indexer(Hanky's or Bribe's) must be used.
And so i dont know how to used some unit indexers so im just asking???because i have already made a spell.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
Maybe I'll join this instead, since the hero contest doesn't seem to be starting.

Edit:

Hurr, and just to be in the clear. Would it be within the confines of the rules to "combine" (read moar kthx) a passive and an active? The spell I'm currently thinking of would be a passive most of the time, but after certain criteria are met, it becomes active. You can kinda consider the passive part the "cooldown".

I want to use two spells, because having one big tooltip on one spell and mess around with requirements is not an approach I favour.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
If I join this contest, it would be my first contest, yipeee :)
To join this contest, must I (is it obligatory?) put WIP or can I just complete the spell and directly submit it ?

EDIT:
Did not realize, it has been 5 months...
 
Status
Not open for further replies.
Top