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

Custom cooldown interface

Status
Not open for further replies.
Level 10
Joined
Apr 9, 2004
Messages
502
Not sure how much of a load on the game this would have but I've rigged up 1 spell to work on this, I think it's a little clunky but with some proper visual flare could feel like a seemless cd display for abilities.

I'm thinking this could open up a lot of possibilities for spells in that you can manipulate spell cooldowns, heck you could do crazy things like pause a heroe's cooldowns for any spell you want, or even increase their cooldown if you wanted. The extra abilities are to allow for a visual effect near the 0 cd mark as to make it more functional for players to use. Does this seem like a viable way to make spell cooldowns work on, say, a 5v5 AoS style map?

I could extrapolate and assume some hero controlled units may have spells too but the way I see the system working I'd limit it to wherever I'd expect to see an ability (namely the bottom 4 slots only).

Test out the map and you'll get an example of how the cooldown system COULD work. My only issue is how precise do you want? I could make buttons for each second up until whatever but we start to add on a lot of size without much return on investment at that point. Granted sometimes you have 3 min cd abilities so I think this presents a nice compromise.

Let me know if there's a way we can make this better/ viable / prettier etc.

Thanks
 

Attachments

  • Hero Map beta v1.0.w3x
    126.3 KB · Views: 450
Level 12
Joined
Mar 13, 2012
Messages
1,121
You should tell people how your system works.
When an ability is used it is removed and depending on the cooldown a dummy ability is added which indicates the remaining cd in seconds. Every second another dummy ability is given to the unit, according to the remaining cooldown.

This is nice but one important thing is lost, namely the fine grained cooldown indicator.
 
Level 9
Joined
Jul 30, 2012
Messages
156
This is the second "cooldown interface" thread I've seen in the past few days. Is everyone copying my idea? :)

Just joking, but the truth is that I have been looking a long time for something like this, a way to display a numeric cooldown indicator in an ability. That is the real source of inspiration for all my recent work, and a after a lot of research, I finally found a way to implement that thing, without the use of imported icons.

This TestMap is just a proof-of-concept, it uses a combination of hacks that I found to display a numeric indicator in the icon of an ability. It has the potential to be used either as a charge indicator, or as a cooldown indicator. I still have a lot of work to do on it, and I'm hitting some small problems to make a perfect implementation, but the good thing is: I already know that it's possible to achieve.

EDIT: Screenshot attached
attachment.php
 

Attachments

  • Cooldown.w3x
    17.9 KB · Views: 420
  • Cooldown.png
    Cooldown.png
    1.2 MB · Views: 1,773
Last edited:
Level 10
Joined
Apr 9, 2004
Messages
502
Sorry about not including the setup.

Essentially every tick on the cooldown is triggered and the one thing that you didn't catch was that I only swap the abilities if the cd is below a certain count, as otherwise, things that need 300s cd would be crazy big. Over 10s I've setup to simply display a + sign to indicate a longer than 10s cooldown, even though the actual time left is tracked on the ability tooltip anyways/

There's truly 1 ability for high counts and the swap to change the display only changes at whatever I set as the low count. In either case hovering the point reveals the current cooldown all the time.

The intent of making a system like this, however, isn't really to preocupy myself with knowing the number display but primarily to have complete control over cooldowns and have a display that's intuitive for users.

Like I said before, I can count however I want to with my system. I can even pause cooldowns or increase them if I want. Seems silly but this can't be done with an ingame display as they only count down.

Realistically I can get away with 4 abilities with enough levels to simulate up to XXX seconds of cooldown, except that you have to hover to tell when your spell is ready, the graphical display is for the user so they know with a fair bit of leeway when they're spell is up. Realistically I set it to 10s because normally you don't plan you 300s cooldown 50 seconds ahead, you can't really plan that far.

right now this would use 12 x 4 = 48 skills to cover all hero units for the bottom 4 slots and that's it. If I use a system that scales with the abilities used, for 10 heroes on the map, that's still 40 abilities although if I have more heroes available to choose I can quickly overshadow this method.

In regards to the flare trick, I'm interested, although I'd like to say if you upgrade a passive into an active if it remains like a passive or not. That could eliminate the problem of using an active flare ability which could screw up counting if you clicked on it while it was not on cooldown. It still needs a lot of abilities to show each second but could save me space by eliminating the need for tons of command buttons.
 
Level 10
Joined
Apr 9, 2004
Messages
502
Ok, so it moreso matches the current cooldown effect. Do you have a generic cooldown icon as well or does the graphic mimic the same as the actual spell command button? I guess if we were to compare cooldowns, this method is probably more clear than typical cooldowns as they're currently displayed because it's hard to guage a physical representation, especially on spells with 100+s cooldowns (you'll be stuck on that sliver forever).
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Well... it depends, you can select an ability set to represent the cooldown.
For some maps it is ok to make an ability set specifically for that ability, but in other maps you get a really high spam of abilities...
We are talking about taking your entire ability list an multiply it by 17.

In that case, having a stock to "sell" can be much better because you only need one.
On the other hand, the spell shield method has no drawbacks except the visuals... but this method also has its visual drawback.
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
This is the second "cooldown interface" thread I've seen in the past few days. Is everyone copying my idea? :)

Just joking, but the truth is that I have been looking a long time for something like this, a way to display a numeric cooldown indicator in an ability. That is the real source of inspiration for all my recent work, and a after a lot of research, I finally found a way to implement that thing, without the use of imported icons.

This TestMap is just a proof-of-concept, it uses a combination of hacks that I found to display a numeric indicator in the icon of an ability. It has the potential to be used either as a charge indicator, or as a cooldown indicator. I still have a lot of work to do on it, and I'm hitting some small problems to make a perfect implementation, but the good thing is: I already know that it's possible to achieve.

EDIT: Screenshot attached
attachment.php

That's some pretty good shit. I haven't fully understood it yet as i see you combine some techniques.
Stuff like that want's me to have a good language for sharing object editor hax...



Well I've seen ability cooldown indicators in The Chosen Ones campaign by Aeroblyctos. You can see what it looks like in this video. I don't how it works though =)...

Custom cooldown indictor; you can import a model for that. Notice that these numbers are just the percentage.
Hive has some custom indicators.
 
This is the second "cooldown interface" thread I've seen in the past few days. Is everyone copying my idea? :)

Just joking, but the truth is that I have been looking a long time for something like this, a way to display a numeric cooldown indicator in an ability. That is the real source of inspiration for all my recent work, and a after a lot of research, I finally found a way to implement that thing, without the use of imported icons.

This TestMap is just a proof-of-concept, it uses a combination of hacks that I found to display a numeric indicator in the icon of an ability. It has the potential to be used either as a charge indicator, or as a cooldown indicator. I still have a lot of work to do on it, and I'm hitting some small problems to make a perfect implementation, but the good thing is: I already know that it's possible to achieve.

EDIT: Screenshot attached
attachment.php

Wow neat! Charges would definitely be a great feature to have. I hope you manage to finish this system. Is the indicator also modifying via triggers?

Would that system require ALL spells use custom cooldowns btw, or does it handle that automatically? (I mean for the sake of consistency)
 
Level 9
Joined
Jul 30, 2012
Messages
156
Wow neat! Charges would definitely be a great feature to have. I hope you manage to finish this system. Is the indicator also modifying via triggers?

Would that system require ALL spells use custom cooldowns btw, or does it handle that automatically? (I mean for the sake of consistency)

Hmm. Implementing charges would be easier to do. I guess I'm going to start with that.

This system, just like all present alternatives, requires big amounts of object data (which will be automatically generated with Lua). The only thing the user will have to do is to create 1 ability based on Engineering Upgrade for every ability that he wants to have a counter.

This ability is the key to create the number in the icon. It must have the same id of the main ability with the first letter changed to "C" (eg. 'C000'). When you want to create a counter, the system will try to add the corresponding ability to the unit. If this ability is there, the counter will be created, if it does not exist, nothing happens.

Nothing else needs to be modified in the map. You will just need to call a function and a number will appear in the bottom-right corner of the icon. The numbers are created by the game itself, it does not use imported icons. And it will not replace the ability with a dummy, the number will appear in the real icon of the ability.

However, not everything is roses. This implementation has some restrictions:

  • Not every ability can have a counter. Only 5 abilities in the game can have counters: Channel, Spellbook, Charge Gold and Lumber, Sentinel and Flare. And you can only have 2 of them in a unit simultaneously. (This restriction will not apply to my future cooldown system, as it will replace the real ability with a dummy)

  • Because Engineering Upgrade is used, it can only be used on heroes. ([thread=270930]HeroicUnit[/thread] has the potential to remove this restriction, but it's not perfect yet)

As I said this system uses a bunch of hacks to acomplish it's job. The basic principle is how the Command UI works: if two abilities in a unit have the same rawcode and the same order id, their buttons will collapse and become only one. Since order id can't be dynamically modified, we are restricted to the 5 abilities I mentioned. Engineering upgrade is then used to change the rawcode of the ability at runtime.

When the buttons collapse, the numbers present in the Sentinel and Flare abilities can be transferred to other abilities like Channel or Spellbook, if you set their order ids to "sentinel" or "flare". Obviously it requires 1 ability for every number that we want to display, but this doesn't affect performance, and those abilities are automatically generated.

There's still a lot of work to do. The concept is already demonstrated, but it's not easy to make this system completely MUI and bug-free. I will be beginning the development in the following days, any suggestion is highly appreciated. If you have any doubts feel free to ask me as well.
 
Level 10
Joined
Apr 9, 2004
Messages
502
So I took a look at your code and it's obvious to me there are a few hacks being used that I don't comprehend. For instance the item casting soul burn to make sure it shows the cooldown effect, not sure how that works (something to do with silencing the unit which has an effect on the spellbook ability?).

I also understood that the order in which the abilities are added to the spell book matters too.

Last thing I noticed and it leads me to believe that this approach still only works as a count down effect is the fact that you're removing abilities.

Correct me if I'm wrong but is the basis of this hack essentially stacking multiple abilities on top and removing the top one until we're back to 0?

I'm guessing there's some hack which links the original ability

From what I can tell, the stacked spells don't actually affect the original spell cooldown and that the original spell will always be the governing ability.

The problem with this method is that it seems to only work in 1 direction. Is it possible to change the count and increase the number or would that require a second set of abilities with increasing values instead of decreasing values?

You're also limited in the cooldowns because the ability cooldowns cannot be dynamically altered as they still run on the origional. This could be cleaned up by using a passive dummy as a base and swapping the ability back in, but then we now need a dummy ability for each ability again. On top of all that do we know if the hack is stable and won't have any sideffects with spell systems or other things?

Overall I think that having multiple icons the same is a bit much so my thought is either (a) do 4 static abilities with 300 levels (or whatever the max second count is) and use these for each spell which means all spells will show only in the tool tip and only a static disabled effect, or (2) create a second ability for every ability made for the purpose of displaying the cooldown only by the tool tip but keeping the icon graphic the same as the ability cast, or (3) this method with has the visual effect indicator near the end. Again the bonus with the visual indicator is it gives enough of a warning when the CD is getting close to refreshing.

Again, the major benefit to having the custom icons and not relying on a hack or modified countdown is the ability to count back up or pause an ability or even associate a different count method (i.e. ability requires 5 attacks before it cooldown etc.) which you cannot do with anything that works off of the UI as a base.


On a side note, another dilema I come accross if I stick with this one is being able to quickly and easily determine the slot position the ability was in as to replace it with the right cd ability indicator. My initial thought was through giving all ability names a tag such that if we read a substring of the ability name we can get the right associated cd icons. Is this a juvenile approach and are there better ways or is this a realistic and efficinet apporach?
 
Level 9
Joined
Jul 30, 2012
Messages
156
Having the original ability cooldown is not a requirement. I was just demonstrating the possibility to use the numbers for a charge indicator, while keeping the original cooldown indicator.

To use the counter for a cooldown system, I replace the real ability with a passive dummy, as demonstrated in this new TestMap. This approach does not require 1 dummy for every spell, but it uses only 1 global dummy for the whole map. This dummy will have its icon transformed at runtime, through the use of Engineering Upgrade. (When you transform a passive ability into an active, the icon gets transformed, but the ability remains passive)

As you see, the order of abilities in the spellbook is important. Because a cooldown normally counts towards zero, it's more efficient to stack abilities in descending order and remove one of them per second. But this doesn't mean that this system can only count backwards. I can add and remove the counter abilities any time I want.

I have included some test commands in this map to demonstrate that. You can pause, resume, and set the cooldown of the ability to any number between 1 and 10.

And btw, you should never make abilities with hundreds of levels, it dramatically increases the map's load time. You can have 300 abilities with 1 level each, and it won't affect performance, but if you have 1 ability with 300 levels, things go really bad.

Screenshot:
attachment.php
 

Attachments

  • Cooldown.w3x
    19.2 KB · Views: 309
  • Cooldown.png
    Cooldown.png
    1.2 MB · Views: 1,722
Level 10
Joined
Apr 9, 2004
Messages
502
Yeah I noticed the initial increase in load time to accommodate that can though I set it up at map initialization so it doesn't show properly.

I'm now curious as how how you discovered this method and what is actually going on to achieve the effect. If you don't mind sharing, I'm really interested in learning how this hack works.
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
And btw, you should never make abilities with hundreds of levels, it dramatically increases the map's load time. You can have 300 abilities with 1 level each, and it won't affect performance, but if you have 1 ability with 300 levels, things go really bad.

kind of offtop, but still - you CAN use any amount of levels in case if none of them get into w3a. For instance AEev has 0% chance over 4 levels, so this passive can be turned into any level passive ability via opt'd files (slk) without any drawbacks.
 
Level 10
Joined
Apr 9, 2004
Messages
502
In my testmap I just preloaded during map initialization. It was maybe 5 more seconds? Surely that isn't the end of the world? Also looking at the script it seems like it's a weird stacking effect and the changing levels is essentially removing, restacking the amount and instantly removing levels to get to the desired number, is there any performance drawback to this? I'm think in terms of the 300s region. If I have to account for up to 300s and i want to set the cd to 15s, would there be a big delay while it removes a ton of abilities from my unit over what is supposed to be an instant? Can we try running this with 300s max timer to see?
 
Level 9
Joined
Jul 30, 2012
Messages
156
kind of offtop, but still - you CAN use any amount of levels in case if none of them get into w3a. For instance AEev has 0% chance over 4 levels, so this passive can be turned into any level passive ability via opt'd files (slk) without any drawbacks.

Seems like you're being contradictory:
load time is unaffected if Widgetizer used and abilities doesn't contain > 4 levels. no matter how many units or any other objects are used.

You said that abiltiies should not have more than 4 levels, now you're saying that you can have any amount of levels if Widgetizer is used... Am I misunderstanding something?
 
Level 10
Joined
Apr 9, 2004
Messages
502
Quick question. Is using the orb trick and having a dummy spell based on flare required? Does the dummy have to be based on flare to work correctly, or can we have it such that the spell icon is not dimmed but is unclickable as a passive would be.

Also, is my assumption of stacking multiple spells on top of the original the basis of this concept? And that being the case would there be much lag or delay with multiple units running this method for high cooldown spells this way? Is there a way of increasing the cooldown without essentially restacking and removing 1 less than previously?

In any case I'm more than Ok using 300 units to address a highest worse-case scenario as this seems to also solve another problem of mine which was spell positioning, which this deals with quite easily.
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
Seems like you're being contradictory:


You said that abiltiies should not have more than 4 levels, now you're saying that you can have any amount of levels if Widgetizer is used... Am I misunderstanding something?


Look: Evasion by default will use 0% chance if field "Evasion chance" is missing. Therefore I can declare AEev-based ability inside SLK, put 1000 levels into it, and use it for "dynamic" tooltip change, for instance, to display stolen ability duration. Maybe it could be used as a side-counter for anything but I'm not sure about other usage of this.

Meanwhile Stormbolt will have "duration" = 0 if we missing this field, therefore this ability won't be useful. It requires to have duration bigger than 0 to avoid permastun, therefore we have to declare it via Editor and setup levels 4+ to correct values. (Except if this ability will never be fired, then we can ignore it's field completely and use this bug as well).

Overall, my message is: if skill exists only in SLK, it will be loaded instantly. If the .w3a file (Widgetized maps or maybe normal too) contains any info related to the loaded spell (like bolt's duration), the more info there is, the longer it will take to preload. If SLK says there are more levels, game quickly (really, no spike or lag) checks if W3A has that entry. If there are none, it skips. Else - it starts parsing, loooong looong parsing duty.

This hack normally won't make any good for mapmakers because they work with editor, not with raw data like me. So dunno.

Quick question. Is using the orb trick and having a dummy spell based on flare required? Does the dummy have to be based on flare to work correctly, or can we have it such that the spell icon is not dimmed but is unclickable as a passive would be.

Also, is my assumption of stacking multiple spells on top of the original the basis of this concept? And that being the case would there be much lag or delay with multiple units running this method for high cooldown spells this way? Is there a way of increasing the cooldown without essentially restacking and removing 1 less than previously?

In any case I'm more than Ok using 300 units to address a highest worse-case scenario as this seems to also solve another problem of mine which was spell positioning, which this deals with quite easily.

I don't think that placing triggered stuff on even 100+ units is a good idea. But in terms of perfomance - you can check youself. I don't think it will make major lags
 
Level 9
Joined
Jul 30, 2012
Messages
156
Quick question. Is using the orb trick and having a dummy spell based on flare required? Does the dummy have to be based on flare to work correctly, or can we have it such that the spell icon is not dimmed but is unclickable as a passive would be.

Also, is my assumption of stacking multiple spells on top of the original the basis of this concept? And that being the case would there be much lag or delay with multiple units running this method for high cooldown spells this way? Is there a way of increasing the cooldown without essentially restacking and removing 1 less than previously?

In any case I'm more than Ok using 300 units to address a highest worse-case scenario as this seems to also solve another problem of mine which was spell positioning, which this deals with quite easily.

As I already said, the main concept is to stack abilities with the same id. In fact, I don't really need to stack all those abilities, I could simply add and remove one of them every second. But stacking is a more efficient implementation, as I can reduce the number of operations that will be done in the timer.

Imagine hundreds of units in the game, each of them having one or two abilities in cooldown. For each ability in cooldown there will be a timer running every second, so it's better that these timers execute as few operations as possible.

The Soul Burn ability, as you noticed, causes the original cooldown indicator to display. I just placed it in a powerup, because I was lazy to make a dummy caster. Its purpose is to fix a small problem with this implementation: When two abilities are stacked in a single button, only the lowest cooldown indicator is displayed. And this is a problem, because only 1 ability (the original) is actually on cooldown, the others are not. That means that the other abilities are on 0 cooldown, and since 0 is the lowest, that's what will be displayed (ie. no cooldown indicator at all)

The solution is to cause those dummy abilities to be permanently silenced. Because [post=2773859]silenced abilities don't display cooldown indicators[/post], they will not interfere with the cooldown indicator of the main ability. Soul Burn is then used to [post=2778019]partially silence a unit's abilities[/post]. Notice that all counter abilities have a manacost of 1. And when they are transformed, their manacost becomes 0. Combining this transformation with Soul Burn, those abilities will be permanently silenced, as I explained in the Silence guide.

The unknown ability does exactly what you said: it links the counter abilities to the main ability. First, a spellbook is added with the counter abilities, then, a global Engineering Upgrade (the 'Cool' ability) is used to transform all those abilities into the same id, through the use of the [post=2247321]add/remove trick[/post]. As you see, this virtual id doesn't need to really exist. After that, we use the per-ability upgrade to transform all those abilities with the virtual id into the original ability.

In the second testmap, I don't use Soul Burn since I don't want the cooldown indicator. Instead, I use Engineering Upgrade to transform the original ability into the inexstent id. Notice that I wait a 0-second timer to do that. I can not replace an ability right in the SPELL_EFFECT event cause it interferes with the regular casting.

After that, I add an Orb-of-slow dummy together with the counter abilities, and transform them all into the real ability. This way the dummy will have the original icon and tooltip of the ability, but it will remain as passive. And since OoS always uses the DISBTN icon, it creates a very nice effect of an ability being disabled while in cd.

If I have to account for up to 300s and i want to set the cd to 15s, would there be a big delay while it removes a ton of abilities from my unit over what is supposed to be an instant? Can we try running this with 300s max timer to see?

A spellbook can only contain 10 abilities. If I want to count to 300, I will need to create 30 spellbooks. My code will not add all spellbooks at once, it will calculate and add only the needed amount. If I want to set a cd of 15 seconds, I will just add the 1~10 spellbook, then the 11~20 spellbook, and remove the counters from 20 to 16. I won't be removing hundreds of abilities in any case, at most I will remove 9 abilities at once.
 
Last edited:
Level 10
Joined
Apr 9, 2004
Messages
502
You sir, are amazing :) . After reading all this, you use more tricks and quirks from wc3 than I thought of or even knew existed. It seems a lot harder to access older threads unless you know exactly what you're looking for so those links were very informative. I know I made this thread but after seeing what you're doing, it's exactly the kind of system I'd want to use and the display I was looking for.. A few questions for follow-up:

I know having flare or sentinel as the base is crucial since these are the only abilities with the counter mechanism. Now do we need to use the orb of slow to make the ability passive and unclickable?

I tried playing around by switching it simply to a passive ability instead and adding that instead of the item ability but it did some very weird stuff so I'm curious.

Also, the way you stacked the levels in the spell id converter (the ANeg ability), is that an important step as well or could you have filled them in an arbitrary order. And how do you guarantee that as you remove the ability, the right icon shows up? Is that because of the stacking order in the spellbook?

I'd truly love to see this method incorporated into a system. Forget what I did, this would be much more efficient and is graphically more in line with was I wanted to achieve anyways.
 
Level 10
Joined
Apr 9, 2004
Messages
502
I have a follow-up question on this. It seems the stack has a certain way of knowing that when you remove the 'A000' ability, that you're removing a certain one. I'm just wondering how I base this hierchy? It seems if I mess around with the number of flares the largest number always takes precedence over the others. Let me know if I'm correct but is there a hierarchy such the highest "level" of displayable information takes precedence?
 
Status
Not open for further replies.
Top