1. Thanks for visiting! These forums are for the original Risk of Rain, if you're interested in discussing the newly released Risk of Rain 2 head over to that game's steam discussion forum
    Dismiss Notice

Different way to manage number of monsters active at one time?

Discussion in 'Suggestions' started by Engio, May 16, 2013.

  1. Engio

    Engio Space Penguin Leader

    During one of my recent runs in hardcore as the commando I was strolling along stage 3. I slowly but surely made my way to the teleporter on the map started that good old timer. I ran around the map getting potshots in when I could but prioritizing my poor little commando's life. By the time the timer was done my game was slowed down into probably .5x speed and I had 99 monsters active (I imagine this is a hardcap coded into the game considering what a perfect number it is. Also for whatever it matters this count didn't include a Vagrant that spawned part of the way through, bug?)

    I survived the whole ordeal and died shortly after on stage 4 but what came to my mind was that perhaps there was an easier way of handling this mass spawning. I play on an average power laptop and the game slowing down when things get flooded with enemies and entities is something we deal with in every game. However the game slows quite a lot once the number of enemies climbs to the 70's (all after the game reduces its settings) to a painful pace. I was wondering if there were any different approaches to look at spawning mobs once the count gets high that could reduce strain.

    Maybe during the teleporter count if the creature total starts reaching past 60 or 70 the spawn rate is reduced drastically and every other "card" the "director" would get from it's "deck" is stored away to be used once the total number of enemies goes below the storage limit.

    This would be different from merely keeping the directors hand of cards until the number of monsters goes below the set limit (I imagine that is roughly what happens right now and the limit among other factors changes as difficulty goes up). All those cards would be put onto a stack and be spawned until the stack is empty even after the teleportation counter has finished.

    Anyone else have any ideas as to ways to reduce the stress of mass quantities of enemies being active on the field at once/
     
    • Shrooblord

      Shrooblord Void-Bound Voyager

      This is rather technical and something probably only the devs will understand, but it may be a good consideration to deactivate all instances that are off-screen if the performance starts suffering too much. The only downside to this is that Items like the Atg Missile will be unable to find their targets...
       
      • Engio

        Engio Space Penguin Leader

        Also then you put extremely large strain on the computer to load things over and over again.
         
        • Treadlight

          Treadlight Existential Complex

          I'm certain the game already does this. But it's not just all instances outside the view are instantly deactivated, they have to be a bit farther than that. Try killing an enemy near the edge of the screen and running away from the coins. If you're quick enough, they'll deactivate far enough away, and not fly to you. (I posted this in the bug reports, since the only lag caused by coins is when there's a giant pile onscreen.)
           
          • Shrooblord

            Shrooblord Void-Bound Voyager

            Reactivation in Game Maker doesn't make it 'load' anything extra. It doesn't reinitialise the instance. When an instance gets deactivated, it basically is put in stasis and this frees up memory.

            On that subject, maybe the game is keeping some things running in the background that could be temporarily shut down if the performance is suffering?

            Yes, it does this automatically if enemies are too far away. However, my suggestion was to 'kill off' unused instances of anything that's offscreen when the computer's performance starts going South. They can be recalled when needed.


            Another suggestion I'd make is turning dead bodies from instances into tiles, if this is not already done. A dead body 'instance' doesn't add anything to the game, as there can be no interaction with it. If it's purely for graphical pleasure, turning the used instances into tiles once they're done with their doings (anything from spawning stuff on death to physics (falling to the ground when killed in mid-air)) should help speed up the game.
             
            • Treadlight

              Treadlight Existential Complex

              I think it does the destruction of unused deactivated instances already, also. I'm pretty sure if you get an item to appear, and then leave it far away, going back will reveal that the item is gone.
               
              • Engio

                Engio Space Penguin Leader

                Items despawn after a given amount of time. Saw this happen with an item I didn't particularly care for and rush to get.
                 

                Share This Page