gmod_game: New spawn effect

Revision 958
New spawn effectChanged Files:
Committed By Garry Newman

Pictures please

Just curious, but why do you use CurTime(), I thought it was synced with the server? Shouldn’t you use RealTime() for effects because the client doesn’t have to worry about the time value being synced?

No I want it to run at the speed of the game, not the speed of the real world. The time could be going slower, or faster, in a timedemo, or demo playback, or some bullettime mod.


(sorry, wrong tab)

Is there a timer that runs at the speed of the server but is independant of the server? For example CSS weapons look super ugly when you toggle ironsight if there’s even a hint of stutter.

Yeah, CurTime()

CurTime() causes that stutter though…

That’s not CurTime’s fault

Isn’t CurTime regularly synchronized with the server when used clientside?

[editline]19th March 2011[/editline]

That’s, like, very obvious if you make something like a text scrolling on the HUD, if you have a high ping it will stutter really badly and even go backwards sometimes.

[editline]19th March 2011[/editline]

but then you’ll tell me that RealTime() would be more appropriate for making scrolling text.

Don’t have a high ping?

I’d like to be able to wave my dick at my internet connection and magically have a lower ping garry. Unfortunately I live in the middle of nowhere so my ping is always high.

[editline]19th March 2011[/editline]

Might as well use a method that’ll be consistent with everyone.

Let me put it another way

Find all “->curtime”
Matching lines: 5088 Matching files: 613 Total files searched: 3419

Find all “->realtime”
Matching lines: 83 Matching files: 22 Total files searched: 3419

NONE of the realtime results are related to game or effects. They’re all related to networking or FPS timers.

Realtime SHOULD NOT be used for game related stuff. If your stuff is lagging with curtime you are hitting prediction problems (calling a hook in the wrong place, not using IsFirstTimePredicted) or your connection is so awful that you should expect problems.

Using realtime is NOT a solution.


Should only really be used by timers

Is this new spawn effect visually different to the previous one, or is the change code-related with no visual difference? (I’d try it out myself, but the Gmod beta crashes at startup)

Well, while we’re at it.

[lua] if ( ply.LastTeamSwitch && RealTime()-ply.LastTeamSwitch < TimeBetweenSwitches ) then
ply.LastTeamSwitch = ply.LastTeamSwitch + 1;
ply:ChatPrint( Format( “Please wait %i more seconds before trying to change team again”, (TimeBetweenSwitches - (RealTime()-ply.LastTeamSwitch)) + 1 ) )
return false


It completely breaks the team selection screen if the server has been running for a long while without crashing, because it reaches ridiculously high values that make it lose in floating point precision.

[editline]19th March 2011[/editline]

Oh well, should have posted this in Niggles, sorry for derailing.