Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: One simple way to avoid wait blocks
One simple way to avoid wait blocks
May 28 2011, 12:37 pm
By: Wormer  

May 28 2011, 12:37 pm Wormer Post #1



I've just thought of this very simple concept to failsafe yourself from getting into wait blocks. Whenever there is a trigger which uses a wait we do the following (uMutex is any unused unit):

Trigger
Players
  • Whatever
  • Conditions
  • Current player has suffered exactly 0 deaths of uMutex.
  • The rest of conditions...
  • Actions
  • Set deaths for current player: set to 1 of uMutex.
  • The rest of actions with waits...
  • Set deaths for current player: set to 0 of uMutex.




  • Some.

    May 28 2011, 6:02 pm Roy Post #2

    An artist's depiction of an Extended Unit Death

    It seems more appropriate to use a switch, because you're just flipping a bit. It's a nice concept, but impractical for complex maps. Sure, this would clearly show if you have wait blocks, but most people want to run triggers simultaneously, including those which would normally use waits. Therefore, death counters are still the most appropriate way of avoiding wait blocks.

    TL;DR: It doesn't stop wait blocks, it stops the whole trigger, which causes the same problem. Death counters ftw.




    May 28 2011, 6:35 pm Wormer Post #3



    Since waits are player-specific, a player-specific death counter looks more appropriate than a global switch. Yeah simultaneously, well... What I had in mind when I was posting this was the following. Waits are useful due to their specific to have a memory of their trigger. Sometimes I'm using waits just to skip a trigger cycle and then return to execution of the trigger. Of course everything may be done with death counters, but waits alike current player help to keep triggers number reasonable. Then, if I have some amount of such triggers there is a possibility they will run altogether, but due to the waits specific this will cause exponential growth of wait time. Since I only wanted to skip one cycle I found practical to use a mutex to manually separate their execution.

    Another thing I found waits extremely useful is displaying information to the player in complex maps. Let's say there is a number of events which may repeatedly happen during the game. When several events happen at a time it might be useful to delay incoming messages for the player (anyways he can't read them all at once). So I split the actual handling of the event and the player notification in different triggers. And then I got a wait in the "notification" triggers: wait(0) before notification and wait(time) afterwards. That way, waits subsystem automatically queues incoming messages and displays them one after another (maybe in the other order though).



    Some.

    May 28 2011, 6:51 pm The Starport Post #4



    Methinks an ASM mod just to allow parallel waits would almost be worth it.



    None.

    May 29 2011, 5:22 am Heinermann Post #5

    memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes memes

    That's easy. You don't even have to manage any data, just use the padding space ("unknown/unused" in the chk specs) for each trigger performing the wait.




    May 29 2011, 5:49 am Wormer Post #6



    Plus with the ability to run triggers every frame and disjunction in conditions. Settled then! Who makes it? :P



    Some.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [10:41 am]
    ManCubuS -- Seems like something's broken regarding the site then. Sadge...
    [07:36 am]
    Oh_Man -- have i ever told u guys my SC2 pro-gamer story
    [11:30 pm]
    Ultraviolet -- That's strange, it looks like you targeted the base image file (sometimes people make the mistake of just using the imgur page link which doesn't work for embedding) but it still didn't work it sounds like.
    [2026-7-26. : 3:34 pm]
    ManCubuS -- Used : " [img=https://i.imgur.com/gpOjTuD.jpeg] "
    [2026-7-26. : 3:28 pm]
    ManCubuS -- Even tried with imgur, doesn't attach.
    [2026-7-26. : 3:14 pm]
    ManCubuS -- I should try a workaround, thanks! Sadly imgur is blocked in my country for some unknown reason.
    [2026-7-26. : 3:05 pm]
    NudeRaider -- I think SEN has trouble with https or hotlinking is forbidden. It certainly is nothing about the size, it just fails to get any size. You can get it working if you use imgur and include the actual image link for the img tag. Like this: [img=https://i.imgur.com/ddYqXZa.jpeg]
    [2026-7-26. : 11:15 am]
    ManCubuS -- Hey fellas! Anyone knows why when I try to upload an image it says "failed to get image size"? I even tried making it so small. Imgur isn't working here and I tried postimg no luck.
    [2026-7-23. : 6:40 am]
    Oh_Man -- true
    [2026-7-23. : 3:16 am]
    RIVE -- Still annoyed there was never a trigger to stop or pause wavs.
    Please log in to shout.


    Members Online: Roy