Reduce Lag on my project

SEMASEMA Member Posts: 161
edited May 2017 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 Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2017

    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.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

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

    @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 Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

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

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SEMASEMA Member Posts: 161

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

  • MelodyCatsMelodyCats Member, PRO Posts: 128
    edited May 2017

    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 Member Posts: 1,485

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

  • SEMASEMA Member Posts: 161

    @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 Member Posts: 1,069

    Gamesalad preview is not indicative of device performance.

    Follow us: Twitter - Website

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Bloated code - Bloated code - Bloated code!

Sign In or Register to comment.