- 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
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):
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.
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
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: