[Oxyd] [0.17.49] Biter pathing does not work as expected

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Gerkiz
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Fri Nov 30, 2018 3:36 pm
Contact:

[Oxyd] [0.17.49] Biter pathing does not work as expected

Post by Gerkiz »

We run a custom scenario that uses biter-pathing alot. But in 0.17.49 biter-pathing works sometimes and whenever it wants to...

What happens:
Biters are spawned but only one group is receiving the actions and are moving.
Sometimes the biters don't move at all and are just running in circles.

What I expect to happen:
All spawned biters should start moving at the designated location.

GIF showing what occurs:
https://media.giphy.com/media/hSKuKuOj8 ... /giphy.gif

The scenario in mention is located at:
fish_defender.maps.fish_defender.fish_defender.lua

The code in mention:

Code: Select all

	local spawn_x = 242
	local target_x = -32
	local group_coords = {}
	for a = -80, 80, 16 do
		insert(group_coords, {spawn = {x = spawn_x, y = a * 2}, target = {x = target_x, y = a}})
	end						
	group_coords = shuffle(group_coords)
	
	local unit_groups = {}
	if global.wave_count > 100 and math_random(1, 8) == 1 then		
		for i = 1, #group_coords, 1 do
			unit_groups[i] = surface.create_unit_group({position = group_coords[i].spawn})
		end
	else	
		for i = 1, get_number_of_attack_groups(), 1 do
			unit_groups[i] = surface.create_unit_group({position = group_coords[i].spawn})
		end
	end

	local biter_pool = get_biter_pool()
	while global.attack_wave_threat > 0 do
		for i = 1, #unit_groups, 1 do
			local biter = spawn_biter(unit_groups[i].position, biter_pool)
			if biter then
				unit_groups[i].add_member(biter)
			else
				break
			end			
		end
	end
	for i = 1, #unit_groups, 1 do	
		unit_groups[i].set_command({
			type = defines.command.compound,
			structure_type = defines.compound_command.logical_and,
			commands = {
				{
					type=defines.command.attack_area,
					destination={group_coords[i].target.x + 192, group_coords[i].target.y},
					radius=32,
					distraction=defines.distraction.by_anything
				},				
				{
					type=defines.command.attack_area,
					destination={group_coords[i].target.x + 128, group_coords[i].target.y},
					radius=32,
					distraction=defines.distraction.by_anything
				},			
				{
					type=defines.command.attack_area,
					destination={group_coords[i].target.x + 64, group_coords[i].target.y},
					radius=32,
					distraction=defines.distraction.by_anything
				},								
				{
					type=defines.command.attack_area,
					destination={group_coords[i].target.x, group_coords[i].target.y},
					radius=32,
					distraction=defines.distraction.by_enemy
				},
				{
					type=defines.command.attack,
					target=global.market,
					distraction=defines.distraction.by_enemy
				}
			}
		})
		unit_groups[i].start_moving()		
	end
Thank you in advance.

Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [Oxyd] [0.17.49] Biter pathing does not work as expected

Post by Oxyd »

This is caused by the same underlying issue as this bug, which will be fixed in 0.17.51.

Post Reply

Return to “Resolved Problems and Bugs”