• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Crash] Different PC spec influence on trigger length/execution quality

Status
Not open for further replies.
Level 8
Joined
Mar 10, 2009
Messages
213
Ok, here's an embarrassing situation:

CONTEXT

I normally work on my maps only with my stationary PC (ok-ish specs: gtx1080, i7-7700k, 4.2Ghz processor, 32 gb RAM, etc.) But today I've updated Wc3 to the latest patch on my older laptop (Intel HD 4000, i5 processor, etc.) and started editing my fallout map in WorldEdit.
Saving the map turned out to be normal, I launched the Test Map command and...

Half of my triggers didn't generate data as they should have generated it past map initialization.

All data (to arrays, hashtables) generating-triggers are executed at start after fixed intervals of time, while user control is disabled, the said intervals (timers) vastly exceeding the time necessary to run all operations (as a measure of precaution, example: trigger runs for 0.3 sec max, interval is 2).
For example, I generate 50x10 Hashtable, but do so via simple recursion with a counter, because I try to avoid in-built loops, since they can bug with large arrays (ForLoopA from 1 to LargeNumber.)

In this particular map, at start (and as a general rule) I avoid almost every custom code possible (unless it's unavoidable, like saving item type as integer to hashtable). Reason: attempt to avoid compatibility issues with new patches etc.

QUESTION

So, does PC performance affect trigger execution, timer cool-downs, etc?
Could it be tied to frame-rate drops? Because the old laptop does lag a lot with the updated WC3.

For instance, one of my simple commands was selecting a unit placed on map (for test purpose). The unit is being selected correctly on my home PC, my friend's PC, but the trigger doesn't work on my laptop. It's really nothing special, I'm posting it below:

Map INI trigger
Code:
function Trig_INI_Copy_Actions takes nothing returns nothing
    // Set players
    // human
    set udg_Player_One_Human = Player(0)
    // /human
    set udg_Player_Two_AI = Player(1)
    set udg_Player_Three_AI = Player(2)
    set udg_Player_Four_AI = Player(3)
    set udg_Player_Five_AI = Player(4)
    set udg_Passive_Player = Player(PLAYER_NEUTRAL_PASSIVE)
    // /Set players
    // Set player groups
    set udg_Player_Group_One_Human = GetForceOfPlayer(udg_Player_One_Human)
    // /Set player groups
    // TMP
    call SetUserControlForceOff( udg_Player_Group_One_Human )
    call CinematicModeBJ( true, udg_Player_Group_One_Human )
    call SetRandomSeed(bj_cineModeSavedSeed)
    call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
    call EnableDawnDusk( false )
    call SetAmbientNightSound( "BlackCitadelNight" )
    call SetAmbientDaySound( "BlackCitadelDay" )
    call PlayMusicBJ( gg_snd_Intro_V2_0 )
    call EnableSelect( false, false )
    call EnableDragSelect( false, false )
    call EnablePreSelect( false, false )
    call SetCreepCampFilterState( false )
    call EnableMinimapFilterButtons( false, false )
    // /TMP
    // Hashtables
    call InitHashtableBJ(  )
    set udg_HashT_Const_Gameplay_Constants = GetLastCreatedHashtableBJ()
    call InitHashtableBJ(  )
    //20 or 30 more HASHTABLES
    // /Hashtables
    // Initialize Block 1
    call ConditionalTriggerExecute( gg_trg_INI_Block_1 )
    // /Initialize Block 1
    call DestroyTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
function InitTrig_INI_Copy takes nothing returns nothing
    set gg_trg_INI_Copy = CreateTrigger(  )
    call TriggerAddAction( gg_trg_INI_Copy, function Trig_INI_Copy_Actions )
endfunction
So, as you can see, I'm creating many hashtables consecutively. All the rest is done step-by-step via timers in chain order afterwards, including setting the map-placed unit that should be selected after data generation.

Then, the said trigger, that doesn't work only on laptop (I've deleted all unrelated commands):
Code:
function Trig_Sys_Prepare_the_very_first_turn_Copy_Actions takes nothing returns nothing
 
    // Force-switch unit
    call ForceUIKeyBJ( GetOwningPlayer(udg_FctVAR_Control_Unit), "U" )
    // /Force-switch unit
   
    call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Sys_Prepare_the_very_first_turn_Copy takes nothing returns nothing
    set gg_trg_Sys_Prepare_the_very_first_turn_Copy = CreateTrigger(  )
    call DisableTrigger( gg_trg_Sys_Prepare_the_very_first_turn_Copy )
    call TriggerRegisterTimerExpireEventBJ( gg_trg_Sys_Prepare_the_very_first_turn_Copy, udg_FctVAR_TimerTurnDur )
    call TriggerAddAction( gg_trg_Sys_Prepare_the_very_first_turn_Copy, function Trig_Sys_Prepare_the_very_first_turn_Copy_Actions )
endfunction

Could it be so, that forcing UI key doesn't work the same way, based on frame-rate or anything? I'm so lost right now, since the map works fine on most pcs, but not on low spec ones.
 
Last edited:
WarCraft 3 patch 1.31+ has introduced a massive overhead compared to all previous versions of WarCraft 3.

However, the thread crashes you describe could be due to something like incompatibility between versions (which isn't the case unless your map had been using something like the H2I bug or the like).

I like how you said "ok" specs when you have a PC with the specs you describe. Even your i5 machine will run WC3 at 60FPS even during fighting. My Intel Atom PC can play WarCraft 3 without thread crashes.
 
Level 8
Joined
Mar 10, 2009
Messages
213
I like how you said "ok" specs when you have a PC with the specs you describe. Even your i5 machine will run WC3 at 60FPS even during fighting. My Intel Atom PC can play WarCraft 3 without thread crashes.
Thank you, bro. That gives me some insight. That's probably some version-related bug. I should try uninstalling the game and downloading fresh copy to the laptop.

As for the laptop, I dunno, the I5 processor (or was it GPU's fault?) lagged like hell when I launched the map. Probably like 10 FPS max. Update: sudden thought - maybe it's just the old laptop dying.

In the meantime, i once left the map running for 3+ hours on my regular PC, executing repeatable actions each 10-30 sec to check memory leak impact (and that was like a ton of text messages for each consecutive unit attack, like here at the precise time
)

And I noticed no performance loss at all.

So, i guess I'll just stick to my main PC and forget about the laptop, finish the whole project. Then, maybe, I should post the result in map dev. section before the release and kindly/humbly ask ppl to run it just to see, if it works on most computers.
 
Last edited:
Level 8
Joined
Mar 10, 2009
Messages
213
My go-to WarCraft 3 benchmark is always the opening cinematic of the Rexxar campaign. If it isn't butter smooth, the game performance on the machine will be sub-optimal.

My Atom is much weaker than your CPU and GPU, so like you said maybe some other software is killing your machine like Antivirus.

What OS is your laptop on?
Thx! I'll check Rexxar campaign asap. OS - Win10, I stopped working with Linux, got too lazy over time =(

A few moments later:

Omg, he moved like a sloth, so much FPS pain. It's 100% soft/hardware fault on that particular machine, I'm sure now. Thank you for saving me countless hours of bug-hunting.
<3
Kinda [SOLVED] I guess.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
So, does PC performance affect trigger execution, timer cool-downs, etc?
Due to the "lockstep" style synchronization model used performance does not effect game results. The only exception is with TriggerSleepAction which is technically a network coordinated delay and hence depends on real time rather than game time. Timers, trigger and pretty much everything else uses game time which is result invariant with performance.

Thread crashes are based on a virtual machine oplimit and not time. If oplimit is coupled with execution time then that would be a serious bug as it introduces behaviour that is not network safe.
 
Status
Not open for further replies.
Top