Page 1 of 1

Configurable Player::generateFarAwayChunks

Posted: Wed May 06, 2026 10:50 am
by zhuyifei1999
Currently, it is set to generate chunks about 1 chunk per second in a 20-radius around the player, result in a minimum of 41x41 = 1681 chunks per surface when a player stays on it for sufficient time. I play on a modded server with around two dozen planets, and the resulting map size quickly inflates just from the number of chunks existing. Some players have to download the map for multiple minutes each time they join. Yes, I could trim the map size with commands, but that's not a permanent solution; the 41x41 will be generated just from a player existing on a planet without any exploration / radar scanning.

I looked into if there's a way to disable the far chunk generation or reduce the radius, but the disassembly suggests that the radius is hardcoded and CharacterController::shouldGenerateFarAwayChunks is set as whenever the update is not paused, leaving no room for modding or anything to configure it.

My suggestion is make it a prototype option for the surface, so each planet mod could opt in/out of far away chunk gen, and could be overridden if needed. Although, I'm not sure why it's needed in the first place, since one can play on a remotely-controlled spidertron and explore the map just fine, without far chunk generation (which I believe is due to RemoteController::shouldGenerateFarAwayChunks always returning false)

Re: Configurable Player::generateFarAwayChunks

Posted: Wed May 06, 2026 3:35 pm
by Thremtopod
Another option would be to put the radius of generated chunks into utility constants, which would allow it to be changed in the data stage.

Re: Configurable Player::generateFarAwayChunks

Posted: Wed May 06, 2026 6:50 pm
by Rseding91
zhuyifei1999 wrote: Wed May 06, 2026 10:50 am Although, I'm not sure why it's needed in the first place ...
"far away" chunk generation was implemented in 0.9.0 so enemies would generate around the player regardless of them having explored away from the spawn location or not. It's a counter to "I never leave spawn and so no chunks with nests ever generate and I never get attacked".

Re: Configurable Player::generateFarAwayChunks

Posted: Wed May 06, 2026 7:19 pm
by Rseding91
I'll add it to utility constants for 2.1.

Re: Configurable Player::generateFarAwayChunks

Posted: Wed May 06, 2026 8:52 pm
by zhuyifei1999
Ah I see. I was thinking of a per-surface override because a lot of modded planets have no enemies, but I don't mind a global constant :) I think pollution will cause attacks sooner or later anyways until one gets late game cheeses, since pollution generate chunks too.

Re: Configurable Player::generateFarAwayChunks

Posted: Thu May 07, 2026 12:57 am
by Rseding91
Both can be done. The utility constant was simply quick and easy. If I - or someone else - doesn't get around to anything else.