TheGameCreators / GameGuruRepo

The GameGuru Repository For Community Collaboration
http://www.game-guru.com
137 stars 56 forks source link

GG:Classic - Problem with AI obstacles and pathfinding in standalone #5464

Open Ghost-l0l opened 5 months ago

Ghost-l0l commented 5 months ago

Video about the problem: https://youtu.be/cIxywcsilRw?si=MA49seHu9Cr6uZ7_

Teabone3 commented 2 months ago

Is this more of an issue with the DLC / custom assets? About their FPE setup?

Ghost-l0l commented 2 months ago

@Teabone3
One car on the vid is indeed custom (from sketchfab), one comes from tgc store, and the wooden beams come from the Death Valley dlc. But I've opened all these assets myself in fragmotion to make sure that there's no unnecessary things inside the mesh, like hidden bones, multiple unused groups or materials

fpe of the wooden beam looks like that: image

Can it be the drawcalloptimizer setting?

I'll try to recreate this problem with other assets too, to see what happens

Ghost-l0l commented 2 months ago

ok I can confirm, the same thing happens with other assets too; I've made a simple wall - only for that one purpose - to guide AI. Wall is just the simplest asset possible, with box collision and forcesimpleobstacle = 2

AI wall.zip

and again - it works in the test game, but doesn't when I build the standalone

Ghost-l0l commented 1 month ago

I did some more tests on this and here's what I found: Gameguru will build obstacles for AI only after you move some objects on the map. So If you move a static object or rotate it or remove it or add a new one, then the engine knows that AI obstacles need to be rebuild.

But If you haven't move anything since the last Test Game gg will NOT rebuild the AI obstacles to shorten the loading time. And in gameguru Test Game mode it works pretty well. The problem is - in Standalone the AI obstacles must be build in loading or else enemies will not see them and will get stuck all the time.

so the right routine to get AI obstacles working in standalone is:

That way the AI obstacles will be rebuild when your standalone game is loading. It means a bit longer loading time, sure, but at least your enemies won't get stuck all the time.

So in the end, you can make it work, but it's a sloppy workaround for a huge BUG

Guys please fix that :)

If that would be any helpful I can upload 2 standalones of the same level, 1 with working AI obstacles, and 1 with not working AI obstacles.

Ghost-l0l commented 1 month ago

To encourage you guys even more to repair this issue, I prepared 2 standalones; In the 1st of them pathfinding works in the 2nd one it doesn't

But it's exactly the same map, with the same assets, the same enemies and the same scripts; The only difference here is what I did before building the standalone;

In one of them I saved after the test game, which means gg thinks it doesn't need to build AI obstacles on loading screen

on the other one I moved one static thing and then saved the map and build the standalone without playing the test game, so gameguru thinks it needs to build AI obstacles on the next loading screen (which is loading in standalone)

Both versions are packed here: https://drive.google.com/file/d/1elxfoWxHJPA-xDCDSeXFOc102j7G4Aaz/view