Page 2 of 26

Re: EvenMatchOmni

Posted: Sun Jan 23, 2022 11:59 am
by pooty
Can you change it to guids? The Server maintains a list of guids for known players.

Re: EvenMatchOmni

Posted: Sun Jan 23, 2022 1:34 pm
by McLovin
captainsnarf wrote: Sat Jan 22, 2022 2:29 pm Ok, so I have shuffle working and also the config database for known players.

For shuffle, admin must login then type "shuffle" in chat to shuffle teams.
...
Does shuffle restart the map?

Re: EvenMatchOmni

Posted: Sun Jan 23, 2022 2:06 pm
by captainsnarf
pooty wrote: Sun Jan 23, 2022 11:59 am Can you change it to guids? The Server maintains a list of guids for known players.
Sure np. The existing code hashes all the IDs so it's not as straightforward as it might seem but easily doable.

McLovin wrote: Sun Jan 23, 2022 1:34 pm Does shuffle restart the map?
It does not restart the map.

1. everybody dies
2. The mutator's ShuffleTeams() is called. This may or may not switch the team you are on (it is a shuffle after all).

The downside is if you were e.g. driving the mino, now the mino is sitting out there abandoned.

Should it just restart the round instead? or the map?

Also I wasn't sure about making it a chat command. I just copied the 'teams' chat stuff. If you want I can change that to make it just a regular console command.

Re: EvenMatchOmni

Posted: Sun Jan 23, 2022 2:37 pm
by pooty
Mulligan basically restarts the map.

Can we have two versions:
reshuffle_round - Reshuffles and restarts round
reshuffle_map - Reshuffles and restarts map (like mulligan)

I can see a use for both.

Re: EvenMatchOmni

Posted: Sun Jan 23, 2022 4:40 pm
by McLovin
captainsnarf wrote: Sun Jan 23, 2022 2:06 pm ...
Also I wasn't sure about making it a chat command. I just copied the 'teams' chat stuff. If you want I can change that to make it just a regular console command.
I like the idea of it working as a chat command. I'd even like "admin kick" to work from the chat, that way everyone could see that "idiot that is idle" got kicked.

Re: EvenMatchOmni

Posted: Sun Jan 23, 2022 5:18 pm
by captainsnarf
Download here EvenMatchOmni_1.1.zip

changes
- Use statsID instead of PlayerName for known player database
- Use 'EvenMatch' damage type when killing players during shuffle so vehicles die too

I could not figure out any way to make the round or map restart. I changed the damage type when killing the players from 'suicide' to 'evenmatch' which causes their vehicle they are driving to explode also.

I think making it restart is probably possible but would take a ton of work.

The statsID is also a bit tricky. When asking the game for statsID, it returns a string separated by tabs.

something like this

Code: Select all

"043dc3cc1018c2bb2f546b3634fde396    captainsnarf    xxxxpasswordhashxxxx"
I use the first value, so here is what is in the .ini file:

Code: Select all

[EvenMatchKnownPlayerDatabase KnownPlayerPPH]
PPH=(ID="043dc3cc1018c2bb2f546b3634fde396",Multiplier=1.0)
Not sure if that is the correct 'id' but I think it's right.

Re: EvenMatchOmni

Posted: Sun Jan 23, 2022 11:21 pm
by pooty
I think making it restart is probably possible but would take a ton of work.
Can't we just use whatever the Mulligan does, its essentially a full restart...

Re: EvenMatchOmni

Posted: Mon Jan 24, 2022 12:20 am
by captainsnarf
pooty wrote: Sun Jan 23, 2022 11:21 pm
I think making it restart is probably possible but would take a ton of work.
Can't we just use whatever the Mulligan does, its essentially a full restart...
Mulligan doesn't restart though. Someone kills the core, the round ends, and when the next round starts it determines if it was a mulligan or not and shuffles teams. This happens inside the CheckScore function. I could probably make it reset the score also like a mulligan, but I'm not able to reset the map without a bit more work. Whatever active powernodes are out there would still be active.

I could probably add code to find all the powernodes and reset them. I could add code to find all the vehicle factories and reset them also. It's a lot of work though and hard to test which is why I'm reluctant. Resetting vehicle factories, remember dropship bugs? LinkNuke flipping nodes, remember how that was glitchy?

I'll give it a try later this week but no promises it's gonna work :D

Re: EvenMatchOmni

Posted: Mon Jan 24, 2022 9:20 am
by pooty
Any way to just simply change the score, ie set red core points to 0, and set the mulligan flag to Y?

I agree we don't want to cause more than it solves.

So right now, the "shuffle" call just redistributes the teams, leaving the map/score state as is, but players and occupied vehicles are killed/destroyed.

Do we have an easy way to get the StatsID matched to a Player Name/Guid? Getting the Guid is simple, there's a file on the server that has all the player names/guids (this is how the admins know when someone is aliasing). But matching player to guid to statsID is what we need to seed the .ini file right?

Re: EvenMatchOmni

Posted: Mon Jan 24, 2022 9:30 am
by pooty

Code: Select all

if (Level.GRI.ElapsedTime < MinDesiredFirstRoundDuration && Level.GRI.Teams[0].Score + Level.GRI.Teams[1].Score > 0) {
		MinDesiredFirstRoundDuration = 0; // one restart is enough
		bBalancing = True;
		if (Level.GRI.Teams[0].Score > 0)
			FirstRoundResult = 1;
		else
			FirstRoundResult = 2;
		Tag = 'EndGame';

		log("Quick first round, shuffling teams...", 'EvenMatch');
		ShuffleTeams();
		BroadcastLocalizedMessage(class'UnevenMessage', 0,,, Level.GRI.Teams[FirstRoundResult-1]);

		// force round restart
		if (Level.Game.GameStats != None) {
			if (EvenMatchMutator.bDebug) log("Resetting team score stats...", 'EvenMatchDebug');
			if (Level.GRI.Teams[0].Score > 0)
				Level.Game.GameStats.TeamScoreEvent(0, -Level.GRI.Teams[0].Score, "reset");
			if (Level.GRI.Teams[1].Score > 0)
				Level.Game.GameStats.TeamScoreEvent(1, -Level.GRI.Teams[1].Score, "reset");
		}
		if (EvenMatchMutator.bDebug) log("Resetting team scores...", 'EvenMatchDebug');
		Level.GRI.Teams[0].Score = 0;
		Level.GRI.Teams[1].Score = 0;

		bBalancing = False;
		return true;
Couldn't we:
function Shuffle_Teams() {

Level.GRI.Teams[0].Score = 1 // Doesn't this end the match, or do we need an event call outside?

MinDesiredFirstRoundDuration = 0; // one restart is enough
bBalancing = True;
Tag = 'EndGame';

log("Admin has called for shuffling teams...", 'EvenMatch');
ShuffleTeams();
BroadcastLocalizedMessage(class'UnevenMessage', 0,,, Level.GRI.Teams[FirstRoundResult-1]);

// force round restart
if (Level.Game.GameStats != None) {
if (EvenMatchMutator.bDebug) log("Resetting team score stats...", 'EvenMatchDebug');
if (Level.GRI.Teams[0].Score > 0)
Level.Game.GameStats.TeamScoreEvent(0, -Level.GRI.Teams[0].Score, "reset");
if (Level.GRI.Teams[1].Score > 0)
Level.Game.GameStats.TeamScoreEvent(1, -Level.GRI.Teams[1].Score, "reset");
}
if (EvenMatchMutator.bDebug) log("Resetting team scores...", 'EvenMatchDebug');
Level.GRI.Teams[0].Score = 0;
Level.GRI.Teams[1].Score = 0;

bBalancing = False;
return true;