- Joined
- Apr 9, 2004
- Messages
- 502
This was previously coined over a year ago and after much toiling I have a proof of concept for a multi cooldown system that seems to work beyond the limits that were first set on it.
I know leandrotp said he was working on a system but I hadn't seen any motion.
A few things to note based on his comments below:
Quick note I've tried the system with thunderclap as a dummy ability and it worked just as well as any other ability. I also don't know about only having 2 of them simultaneously as my testmap shows 4 channel based abilities all running on 1 unit so either i misunderstood or my modifications overcomes these limitations.
As it stands my test map shows that I can use more than 2 channel based abilities on a unit and it seems to work just fine.
I basically replicated leandrotp's code 4 times redefining the triggers so they were all unique instances and making the necessary modifications to replica abilities required to ensure each cooldown worked independently and did not cause errors with any other cooldown.
The testmap shows proof of concept on multiple abilities for up to 10 seconds at the moment but the plan is to allow up to 360 seconds (6mins) max cooldown time on up to 6 abilities on heroes only.
Notice that I'm only using flare and channel, and that I did not need to reference using sentinel or any of the other abilities he referenced.
My guess is that the ability modifications I made might require more upfront base abilities to work but it gets rid of those limitations that his setup had (assuming i'm not misunderstanding the explanation of those limitations)
I'm working on the code to make this MUI and for the most part it's really quite easy to explain how this works:
I have the following list of abilities that all work together:
Bulk of the system:
-360 flare dummy abilities all with 1-360 charges
-1 dummy flare ability, no charges
(used to link display to a unique orb of slow ability)
-6 unique orb of slow dummy abilities with the dummy flare as the equipped ability
(these will eventually "contain" and show the real ability with cooldown number listed which is a pretty nice looking cooldown effect)
-6x36 dummy spell books used to stack spells in segments of 10 counts (flare abilities), for each array from 1-10s, 11-20s etc. up to 351-360s for each of the 6 cooldowns instances
(used because the actual refresh triggers only need to run every 10 counts per unit so less overlap as all that goes on in the meantime is im removing 1 ability when i tic down 1s.
6 unknown base abilities which are used to link real abilities, and dummy abilities together (i tried using only 1 but this causes issues when more than 1 ability is on cooldown)
36 dummy abilities which convert all numbers into the unknown base ability
(uses the reverse engineering hack to transform the cooresponding number abilities in the current spellbook to the specific base ability being used for the cooldown instance)
For each real ability you use:
1 dummy ability that convert the real ability to the unknown base ability as well as convert a secondary dummy ability back into this ability
1 dummy ability used for actual casting and cooldown effect
[Update 2017-03-16]
Did find an issue which caused the dummy caster ability to always revert to level 1. To circumvent this I worked in an extra level which simply displays "on cooldown" with modified text. This was the quickest and cleanest fix and the issue definately outlines a flaw with the system.
Finished all of the polishing work on the system (i.e. added lua to generate base real abilities and corresponding dummy abilities, updated triggers to control real and dummy caster linked abilities) overall this feels like you could stick it in a map and start working with it. Ready to test and optimize. Will have a full breakdown here within a few days. In the meantime, feel free to look at the map code and comment on anything you find.
[Update 2017-03-15]
Managed to get the system running with proper UI, still haven't generated the LUA to easily make abilities nor have I coded adding the dummy casting ability upon learning the real hero ability.
For now I'm showing how the dummy casting abilities run the system.
A few notes:
-Lag spike in loading, I preloaded the abilities onto existing units (right now all units are heroes but will need a hero filter)
-Adding a new unit has a bit of a delay but not too bad.
I'd like people to try out the system and let me know what you think, if it seems at all feasible or useful or if it's too much of a drain on performance for this one effect.
I know leandrotp said he was working on a system but I hadn't seen any motion.
A few things to note based on his comments below:
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:
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.
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.
Quick note I've tried the system with thunderclap as a dummy ability and it worked just as well as any other ability. I also don't know about only having 2 of them simultaneously as my testmap shows 4 channel based abilities all running on 1 unit so either i misunderstood or my modifications overcomes these limitations.
As it stands my test map shows that I can use more than 2 channel based abilities on a unit and it seems to work just fine.
I basically replicated leandrotp's code 4 times redefining the triggers so they were all unique instances and making the necessary modifications to replica abilities required to ensure each cooldown worked independently and did not cause errors with any other cooldown.
The testmap shows proof of concept on multiple abilities for up to 10 seconds at the moment but the plan is to allow up to 360 seconds (6mins) max cooldown time on up to 6 abilities on heroes only.
Notice that I'm only using flare and channel, and that I did not need to reference using sentinel or any of the other abilities he referenced.
My guess is that the ability modifications I made might require more upfront base abilities to work but it gets rid of those limitations that his setup had (assuming i'm not misunderstanding the explanation of those limitations)
I'm working on the code to make this MUI and for the most part it's really quite easy to explain how this works:
I have the following list of abilities that all work together:
Bulk of the system:
-360 flare dummy abilities all with 1-360 charges
-1 dummy flare ability, no charges
(used to link display to a unique orb of slow ability)
-6 unique orb of slow dummy abilities with the dummy flare as the equipped ability
(these will eventually "contain" and show the real ability with cooldown number listed which is a pretty nice looking cooldown effect)
-6x36 dummy spell books used to stack spells in segments of 10 counts (flare abilities), for each array from 1-10s, 11-20s etc. up to 351-360s for each of the 6 cooldowns instances
(used because the actual refresh triggers only need to run every 10 counts per unit so less overlap as all that goes on in the meantime is im removing 1 ability when i tic down 1s.
6 unknown base abilities which are used to link real abilities, and dummy abilities together (i tried using only 1 but this causes issues when more than 1 ability is on cooldown)
36 dummy abilities which convert all numbers into the unknown base ability
(uses the reverse engineering hack to transform the cooresponding number abilities in the current spellbook to the specific base ability being used for the cooldown instance)
For each real ability you use:
1 dummy ability that convert the real ability to the unknown base ability as well as convert a secondary dummy ability back into this ability
1 dummy ability used for actual casting and cooldown effect
[Update 2017-03-16]
Did find an issue which caused the dummy caster ability to always revert to level 1. To circumvent this I worked in an extra level which simply displays "on cooldown" with modified text. This was the quickest and cleanest fix and the issue definately outlines a flaw with the system.
Finished all of the polishing work on the system (i.e. added lua to generate base real abilities and corresponding dummy abilities, updated triggers to control real and dummy caster linked abilities) overall this feels like you could stick it in a map and start working with it. Ready to test and optimize. Will have a full breakdown here within a few days. In the meantime, feel free to look at the map code and comment on anything you find.
[Update 2017-03-15]
Managed to get the system running with proper UI, still haven't generated the LUA to easily make abilities nor have I coded adding the dummy casting ability upon learning the real hero ability.
For now I'm showing how the dummy casting abilities run the system.
A few notes:
-Lag spike in loading, I preloaded the abilities onto existing units (right now all units are heroes but will need a hero filter)
-Adding a new unit has a bit of a delay but not too bad.
I'd like people to try out the system and let me know what you think, if it seems at all feasible or useful or if it's too much of a drain on performance for this one effect.
Attachments
Last edited: