GameSalad

Reduce Lag on my project

SEMASEMA Posts: 136Member
edited May 19 in Working with GS (PC)

I am working on a game that requires levels to have a lot of objects(actors). Most of the objects have attributes inside that detect distance between the player and object to make an appear and disappear animation. The scene is long 20000+. My game starts to lag when a huge amount of objects appear and I notice the music on the game has a delay. Need help to reduce lag in game

Comments

  • tatiangtatiang Posts: 10,709Member, Sous Chef, PRO, Senior Sous-Chef
    edited May 19

    It doesn't sound like you're necessarily doing anything wrong. Having a lot of actors doing calculations (and possibly using constraints) in a large scene with music is going to produce lag.

  • SocksSocks London, UK.Posts: 12,437Member

    @tatiang said:
    It doesn't sound like you're necessarily doing anything wrong. Having a lot of actors doing calculations (and possibly using constraints) in a large scene with music is going to produce lag.

    Music shouldn't produce lag as it's streamed by dedicated hardware on the device, rather than being handled by the processor and/or loaded into RAM ?

  • tatiangtatiang Posts: 10,709Member, Sous Chef, PRO, Senior Sous-Chef

    Good point, @Socks. I guess I wasn't sure if it was music or sounds.

  • SEMASEMA Posts: 136Member

    Is there any possible solution or any tips to reduce lag?

  • MusicBoutiqueMusicBoutique Posts: 63Member, PRO
    edited May 19

    My last project had quite a few performance issues and I had to do quite a bit of optimisation.

    • look for any actors that no longer need to be there and destroy them. For example I had a couple that were needed right at the start of the scene but after that I could get rid of them - so for example when game.time >1 -- destroy.
    • try to have least amount of actors off scene doing nothing. only spawn them when necessary. Should add that probably best to avoid spawning or destroying lots of actors simultaneously. If possible try to stagger the actions to avoid frame drops.
    • biggest improvement was making sure I didn't have any unnecessary extra rules.
      not sure how to best explain so attaching an example of actor with 2 rules that could be combined.
  • IceboxIcebox Posts: 1,243Member

    Did you test on ios or android ? how many devices did you test on ? are they old or new ?

  • SEMASEMA Posts: 136Member

    @Icebox I haven't test it on any device, I test them on the gamesalad preview. @MusicBoutique I will try to remove any unnecessary rules.
    Thank you

  • AlchimiaStudiosAlchimiaStudios Posts: 792Member, PRO

    Gamesalad preview is not indicative of device performance.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,860Member

    Bloated code - Bloated code - Bloated code!

Sign In or Register to comment.