Console: change running speed of all biters?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Plawerth
Fast Inserter
Fast Inserter
Posts: 116
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Console: change running speed of all biters?

Post by Plawerth »

Okay so, I'm playing a game that is running like mud, and the only way to make it playable is to lower the game speed or everyone jumps and can't move.

/c game.speed = 0.75

Except this makes all the players move slowly which is annoying. However I have discovered there is a way to compensate for the slow game.speed so all players run normally again.

/c game.player.force.character_running_speed_modifier = (1 / game.speed)-1

Though there is concern that this introduces an imbalance into the game because the biters still move slowly. Is there a way to also increase their run speed too?

I was poking around, and this value exists:

/c game.player.print (game.forces["enemy"].character_running_speed_modifier)
0

However it does not seem to have any effect on the biters...

/c game.forces["enemy"].character_running_speed_modifier = 1

Nothing seems to change.


Is there a known way to boost biter run speed at slow game.speed in a vanilla game?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Console: change running speed of all biters?

Post by darkfrei »

Plawerth wrote:
Sun Sep 20, 2020 9:10 am
Is there a known way to boost biter run speed at slow game.speed in a vanilla game?
You are need the mod with this code in the data.lua file:

Code: Select all

data.raw.unit["small-biter"].movement_speed = 0.2
data.raw.unit["medium-biter"].movement_speed = 0.24
data.raw.unit["big-biter"].movement_speed = 0.23
data.raw.unit["behemoth-biter"].movement_speed = 0.3

data.raw.unit["small-spitter"].movement_speed = 0.185
data.raw.unit["medium-spitter"].movement_speed = 0.165
data.raw.unit["big-spitter"].movement_speed = 0.15
data.raw.unit["behemoth-spitter"].movement_speed = 0.15


data.raw.unit.compilatron.movement_speed = 0.2
Here are the default values, but you can write what you want, for example like:

Code: Select all

data.raw.unit["small-biter"].movement_speed = 0.2 / 2 -- twice slower than default

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Console: change running speed of all biters?

Post by Klonan »

You can loop through all biters and increase their speed:

Code: Select all

for k, biter in pairs(game.player.surface.find_entities_filtered{type = "unit"}) do
  biter.speed = biter.speed * 2
end
But that will only affect currently living biters.

Plawerth
Fast Inserter
Fast Inserter
Posts: 116
Joined: Thu Mar 02, 2017 12:57 am
Contact:

Re: Console: change running speed of all biters?

Post by Plawerth »

Okay, so apparently there is no global runspeed adjustment available for the enemy force like there is for all players. What does it take to get something like that added to the game base code?

The other option I guess is to add a control.lua event that for every biter/spitter spawn, modifies their runspeed to be multiplied by 1/game.speed.

I don't know LUA or the game API to write that, though it would probably only be about three lines long.

Post Reply

Return to “Gameplay Help”