[SOLVED] All that matters is what being displayed regardless of room size?

Discussion in 'Programming' started by krugen, Jul 7, 2019.

  1. krugen

    krugen Member

    Joined:
    Jan 24, 2019
    Posts:
    146
    Says my room size is 10k x 10k, but my actual view is 600 x 300, and that makes it ok? With the whole room filled with tiled map and instances.

    Does this make sense?

    Why I wanted such thing? Coz Im thinking what's gonna happen if I break the whole game into several parts and would there be lag whenever the player crosses those boundaries? Because once crossed, a whole basket of instances need to be created.
     
  2. JackTurbo

    JackTurbo Member

    Joined:
    Oct 19, 2016
    Posts:
    821
    No not really ok. By default everything in the room is active. So you would likely have poor performance with a 10k pixel room

    What your talking about in your second paragraph is a chunking system which is generally the approach of how to make bigger world's. If you look up chunking system I'm sure you could find some tutorials that cover it.
     
    Bentley, Yal, Amon and 1 other person like this.
  3. NightFrost

    NightFrost Member

    Joined:
    Jun 24, 2016
    Posts:
    1,853
    Instances will degrade performance since they're still active outside view. GMS tile system, as far as I'm aware, only draws what is necessary so tiling a 10k room will not impact performance as only what's in the view gets rendered.
     
    Bentley likes this.
  4. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,359
    Size of the room doesn't matter. Thats just a number.
    Tilemaps and asset layers can be pretty huge too, GM will cull things outside the view. Same for rendering instances (to an extent).

    Where it gets expensive is with logic to do with instances. Not only does having more instances mean you need to run their step events, etc, but you also need to perform collision checks against them, etc.

    For that reason it's generally recommended that you deactivate instances that are far outside the view, and reactivate them when they get close.
    Of course that in itself can be expensive so you will have to come up with a scheme that deactivates instance effectively, but not too often.
     
    Japster and Bentley like this.
  5. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,460
    Usually it's enough to run deactivation stuff using a periodical alarm... I usually activate walls in a wider berth around the view than non-wall stuff, so that enemies outside the view won't get stuck into magically materializing walls all the time.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice