• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Snippet] Game Start

Level 17
Joined
Apr 27, 2008
Messages
2,455
I know quite nothing about that, i'm just asking.

So using a Timer(0) is not enough ?

About the loading screen, what's happening with it ?

Does the game start only when all players have finished the loading, and then it never starts if not every players have sucessfully loaded the map ?
Or is there a max time, and then if it's reached the game starts anyway ?
 
Does the game start only when all players have finished the loading, and then it never starts if not every players have sucessfully loaded the map ?
Or is there a max time, and then if it's reached the game starts anyway ?

When I was working with data syncing, at t = 0, I found that the host would send its packet to the other players, but the packets from the other players wouldn't read the host. What I also found was that the other computers entered the game at a delay relative to the host (the loading screen going away). Furthermore, slower computers entered the game at a delay compared to faster computers.

What I found was that packets would not be sent from a machine until the game was loaded. They'd be queued etc, but would not be sent until after the computer was in the game. What this meant was that my syncs wouldn't work until after all players were in the game and could see each other ; o.

So, I created this script. When a player finishes loading, then send a value to the other players saying that they finished loading. When a player sees every other player in the game, they send thread sync request, saying that they now see all of the players in the game. When all players have sent the sync request, the game is considered started as all players are verified to see each other : ).
 
And if you select one unit with GetLocalPlayer, player events can fire while the player is not already in game ?

The big problem was that the select unit wasn't guaranteed to fire after all of the data was synchronized because the first player to finish loading send in the select unit thing before the other players even send the data.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
The first ok, but let's say we have X players and you don't remove the unit, or even try to deselect, so it will fire X events.
Then when all of the X player events have trigger the trigger, it's still possible that all players have not completely loaded the game ?
 
The first ok, but let's say we have X players and you don't remove the unit, or even try to deselect, so it will fire X events.
Then when all of the X player events have trigger the trigger, it's still possible that all players have not completely loaded the game ?

Quit trying to make up impossible scenarios. One unit is created for each player.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
It is possible, i'm just trying to get a better solution and this could work, and no i'm not saying it will work, it's just a possibility.

Now ofc instead of not deselect at all just deselect for the triggering player with GetLocalPlayer.

I have no made any test about that, so i could be wrong or miss something, i'm just asking, and you're supposed to be the guy which has tested it, nothing else.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
More, you could even use only one "static" dummy unit for your thread thing.
Now frankly if i would do a map and care about this event, i would just use a selection on my dummy caster with GetLocalPlayer and check the player select events.

Anyway the loading screen should be the best option if you care about that event (only if you like the hardcoded behavior of it)
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Hm, i was thinking, could this same method also be used to detect when a player is lagging?

Lets say if a player was lagging for 5 seconds the game would automatically save for that player so if he drops than his code is given to him
 
Hm.... you could continue to ping players, and if their ping times out above 50% of the avg, they are likely lagging, so you could do an autosave.

edit
@Troll

Upon further evaluation, your idea is no different from how I'm currently doing it -.-, so I'll pass.

You are just obsessed with using unit selection events over the gamecache. I'm just using your current exact idea, but with the gamecache instead.

Using unit selection events instead would require an entirely new library or a new unit as Thread doesn't support it, so I'm not even going to bother.

This library's just staying as is.

edit
updated library to make it easier to use ; )
 
Last edited:
Level 17
Joined
Apr 27, 2008
Messages
2,455
Well, since an unit is the most interactive thing ever, if i can only use one "static" unit, then it's definetely worth it.
Now maybe it can be applied in a public resource, but in any real map that should be fine.

I just feel that there your library requirements are overkill, and even less accurate than the "easy way", but yes don't worry i know your point of view about it.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
How can I implement your Game Start System ?
Im noob in Jass, Im Gui user.
I got desync 1 or 2 sec after my map start, want to try your code.
Should I paste it into Custom Script Code window?
Do I need to copy other Snippets? (Thread snipped?)
thanks, Zibi

Custom Script : call WaitForGameToStart()
 
Top