Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

9 years ago by Roubjon

Hey Everyone,

My game was running at a relatively stable 60 fps on most computers, but I wanted to give it a speed boost, so I tried checking the "pre-render" box for many of the layers in welty. I eventually decided it didn't do enough to help, so then I unchecked all the boxes (triple checked this), but now ever since I did that, the game has had an absurd amount of system lag. Where now it's running at 12 fps on a level when it used to run 40 fps on the same level.

Now I am completely stumped as to where the problem lays, because I tried playing the game on an old level that I haven't touched in a year that was never altered for pre-rendered purposes, but it still lags there. I didn't make any substantial changes to the main method between before the sudden increase in system lag, but I feel like that's the only reason why the game would still be lagging, as it's a game-wide problem now, and the only function being called in every level is main. But no matter what I do with main, nothing ever changes.

Is there any advice maybe you guys could give me regarding system lag or something? Here's an image of what it looks like on the debugger:

http://i.imgur.com/zD5mJ9X.png

There are hardly any draws being made and it's a relatively empty level and the game is still lagging like mad. I'm really confused.

9 years ago by DanielGray

Are you drawing large backgrounds using small tile sizes? Or using a ton of small collision boxes? If you use small tiles for image assets for levels and collision that can cause insane performance hits.

For me I found that having large areas composed of collision tiles of less than 100x100 begin to exponentially kill performance (only in LARGE areas though of around 5,000 px by 10,000 px for example).

The same is true for loading images, if you have relatively big image assets for your levels and you use small tiles (like 10x10 px for an image that is 2,000 px by 1,000 px, you'll potentially see a huge performance hit).

This may not be the case for everyone, but after I changed my collision layer tile size to 100 and my BG asset tile size to 200 x 200 tiles my game's performance increased drastically.

9 years ago by Joncom

Hi Roubjon. Are you using version control, such as Git? When using version control, predicaments such as this should not occur. The idea is that you take "snapshots" of your progress as you work. And when something goes wrong, you can simply revert back to the last working state. Or you can take a look at what exactly has changed since the last working state.

9 years ago by drhayes

Does this happen in all browsers you care about, or only Chrome recently? Are you using WebGL? Are there any new particle effects in your levels – your draws aren't that big but those "system lag" spikes are pretty huge. What's that? Does it run like that on other computers?

This could be your friend for the next couple of days.

9 years ago by Roubjon

This happens on all browsers of mine. In those levels there aren't any particle effects going on. In order to test things, I created an empty level with nothing but a couple of tiles and collision blocks, and it was still running at around 25 fps. Previously it would have easily done 60.

I have a Mac and PC with higher specs than this laptop (Much more RAM, dedicated graphics card) and it runs the game fine. This laptop has integrated graphics, with 6GB Ram and 2.6 GHz CPU. I'll definitely look into the link you gave me. Thank you!

9 years ago by drhayes

Does it happen on your friends' computers? Is there anything else hanging around in your game's update method?

Sorry, just brainstorming things I'd look for. This all sounds vague; sounds like you have a bug hunt in front of you.

9 years ago by SirPereira

Have you ever figured this out @Roubjon?

I was reading this and became a bit curious about what could be the thing!

9 years ago by Roubjon

Hey Everyone,

No, the problem still persists!

I've tried creating empty rooms with only 1 player entity and it still was running poorly.. I tried pre-rendering all of the background layers in Weltmeister and it didn't do anything. There were only around 50ish draws from I remember and the framerate still never got past 30 I even bought a new highend laptop in order to test if it was my old laptop's poor hardware, and nope, it barely changed a thing. Now once in a while the framerate will be at around 45 fps, but when I package the game using NodeWebkit, it drops back down to 30 fps.

It happens on many computers, but on others it doesn't. I really have no idea what the problem is. It's been bugging me for months now and it's driving me insane.

9 years ago by Joncom

Previously it would have easily done 60.
One method to solve this:

- Create a backup of your game.
- Remove things from your game, one by one, until the problem goes away.
- Then you know what code was causing (or is at least related to) the issue.
Page 1 of 1
« first « previous next › last »