Jump to content

Recommended Posts

I just notice many people are complaining about the pathfinding which has been used to easily handle the powerful or a large group of mobs.So i made this : Better Pathfinding

I think it's okay to made it as a mod so that you can just challenge yourself to fight with smarter enemies.

I just try to add pathfinding walls for more obstacles, including statue/lureplant/fossile/homesign and other wild obstacles which spawned in the world, so almost creatures can walk around the obstacles when pathfinding ,but it seems no works for some giant epic boss.

some of the boss can walk around the obstacle(eg: bearger, leif), and some of their just walk straight to the player without pathfinding.(eg: klaus and stalker)

except that, the giant will try to cross the gap of obstacles evenif it's impossible for his physics radius.Yeah it's a rough thing and just like many other game's pathfinding system, the pathfinder will not consider the physics range of pathfinding requester, and it just consider all of them as with the radius of the wall.

Edited by Littlefat1213
i have updated this mod to solve some of above issue

okay, i notice the stalker and klaus will walk straight just because of pathcaps.ignorewalls = true.For they can collide and destroy the structure which has workable component. But I'm confused about why did klei set up pathfinding walls for ancient gate now that stalker already ignore walls ?

3 hours ago, _zwb said:

Would mobs still try to walk straight to you if the path they find is extremely long? It's very common in the caves, when you click on the other side, the player would walk straight to it and get stuck.

It's inevitable.They got stuck maybe just because quit the pathfind since beyond maxwork of one request, all the creature request pathsearch to the unique pathfinder(TheWorld.Pathfinder) so it should be limited the number of point visited. if beyond the limits(I have tested and found that this is around 10 frames,easy to understand it's also proportional to timecost), the pathfinder just stop the process and return no way.

8 hours ago, Littlefat1213 said:

okay, i notice the stalker and klaus will walk straight just because of pathcaps.ignorewalls = true.For they can collide and destroy the structure which has workable component. But I'm confused about why did klei set up pathfinding walls for ancient gate now that stalker already ignore walls ?

I update the tweak for pathcaps as following :

	if inst.Physics and inst.components.locomotor then
		local can_cross_land_ocean_limits = inst.components.amphibiouscreature ~= nil or 
				(not CanCollideWith(inst, COLLISION.LAND_OCEAN_LIMITS) and 
				(not inst.components.drownable or inst.components.drownable.enabled == false)) 
		local can_cross_obstacles = not CanCollideWith(inst, COLLISION.OBSTACLES)
		local can_cross_spiderweb = not inst.components.locomotor.triggerscreep 
		
		if inst.components.locomotor.pathcaps == nil then
			inst.components.locomotor.pathcaps = {}
		end
		inst.components.locomotor.pathcaps.allowocean = can_cross_land_ocean_limits
		inst.components.locomotor.pathcaps.ignorewalls = can_cross_obstacles
		inst.components.locomotor.pathcaps.ignorecreep = can_cross_spiderweb
	end

and about registering pathfinding walls see components/ngl_pfwalls.lua. It hook the Physics Component to update the ispathfinding state and sync to apply the pathfinding wall in ngl_pfwalls_replica.lua.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...