tips on optimizing game?
-
I like polishing my game as much as I can in every way possible, but I find I’m probably being inefficient in terms of the amount of behaviors and timers I use.
I only have one timer in my entire game set to 0 seconds and it’s only in charge of calculating and executing player movement. I have roughly 18 weapons with their own timers(between 0.05 and 0.45 seconds), but only one timer is ever active at a time. Every enemy (roughly 8 at a time) has a timer set to 0.4 seconds that calculates the player direction and executes the enemy’s behavior.
My game usually runs just fine (I only notice a frame drop if multiple things happen to explode at once), but it tends to crash after I’ve replayed the level about 5 or more times. Could having too many behaviors cause this as well?
-
@bosswave What iPad are you using? After you’ve replayed the level as in restarted it without using the hyperPad menu? What is the world/scenery made of? Do you have tonnes of objects making it up, or just a few larger objects? Is it anything in particular you’re doing before the crash, or it just happens randomly?
-
@Aidan_Fire I believe it’s a second generation iPad Air.
And yes, the scene restarts and randomly generates a new level when you complete it.
The scene is currently composed of roughly 350 wall objects that form the level. They all use the same exact asset. They each currently have 13 behaviors but I plan on overhauling level generation in such a way that they will all have none, and so that wall objects that cannot be interacted with are made scenery.
The crash happens randomly. Sometimes upon restarting the scene, sometimes when picking up an item in-game, sometimes when I’m doing nothing. But it never happens the first 2 or 3 “levels”.
Edit: if it counts for anything, I set up a loop and did a few runs and the amount of wall objects ranges between 175 and 350 with no notable change in performance.
-
@bosswave That is a lot of objects and hyperPad isn’t very good at handling lots of different objects. I’m not sure exactly how your worlds generate, but is it possible to combine some groups of them into one large object? Another option might be to have the level saved in an array or something, and only load it as you enter the area but that would take a lot of effort and might not be worth it. Possibly silly question, but could you be accidentally leaving some of the previous level loaded somehow? Can I maybe try it?
-
@Aidan_Fire I figured it was a lot. I’m probably going to end up reducing the size of my levels or just find a way to more efficiently overhaul me level generation (just gotta find the motivation to get around to it).
I could send you the project but fair warning, there’s a lot going on. How would I share it? Through email?
-
@bosswave hyperPad DM?