Performance nightmare ... a small but helpful story (you can share yours too) :)


#1

The last 2 weeks were probably the hardest and the most annoying in my upcoming game
“Miko Adventures:puffball” … Here is the full devlog if you haven’t already saw it: Miko Adventures (Puffball update!) A MASSIVE NEW UPDATE ! 😮
.
A month ago I started drawing the basics of the biggest level probably in the whole game, And after the drawing process in PS I decided it’s time to add the level into the engine and oh boy … A nightmare stared … performance was … look … I won’t say terrible but bad … it had this micro stutter that was consistent and didn’t go away so I decided cool let’s get back to PS And slice the picture even more to smaller picture … here’s how it went…
.
The level was more than (13000 x 12000 px) … yeah big I know!
So I started cutting the image into 4x4 (16 pictures) but didn’t’ work … 5x5 (didn’t work)
then 6x6 - 7x7 - 8x8 - 9x9 - 10x10 - etc…
Nothing worked (after over 8 days no sleep - food or anything) I was weak tired and scared about the game and what I’m going to do … I felt awful because I thought at the moment I wouldn’t be able to make it work and this means that the whole game is at risk … I slept (broken inside) …
.
The next day I woke up and I decided to do the impossible … which is cutting the image even more (to 32x32) which means I had to go through 1024 pictures … yes it’s painful :cry:
I didn’t even know if it will work or not and I decided to do it … I mean nothing was working so I might as well just try it and see who knows …
after 6 hours of adding pictures into parts … each with separate animations … numbers … lot’s of them … objects … hundreds … my eyes watering and dry … red … my fingers are going to stop working.
.
I open the game and BOOM!
It worked :heart:
I made gdevelop run probably the biggest level to be ever made in the engine (98% work fine with so little to no lag)…
the last 2 weeks were painful but I was determined to keep on pushing the boundaries of Gdevelop, I believed it can do it and it did…
.
So to the people wondering can you run a big level in a game you’re creating … the answer is 100% yes … but keep in mind these notes:-
.
1- JPEG 50-80% if you can … if not then PNG-8 (But I don’t recommend it with big levels) … don’t go for PNG-24 (just not worth it).
.
2- (The most important note) >>> Small images … small images … small images … how small? go under 300 * 400 px
.
3- Task manager is your close friend … memory … cpu … etc … less ram means better
.
4- optimizing the object in the scene which means if you can combine 2 objects then make it happen, if you want to color an object don’t use events … just go in PS and color what you want.
.
5- From testing hundreds of times maybe thousands (and working in GD for over 2 years) … I can tell that GD don’t care about the count of the objects in the scene but rather their size … in my biggest level the engine can handle + 1400 object in the scene no problems at all (and I can go even more np).
.
6- (This one is interesting) >> don’t over crowd objects in one place … lag will happen … separate them and you’ll be fine.
.
7- Whenever you can … use tiled sprite …
read this note carefully (from construct website):
Using Sprites instead of Tiled Backgrounds
Creating too many objects can cause slowdowns, and a common mistake is to use grids of sprite object instead of Tiled Background objects This is similar to using tilemaps inappropriately. For example, a 20x20 grid of sprites has 400 objects, which is a significant impact on the object count. A single tiled background can replace the grid of sprites and it only counts as a single object. Tiled backgrounds are specially optimised for repeating their texture so in this case it is literally 400 times more efficient than the grid of sprites. Always use Tiled Backgrounds instead of repeating Sprites wherever possible.
and take a look here: https://www.scirra.com/manual/134/performance-tips
.
8- Make your game clean … resources … objects … pictures directories … etc…
.
9- You’re going for a small game? … sure
going for an open world? … semi-open world?.. before you start … think how the engine will handle something this big … how will you save the game? … etc … (think deep about this … trust me … just think about this)
.
At the end I’d like to say that yes I’ve gone through a nightmare but I love every second of this… Gdevelop is just so awesome :heart:
Here is a picture of the level I was talking about :heart:
Enjoy : )
.


.
I hope my story helps anyone here :heart:
And if you have one … I’d love to hear it for sure : )


#2

I can relate to this much, im hooked into mobile game development right now, and I can tell, that we have no difference at all. I’ve gone through worst especially when it comes to performance. Hours or even days of frustration and that overwhelming feeling of thinking myself as a fraud and also giving up. One thing I learned during those times was to keep moving forward no matter what, like doctors are once a student right? Right now im in pre-production stage for my third but very first game to be released on public, and each step I take, I make sure I apply the lessons I’ve learned from my mistakes. Thank you so much for sharing your experiences :blue_heart:, it really helps alot especially when an individual is in a state of being down.

Also I find watching Game development videos helpful, and also listening to cafe musics. :smiley:

Anyways, continue what your doing and dont forget to have fun along the way. Once again thank you so much :grin:


#3

Relatable here too!

I faced a similar issue with my painting app, but it has since been solved. It was still a nightmare while it was happening though, to figure out what the problem was since my graphics weren’t very big or intense. In my case, it was creating too many text objects (like a 100) via events, even with trigger once.

I love your artwork, btw. Beautiful. :slight_smile:


#4

Verry informative topic. Thanks for sharing .


#5

@Stoicorum Thank you : )
And yeah I can feel your pain with mobile game dev, When I first started using GD (around 2-3 years ago) … Miko Adventures was not a real thing at that moment but I made another game that never went puplic, it was the beginning of Miko and the start of my journey, the thing is I started with mobile game development and that was painful to start with…
I had not that much knowledge about game dev in general + whenever I test the game on mobile … it just lags and I was like … (I hate my life)
And then I said nope … I have to go big and upgrade this game … then I found Miko and the story begins … I decided to move to pc which is a lot better and have a lot more freedom than mobile.
IMO mobile game dev is way harder than any other platform in the aspect of performance … I don’t know but the feeling of just being limited most of the time because of performance and stuff like that can be annoying and tough.
But anyway good luck with your game : ) … I really hope you reach your goals with this one :slight_smile:


#6

@Phenomena Thank you so much :slight_smile: and I’m glad you managed to fix your problem … keep it up :wink:
@Ruhan Thank you, I’m glad you found it helpful :slight_smile:


#7

Now thats a hella rollercoaster your riding in! Congratulations on your game!! :smiley: Yeah I kinda agree with being limited (like following strict rules in order to achieve stable performance) and I think thats the beauty of game development, the challenge! Anyways, stay healthy, and also I appreciate your reply :smiley:. Keep going and stay positive! You too, I hope you reach your goals :smiley: Thank you :smile:


#8

@CorianderGames

Wondering, do you get any better performance with the new Pixi 5 renderer?
Devs currently working hard to bring it to us so we get better performance.

But, I did test recently the raw rendering performance of GD and to be honest it was not great and I experienced no improvement with the new Pixi 5 version. It could be that my test was not balanced or something, since you did go down in to this rabbit hole and was not even eat and sleep, would you mind testing and share what do you get with Pixi 5? Is it any better?

Thanks.