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

    SDE, BWAPI owner, hacker.

    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.
    [03:45 am]
    Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
    [2024-5-17. : 6:47 am]
    NudeRaider -- lil-Inferno
    lil-Inferno shouted: nah
    strong
    [2024-5-17. : 5:41 am]
    Ultraviolet -- 🤔 so inf is in you?
    [2024-5-17. : 4:57 am]
    O)FaRTy1billion[MM] -- my name is mud
    [2024-5-17. : 4:35 am]
    Ultraviolet -- mud, meet my friend, the stick
    [2024-5-16. : 10:07 pm]
    lil-Inferno -- nah
    [2024-5-16. : 8:36 pm]
    Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
    [2024-5-16. : 5:25 pm]
    NudeRaider -- there he is, right on time! Go UV! :D
    [2024-5-16. : 5:24 pm]
    lil-Inferno -- poopoo
    [2024-5-16. : 5:14 pm]
    UndeadStar -- I wonder if that's what happened to me. A returned product (screen) was "officially lost" for a while before being found and refunded. Maybe it would have remained "lost" if I didn't communicate?
    Please log in to shout.


    Members Online: RIVE, Wing Zero, 1carolinee471rM1