About Store Forum Documentation Contact



Post Reply 
Slow & Low Performance Issue
Author Message
dylantan Offline
Member

Post: #1
Slow & Low Performance Issue
Hello everyone, and I am just seeking your opinion and help about a few problems we are currently facing and I am not sure if anyone are facing similar problem and manage to solve them.

1. Saving the game takes a few mins and almost in "hang" status. At first we thought it was due to the db connector (we using SQLite) but after we remove the DB and save it directly to the text files, it also takes the same amount of time. Worth to mention that when saving the game, there isn't lot of information that we saving and perhaps not more than just a few lines of data (at most) which we think shouldnt' even take more than a 10 seconds. We are completely at lost on how to make it save faster.

2. Exiting the games take a min or so (which is feels like forever). Same thing happen when existing the game. The game is almost at a hang status when exiting. I think it might be due to the next issues which is why the game takes so much memory (RAM).

3. How come the games takes so much memory (RAM)?. When we analyse further, we feel that the reason as to why the games take so much memory was due to the entire world map being loaded into the memory and hence taking up alot of system memory. I mean we are taking about 400-700MB of memory being taken up by the game and the map isnt exactly large either. And we suspects that the when exiting the game, the system is trying to clean all the memory usage and it takes a bit of time to clear them all, hence why it is so slow when exiting the game (issue no 2)

4. Huge performance drop when running on Deferred Mode. Before we update to latest EE 1.0 built 24, we were running built 22, and the performance is somewhat acceptable and we get around 18-35fps on the game (I know its not great but at least it's working ok with PC but not on notebook). The moment we updated to Built 24, all hell break lose. The performance drop so much we are getting only 7-12 fps at most on the same world map which previously running at 20-30 fps, everything else run horribly slow. The only mode that can run smoothly is "Simple" mode which we can get 18-45 fps (which also considering very low). We updated all name change and update the game, so we confirm that there is no issues with code (I think). For the life of me, we have no clue how to solve this and we are months away to release the game.

Esenthel, and everyone, we could really use your help on this one. We are completely dumbstruck by these issues and really seriously hope to resolves them. Any advice, tips and even opinion are welcome and appreciated. We thank you in advance.

- Dylan
(This post was last modified: 08-15-2013 01:17 PM by dylantan.)
07-23-2013 03:36 PM
Visit this user's website Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #2
RE: Extremely slow saves and exiting the game
Before I try to guess what the problem is what can you tell us about the opposite functions? How fast is loading and starting the application? (NOT the first time you run it, it's always slower before it's loaded in cache; the 2nd time you start it, in how much time does the world load?) This should help us figure if it's particulary an exit issue (which might mean some destructors are to blame (?) ) or if it is indeed world-related (maybe you have a too huge view range).

Anyway, I think we need more info here.
07-23-2013 04:18 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #3
RE: Extremely slow saves and exiting the game
As far as I know, all memory that you allocate and don't clean yourself gets "cleaned" by Windows itself. Which is slower, so you'll want to deallocate properly.

So yeah, imo, it might be memory leaks causing it to be so slow. But if you only load a world and close it again, it doesn't make much sense.
07-23-2013 07:17 PM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #4
RE: Extremely slow saves and exiting the game
Thanks for the reply guys. However I am very sure it is not memory leak that cause the game to save and exit slow.

After some discussion with Zervox and Tottel, we realize that it might be a bug that causing the slowness in the game save and especially exit. You might want to see/follow the discussion found http://www.esenthel.com/community/showth...p?tid=6674 about this bug. So in other word, it is the Game::World.del() calling Save both on during saving and exiting. If the world has been loaded it will automatically call save for some reason. In other word, when calling Game::World.del() all objects in the world are calling save even without ever having set ::save anywhere. Even if you remove Game::World.del() from gamestateshut() it will still do the save call when exiting the application completely.

Will update this thread when we found the solution (and awaiting for Esenthel to reply as he might know these issues better)
(This post was last modified: 07-25-2013 12:16 PM by dylantan.)
07-24-2013 04:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #5
Slow/Low Performance Issue
Bump ...

Esenthel sir, see you back and welcome back smile Hope you can have more time to help us with our problem soon
08-15-2013 01:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: [Need Help Urgently] Slow & Low Performance Issue
Hello!
I've replied to the 2nd thread about game world deletion.
As for your issue, I don't think there's anything wrong on the engine side, it just calls save for all objects.
Perhaps you have too many objects? Do you use "embed into terrain" for most of the terrain objects? Those won't need to be saved.
08-15-2013 09:45 PM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #7
RE: [Need Help Urgently] Slow & Low Performance Issue
(08-15-2013 09:45 PM)Esenthel Wrote:  Hello!
I've replied to the 2nd thread about game world deletion.
As for your issue, I don't think there's anything wrong on the engine side, it just calls save for all objects.
Perhaps you have too many objects? Do you use "embed into terrain" for most of the terrain objects? Those won't need to be saved.

Thanks for the reply Esenthel. We manage to resolve the slow save/exiting issues and the large memory usage.

1. [Solved] Saving is like you said it save every object in the map, and this include all the events that we have for the game. Hence the slow saving. We managed to exclude the event's from Saving hence solve this problem. We need to check if the item are "embed into terrain" but I believed that most are.

2. [Solved] Exiting the game takes too long is also due to the 1st issues above. This also solved once the saving is done.

3. [Solved] The game takes so much memory. This is due to one function called Frustum not implemented. Thanks to Zervox over this recommendation. Once implemented, the memory usage drop by half, and stabilized over 320mb at most.

4. (Need Esenthel Urgent Attention) However the last and most important issues that we didn't manage to solve is the Huge Performance Drop when in Deferred/Forwarding Mode. Also there is a big difference performance drop between EE 1.0 built 22 and built 24 in deferred mode as I mentioned above 1st post hence we use revert back to Build 22. Forward Rendering does not work with our project (in either build).

However we discover (thanks to Zervox for spotting this) that it is Shadow that causing a huge drop in the performance when used in Deferred mode. Without Shadow, we get decent 30-40fps but once the shadow is on it drop to 15-25fps, which by half but depends on the terrain. We set the shadow quality mode to the lowest too. This only happened for outdoor maps, but for indoor maps such as inside a building or dungeon/caves the performance are very stable at 40-50fps even with full shadow quality. Only outdoor map/world that have serious performance issues. Esenthel if you could advise us on what we should do, we would really appreciate it. Looking forward to hear from you on what you think we should do.
(This post was last modified: 08-16-2013 04:38 AM by dylantan.)
08-16-2013 04:37 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply