Page 1 of 1

game.speed?... how about game.rate!

Posted: Sun Jun 18, 2017 4:41 pm
by distortions864
On larger maps, many people's computers cannot keep up on multiplayer.

So, on larger maps. I set game.speed to half.. and double walking speed.
I'm probably going to attempt to mod all the speeds i can to match the normal speed.

But it would be nice if there was a game.rate ( ... or something ) that adjusted the game FPS and adjusted all the other in-game speeds ( walking, assembly machines, belts etc ) to match. I realise it may have to be even multiples... because math.

Maybe full, 3/4ths half and quarter speeds ( or something similar ).
This would be extremely helpful for anyone that likes to play multiplayer.

Re: game.speed?... how about game.rate!

Posted: Mon Jun 19, 2017 4:28 pm
by ssilk
Well, the game speed is in general an issue for multiplayer, so I'm more or less sure, this aspect will be changed somehow.

Re: game.speed?... how about game.rate!

Posted: Tue Jul 18, 2017 9:02 pm
by distortions864
This only does walk speed ( not everything else ) but is still very handy.
Having to walk slower with slowed game is painful.
Just leaving this here for everyone, because manually setting game.speed and player walk speed is annoying...

commands.add_command( "gspeed", "change game speed ( with auto walk speed adjustment )", function(param)
local player = game.players[param.player_index]

if ( player == nil ) then
return
end

if ( player.admin == false ) then
player.print ( "Nope." )
return
end

if ( param.parameter == nil ) then
return
end

local value = tonumber ( param.parameter )
if ( value >= 0.25 and value <= 1.0 ) then
game.speed = value
player.force.character_running_speed_modifier = ( ( 1.0 / value ) - 1.0 )
player.print ( "Game speed: " .. value .. " Walk speed: " .. player.force.character_running_speed_modifier )
game.print ( "(System) Game speed set to %" .. (game.speed * 100.00) )
else
player.print ( "That doesn't seem like a good idea..." )
end


end)

Right now, it just sets walk speed for force admin is on.
You could easily change it to set more forces, or only the "player" force... etc.