Jump to content
  • 0
Slimwaffle

AI Crash

Question

I was wondering if anyone is able to help me.

So I have had an issue for months now with Enemies crashing my game. Regardless of the models/animations I use. Regardless of the scripts or code I use (I have tried the Default, The HUD elements ai script and about 4 variations I have made myself). Simply having enemies in my project causes crashes. I have tried running my game without enemies and it runs perfectly. But even if I set them to run away instead of attacking, simply having enemy characters causes the game to crash.

I would really love and appreciate some help fixing this because its an issue that makes my game unplayable and the only major bug I have left to fix.

Share this post


Link to post

11 answers to this question

Recommended Posts

  • 0

I don't know your specifics but recently I had a crash when I loaded a different model in my game.  The issue ended up being that I was trying to manipulate an attachment via code that the new model didn't have.  In other words, make sure you're not trying to access a model (like a gun) that your new models may not have.  Just a thought; could be anything though.

Share this post


Link to post
  • 0
  • Often starting in debug mode, can give you at least an error instead of just a crash.
  • Starting adding nil checks and print out a console warning when something is nill when it shouldn't be

Share this post


Link to post
  • 0

I don't think its a bone reference thing. Because it even does it while using default crawler prefab.And I tried a very basic script that I wrote where all that was in if was; if player is inside this distance run to random position.

I tried debug mode but its unusable my game won't even run in debug. It hits 2fps and stays there in debug mode. Which is weird because I have a pretty decent pc and my gpu is the nvidia 1080.

I don't think nil checks will help because I have already tried bare bones code that simply says re-position if player is in range. Using this method I was able to get the crashes from every minute or so up to around the 5-10 minute mark. Also something to point out using this method the game would run longer with fewer crashes but it would also experience a different kind of crash that wasn't so random. Where my game just kept getting slower and slower as more spawned in and then it crashes. 

I noticed there was a collectgarbage command. Is this something that only works in debug? What is the correct way to use this? I was thinking it might help if I use it in the update world function.

Share this post


Link to post
  • 0

Is there anything more specific about when they crash? Is it on startup or when they die or does it happen at 14 minutes or something like that?

Share this post


Link to post
  • 0

There is literally nothing specific going on. I have been trying for months to narrow this down. It happens at random and they are doing different things. One that does happen a lot. Enemies will run in place because of the broken navigation. Then after a while they will glitch out collide with the terrain and then the game will crash. But that is only one of many causes. It honestly feels like simply having enemies in my project causes the crash.

Share this post


Link to post
  • 0

Maybe make a new fps project and try out the default crawler and so on there ? Because I didn't experience so bad behaviour yet.

Share this post


Link to post
  • 0

I think it might be the navigation being broken. A blank small project works fine. But I remember reading in the forums there was a bug where if you changed the world size or terrain size (something like that) it breaks the navigation. And I did this in my game because I was making a massive open world game. The navigation does appear to be broken because enemies often don't know where to run or move to (and glitch out). And I have noticed these crashes are happening when they glitch out. I have also noticed having more then 1 or two enemies causes the scene to become overloaded very quickly. But this could be because the Leadwerks is 32 bit and isn't able to access more ram.

Share this post


Link to post
  • 0

If you upload your game and send me a link I can run it through the VS debugger and see what is happening.

  • Like 1

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...