• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 I was just wondering about the resource tree...

F

Falconsoft-Industries

Guest
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.
 
F

Falconsoft-Industries

Guest
So I could have over 200 objects and sprites? Cool... ;)
 

TsukaYuriko

🌠
Forum Staff
Moderator
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);
 

Simon Gust

Member
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);
Don't instance IDs start at 1 million?
 
M

Multimagyar

Guest
Don't instance IDs start at 1 million?
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.
 
F

Falconsoft-Industries

Guest
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.
 

Simon Gust

Member
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.
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.
 
M

Multimagyar

Guest
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.
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

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.
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.
 
F

Falconsoft-Industries

Guest
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 :)
 
Top