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

Other way to preload ability

Status
Not open for further replies.
Level 6
Joined
Dec 8, 2016
Messages
127
Is there any other method other than preload to avoid 1st time spell casting hang? Preloading trigger during game makes my map unplayable more than 15 seconds, because my hero skill selection system has more than 50 dummy abilities. If i preload before map starts, the loading time is too long.
 
Level 6
Joined
Dec 8, 2016
Messages
127
You could preload ONLY the abilities that are going to be used

By example: If you have 10 players but 100 heroes. You wait for each player to pick a hero, when hero gets picked, you preload their abilities

I mean is there any other method to avoid lag other than preload.

How does your preload trigger look like?
Typical create 1 dummy , add and remove ability for 50 times.
 
Level 6
Joined
Dec 8, 2016
Messages
127
1x: UnitCreate
50x: AddAbility
50x: RemoveAbility

^That is no problem at all at won't take 15 seconds for your computer, not even one. Maybe the source is somewhere else.

1st time casting already take 1 second, how preloading 50 skills take less than 1 second? I rember picking Invoker in dota already take quite some time to load, i guess that hero need around 30dummy skills.
 
Level 7
Joined
Jan 23, 2011
Messages
350
You're asking for a way to not preload your abilities?? I would use one level abilities only if i wanted that. But, avoid lag on cast + avoid Preloading abilities, you want to close the window but you also want to feel the fresh air from outside. You simply can't
 
Level 6
Joined
Dec 8, 2016
Messages
127
You're asking for a way to not preload your abilities?? I would use one level abilities only if i wanted that. But, avoid lag on cast + avoid Preloading abilities, you want to close the window but you also want to feel the fresh air from outside. You simply can't
  • Preload Heroes 2
    • Events
    • Conditions
    • Actions
      • For each (Integer PreloadINT[2]) from 100 to 183, do (Actions)
        • Loop - Actions
          • Unit - Add AdvisorSkill[PreloadINT[2]] to Preloader_B[32]
          • Unit - Remove AdvisorSkill[PreloadINT[2]] from Preloader_B[32]
      • For each (Integer PreloadINT[3]) from 189 to 194, do (Actions)
        • Loop - Actions
          • Unit - Add AdvisorSkill[PreloadINT[3]] to Preloader_B[32]
          • Unit - Remove AdvisorSkill[PreloadINT[3]] from Preloader_B[32]
      • For each (Integer PreloadINT[2]) from 200 to 283, do (Actions)
        • Loop - Actions
          • Unit - Add AdvisorSkill[PreloadINT[2]] to Preloader_B[55]
          • Unit - Remove AdvisorSkill[PreloadINT[2]] from Preloader_B[55]
      • For each (Integer PreloadINT[3]) from 289 to 294, do (Actions)
        • Loop - Actions
          • Unit - Add AdvisorSkill[PreloadINT[3]] to Preloader_B[55]
          • Unit - Remove AdvisorSkill[PreloadINT[3]] from Preloader_B[55]
      • For each (Integer PreloadINT[4]) from 1 to 113, do (Actions)
        • Loop - Actions
          • Unit - Add PreloadAbility[PreloadINT[4]] to Preloader_B[32]
          • Unit - Remove PreloadAbility[PreloadINT[4]] from Preloader_B[32]
      • For each (Integer PreloadINT[5]) from 1 to 93, do (Actions)
        • Loop - Actions
          • Unit - Remove Preloader_B[PreloadINT[5]] from the game
My mistake, i need to preload more than hundreds skills, the game freeze more than 15 seconds. If preloading is unavoidable, is there anyway to at least reduce the duration?
 
Level 2
Joined
Oct 3, 2017
Messages
26
yes, do not use abilities with 5+ levels (beyond 4 levels). This will improve perfomance drastically. In case if thats imminent you have no other choice but to preload, better using periodic timer, one by one, instead of full bunch of preloading at once
 
Level 6
Joined
Dec 8, 2016
Messages
127
As i already wrote up there on a comment
Just preload the abilities for the heroes that are going to be used, why preload 400 abils if you're picking 10 héroes (50 or 40 abils)
Maps like Dota, I guess it only preload around 10 abilities for each hero when picked. But when a hero is picked in my map it needs to preload more than 100 abilities. I tested preloading them at once is more faster than preloading over time.

Never mind, maybe my expectation is too high, I expect my map's loading time to be less than 45 seconds.
If loading time is long, how long it is to be generally acceptable? 2 minutes ok?
 
Level 6
Joined
Dec 8, 2016
Messages
127
My map isnt finish, i estimate each hero (7 to choose) has 25 abilities, 25 fake abilities to choose(w3 limit is 5 only, so i make custom system), the rest is dummy skills (custom spells).
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Think it over, do you really need that many abilities? Most often such amounts stem from system like an array of abilities that only differ in one attribute. But maybe there is a better alternative. Dummy units/abilities are often not mandatory. Xonok found that most of the increased loading time originates from string modifications. Are those necessary? Having more abilities with fewer levels enables you to gradually preload them. And the most promising solution is still to convert your object data to SLK, the native object definition format in wc3. This comes with a couple of application conditions however and is not supported by the WE, you would have to process your map through a converter tool.

edit: Actually, this is such a common question, it should be covered in FAQ.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Dunno the resource you speak of. The level 4 threshold is probably referring to the abilities SLK only containing fields for up to level 4 attributes. It is weaker than the objMods you normally achieve with the object editor in that sense but often, levels can be split into multiple abilities.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Is there any other method other than preload to avoid 1st time spell casting hang? Preloading trigger during game makes my map unplayable more than 15 seconds, because my hero skill selection system has more than 50 dummy abilities. If i preload before map starts, the loading time is too long.
You seem to be missing the point of preloading. The reason it takes so long in both cases is because that is just how long it takes to load the required data. There is no work around next to loading less data.

If you do not preload, it takes that long when the data is loaded which is why frames may be dropped.
^That is no problem at all at won't take 15 seconds for your computer, not even one. Maybe the source is somewhere else.
The time it takes depends on the time it takes to load the ability data. If these abilities have thousands of levels it could take a good part of a minute or more.
Before any unit casts the spell, it should be preloaded already. To completly preload it, add and remove it from your dummy unit on map init.
Which defers loading of the data to the load screen, which increases load time.
Maps like Dota, I guess it only preload around 10 abilities for each hero when picked. But when a hero is picked in my map it needs to preload more than 100 abilities. I tested preloading them at once is more faster than preloading over time.
Possibly a sign of bad design. WC3 is not meant to deal with such a situation so you might want to either preload the abilities as they are picked at the cost of some dropped frames or to reduce the number of abilities to a more reasonable 6-11 (Heroes of the Storm style).

With triggered abilities one could get away with a single ability level which scales in other ways. This is how more modern designed games like Heroes of the Storm work.
 
Level 6
Joined
Dec 8, 2016
Messages
127
Majority of my abilities is more than level 5. Maybe that is the problem.
Before revamping my map all abilities set to max level 4, do I need to change all purple field after level 4 in ability object editor before set to level 4?
 
Level 2
Joined
Oct 3, 2017
Messages
26
Have you guys actually tried this? The data definitely does stay even if you save, close the editor and open it up again.
I'd bet it also gets loaded, since WC3 typically isn't very smart about such things.
it didnt stay, for sure, elseway how would I reduce w3a file size by stripping levels of useless abilities? wc3 1.26, idk about rest (means they're irrelevant anyway)
 
Level 2
Joined
Oct 3, 2017
Messages
26
There are no editor-only files in this case, so there is no reason to not remove data from the levels that you don't use. It doesn't remove automatically, although the game might not load them.
sigh
I removed data using editor many times, reducing my w3a from 15 to 7 kb in the end. Stop that plz.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Are we even arguing the same case?
w3a.jpg
This picture is of an ability with 100 levels of data, but the levels field is set to 1.
If you want to say that simply setting the levels field to a lower number changes the size of the w3a file you need to make a way better case, because clearly the data itself is still there.
 
Status
Not open for further replies.
Top