Which method is better to optimize Space Shooter video game?

0 favourites
  • 3 posts
From the Asset Store
Cannon Ball Shooter game assets for 2D bubble shooter puzzle game.
  • Hi everyone.

    I've been working on a video game for a while now

    I posted on the play store, I don't know if I should post a link because I did it as a paid app, maybe I shouldn't spam.

    But here's my question:

    My game is space shooter style (that's the name of the game). With some differences, for example there are images of approximately x100/200 px which I then resize (I will try to reduce the dimensions to a minimum but they are artistic images so I cannot reduce them to 10x10.

    But I created all the levels by inserting spaceships, asteroids, etc... in each layout measuring 50000 x 480 (the maximum).

    however I inserted objects up to a maximum of 20000 px.

    The viewport continuously moves to the right showing incoming enemies, up to the level width entered in a dictionary object.

    Here's the question:

    The fact of already having all the objects created in the layout (there can be 50-60 plus the small star images of 20x20 px created randomly at the beginning of the layout which can even be more than 100!)

    Does it greatly affect the performance of the game?

    Would it make sense to record all the objects with their properties in a dictionary, change the layout size to 854 x 480 px and create the objects at 1000px and make everything move to the left?

    That is, creating a dictionary with example:

    time 1sec. --> asteroid(height 200, size, variables, etc...) time 3 sec --> enemy (height etc...)

    And make a function that creates enemies like that?

    it's a job that takes some time because I want to recover all my levels as they are.

    Does it make sense to do it?

    Because I see my game lagging on my smartphone, and it will lag even more in the future.

    What is best to do?

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If your game is not fast enough, make measurements using the CPU and GPU profiler, identify the parts that are slowing it down, and optimize those. Otherwise you are probably just wasting your time.

  • I use levels up to 10k and that's fine. It is very important to enable the behavior of objects that the player sees and disable those that he does not see.

    If the level is longer I think it would be better to scroll the background and spam enemies from the array, so you can create an infinite level.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)