• VitoRobles@lemmy.today
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 days ago

    This is how it works in many game engines.

    You set up the monsters and just hide them/disable them. They’re already allocated to memory.

    And it’s a performance cost to create/delete versus just moving a dead enemy out of view, then respawning that enemy later in the level.

    • umbrella@lemmy.ml
      link
      fedilink
      English
      arrow-up
      0
      ·
      11 days ago

      im not very versed in game engine design, but dont they dynamically stream them into memory before they will be needed, and discard them when they wont nowadays?

      • AdrianTheFrog@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        11 days ago

        Dynamic streaming is common nowadays, as games have gotten large enough that not everything in a level can fit into memory.

        I don’t know about what is actually done in industry but I feel like most of the time you wouldn’t bother with keeping dead instances unless instancing is shown to actually be a performance problem, which will probably not happen all that often

        Godot for example doesn’t have built in dynamic level streaming yet or a built in way to cycle through dead instances as far as I can tell, although I’m sure that wouldn’t be hard to do with code