Missing upper limit for character_loot_pickup_distance_bonus

This subforum contains all the issues which we already resolved.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1210
Joined: Wed May 18, 2016 4:55 pm
Contact:

Missing upper limit for character_loot_pickup_distance_bonus

Post by Mooncat »

Bug:
Setting LuaForce.character_loot_pickup_distance_bonus to a large number can possibly freeze the computer.
It may be the same as LuaControl::character_loot_pickup_distance_bonus.

Steps to reproduce:
Note - the following may freeze your computer, such that you may need to do a hard reboot if you can't kill Factorio.exe.

1. Start a game.
2. Set LuaForce.character_loot_pickup_distance_bonus to a large number, e.g. 1e+06 or even larger.

I have accidentally frozen my computer by setting force.character_loot_pickup_distance_bonus to 1e+06. I hard rebooted it 4 times before knowing what happened.
(I know why doing so cause this issue, but I didn't aware I did that.)

Expected behaviour:
Please throw me an error rather than freezing my computer if character_loot_pickup_distance_bonus is larger than 1e+05.
Image
(Or throw error if UPS is too low, etc.)

Edit: maybe also limit for LuaForce::character_item_pickup_distance_bonus and LuaControl::character_item_pickup_distance_bonus
User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

Re: Missing upper limit for character_loot_pickup_distance_bonus

Post by TruePikachu »

Does the process freeze with 0% single-core usage or 100% single-core usage?
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1210
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Missing upper limit for character_loot_pickup_distance_bonus

Post by Mooncat »

TruePikachu wrote:Does the process freeze with 0% single-core usage or 100% single-core usage?
I don't know. Couldn't even open task manager.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16029
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Missing upper limit for character_loot_pickup_distance_bonus

Post by Rseding91 »

TruePikachu wrote:Does the process freeze with 0% single-core usage or 100% single-core usage?
It would max the CPU to 100% of a single core and eat a ton of RAM :P

I'll add an artificial limit to it. I also fixed the loot mechanic to not create chunks when looking for loot around the player (which is why it locked up for you - ran out of RAM and started paging to disk).
If you want to get ahold of me I'm almost always on Discord.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1210
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Missing upper limit for character_loot_pickup_distance_bonus

Post by Mooncat »

Rseding91 wrote:
TruePikachu wrote:Does the process freeze with 0% single-core usage or 100% single-core usage?
It would max the CPU to 100% of a single core and eat a ton of RAM :P

I'll add an artificial limit to it. I also fixed the loot mechanic to not create chunks when looking for loot around the player (which is why it locked up for you - ran out of RAM and started paging to disk).
Thanks!
Post Reply

Return to “Resolved Problems and Bugs”