Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[QUESTION]Is it possible to crash Amnesia if...
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#4
RE: [QUESTION]Is it possible to crash Amnesia if...

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?

(This post was last modified: 01-29-2015, 11:42 PM by MrBehemoth.)
01-29-2015, 11:39 PM
Find


Messages In This Thread
RE: [QUESTION]Is it possible to crash Amnesia if... - by MrBehemoth - 01-29-2015, 11:39 PM



Users browsing this thread: 1 Guest(s)