Staredit Network

Staredit Network -> UMS Assistance -> Debugging Contest!
Report, edit, etc...Posted by (U)Bolt_Head on 2004-07-20 at 13:12:38
Hello everyone, I have decided try something out (again), This thread was already deleted once and im annoyed that I have to remake it.

Anyways I’m making this thread, to increase peoples problem solving skills. What I will do is submit a map with a trigger bug and the first person to determine what the bug is will win a mineral reward provided by me.

I’m sure it sounds really easy but there are a few catches. First off I am not asking people to fix the bug. Only to describe why It doesn’t work.

Anyways here we go.

<hr>
EDIT: Yoshi reset the minerals so i can't give the reward away. Also we have a winner so if you wish to try to figure out the bug by yourself, don't read on until after you have tried
1000 Mineral Reward
Difficulty: Hardest

Time Allowed: One week (if the thread isn't deleted by then)

Background: The following map is a bound that I received on battle.net. The creator of the map came to me for help and I found the bug so interesting (and challenging) that I thought I would keep it.

Bug Description: Anyways the bug is this. When you play though the bounds levels too quickly, the levels begin to malfunction. The level will not stop and all the other levels will go slow. (You will need to play the map.)

Rules:
  • The goal is not to fix the map, Only to tell what causes the problem.
  • All answers are to be in the form of a reply
  • I will judge the correctness of the answers and will not hint towards correctness until the problem has been solved or the time is up
  • First reply to have a correct answer wins (no cheating i can tell if you edit your post). So don't edit your post after you have submitted your answer.
  • Rules are subject for change (got to love that one)
Report, edit, etc...Posted by DT_Battlekruser on 2004-07-20 at 13:39:45
Here's my solution:

The finish level trigger for the bound goes like this:

CONDTIONS:
-Bring At Least 1 man to 'beat level'
-Switch 'curlevel' is set

ACTIONS:
-Comment "clear x set y"
-Display Text "First Victory Text"
-Wait 500
-Display Text "Second Victory Text"
-Wait 500
-Display Text "Third Victory Text"
-Set Switch
-Clear Switch

Also, it is hypertriggered.

If you set off a clear level trigger, but then reach the next clear level spot before 999 milliseconds elapses (before the second wait has elapsed), the hypertriggers will find the next clear level trigger and interrupt the running one before it reaches the set switch actions. Therefore the level switches are not cleared and the previous level runs, lagging all subsequent levels.

SOLUTIONS:
-Delete the Hypertriggers
-Move Switch actions to the top of the list

I did the second and the bug was fixed. Owned. tongue.gif

EDIT> Owned in 17 minutes w00t.gif
Report, edit, etc...Posted by Clokr_ on 2004-07-20 at 13:46:10
How can the user reach the next level spot? The wall must be removed, and for that the switch must be set, so that trigger MUST end before the player reaches the next level spot...
Report, edit, etc...Posted by CheeZe on 2004-07-20 at 13:48:20
..I got the same answer =/ but they beat me so blah
Report, edit, etc...Posted by Clokr_ on 2004-07-20 at 13:49:59
Hmmmm does that happen because the wait time is diferent from the game time?!
Report, edit, etc...Posted by DT_Battlekruser on 2004-07-20 at 13:50:27
For the first several triggers, the remove wall is not in the same trigger as the set switch. If you went too fast later on, the walls wouldnt go away.

EDIT> And well, I fixed it and it works. The minerals are mine, all mine MUAHAHAHAHAHA! tongue.gif wink.gif tongue.gif

EDIT2> Oh and the wall goes because the next level starts, the last level just doesnt finish
Report, edit, etc...Posted by Clokr_ on 2004-07-20 at 13:52:00
But the trigger that removes the wall only fire is the switch is set.

EDIT: "First off I am not asking people to fix the bug. Only to describe why It doesn’t work."
Report, edit, etc...Posted by (U)Bolt_Head on 2004-07-20 at 13:53:52
Pretty good DT Battlekruser, but incorrect. Also you don't actually have to fix the map for the contest, and yes what you did would fix it and i understand it is a way to test your hypothesis, just don't bother attaching it.

PS. I belive it would be unfair to go into detail about why it is incorrect, I'll explain once someone is correct or once the time is up.
Report, edit, etc...Posted by Clokr_ on 2004-07-20 at 14:01:38
Is it because the triggers that creates the levels are long (too much waits) and when you clear the last level and set the next, the waits of the last level messes the waits of the next one?
Report, edit, etc...Posted by (U)Bolt_Head on 2004-07-20 at 14:08:41
Clokr_ That explains why the levels will go slow, not why the level doesn't stop.
Report, edit, etc...Posted by CheeZe on 2004-07-20 at 14:12:40
GAH i was wrong again it did stop but you have to wait vERy LOng time !!!
what I did was finish the levels (get the bug working) fast

so it starts happening.

the first one continues the go while the second one triggers 1 explosion per cycle of the 1st one. i finished another level (stacking even more waits) and it and then that 1 exploded per cycle of the slow one. waits are a tricky thing..
Report, edit, etc...Posted by DT_Battlekruser on 2004-07-20 at 14:15:31
Lol. The levels go slow because another level is running no matter what you do with waits.
Report, edit, etc...Posted by Clokr_ on 2004-07-20 at 14:19:24
That is what I said. The problem is, why levels DONT stop, or why they stop after a long time?
Report, edit, etc...Posted by CheeZe on 2004-07-20 at 14:27:17
when you run too fast and finish the level (only if the level is still running with waits), then the wait will still be stacked with the waits of the next level that starts (clear switch, set switch(WAIT, this wait is from the next level and interferes with the switch). If you keep going onto the next level, you will notice that it runs the original one through at normal speed with each cycle allowing another one at the "slow" one to have one explosion (the waits caused by that level does this). after some cycles through (i really need to count this), the original stops, that one will run normally again. if you go through 2 levels, then the one your at is slow, the one in between is stuck(frozen), and the original one is at normal speed. after it's done, the middle one will go at normal speed and the last one will still be slow...until the middle one is complete. the whole problem is just the waits that are stacked on top of each other because the switches are not cleared at the wrong time

^PROBABLY WRONG BUT WHO CARES?^
Report, edit, etc...Posted by Clokr_ on 2004-07-20 at 14:46:16
The trigger that enables the level fires twice, but the first time that it first it dont ends, because the waits messes up and it need a lot of time for end, so the next level starts because the trigger fired twice, but after some time the trigger clears the switch and set the next one again and that messes everything.

Bolt, does it fire again when the wait happens?
Report, edit, etc...Posted by (U)Bolt_Head on 2004-07-20 at 14:47:53
Ok I guess I’ll need to explain something so we don’t just end up with everyone explaining why the levels are going slow. This one may have been too hard to start the thread out with.

First off make sure you realize that the triggers do what they are intended to do.
Hint: The switch for the next level is set at the same time the switch for the previous one is cleared. So you need to ask yourself, “why does the next level start and the previous one not stop”

You guys are doing too much guess work on why exactly the levels go slow and not focusing on the real problem of why the first one doesn’t stop. You are of course allowed to make debugging triggers. For example if you want to make triggers so you can see when all the switches are set or clear that is fine, that is part of debugging.

Cheese: Your reply is very good and it explains why the following levels go slow quite well. However as you predicted you are wrong, mainly just because your annualizing the wrong thing.

PS. The reason behind this is quite complex, the reason i kept the map is because it is the most difficult bug problem i have seen in about a year directly relateing to triggers. (excludeing large trigger systems)

Edit:
QUOTE(clokr_)
The trigger that enables the level fires twice, but the first time that it first it dont ends, because the waits messes up and it need a lot of time for end, so the next level starts because the trigger fired twice, but after some time the trigger clears the switch and set the next one again and that messes everything.

Bolt, does it fire again when the wait happens?

Very close, keep going with that
Report, edit, etc...Posted by Clokr_ on 2004-07-20 at 15:08:00
When you finish one level the level changer trigger fires. It shows the message, but when it reaches the first wait, the triggers check again its conditions. The level switch isnt cleared, so the trigger fires again. The first trigger that fired cannot continue the wait, until all the new triggers that fired ends, so it stop there. You don't see the message of the first trigger, because the second time that it fires it removes it. If you remove the blank zone at the top of the display message string you can check it. The triggers keep going like that, but when you are like in level 4, the level 1 trigger ends, and sets level 2 again. That is what happens. If you make debug triggers that show the state of each switch, you will see how when you are in lvl 6, lvl 3 is set again, then cleared and lvl 4, then cleared and lvl5 set, and that is what creates all the problems.
Report, edit, etc...Posted by Kejardon on 2004-07-20 at 15:19:33
Can I take this now? tongue.gif

Ok. The clear level triggers are for all players: That is the main problem. Making them only for the players will fix the game quite nicely, since there's no way of even a ling running those courses in under a second.
Lemme think of a way to explain this...
The explosions trigger for Level 1 is running. You run a ling through it, and the switch for clear level 1 starts running. For P1-6, the trigger quickly finishes, and the level is clear. Note that, since it is for all players, it is also running for Player 7. Because it's an overlapping wait trigger, it will have to wait through the level triggers, twice.
You beat the next level before the explosions finish twice. Now Level 3 is set by P1-6, and Level 2 is cleared.
Player 7's delayed trigger for clearing the levels finally catches up, and clears level 1, then sets level 2. Whoops.
Player 7 will also be trying to run through the next clear level trigger. The more levels you stack up, the more Player 7 will lag. Eventually, of course, Player 7 will catch up and fix it all. But that'll take a while. In the mean time, you'll have two levels going on at once, and one will usually lag.

Wait triggers are pure evil.

::Edit:: Do you still plan on giving 1,000 minerals? Becuase you better be able to get a loan somewhere. tongue.gif ::/Edit::
Report, edit, etc...Posted by Deathknight on 2004-07-20 at 15:20:14
Just use a counter and it will fix all your problems. smile.gif
Report, edit, etc...Posted by CheeZe on 2004-07-20 at 15:21:11
QUOTE(Ðeathknight @ Jul 20 2004, 02:20 PM)
Just use a counter and it will fix all your problems. smile.gif

hahha yesturday there was a small debate on that and I said just use scores ^_^

looks like i'm right once again!! biggrin.gif


I THINK CLOKR_ is right and we should all give UP!!!
Report, edit, etc...Posted by Clokr_ on 2004-07-20 at 15:36:30
Sorry, but there is not gonna be reward. Yoshi removed bank and all the money sad.gif
Report, edit, etc...Posted by CheeZe on 2004-07-20 at 15:37:14
QUOTE(Clokr_ @ Jul 20 2004, 02:36 PM)
Sorry, but there is not gonna be reward. Yoshi removed bank and all the money sad.gif

what the .. ranting.gif ranting.gif ranting.gif I WILL FORCE IT OUT OF HIM!! !!!
Report, edit, etc...Posted by (U)Bolt_Head on 2004-07-20 at 15:39:30
Very nice Kejardon, Thats exactly what happens.
Congradulations Kejardon you win

I was very tempted to give it to clokr because he was starting to get on track. (maybe i should just not veiw the thread every 5 minutes) next time.

Clokr_ you were on the right track when you talked about the trigger firing multiple times. So I'll give you a second place price. But im not going to say how much lol.

Anyways if you guys want to hear my exclamation (Kejadon did a good job) here it is. (i already wrote it)

<hr>
Ok as for my exclamation to why it doesn’t work. The two key aspects here are the wait block and trigger ownership. (the two most commonly overlooked things).

The triggers that end the level and set the next have two waits in it.
CODE
CONDTIONS:
-Bring At Least 1 man to 'beat level'
-Switch 'curlevel' is set

ACTIONS:
-Comment "clear x set y"
-Display Text "First Victory Text"
-Wait 500
-Display Text "Second Victory Text"
-Wait 500
-Display Text "Third Victory Text"
-Set Switch
-Clear Switch


But more importantly you must look at the player that owns the trigger. “All Players” That means for every player in the game the trigger will run for that player, and independent of eachother. What this means is the switches are set and cleared multiple times once for each player. This is where the problem with wait blocks become part of the issue.

As you may notice the bug ONLY happens if you complete the obstacle too quickly. So what is too long? And what determines this time?

When a player beats the 2nd level for example the set next level trigger will start running for everyone. When the human players run this trigger they have no active waits, so they see the text, then the trigger clears the switch for the 2nd level and starts the 3rd.

The problem is Player 7’s trigger does something different. Although the trigger starts at the same time it doesn’t end at the same time. If you move the clear/set level triggers to the “gaming lord force” you will see that it lies AFTER the level that it is clearing. This is the way it actually happens. This means that the waits in the clear/set trigger owned by player 7 must wait for the obstacle trigger to complete its round before running.

So if you complete the 3rd level before player 7s trigger finishes from completing the 2nd then the human players and other comp will run there trigger to start the 4th before player 7 finishes running the trigger for the 3rd. Then when player 7s trigger finally finishes it will start level 3 up again after they just passed it.

QUOTE(Clokr_)
Sorry, but there is not gonna be reward. Yoshi removed bank and all the money


<hr>
Edit:
It sucks, did he do it already? (guess i'll find out when i try to give him 1000 minerals). Anyone have a good suggestion of a reward? (pride just doesn't modivate people lol)
Report, edit, etc...Posted by CheeZe on 2004-07-20 at 15:43:36
I would be happy if I won ^_^(I think knowing that your better than everyone else is enough..but eh whatever he wants)

gg Kejardon you owned us all

do this again sometime!! it actually made me think (and fail but who cares?)
Report, edit, etc...Posted by (U)Bolt_Head on 2004-07-20 at 15:47:49
Well there is actually another bug in the same map. Equally dumb and hard, And i wouldn't of know what the deal was if Dabuu didn't write that little hyper trigger thing a while back.


Level 9 (the first horizontal level) works but the hyper triggers do not seem to effect it. If you watch it you will notice it pauses after each cycle unlike the rest of the obsticals.
Next Page (1)