Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: violent ownership fluctuation ("command most at")
violent ownership fluctuation ("command most at")
Apr 15 2017, 7:15 pm
By: theskinsurf  

Apr 18 2017, 12:45 pm ihjel Post #21



This seems to do what you're asking.

Quote
Trigger("Force 1"){
Conditions:
Deaths("Current Player", "Independent Command Center", Exactly, 1);
Deaths("Force 1", "Independent Command Center", Exactly, 1);
Bring("Current Player", "Start Location", "Location 0", Exactly, 0);

Actions:
Give Units to Player("All players", "Current Player", "Start Location", All, "Location 0");
Display Text Message(Always Display, "You gained control of the location!");
Preserve Trigger();
}

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

Trigger("Force 1"){
Conditions:
Deaths("Current Player", "Independent Command Center", At least, 1);

Actions:
Set Deaths("Current Player", "Independent Command Center", Set To, 0);
Preserve Trigger();
}

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

Trigger("Force 1"){
Conditions:
Commands the Most At("Men", "Location 0");

Actions:
Set Deaths("Current Player", "Independent Command Center", Set To, 1);
Preserve Trigger();
}


Post has been edited 1 time(s), last time on Apr 18 2017, 2:18 pm by ihjel.



None.

Apr 18 2017, 4:55 pm NudeRaider Post #22

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Fuck, this shit is ingenious! Thinking the logic through it almost feels like magic. Using the total Force count of the dc and the cleaning up RIGHT at the proper spot so it doesn't interfere with the other player's calculations. This was the solution I was looking for, but I was too set on my comp player, and Lanth was too set on using switches.
The giving lags behind the game state by 1 trigger loop, but it eliminates all other problems and requirements, so well done.

Just 2 minor things: The condition of the 2nd trigger can be always. And you have to use beacons instead of start locations. But I'll still award this post with 50 minerals.




Apr 18 2017, 6:25 pm theskinsurf Post #23



lots of interesting ideas here. as it stands right now the structures currently fluctuate still, but I put the acquiring messages on a short timer so they cancel out if lots of exchanging happens in a short time. it works reasonably well, perhaps one day I'll dig deeper and start implementing these owner-retention failsafes. the fluctuation usually only lasts for a couple seconds as units are mopped up and the true owner becomes apparent.



Current project: Star Rogue
Other projects: Triumvirate Defense, Skirmish Islands

Apr 18 2017, 6:29 pm theskinsurf Post #24



the last solution seems especially elegant, but I believe I'd need to refactor it a bit as it's competing forces of three capturing the beacons in my map.



Current project: Star Rogue
Other projects: Triumvirate Defense, Skirmish Islands

Apr 18 2017, 7:18 pm Wormer Post #25



Quote from theskinsurf
the last solution seems especially elegant, but I believe I'd need to refactor it a bit as it's competing forces of three capturing the beacons in my map.
Given your computer players aren't in these forces just use Force 1, Force 2, Force 3 instead of Force 1.

ihjel solution is nice, but would need an extension if one needs to do something for the offended side (as I understand, it's not that important for the moment).

The thing that I don't quite like about it is as players with higher or equal numbers than of the current player contribute to the counter with their command the most data from the previous trigger cycle and players with lower numbers - with their up-to-date data. This may lead to a scenario when for instance P1 takes the beacon and P2 takes the beacon on the same trigger cycle or when the transfer is delayed on a cycle.

Not a big deal probably, but if I would be making this I would let the state accumulate in a separate DC that is copied to the final DC at start of each trigger cycle. For instance:

Collapsable Box


Also note that when there are no units at location all players command the most (and the least) units simultaneously. It doesn't break anything, but a thing that should be always remembered. For instance this will lead to the player taking all beacons (start locations) at the beginning of a game where he is the only non-computer player.

EDIT: I realized it won't work as I initially thought, so it requires the last player to be a computer now. Still can be done without computers, but technique isn't very elegant.

EDIT2: OK, nonetheless I'll put the solution without computers here for reference. If we need to select the last player from a force to execute stuff we can do the following. Put this series of triggers on the bottom of the list (i.e. after all triggers for Force 1 players).

Collapsable Box


For a trigger that needs to execute only once for the last player in the Force 1 you put the condition: Deaths("Current Player", "Danimoth (Arbiter)", Exactly, 1).

For instance the last 2 triggers from the first code box would be rewritten as:
Collapsable Box

The described system kicks in with a cycle delay after the last player leaves the game.

It works simpler when we need to select the first player from a force due to same reasons. The only trigger is required on the top of the triggers list.

Collapsable Box

This one kicks in instantly.

Post has been edited 14 time(s), last time on Apr 18 2017, 8:08 pm by Wormer.



Some.

Apr 19 2017, 1:58 am NudeRaider Post #26

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Wormer
The thing that I don't quite like about it is as players with higher or equal numbers than of the current player contribute to the counter with their command the most data from the previous trigger cycle and players with lower numbers - with their up-to-date data.
Hm really? I couldn't find a scenario in which the players would calculate differently within the same loop. I thought the combination of Force and Current Player Conditions in the first trigger makes this pretty robust. Analysis time!

The only case where there could be a difference in the calculated outcome is the part after P1 calculated if they should take over (First trigger) until the next player calculates their first trigger. So there's 2 triggers to look at. The 2nd one always resets, so this one would introduce a change if P1 had most units there, but in that case the third trigger would instantly overwrite, so it's really just that 3rd trigger.

Now there 2 scenarios where this trigger behaves different this loop, compared to the previous:
1) P1 had the most units there, but doesn't now
1a) P2 had the most units there, still has
1b) P2 hadn't the most units there, still doesn't
2) P1 hadn't the most units there, but does now
2a) P2 had the most units there, still has
2b) P2 hadn't the most units there, still doesn't

1a) P1 got attacked, and lost. Loses his base this turn
1b) P3 has taken over the base = case 1a
2a) P2 is getting attacked, beacon is contested, nothing happens
2b) P3 owns the base, P1 attacks. If P1 takes over will be determined next turn.

So yeah, lower player lose their base the same turn, while for higher player numbers it happens the next.
It's a slight bias, but no outright wrong or contradicting calculations. For 2 players this can be mitigated by reordering the spawning triggers.




Apr 26 2017, 7:15 pm Wormer Post #27



Quote from Wormer
This may lead to a scenario when for instance P1 takes the beacon and P2 takes the beacon on the same trigger cycle or when the transfer is delayed on a cycle.
NudeRaider, you're right, the scenario above I was initially thinking about indeed doesn't work. The delay of the transfer isn't a big deal. There is still an update anomaly which is revealed by the following scenario for 3 players.

1. Initially P1 and P2 command the most and ICC count is (1*, 1, 0), where first number in braces is ICC count for P1, the second number is for P2, the third is for P3. The star shows that beacon belongs to P1.

2. The next trigger cycle P3 commands the most and P1 with P2 doesn't. When triggers star to execute for P2 the state of ICC counts is (0*, 1, 0). Hence trigger 1 fires for P2 giving beacon to him. When all triggers are executed the state is (0, 0*, 1).

If nothing changes further P3 will get beacon at the third trigger cycle. As a side effect P2 received a false-message and probably some false-rewards (minerals, score, etc.).

When at the start of the third trigger cycle something changes to the point where P3 won't be the only one who commands the most he's risking to never receive the beacon.

It turns out the solution is alright and pretty stable for the remaining possibilities.



Some.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
Please log in to shout.


Members Online: Ultraviolet, Roy