Feedback I was just wondering about the resource tree...

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Falconsoft-Industries, Jul 5, 2018.

  1. Falconsoft-Industries

    Falconsoft-Industries Member

    Joined:
    Dec 14, 2016
    Posts:
    174
    how many resources are the maximum limit for objects and sprites?
    Because my game I am making will need lots of them, since it’s a rpg.
     
  2. Dog Slobber

    Dog Slobber Member

    Joined:
    May 20, 2017
    Posts:
    283
    There isn't a published maximum limit.

    Limitations are defined by performance and memory.
     
  3. Falconsoft-Industries

    Falconsoft-Industries Member

    Joined:
    Dec 14, 2016
    Posts:
    174
    So I could have over 200 objects and sprites? Cool... ;)
     
  4. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,577
    The soft limit for objects is 100000. That's the point where object IDs and instance IDs start to overlap, context-based confusion may arise and you should really start to ask yourself "What am I doing with my life when I take the time to make 100000 objects in one project?".

    This is due to how the internal identification works. Object IDs start at 0, instance IDs start at 100000. Due to the similar contexts objects and instances are often used in, it will no longer be possible to tell the two apart in all cases, as sometimes both an object ID and an instance ID will be a valid input. In such cases, undesired results may or may not occur.

    Now that's all good and won't cause problems until 100000, but after that, consider this situation:
    There are two objects, obj_apple with ID 100000, obj_tomato with ID 100001.
    There is an instance of obj_tomato in the room. As it is the first instance, it has ID 100000.
    Now this instance of obj_tomato and obj_apple have the exact same ID.

    What would happen if you run this code now?
    Code:
    instance_destroy(obj_apple); // Reminder: This translates to instance_destroy(100000);
     
    MarceloP, K3llyll and Simon Gust like this.
  5. Simon Gust

    Simon Gust Member

    Joined:
    Nov 15, 2016
    Posts:
    3,164
    Don't instance IDs start at 1 million?
     
    K3llyll likes this.
  6. Multimagyar

    Multimagyar Member

    Joined:
    Jun 20, 2016
    Posts:
    144
    It is in fact start from 100 000 my ever lasting question in GMS1 was what taking up 0th and 1st indicate in that ID system. because the first object I spawned it spawned with 100 002 so I don't know.
    Unless it's the world's most complex RPG ever written, I don't see how would you need over 200 object honestly I mean I give the benefit of the doubt but most pickups are a single object with different images/models and stats in values to them same with NPC. The rest for NPCs are just attached scripts and management of the right script being called after a quest is complete. I yet have to see a game with 100 000+ objects it's not too much of a valid threat to breach that limit. I don't think you will have to worry about breaching even the soft limit. But if you do end up having a unique object for each entity you might end up having a really long compile time.
     
  7. Falconsoft-Industries

    Falconsoft-Industries Member

    Joined:
    Dec 14, 2016
    Posts:
    174
    Great so my rpg can be as big as or bigger than MegaMan battle network Chrono x? Note I am not copying MegaMan battle network Chrono x, rather creating my own huge fantasy rpg.
     
  8. Simon Gust

    Simon Gust Member

    Joined:
    Nov 15, 2016
    Posts:
    3,164
    Weird, does it say that on completely empty projects too?
    Maybe you spawned the object twice somehow, check your instance order list and your room creation code.
     
  9. Multimagyar

    Multimagyar Member

    Joined:
    Jun 20, 2016
    Posts:
    144
    You can make world of warcraft x5 as long as you manage it right in object count certainly can make bigger than either. You are not limited to do too much just your optimization capabilities how you use your resources. Well okay not completely true there are a few things that certainly missing like parallel options, and such but most things should be enough to do what you need to do

    I used to check it in the debugger. GMS2 now always start with 0 but I remember I was searching for these two mysterious instances in GMS1 that spawned in empty or on-going projects. I'm not sure what caused it, there were no instances in the debugger pointing at any of these, and that was that, they disappeared ever since. I assume it might have been some sort of silent objects for the system and graphics classes that accidentally was added to the reference list.
     
  10. Falconsoft-Industries

    Falconsoft-Industries Member

    Joined:
    Dec 14, 2016
    Posts:
    174
    Cool that’s great because that means I can make my rpg, including a fan based MegaMan Star Force game which I am calling MegaMan Star Force 4
    Anyway thanks for the helpful information I am very greatful :)
     

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