Spawn actors VS Already laid out on screen?

brett-nortonbrett-norton Member, BASIC Posts: 64

Hi All,

Im just laying the foundations to my side scroller im wondering what is the best practice and which uses less resources,

Please note all my actors when the reach the left side of the screen will be destroyed.

  1. Spawn enemys to the right of the screen every 5 seconds. (May be harder to lay the scene out as they move to the left and may land where i dont want them)

  2. Have them laid out on screen where i want them to be and make them move when player actor is near. In total there may be 30+ Actors laid on screen.

Thanks in advance.

Comments

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069
    edited April 2017

    Spawning will tax the CPU and add to RAM usage actively as it happens.

    In place will load all into RAM on scene start, tax CPU more steadily.

    That being said, one spawn per 5 seconds is not going to cause much of a CPU strain at all. Nor would 30 actors being on scene beforehand, depending on complexity.

    Also if the enemies share graphics, those will be loaded into RAM only once for each image, so if enemies share the same sets of graphics, the ram usage wouldn't change much from 1 enemy of a type to 15-30 enemies of a type (depending on logic within).

    It's sometimes hard to say what will be more taxing in a situation like this because of the variability of a games code. Neither method is "wrong".

    Follow us: Twitter - Website

  • ToqueToque Member Posts: 1,187
    edited April 2017

    What ever is most time efficient and easiest for you. A few spawns or pre set enemies shouldn't be a problem either way.

    You can read about Viking research about load times.
    http://forums.gamesalad.com/discussion/94447/why-my-game-always-delay-when-change-scene#latest

Sign In or Register to comment.