Page 1 of 1

Creeps forget their command sometimes, and don't get removed on command failed

Posted: Thu Jun 06, 2019 11:06 pm
by ownlyme
Factorio's AI on a stress test:
https://mods.factorio.com/mod/dota
After a while, some creeps seem to forget their command
Since i increased their collision size, it got even worse.
I also told them to destroy themselves when their command failed, but they don't...
Afaik there's no way to read a unit's command to destroy them manually.

Code: Select all

local south_biter = game.surfaces[1].create_entity{name="dota-biter-"..south_level.."-"..color, position = south_spawn, force = color}
south_biter.ai_settings.allow_destroy_when_commands_fail = true
south_biter.ai_settings.do_separation = true
south_biter.set_command{
	type = def.command.compound,
	structure_type = def.compound_command.return_last,
	commands =
	{
		{type = def.command.go_to_location, destination = {x=177 ,y=115}},
		{type = def.command.go_to_location, destination = {x=118 ,y=170}},
		{type = def.command.attack_area, destination =enemy_silo_pos, radius = 70}
	}
}

Code: Select all

	
local unit = table.deepcopy(data.raw.unit["small-biter"])
unit.can_open_gates = true
unit.flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "not-repairable", "breaths-air", "player-creation"}
unit.ai_settings = { destroy_when_commands_fail = true}
unit.selection_box[1][1]= unit.selection_box[1][1]*1.2
...
unit.collision_box[1][1]= unit.collision_box[1][1]*2.5
...
unit.attack_parameters.range = unit.attack_parameters.range * 2

Re: Creeps forget their command sometimes, and don't get removed on command failed

Posted: Mon Jun 10, 2019 11:27 am
by Klonan
can you provide a save game or scenario demonstrating the bug,
Something we can just load and it shows the bug without needing to do any console commands or hope it happens by random during the script execution

Re: Creeps forget their command sometimes, and don't get removed on command failed

Posted: Mon Jun 17, 2019 6:23 pm
by ownlyme
Oh sorry, forgot to subscribe to the thread
Hi :)
https://mods.factorio.com/mod/dota
Takes a while until it happens and often resolves itself when they get killed, but still kinda weird.
Could it be that i issued the biters to somehow fall back to wander behaviour?

Re: Creeps forget their command sometimes, and don't get removed on command failed

Posted: Sat Jan 25, 2020 6:23 pm
by ownlyme
i created an additional script that iterates over all my units and re-assigns commands if their current command type is wandering (is this new that we can read their command? if so, thank you)
it might not be perfect but for me it works like this..

Re: Creeps forget their command sometimes, and don't get removed on command failed

Posted: Sat Jan 25, 2020 7:15 pm
by Klonan
Right!

I also had this problem when updating my unit control mod, and I reported internally to our great biter dev Oxyd, and its fixed for the next release.

However, I think the specific case that was fixed was not present in 0.17, so your problems from June I do not know if they are fixed

Let us know after the next 0.18 release, if the problem still happens