ScoreSave mutator

Search, find and discuss about Mutators!
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: ScoreSave mutator

Post by iloveut99 »

Hm... Seems I found a bug? :loool:

Seems this mod radically increase/change fph scores in dm scoreboard. There's any chance that it don't interfere with scoreboard?
Last edited by iloveut99 on Sat Aug 21, 2010 1:52 pm, edited 1 time in total.
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Re: ScoreSave mutator

Post by TheDane »

just make it restore the players preveous gametime too and the fph should once again be accurate.

but, realy, this mutator has been made over and over again and again ... it was originaly íntended as use against the disconnect/reconnect to get rid of bad scoring/deaths etc. Many server base their score upon eff%, so reconnecting would reset your stats, and by only 1 frag you'd be back at 100% eff.
Retired.
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: ScoreSave mutator

Post by MrLoathsome »

I may revisit this and add the gametime value to the data that gets restored.

Will post update here if I do so.
blarg
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: ScoreSave mutator

Post by iloveut99 »

Ok thanks. :)
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: ScoreSave mutator

Post by iloveut99 »

I have updated for myself the mod, so it does restore the player start Time, it does fix indeed the f2 fph scoreboard.

However it does display the wrong fph if a player reconnect and have some frags in f1 panel... Seems the variable of this panel does not get recovered and use the actual game time. It does not interfere with the FPH f2 panel however.

If somebody knows how to fix the F1 FPHS scoreboard let me know.

The new code is attached.
Attachments
ScoreSave_v2.0(iloveut99).zip
(5.34 KiB) Downloaded 179 times
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: ScoreSave mutator

Post by MrLoathsome »

I think if you add an update to the PlyrStartTime[] array in the ScoreKill function, it will fix that issue.**

Note, I will be releasing a fix on this in a day or 3, perhaps even later tonight.
New version will also save the players team and a few other values.

Update:

** Actually, it will be needing a bit more than that.....

I spent some time rewriting this thing so that it uses a timer as it should instead of latching on to the ScoreKill function.
The rate at which the mutator saves the current values will be adjustable via an ini setting.
Current version works exactly as the previous version and has the exact same issue with the Time & FPS values on the F1 scoreboard. :loool:
(The F2 stats are only written to the servers ini file at the end of each game, and would not be changing during a match.)

Adding the StartTime as iloveut99 suggested gets the correct info sent to all other players in the game.
However the player who is reconnecting will get invalid values for Time and FPS for ALL players, including himself.

In order to fix this, if I can, I will need to take a look at trying to initialize the reconnecting players HUD with the current values for all the other
players & bots in the game, as well as the saved values for that player.

Not sure at this point why they don't synch up, but they don't. I was testing today with 2 client PC's connecting to a dedicated server.
The PC I left connected to the server, was showing the correct Time/FPS values for all players, including the player who had disconnected and
rejoined the game. While the Score/Deaths are getting shown correctly on the reconnecting players HUD, The Time values for
all players and bots get reset to 1, which screws up the FPS numbers.

As usual, this has become a bit more involved than expected. It may be a bit longer than the 2-3 day estimate before a new
version is released.

Thanks to iloveut99 for the feedback and for picking the correct name for the PlyrStartTime array. :tu:
blarg
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: ScoreSave mutator

Post by iloveut99 »

Np. :D

Yeah seems the only incorrect info is the in reconnecting player panel. Both the server (so it does save the correct stats at the end) and other player get the correct info.

Agree with you, a timer() may be less cpu intensive and should work well too.

Thanks for the effort.
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: ScoreSave mutator

Post by MrLoathsome »

Guess I lied about when I would release an update.....

I did get a rewrite that uses a timer done, but nothing I have tried fixes the problem with the Frags Per Second stats on the
reconnecting player. New version does also restore the players team, but I didnt test that extensively. If the team fills up
before the reconnection, I dunno what is gonna happen... Didn't seem worth releasing a new version with the fps still broke.

I believe the root of the problem is in the GRI.PRIArray and the fact that the reconnecting player is going to have a new PlayerID value.
Any attempts I made to try and get that in synch with the saved values seem to crash the server nicely with a segmentation fault.

The mutator is a bit of a hack actually, and I was sort of surprised it works
as well as it does.

I may clean up the current timer version, and take out the possibly problematic restore on the players team, and release that later
if there is any interest. It will function exactly as the prior version, and have the same problem at this point.

If anybody has any ideas on how to fix that fps issue, and they work, I could include that in the next version.

If there is one.....

Moo !
blarg
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: ScoreSave mutator

Post by MrLoathsome »

Well attached is the new version that uses a timer.

Currently update rate is once every 10 seconds. That is hardcoded so you will need
to edit the source and recompile if you wish to adjust that.

Frags Per Second stat is still broken for reconnecting players. Further testing
shows it is broken on the server side also, so if that stat is important, this mutator
is not for you.

In this version, the reconnecting player will see the correct stat for others in the game
however anybody can reconnect at any time and reset their own Starttime and fps for
that player gets all out of wack.

*See post 1 for current release
Last edited by MrLoathsome on Tue Nov 30, 2010 4:03 am, edited 1 time in total.
blarg
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: ScoreSave mutator

Post by iloveut99 »

Frags Per Second stat is still broken for reconnecting players. Further testing
shows it is broken on the server side also, so if that stat is important, this mutator
is not for you.
Are you sure? :o

Restoring the player start time in my version seems to fix it serverside. And it is running in my server at some weeks.

Also why do you stop and restart the timer() at lines 56 and 84? Didn't got it. :)
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: ScoreSave mutator

Post by MrLoathsome »

Seems you are correct regarding the StartTime. I have added that back for this version.

Regarding the Starting and Stopping of the timer in ModifyPlayer.

There is a remote, but possible chance that if a player reconnects at the
same point in time that the Timer function is updating the arrays, one
or more of the values in the array could get set to zero from the PRI
before the ModifyPlayer function has restored the values from the array.

By turning the timer off at ModifyPlayer start and then back on at the end
of the function, I think this eliminates the chance of that happening.

Thanks again for the feedback and testing !
Last edited by MrLoathsome on Tue Nov 30, 2010 4:04 am, edited 1 time in total.
blarg
RocketJedi
Inhuman
Posts: 850
Joined: Wed Mar 12, 2008 7:14 pm
Personal rank: I.T Master
Location: New York
Contact:

Re: ScoreSave mutator

Post by RocketJedi »

does this actually work with smart ctf? because when you get a gpf or have to reconnect your points will be restored but not your frags. thanks
https://www.vulpinemission.com
Image ROCKET-X8 Server
Image MONSTERHUNT w/ NALI WEAPONS 3 + RX8
Image BUNNYTRACK NY
Image SNIPER DEATHMATCH
Image InstaGib + ComboGib + Jailbreak
Image ROSEBUM ROCKET-X RB
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: ScoreSave mutator

Post by iloveut99 »

Seems there's a bug with spectators.

Here's how to replicate:

-Play a while in the server
-Reconnect as spectator
-Reconnect as player

You got your stats reseted and not recovered.

Maybe that's because you are also saving "spectator" stuff?

Maybe you should change "if (!Other.IsA('Bot'))" to "if (!Other.IsA('Bot') && !Other.IsA('Spectator'))"

or better:

Code: Select all

local TournamentPlayer NewPlayer;
	local int i;
	local string PName;

	SetTimer(0.0, False);
	if ( NextMutator != None )
		NextMutator.ModifyPlayer(Other);

        NewPlayer = TournamentPlayer(Other);
	if (NewPlayer!=None)
                   ....
?

Another nice feature would be the timer time configurable in some *.ini.

Edit\

Tested your RC3 version for real (what I was saying above was based in a custom version of yours that I did for my server), so see if the above applies to your mutator;

This time I tested seemed that there was a bug when I respawn I got reseted in stats everytime... I played in a localhost server against bots.
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: ScoreSave mutator

Post by MrLoathsome »

Good input ilovut99.

Your TournamentPlayer suggestion works fine and is better.
Still attempting to get the times on the reconnecting players hud to display correctly, but they do not atm.

Going to try a few more things later. Would like to get that working before uploading the new version if possible.
blarg
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: ScoreSave mutator

Post by MrLoathsome »

Oh yeah, also added the code to fix the spectator bug, but havent actually test that out yet.....
blarg
Post Reply