Page 1 of 1

[1.1.64] Crash on LuaSurface.request_path with path_resolution_modifier value of 10

Posted: Thu Aug 04, 2022 12:19 am
by Muppet9010
When running LuaSurface.request_path and a path_resolution_modifier value of 10 for a valid pathable route the game crashes.
With a path_resolution_modifier value of 1 or 0 (default) it doesn't crash.

Sample vanilla save that the below command breaks:
pathfinder_crash.zip
(1.06 MiB) Downloaded 82 times

Code: Select all

/c game.surfaces[1].request_path({
	bounding_box = game.player.character.prototype.collision_box,
	collision_mask = game.player.character.prototype.collision_mask,
	start = {0,0},
	goal = {100,150},
	force = game.player.force,
	path_resolution_modifier = 10
})
I was trying to work out what the path_resolution_modifier setting actually did as the description in the API docs is unfortunately rather cryptic. So I tried the value of 10 to see what difference it had to the default of 0.

Re: [1.1.64] Crash on LuaSurface.request_path with path_resolution_modifier value of 10

Posted: Thu Aug 04, 2022 4:04 am
by boskid
I can give you some hints about what will be the fix in 1.1.65 when it will be fixed:
- path_resolution_modifier parameter is used for AI Pathfinder's pathResolutionModifier
- The same AI Pathfinder's pathResolutionModifier when searching for paths for units gets its value from AI settings, specifically from LuaAISettings::path_resolution_modifier
- There is certain range of valid values for the LuaAISettings::path_resolution_modifier.

Re: [1.1.64] Crash on LuaSurface.request_path with path_resolution_modifier value of 10

Posted: Thu Aug 04, 2022 4:27 am
by boskid
Thanks for the report. Issue is now fixed for 1.1.65.