• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

map initialisation

Status
Not open for further replies.
Level 5
Joined
Aug 24, 2010
Messages
133
I would just like to clarify that map initialisation triggers as soon as the first player finishes loading even when that player is still at the press any key screen
so if I want to make a trigger work once everyone has finished loading and is past that screen would I use elapsed game time 0.01
 
I would just like to clarify that map initialisation triggers as soon as the first player finishes loading even when that player is still at the press any key screen
so if I want to make a trigger work once everyone has finished loading and is past that screen would I use elapsed game time 0.01

Or better yet, how do you make map initiation to start without the need of pressing any key? like in dota?:goblin_wtf:
 
I would just like to clarify that map initialisation triggers as soon as the first player finishes loading even when that player is still at the press any key screen
so if I want to make a trigger work once everyone has finished loading and is past that screen would I use elapsed game time 0.01

Starting the triggers before the game initiate is impossible, other than Map initiation Action -> add spellbook, in order to make spell books not lag when added in hero abilities, you could try this if you want but I belive no other trigger may take action before the game started, I think you should aim to ask HOW DO YOU MAKE DOTA-ALIKE START SCREEN IN WHICH THERE IS NO NEED TO PRESS A KEY? This I do not know, but I think it might be something like costum script that force players to press a key inside this EVENT - MAP INITIATION.
Actions - Costum script: Force a player to press a keyboard
But this is just a random attemp
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
@best_player_88:

It's map initialization. Initiation is something entirely different.

By the way do this:

  • Cancel Loading bar thingy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: call ForceUICancel()
Or, if you want to do it for a specific player only:
  • Cancel loading bar thingy for player 1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Force Player 1 (Red) to press Escape/Cancel
@blacksheepwalll:

Map initialization is triggered "during" initialization. This means that whatever code or trigger you use for map initialization will be used for setting up the map before playing.
If you want something to happen right after the map is done initializing for all players, you should indeed use elapsed game time 0.00 seconds.

This can sometimes be the reason why loading bars take so long (because of a huge amount of initialization code).
But then again, it can also be due to preloading handles. Basically, it loads all the data it needs to start the map with, inside your temporary memory.
Usually though the problem is with the client's computer since read/write speed and RAM can be different for each client (slow computer).
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
I always tend to use elapsed time = 0 because some functions don't work with map initialization.

Not a good idea. Doing this causes lag when the game first starts up. You try to put as much in a map initialization trigger as possible so it loads before the game rather then at the start of the game, reducing the lag at the beginning.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
I would just like to clarify that map initialisation triggers as soon as the first player finishes loading even when that player is still at the press any key screen
so if I want to make a trigger work once everyone has finished loading and is past that screen would I use elapsed game time 0.01
Incorrect.

Map Initialization runs before a player finishes loading so is counted as load time. It is run at exactly the same load progress for every player in turn. The game remains in synchronization because the game remains paused until each player has finished loading.

The sort of multiplayer synchronization used in RTS games like WC3 is synchronous clients. This means that the game state (and thus triggers) progress equally for all players to produce the same states as each other. All triggers are run on every client. The exception is if you use GetLocalPlayer() which will return a result that is client dependant and thus can be used to run script for specific clients (and possibly cause a desynchronization split as a result).

Although all clients go through the same game states at the same rate, there is an exception to this. Depending on latency with the host (server) the client will run slightly ahead. This means that it will decide the results of any synchronization calls as it gets to run them first. The host detection system used this as the host player ran both a server and a client which communicated locally so had nearly no latency compared to external communication, however in the case of high system load or a LAN player (proper LAN, not fake WAN) the latency to them might be so small that it incorrectly decided they were host.
 
Map Initialization runs before a player finishes loading so is counted as load time
Its very valuable information for me, thanks Dr Good, I didnt know that. You experienced user, maybe you can help with desynchronization problem? On all Hiveworkshop noone can help me with this problem, Im starting to be desperate, and start thinking about abondon my project:( After many, many experiments I still coudn't find a solution why map desynchcing.
My topic is here:
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/hordevsalliance-wetlands-help-desync-226427/

I tryed in two main ways:
1st: Change map so NONE triggers are executed before ElapsedGameTime=6sec
Its desyncing right after start (1 or 2 sec at begining)

2nd way: after read Dr Good advice I put as many as posible settings into trigger with event MApInitialization.
Its desyncing right after start (1 or 2 sec at begining)

NO GetLocalPlayer in my map, NO PanCamera things at begining (only later)
NEVER desync in later game, Only 1 or 2 sec after start - 90% games.

I think it might be related with ObjectEditor: maybe some mistakes in units, items, abilities, buffs or upgrades? Or doodads, units placed on map? Variables maybe (No hashtables in map)??

Please point me out if Im wrong in basic triggers things:
IF triggerA is Enabled but initialy turned OFF, and not run Or turned ON by another trigger, so this triggerA cannot cause desync, am I right?

IF triggerB is Enabled and initialy ON, but has event which not happend (so trigger is not running), and not run by another trigger, so this TriggerB cannot cause desync, am I right? For example one of spells triggers below:


  • Stombolt
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to -StormBolt
    • Actions
      • -------- --------
      • -------- Create a dummy unit to represent this spell --------
      • -------- --------
      • Set TargetPoint = (Target point of ability being cast)
      • Unit - Create 1 Dummy (Vexorian, Anitarf, Infrane) for (Triggering player) at TargetPoint facing 0.00 degrees
      • -------- --------
      • -------- The variable ID represents this individual cast of the spell --------
      • -------- --------
      • Set TempUnit_1 = (Last created unit)
      • Set ID_1 = (Custom value of TempUnit_1)
      • Set TargetUnit_array[ID_1] = (Target unit of ability being cast)
      • Set TesterSpell_Caster[ID_1] = (Triggering unit)
      • -------- --------
      • -------- --------
      • Set TempReal = (Real((Level of (Ability being cast) for TesterSpell_Caster[ID_1])))
      • Set TesterSpell_Damage[ID_1] = ((0.03 x TempReal) + 0.06)
      • -------- --------
      • Set TesterSpell_Duration[ID_1] = 3.00
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (TesterSpell_Group_array[1] is empty) Equal to True
        • Then - Actions
          • -------- --------
          • -------- Turn on the loop trigger as it's currently off --------
          • -------- --------
          • Trigger - Turn on Loop Stormbolt <gen>
        • Else - Actions
      • -------- --------
      • -------- Add the dummy to this spell's group so that it can be referenced over time --------
      • -------- --------
      • Unit Group - Add TempUnit_1 to TesterSpell_Group_array[1]
      • -------- --------
      • -------- Clean leaks of course --------
      • -------- --------
      • Custom script: call RemoveLocation(udg_TargetPoint)



pls help with this mystery
Zibi
 
Be aware that some native game functionality such as terrain deformations of shockwave are platform dependant and will cause a MAC and Windows client to desynchronize from each other.

Through existence in map OR when it is casted ??
desynchronization only appears 1 or 2 sec after start.

btw thanks for reply, Zibi
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
that spell will not desync... only GetLocalPlayer() blocks (and some initialization functions) will desync.

If you seriously believe it to be an initialization problem, look up Nestharus's Game Start in the JASS resource section,

(it might also be a problem with function main o_O)
 
Status
Not open for further replies.
Top