Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Complex Hyper Triggers not Firing Correctly
Complex Hyper Triggers not Firing Correctly
Mar 9 2022, 2:45 am
By: riffdex  

Mar 9 2022, 2:45 am riffdex Post #1



I'm a mapmaker from back in the day and been out of the game for awhile, but I've been recently working on a map and making some solid progress. I was encountering wait blocks with standard HTs so I wanted to try complex HTs for the first time. I implemented them precisely as laid out in this guide

https://staredit-network.fandom.com/wiki/Hyper_Triggers#:~:text=Complex%20hyper%20triggers%20are%20a,more%20convenient%20than%20basic%20hypers.

and they are operating horribly. Basically with the original HTs every action fired instantly, and with the new "Complex HTs" every action has a good delay, similarly to how SC might fire triggers without any HTs at all.



None.

Mar 9 2022, 4:53 am DarkenedFantasies Post #2

Roy's Secret Service

Do you have a map for us to look at, so we can tell you what the cause of the issue is? Have you tried implementing them in a blank controlled test map to see if you're doing it correctly and/or if the problem is a conflict within your specific map?




Mar 9 2022, 7:04 am riffdex Post #3



Do you have a map for us to look at, so we can tell you what the cause of the issue is? Have you tried implementing them in a blank controlled test map to see if you're doing it correctly and/or if the problem is a conflict within your specific map?

Thanks for the reply! I am going to attempt it on a blank map as you recommended. If I can't get any resolution I will be happy to share the map in question.



None.

Mar 9 2022, 2:47 pm Roy Post #4

An artist's depiction of an Extended Unit Death

Switching from classic hyper triggers to complex hyper triggers is not going to solve wait blocking issues: wait blocks are a quirk in the way the Wait action is designed. If you notice the actual hyper triggers blocking your other triggers, it's probably because your hyper triggers are running before those triggers, and you should move them to the bottom of the trigger list. If you have a need for simultaneous timed triggers running under a single player, you would need to do something more drastic such as converting your triggers to using Death Counters instead of Waits.

But let's assume complex hyper triggers can solve your particular situation:

There are a handful of ways complex hyper triggers could fail. If you're certain you made them correctly, the most likely issue is that one or both of the triggers are owned by players that aren't in the game, which would break the hypers. Ensuring each trigger is owned by different CPU players would be the solution.

However, complex hyper triggers are a bit dated, and there are two superior approaches. The first, outlined in The Hyper Trigger topic, is the most compact version of standard hyper triggers:
The Hyper Trigger
Trigger("All players"){
Conditions:
    Deaths("All players", "Cave", Exactly, 0);

Actions:
    Set Deaths("Current Player", "Cave", Set To, 1);
    Wait(0);
    Set Deaths("Current Player", "Cave", Set To, 0);
    Wait(0);
    Preserve Trigger();
}

//-----------------------------------------------------------------//

This is an evolution of the old complex hyper triggers that condenses it to a single trigger.

The other alternative is the single-frame hyper trigger (sometimes called super hyper triggers), which uses EUDs to reset the frame counter between trigger checks to zero:
Single-Frame Hyper Trigger
Trigger("All Players"){
Conditions:
    Always

Actions:
    MemoryAddr(0x006509a0, Set To, 0);
    Preserve Trigger();
}

//-----------------------------------------------------------------//

This actually executes faster than standard hyper triggers, as it will cause triggers to be checked every frame, as opposed to every other frame.




Mar 10 2022, 1:59 am TheHappy115 Post #5



Quote from Roy

The other alternative is the single-frame hyper trigger (sometimes called super hyper triggers), which uses EUDs to reset the frame counter between trigger checks to zero:
Single-Frame Hyper Trigger
Trigger("All Players"){
Conditions:
    Always

Actions:
    MemoryAddr(0x006509a0, Set To, 0);
    Preserve Trigger();
}

//-----------------------------------------------------------------//

This actually executes faster than standard hyper triggers, as it will cause triggers to be checked every frame, as opposed to every other frame.

Thanks for this info. In general purpose, I never found any "real" reason to use other complex hyper triggers (for myself) as I almost always use Death Counters now and creating the first iteration of the hyper trigger always took me ~30 seconds at most anyways (the space it takes also didn't matter to me). However, EUD execution is something interesting since it would trigger each frame making it check essentially twice the speed.
I am curious if this causes any side effects though. I don't actually know to much about EUDs and a side effect that I have been told of implementing Health-Modification EUDs was the disabling of saving the game (which may be important in single player games/campaigns). I'm not entirely sure if EUDs in general just disable saves or if only certain ones do.



None.

Mar 10 2022, 3:21 am DarkenedFantasies Post #6

Roy's Secret Service

Quote from TheHappy115
I am curious if this causes any side effects though. I don't actually know to much about EUDs and a side effect that I have been told of implementing Health-Modification EUDs was the disabling of saving the game (which may be important in single player games/campaigns). I'm not entirely sure if EUDs in general just disable saves or if only certain ones do.
I haven't checked EUDs on SCR in a while, so I'm not 100% certain, but I believe any EUD trigger disables saving (also not sure if only actions do or if they've included conditions as well). The reason for disabling saves is because some data simply isn't stored in the save file, such as trigger waits, and DAT information like which weapon a unit uses or its max health.

Most DAT info also gets reset after a game restart/reload or new game, but I'm not sure if it's because of the game itself or a safety measure from the EUD Enabler plugin (in 1.16.1). I know that Images.dat values persist between games in 1161, and also did in SCR for a while, so I'm thinking it's likely to be the game itself.

Other things like a unit's current health are stored in the save file, so there wouldn't be any reason to disable saving if you only had EUDs modifying this for example. I think they made it a global switch only out of laziness or they just didn't care enough to bother making exclusions.


Edit: Decided to confirm a few things, and turns out Units.dat Max Health does get stored in save files. So, not all DAT info gets reset when loading a saved game.

Post has been edited 1 time(s), last time on Mar 10 2022, 3:41 am by DarkenedFantasies.




Mar 10 2022, 4:06 pm riffdex Post #7



Quote from Roy
Switching from classic hyper triggers to complex hyper triggers is not going to solve wait blocking issues: wait blocks are a quirk in the way the Wait action is designed. If you notice the actual hyper triggers blocking your other triggers, it's probably because your hyper triggers are running before those triggers, and you should move them to the bottom of the trigger list. If you have a need for simultaneous timed triggers running under a single player, you would need to do something more drastic such as converting your triggers to using Death Counters instead of Waits.

But let's assume complex hyper triggers can solve your particular situation:

There are a handful of ways complex hyper triggers could fail. If you're certain you made them correctly, the most likely issue is that one or both of the triggers are owned by players that aren't in the game, which would break the hypers. Ensuring each trigger is owned by different CPU players would be the solution.

However, complex hyper triggers are a bit dated, and there are two superior approaches. The first, outlined in The Hyper Trigger topic, is the most compact version of standard hyper triggers:
The Hyper Trigger
Trigger("All players"){
Conditions:
    Deaths("All players", "Cave", Exactly, 0);

Actions:
    Set Deaths("Current Player", "Cave", Set To, 1);
    Wait(0);
    Set Deaths("Current Player", "Cave", Set To, 0);
    Wait(0);
    Preserve Trigger();
}

//-----------------------------------------------------------------//

This is an evolution of the old complex hyper triggers that condenses it to a single trigger.

The other alternative is the single-frame hyper trigger (sometimes called super hyper triggers), which uses EUDs to reset the frame counter between trigger checks to zero:
Single-Frame Hyper Trigger
Trigger("All Players"){
Conditions:
    Always

Actions:
    MemoryAddr(0x006509a0, Set To, 0);
    Preserve Trigger();
}

//-----------------------------------------------------------------//

This actually executes faster than standard hyper triggers, as it will cause triggers to be checked every frame, as opposed to every other frame.

Thank you for the reply. I have since redone all the dialogue in the entire map from the ground up, in order to eliminate wait blocks. This was a headache to do but will make the map more reliable to execute all the triggers in entirety. I changed all dialogue from using "wait" actions to now being entirely built on death counters as a timer.

As for the original point of the topic, the complex HTs were both independent computer players and as far as I can tell they *should* have executed correctly, they simply wouldn't.

I'm interested in implementing the first HT substitution you mentioned. So this implementation would only require a single trigger and must be under the "All Players" player - correct?

As for the second HT option you mentioned, I would presume this would break all my dialogue in the fact that I built it upon death counters. So my dialogue would probably end in half the time. Not worth rewriting all the dialogue another time if this is the case, but that's an interesting option for future maps.



None.

Mar 10 2022, 6:41 pm Roy Post #8

An artist's depiction of an Extended Unit Death

Quote from riffdex
I'm interested in implementing the first HT substitution you mentioned. So this implementation would only require a single trigger and must be under the "All Players" player - correct?
Correct. You would still want it at the bottom of the trigger list so it won't be interfering with other triggers, though, since its Wait(0) actions will still partially block other waits if they run first.

Quote from riffdex
As for the second HT option you mentioned, I would presume this would break all my dialogue in the fact that I built it upon death counters. So my dialogue would probably end in half the time. Not worth rewriting all the dialogue another time if this is the case, but that's an interesting option for future maps.
I feel like you could do "Set to 1" instead of 0 to make it behave the same as regular hyper triggers, but I've never actually tested it.




Mar 10 2022, 10:01 pm DarkenedFantasies Post #9

Roy's Secret Service

Quote from Roy
I feel like you could do "Set to 1" instead of 0 to make it behave the same as regular hyper triggers, but I've never actually tested it.
This is correct.




Mar 11 2022, 2:55 am riffdex Post #10



Quote from Roy
Quote from riffdex
I'm interested in implementing the first HT substitution you mentioned. So this implementation would only require a single trigger and must be under the "All Players" player - correct?
Correct. You would still want it at the bottom of the trigger list so it won't be interfering with other triggers, though, since its Wait(0) actions will still partially block other waits if they run first.

Quote from riffdex
As for the second HT option you mentioned, I would presume this would break all my dialogue in the fact that I built it upon death counters. So my dialogue would probably end in half the time. Not worth rewriting all the dialogue another time if this is the case, but that's an interesting option for future maps.
I feel like you could do "Set to 1" instead of 0 to make it behave the same as regular hyper triggers, but I've never actually tested it.

I tried the first HT implementation you suggested. I had the exact same behavior that I experienced with the complex hyper triggers which I first made this thread for. I switched back to conventional HTs because they haven't given me the problem. I'm wondering why they are operating so poorly...



None.

Mar 11 2022, 6:59 am DarkenedFantasies Post #11

Roy's Secret Service

Let me take a look at the map and I'll be able to tell you exactly why.




Mar 12 2022, 3:30 am riffdex Post #12



Let me take a look at the map and I'll be able to tell you exactly why.
Okay. Are you online now? Do you check the shoutbox? I'll shout periodically and try to find you online.



None.

Mar 12 2022, 4:17 pm Ultraviolet Post #13



Quote from riffdex
Let me take a look at the map and I'll be able to tell you exactly why.
Okay. Are you online now? Do you check the shoutbox? I'll shout periodically and try to find you online.

Just upload the map to Google Drive or something and send him the link in a PM if you don't want to share it publicly. Waiting around until you're both online is silly lol




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
Please log in to shout.


Members Online: IlyaSnopchenko