Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [CODE]Server frame time checker (Thanks to jonwil!)
[CODE]Server frame time checker (Thanks to jonwil!) [message #492322] Sat, 29 April 2017 05:57 Go to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
Thanks to Jonwil for suggesting this method and the RealFrameSeconds variable to use.

This will display a Frame Time warning in the console if the frametime is higher or equal to 12 milliseconds. If the server is set to 100 sfps than the normal frame time is 10 ms. If the SFPS is 60 than its 16.6667ms etc.

If server suffers from frame time stutters a lot of really annoying lag occurs...when jumping your jumps are random interrupted and/or will warp you around. Movement will warp around, and enemy infantry unit movement will stutter so if you're aiming (for head shot) you will miss.

Servers like MPF and RenCorner suffer heavily from that. Both servers will drop to 99 sfps (from 100 sfps a bit). The ingame SFPS counter averages over one second (so if sfps is 100..it will be 100 frames), this makes it look like it's not that much of an issue as it's just one or two SFPS that are lower...but in actuality those server FPS drops come from one frame taking more than 40 milliseconds...causing very noticable stutter.

REF_DEF2(float, RealFrameSeconds, 0x00857294, 0x0085647C);
uint32 LastInterval = 0;
int FrameTimesIndex = 0;
float  WorstTime = 0;
uint32 CurrentUpdateTime = 0;

void Main_Hooks::Think() {
	CurrentUpdateTime = TIMEGETTIME();

	// check every second
	if ((CurrentUpdateTime - LastInterval) >= 1000)
	{
		LastInterval = CurrentUpdateTime;

		// output only if frame is more than or equal to 12 milliseconds
		if (WorstTime*1000 >= 12.f) {
			Console_Output("[FrameTime] Worst frametime last second: %3.3fms\n", WorstTime*1000);
		}
		WorstTime = 0;
	}
	WorstTime = max(WorstTime, RealFrameSeconds);
}


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Sat, 29 April 2017 06:01]

Report message to a moderator

Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492328 is a reply to message #492322] Sat, 29 April 2017 17:41 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 829
Registered: February 2003
Location: California
Karma: 0
Colonel
I'll put this on RC and see what it says.

Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )

[Updated on: Sat, 29 April 2017 18:02]

Report message to a moderator

Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492330 is a reply to message #492322] Sat, 29 April 2017 22:07 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Beat me to it.

Edit:

It appears to work well. running it on my test server it would go off a lot. Every time I minimized the game or when the sfps would drop.


http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Sat, 29 April 2017 22:43]

Report message to a moderator

Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492340 is a reply to message #492322] Sun, 30 April 2017 16:33 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
The best SFPS to set is actually setting it to 58 (the int casting makes this number off) in the config. This makes it come out 59/60 fps per second. It also gives you the full 30 net_updates per second at evenly spaced intervals. The way the net_update code works if that at 100 sfps it won't actually run 30 times because it does 1/30 seconds and checks if the amount of time since the last update is greater. So at 100 sfps it won't be greater than that until 4 frames in which is 4/100 seconds. That means at 100 sfps you are only getting 25 updates per second. At 59/60 sfps which also happens to be the rate most monitors refresh at you get the full 30 because it will do every other frame. This also makes them consistently spaced out. Some things with physics also don't work the same when going over 60fps.

[Updated on: Sun, 30 April 2017 16:57]

Report message to a moderator

Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492341 is a reply to message #492322] Mon, 01 May 2017 04:42 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
I think on RenCorner the server NUR is set lower than 30 anyhow. Maybe someone can confirm this cause I was talking to one of their admins about it like 2 weeks ago and I vaguely recall him mentioning how server NUR wasn't really helping much for them other than increasing server and client bandwidth usage.

On my test server I have it set to 50 NUR with 100 SFPS and 1000 client NUR and it fixes the crouching lag. That test build fixed the jumping lag.

I and ExEric tried 60 sfps with 30 server NUR and we'd still get lag, at around 50-60 server NUR it stops getting better quality wise. The main issue we noticed is vehicle lag when getting in and out and with movement...probably because infantry movement is mostly client-side now and at a very high update rate with 1000 NUR.

I've tested the 1000 client NUR (with the 4.4 test build with jump lag fix) on empty US servers and I can confirm this fixes all the lag on your infantry unit as long as the server has no frame time issues.

If the server has frame time issues your jumps get 'cancelled' in mid air and you warp all over the place...enemy infantry start stuttering like crazy.

I haven't tested this really but I also think that if an enemy player has 1000 client nur...his movement is smoother and he's easier to hit. ExEric was running 1000 client NUR on our Euro test server and he's easier to hit than other Euro players with 10-30 client NUR.

Note that I and ExEric tested it with 50 players (joining with +multi clients) and the frame time chceker showed that the frame time kept below 12 ms....and all the lag was still fixed with client nur 1000 and that test scripts build. So as long as frame time is good the lag doesn't increase.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Mon, 01 May 2017 04:45]

Report message to a moderator

Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492342 is a reply to message #492322] Mon, 01 May 2017 06:53 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3555
Registered: February 2003
Karma: 0
General (3 Stars)

The NUR isn't supposed to be able to go above 30. Both the console command and ini keyword enforce the 30 restriction.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492343 is a reply to message #492322] Mon, 01 May 2017 08:25 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
Yes, but according to dblaney1 the crouching lag can't be fixed in any other way as it's a by effect of the way it works. Setting the client NUR real high resolves it.

Server NUR seems to help vehicle lag.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492345 is a reply to message #492322] Mon, 01 May 2017 10:15 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
The server side NUR doesn't need to go above 30 updates per second. Its just the client side nur (command rate me and saberhawk have been calling it to distinguish it from server to client net update rate). Vehicle lag in the latest bandtest works just fine at 30 updates per second. I found that setting it to 35 comes out to the best as it adds a bit of padding to the incase a frame ends up slightly fast which at the default sfps (comes out to 62-63) it does. This makes the server send out updates every other frame. With the default 30 it ends up being every 3rd frame and comes out to 20-21 updates per second.

I have had great sucess with a command rate (client to server) set to 75 which with vsync on comes out to exact one client to server update per frame. It has minimal bandwidth increase but drastically improves latency and sliding.

[Updated on: Mon, 01 May 2017 10:24]

Report message to a moderator

Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492346 is a reply to message #492322] Mon, 01 May 2017 10:20 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
Settings SFPS to 60 compared to 100 increases jumping lag when not running that jump lag fix test build of 4.4.

ExEric and I tested it today.

ExEric and I didn't notice much different between server NUR 50 and 60. But NUR 50 with 100 sfps is divisble to a whole number so the update rate will be constant if there are no frame time issues.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492347 is a reply to message #492322] Mon, 01 May 2017 10:29 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Try sfps set to 58 with nur of 35 which comes out to about 30 updates per second.
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492349 is a reply to message #492322] Mon, 01 May 2017 10:36 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
if you use SFPS 58 it will set it to 59, ExEric tried it like an hour ago.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492350 is a reply to message #492322] Mon, 01 May 2017 10:36 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Yes I know, thats what I wanted.
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492351 is a reply to message #492322] Mon, 01 May 2017 10:37 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
btw off-topic but is it possible to have a seperate mine and remote c4 limit...when proxy c4 and remote c4 are seperated they still make use of the same mlimit command to check how many of a remote and proxy c4 are needed. You can't say "50 proxies mine limit and 200 remote c4 limit".

I bypassed this by setting mine limit to 999 and implementing my own mine and remote c4 limit logic and then overwritten mlimit console command for the proxy c4 limit.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492352 is a reply to message #492322] Mon, 01 May 2017 14:26 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
On RC server nur is 30 so is the client.
I will set the sfps to 58, nur to 35 and client to to 75 for starters and see how that goes.


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492353 is a reply to message #492322] Mon, 01 May 2017 14:44 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
if you set it to 58..it will become 59 income because of casting int to float or the other way around.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492354 is a reply to message #492322] Mon, 01 May 2017 23:14 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
I had this happen to me. How did it ever become 353872

int Get_SFPS() {
return *(int*)(*((char**)0x0082EEE8) + 0x6B4);
}

[FrameTime] Worst frametime last second: 24.000ms SFPS 58
[FrameTime] Worst frametime last second: 22.000ms SFPS 59
[FrameTime] Worst frametime last second: 21.000ms SFPS 58
[FrameTime] Worst frametime last second: 23.000ms SFPS 58
[FrameTime] Worst frametime last second: 21.000ms SFPS 58
[FrameTime] Worst frametime last second: 22.000ms SFPS 59
[FrameTime] Worst frametime last second: 679.000ms SFPS 353872
[FrameTime] Worst frametime last second: 22.000ms SFPS 58
[FrameTime] Worst frametime last second: 39.000ms SFPS 56
[FrameTime] Worst frametime last second: 24.000ms SFPS 58
[FrameTime] Worst frametime last second: 21.000ms SFPS 59
[FrameTime] Worst frametime last second: 23.000ms SFPS 59
[FrameTime] Worst frametime last second: 21.000ms SFPS 58


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492355 is a reply to message #492322] Mon, 01 May 2017 23:18 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
lmao those frame times

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492356 is a reply to message #492322] Mon, 01 May 2017 23:38 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
lol

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492357 is a reply to message #492322] Tue, 02 May 2017 02:28 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4299
Registered: April 2011
Karma: 0
General (4 Stars)
what the hel are you running dude lmao

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Server frame time checker (Thanks to jonwil!) [message #492359 is a reply to message #492322] Sat, 06 May 2017 01:28 Go to previous message
Goztow is currently offline  Goztow
Messages: 9716
Registered: March 2005
Location: Belgium
Karma: 12
General (5 Stars)
Goztoe
Do frame times need to be lower or higher?

You can find me in The KOSs2 (TK2) discord while I'm playing. Feel free to come and say hi! TK2 discord
Previous Topic: RenList 1.0.9
Next Topic: [SSGM 4.0 Plugin] NoC4DefuseOnLeave
Goto Forum:
  


Current Time: Fri Apr 19 10:35:15 MST 2024

Total time taken to generate the page: 0.01097 seconds