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



My Projects:

Impossible Ultraviolet | Impossible UV2 | Impossible UV3
Mercenaries 2020 | Mercenaries III
Squad Defense

Legacy Projects (No guarantee of functionality in modern SC):

Pixel Adventure 2 | Space Snipers | Control the Ball

______________________________________________

Join me in Torn City

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:24 pm]
Vrael -- CUT IT OUT
[05:24 pm]
Vrael -- HEY STOP BEING NICE
[05:01 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: actually I am mad after all, looks like you're gonna have to follow through
didn't I by posting the note?
[04:59 pm]
Ultraviolet -- actually I am mad after all, looks like you're gonna have to follow through
[04:59 pm]
Ultraviolet -- :lol:
[04:46 pm]
NudeRaider -- damn, and here I was prepared and got chatgpt to rephrase it a bunch of times for more people to join the bandwagon. :D https://anotepad.com/notes/7fk84xef
[04:33 pm]
Ultraviolet -- lol it's fine, I was just being sassy :P
[03:19 pm]
Vrael -- maybe my browser window didnt update or something funky
[03:19 pm]
Vrael -- lol sry UV, I must not have read that? I couldve sworn I was the next person to say something after CAFG but clearly based on timestamps I was 4 hours later
[03:18 pm]
Vrael -- :teach:
Please log in to shout.


Members Online: Zincoshine