Does anyone else get strange bugs that only happen while running a published map on bnet - not while testing the exact same map (using test mode?) I have the exact same number of players, no changes to triggers, and for some reason I get the "trying to access an element past the end of an array" error message. ONLY while running the map on BNet. I am puzzled O.o
Do you have any globals that are shared by all players? For example a global integer g_i. With allowable range of 0-9. When it's called into a thread that increments it in single player, it'll never get past 9. But in multiplayer with say, 2 players, the thread runs twice as many times, potentially making it go past 9. Thus, giving the index error.
I thought multithreading only happens if you have two separate triggers running a loop using the same variable at the same time, not within a single trigger.
In any case, I can't fathom how it could possibly be exceeding the maximum array index since I use the exact same number of players on Bnet as with testing. In other words, I test it alone, then load the map on Bnet alone (after publishing.) It works while testing, but while on bnet I get the error.
EDIT: Hmm, I think I figured it out. I was using the "Player in Group (Players on team x)" condition. Apparently it always returns false in test mode, so I was avoiding the error that way.
Anyway, since we're on the subject, what else is different between test mode and Bnet mode? Game variants and attributes are some of the other things I can think of, but is there anything else?
Not too sure on that. I haven't done much online testing so I've never really had a chance to really find out. But if I were to take a shot, I'd say that banks and functions that cause network traffic would be the buggiest.
I thought multithreading only happens if you have two separate triggers running a loop using the same variable at the same time, not within a single trigger.
In any case, I can't fathom how it could possibly be exceeding the maximum array index since I use the exact same number of players on Bnet as with testing. In other words, I test it alone, then load the map on Bnet alone (after publishing.) It works while testing, but while on bnet I get the error.
EDIT: Hmm, I think I figured it out. I was using the "Player in Group (Players on team x)" condition. Apparently it always returns false in test mode, so I was avoiding the error that way.
Anyway, since we're on the subject, what else is different between test mode and Bnet mode? Game variants and attributes are some of the other things I can think of, but is there anything else?
Game speed is Normal in Test Mode, while it is Faster in Battle.net. It normally wouldn't cause any "bugs", except maybe if you play a sound at a specific time, but you set it as Real Time instead of Game Time so the output time is different in Battle.net.
Network traffic in itself is not a problem, the problem arises with delay, the physical distance between you and b.net, thus using "Player presses key A" will cause delay, because it has to be sent to Bnet and back to show the result on the local computer. Blizzard show allow the creation of local triggers, especially for using hotkeys and 'showing/hiding' dialogs, because it is not interfering with the game itself, not changing anything server side. That is common sense for me.
Pressing a dialog button or a hotkey locally shows up automatically, however because I am in Australia it is about a 1 second wait back to Battle.net.
Real time should always be used for everything in scripting ... now that the data editor is so powerful, unlike Wc3. You should set your game to run "Faster" anyways by default ...
May I ask what the difference is between real time and game time? (Assuming thats the real time you're referring to) And how would I make my key responses real time over game time?
Real Time is Real World Time ... 1 second in game = 1 second in real life.
Game Time is a variable amount that changes depending on game speed. 90% of games you play are on the Faster setting, and that should be the default for all Sc2 Maps, otherwise it is awefully slow. From memory 1 second real time = 1.33 seconds of game time on Faster setting, so a 30 minute game in Starcraft (Faster) is actually 40 minutes in the replay file, or 40 minutes on Normal speed.
Key responses have notihng to do with time because they have no delay, ie, they will be processed the next game loop which is 32 times a second, however, key responses must be sent from your computer to bnet and back again, so for someone like me in Australia, it is half a second to bnet, half a second back = 1 second delay time when using key responses. This is simply the laws of physics, moving at nearly the speed of light through a dozen routers.
Where as "data" is local, it is based on your computer. The commands you issue are locally shown and sent to the server at the same time = no delay. Hence the need for a Data system for WASD movement, because it would be locally based = no delay.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Does anyone else get strange bugs that only happen while running a published map on bnet - not while testing the exact same map (using test mode?) I have the exact same number of players, no changes to triggers, and for some reason I get the "trying to access an element past the end of an array" error message. ONLY while running the map on BNet. I am puzzled O.o
@BasharTeg: Go
Do you have any globals that are shared by all players? For example a global integer g_i. With allowable range of 0-9. When it's called into a thread that increments it in single player, it'll never get past 9. But in multiplayer with say, 2 players, the thread runs twice as many times, potentially making it go past 9. Thus, giving the index error.
I thought multithreading only happens if you have two separate triggers running a loop using the same variable at the same time, not within a single trigger.
In any case, I can't fathom how it could possibly be exceeding the maximum array index since I use the exact same number of players on Bnet as with testing. In other words, I test it alone, then load the map on Bnet alone (after publishing.) It works while testing, but while on bnet I get the error.
EDIT: Hmm, I think I figured it out. I was using the "Player in Group (Players on team x)" condition. Apparently it always returns false in test mode, so I was avoiding the error that way.
Anyway, since we're on the subject, what else is different between test mode and Bnet mode? Game variants and attributes are some of the other things I can think of, but is there anything else?
@BasharTeg: Go
Not too sure on that. I haven't done much online testing so I've never really had a chance to really find out. But if I were to take a shot, I'd say that banks and functions that cause network traffic would be the buggiest.
Game speed is Normal in Test Mode, while it is Faster in Battle.net. It normally wouldn't cause any "bugs", except maybe if you play a sound at a specific time, but you set it as Real Time instead of Game Time so the output time is different in Battle.net.
Network traffic in itself is not a problem, the problem arises with delay, the physical distance between you and b.net, thus using "Player presses key A" will cause delay, because it has to be sent to Bnet and back to show the result on the local computer. Blizzard show allow the creation of local triggers, especially for using hotkeys and 'showing/hiding' dialogs, because it is not interfering with the game itself, not changing anything server side. That is common sense for me.
Pressing a dialog button or a hotkey locally shows up automatically, however because I am in Australia it is about a 1 second wait back to Battle.net.
Real time should always be used for everything in scripting ... now that the data editor is so powerful, unlike Wc3. You should set your game to run "Faster" anyways by default ...
@DogmaiSEA: Go
May I ask what the difference is between real time and game time? (Assuming thats the real time you're referring to) And how would I make my key responses real time over game time?
Real Time is Real World Time ... 1 second in game = 1 second in real life.
Game Time is a variable amount that changes depending on game speed. 90% of games you play are on the Faster setting, and that should be the default for all Sc2 Maps, otherwise it is awefully slow. From memory 1 second real time = 1.33 seconds of game time on Faster setting, so a 30 minute game in Starcraft (Faster) is actually 40 minutes in the replay file, or 40 minutes on Normal speed.
Key responses have notihng to do with time because they have no delay, ie, they will be processed the next game loop which is 32 times a second, however, key responses must be sent from your computer to bnet and back again, so for someone like me in Australia, it is half a second to bnet, half a second back = 1 second delay time when using key responses. This is simply the laws of physics, moving at nearly the speed of light through a dozen routers.
Where as "data" is local, it is based on your computer. The commands you issue are locally shown and sent to the server at the same time = no delay. Hence the need for a Data system for WASD movement, because it would be locally based = no delay.