Trapper net erroneously checks for Psyker domes after having checked if a player is caught

Issue Type (Required):

Enemy Mechanics

Issue Description (Required):

The following check in bt_shoot_net_action.lua, in function BtShootNetAction._update_shooting:

if scratchpad.force_field_system:is_object_inside_force_field(new_sweep_position, radius, true) then
	scratchpad.internal_state = "shot_finished"

	return
end

Is done after checking if a player was caught or not, rather than being done right after checking for geometry obstacles.

This can result in Trappers netting players inside a Psyker dome while standing right at the edge. This is both unintuitive and inconsistent.

For reference, the net checks things in the following order:

  1. Line raycast for geometry. This is why the net can go through obstacles (it’s not some weird physics issue, it’s intentional). I do hope it’s reconsidered to have it use a small spherecast/sphere raycast.
  2. Finds player targets that overlap with the net.
  3. Gets the first player detected by the overlap search, the rest are ignored.
  4. If this player isn’t dodging and isn’t currently being disabled by other enemies, put them in the netted state. If the player is dodging, check if they’re inside a slightly smaller radius of the net (0.35 instead of 0.5), using horizontal distance.
  5. Check for Psyker domes.
  6. Check if the net has reached its maximum travel distance.

Another small oversight is that in this bit here:

local hit_actors, actor_count = PhysicsWorld.immediate_overlap(physics_world, "shape", "sphere", "position", new_sweep_position, "size", radius, "types", "dynamics", "collision_filter", "filter_player_detection")

if actor_count > 0 then
	local hit_actor = hit_actors[1]
	local hit_unit = Actor.unit(hit_actor)
	local is_valid_hit = self:_evaluate_collision(action_data, hit_unit, new_sweep_position)

	if is_valid_hit then
		self:_start_dragging(unit, t, scratchpad, action_data, hit_unit)
	end
end

There should be a return statement inside the if is_valid_hit block, to avoid overriding the scratchpad.internal_state variable.

I attached a txt file pointing out both issues (not sure if it’ll actually upload since it gave me an error message but still showed up..).

Steps to Reproduce (Required):

  1. Place a Psyker dome when a Trapper is nearby.
  2. Stand right at the edge, closest to where the Trapper is coming towards you, but while still inside the dome. Ranged attacks should be blocked.
  3. Let the Trapper shoot her net.
  4. Notice that you can be caught by it despite being inside the dome.

Reproduction Rate (Required):

Constant (100%)

Platform (Required):

PC - Steam

Upload Supporting Evidence (Optional):

net bug.txt (3.42 KB)

2 Likes