Frictional Games Forum (read-only)
[QUESTION]Is it possible to crash Amnesia if... - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [QUESTION]Is it possible to crash Amnesia if... (/thread-29553.html)



[QUESTION]Is it possible to crash Amnesia if... - FlawlessHappiness - 01-29-2015

...my script tries to do a lot of things with entities that don't exist?

My computer seems to be running just fine, but a beta-tester crashed (blackbox) upon loading a map, that he had already been at.

When looking at the .log file, I was trying to do stuff with objects that don't exist, and I'm aware of this.
But could it cause a blackbox crash?


RE: [QUESTION]Is it possible to crash Amnesia if... - 7heDubz - 01-29-2015

I'm not sure, but that doesn't sound very optimized if it's trying to do a lot of things with entities that don't exist.

But I haven't seen the code so I couldn't tell you.


My immediate assumption is that YES that would cause at the very least a lot of errors, I don't think it's good practice to do this.

Unity crashes if I mess with things that don't exist at least.


RE: [QUESTION]Is it possible to crash Amnesia if... - FlawlessHappiness - 01-29-2015

Weird thing is, I just played through the thing, and didn't get a single crash


RE: [QUESTION]Is it possible to crash Amnesia if... - MrBehemoth - 01-29-2015

This sounds familiar to me, although I'm not sure if it's exactly the same...

HPL2 is designed to handle when an entity doesn't exist, but writing a warning to the log takes up resources.

For a while I was getting a recurring crash with Second Dimension, always on loading a new map. The weird thing was that it seemed to be dependent on how long the engine was running for, nothing to do with the complexity of the map or anything like that. It also seemed to include time when the engine is frozen, i.e., the window loses focus. I figured that it must be something to do with memory, because the memory allocated to the engine was the only thing that could be changing.

SD has a timer loop that runs 30 times per second. During that loop, it was performing operations on entities that may or may not exist in the current map. I thought it would be more efficient to attempt to call an entity that didn't exist than to check whether the entity existed or not first. I forget how many times, but let's say this happened 10 times per loop. So in 1 second, there were up to 300 lines of warnings written to the log. In five minutes of testing the log could be about 100000 lines long.

tl;dr - the log was getting too big.

It turned out that, crashes aside, testing whether an entity exists is more efficient than writing a warning to the log to say that it doesn't. I made lots of changes that reduced the number of warnings in general, and got a big performance boost and little to no crashes. (I'm still working on this optimisation - obviously the goal is zero crashes.)

Could your problem be similar to this?


RE: [QUESTION]Is it possible to crash Amnesia if... - FlawlessHappiness - 01-30-2015

I don't know.

I had another friend do the exact same thing guy number 1 did. No problems. No crashes.


I'm mostly thinking something is wrong with the files on guy number 1's computer, but I honestly don't know.


RE: [QUESTION]Is it possible to crash Amnesia if... - PutraenusAlivius - 01-30-2015

Maybe the error is because the tester didn't have some necessary stuff?


RE: [QUESTION]Is it possible to crash Amnesia if... - FlawlessHappiness - 01-30-2015

(01-30-2015, 08:36 AM)Julius Caesar Wrote: Maybe the error is because the tester didn't have some necessary stuff?

That seems weird, since the tester already had visitted the map before, with no crash, right?


RE: [QUESTION]Is it possible to crash Amnesia if... - PutraenusAlivius - 01-31-2015

(01-30-2015, 05:42 PM)FlawlessHappiness Wrote:
(01-30-2015, 08:36 AM)Julius Caesar Wrote: Maybe the error is because the tester didn't have some necessary stuff?

That seems weird, since the tester already had visitted the map before, with no crash, right?

That is weird. Usually something goes wrong in Windows or something and maybe that's the cause.

Sometimes, if I start up the Level Editor, it will say that I don't have OpenAL installed, then once it's closed, I open it up and nothing appears. Windows had a brainfart :/