Someone told me this is why Im having this problem, but I want to get professional opinions on here.
Ok. In my game Im having a problem where when the map save (The game saves things that players build on the map) reaches about 20'000+ objects in it, when players load their characters every object in their contents of their mob is gone.
It is uncannily related to each other, the map save gets big, more characters become ruined.
Someone told me that I was overloading the resource by having that many objects in-game at once, OR something like that.
I want professional opinions on this. It is ESSENTIAL that my game have the map saving feature, yet each method I try comes out with a serious flaw, despite its simplicity. First I saved turfs built by people directly into a savefile, the problem with that? Apparently byond cant save turfs directly into a savefile without crashing (Which I think they REALLY need to fix). So since byond seems incapable of doing it the direct way, I made it so that when the person places down a turf, a place-holder object containing its type is added to a global list, that list is saved upon shutdown, then restored upon startup. This method worked flawlessly and didnt crash at all (And, might I add, it was the -exact- same code as before except it substituted turfs with objects, which shouldnt affect its ability to save, so its a byond problem) UNTIL we noticed the map save get around 20'000+ objects in it, at which point we noticed the problem where when people attempted to load their characters none of the objects in their contents could be loaded along with them.
I also think this should count as a bug report, on the part where if you attempt to save turfs it crashes but if you substitute them with objects using the exact same code it still works. That just doesnt make sense to me i'd like some explanations and opinions please. I need workarounds for this.
ID:151996
Jun 20 2008, 9:45 am
|
|
Jun 20 2008, 2:44 pm
|
|
You're hitting the object limit in BYOND, which is 65,535 unique objects. Don't save turfs directly, save their variables along with their location, and rebuild the turf later on.
|
In response to Xooxer
|
|
But what am I storing their variables on? Thats why Im using objects, so I can make the objects contain the information needed to restore the turfs.
What Im probably asking is ignorant but I dont know what else to possibly store it in. Also it would still be nice if I could simply save turfs right into the savefile. But thanks for explaining that I can still only have 65000 objects. I thought with byond 4.0 they said that the limit was moved into like the quadzillions or something. It would be nice if it was. Also out of curiousity why -is- byond restricted to 65535 objects? World of Warcraft has -waaaay- more than that and its even 3d...I just dont get it. Cant they do something theoretically to expand it? 65000 is very restricting for a building game. |
In response to Dragonn
|
|
Dragonn wrote:
But what am I storing their variables on? Thats why Im using objects, so I can make the objects contain the information needed to restore the turfs. You store them in the savefile. :P Also out of curiousity why -is- byond restricted to 65535 objects? World of Warcraft has -waaaay- more than that and its even 3d...I just dont get it. Cant they do something theoretically to expand it? 65000 is very restricting for a building game. Not if you manage your resources properly. |
In response to Dragonn
|
|
WoW isn't designed to encompass a massive variety of possible game types, nor, as far as I know, does it have anything but a simple scripting language for missions. Regardless of it being 3D, it's not designed to do anything even vaguely similiar to what BYOND is.
|
In response to Dragonn
|
|
Dragonn wrote:
But thanks for explaining that I can still only have 65000 objects. I thought with byond 4.0 they said that the limit was moved into like the quadzillions or something. It would be nice if it was. The object limit is in fact separate limits for different types. You can have [~]65k lists, and both 65k objs and 65k mobs etc. Also, the turf limit has always been higher - ~16 million. This is due to special behavior in how turfs are handled internally, relating to the fact tons of turfs in a game are identical, IIRC. The limit that was raised in BYOND 4.0 is the datum one, which was 65k but is now 16 million as well. For your reference, Jtgibson posted all (I think) the limits here: [link] Also out of curiousity why -is- byond restricted to 65535 objects? Cant they do something theoretically to expand it? Do search before asking questions, since the BYOND Staff themselves have answered this many times. Basically, BYOND was built with these limits from the beginning due to the way it works, and changing them will require a lot of backend overhaul, so it isn't going to happen. But- 65000 is very restricting for a building game. Actually, it is more than enough, like said previously in this topic. A justified scenario where bigger limits are required is probably as rare as a justified scenario where goto is required. |
In response to Dragonn
|
|
Dragonn wrote:
Also out of curiousity why -is- byond restricted to 65535 objects? World of Warcraft has -waaaay- more than that and its even 3d...I just dont get it. Aye, most people don't get it. You're trying to compare a commercial powerhouse of a game to kiddie stuff. That's like trying to compare a matchbox car to a race car, and wondering why the little toy can't win the Daytona 500. Also, 3D shmeedee. There's nothing object intensive about being 3D. That's just a graphical paint job on an otherwise mediocre game engine. Just because the game looks 3D doesn't mean jack to the server. It's still just tracking object locations and sending updates to clients. The 3D part is done on your end, not the server. |
In response to Dragonn
|
|
You don't need objs to save the turfs when not being used. That's what files are for.
Also keep in mind the object limit is a limit on objects loaded at one time. So, if you anticipate 2000 players, you can plan around it by doing things like store items not in use (items in layer empty areas, etc.) and load them up when the player enters the region. Or just set up multiple servers. You know, like Blizzard. |
In response to Xooxer
|
|
Xooxer wrote:
Dragonn: Also out of curiousity why -is- byond restricted to 65535 objects? World of Warcraft has -waaaay- more than that and its even 3d...I just dont get it. Cant they do something theoretically to expand it? 65000 is very restricting for a building game. In that case I need some advice. The building system in my game basically has some objects called obj/Build, so when you hit the Build verb to turn on building for your character, it files through all turf types and creates an obj/Build that has that turf's icon, type, and so forth stored on it. Each of those obj/Builds are added to your character's contents. They then appear in a tab called "Build", when you click an obj/Build, it creates a turf of its stored type underneath your character. There are 250 turfs, therefore each character with build turned on has 250 obj/Builds in their contents. I almost always have 100+ players, 250x100 = 25000. 25000 objects just from players alone. Sometimes, like yesterday, I have 150 players, therefore 37500 objects. Very close to the limit. You add about 10000 other objects such as trees that are on the map and items players have bought/dropped/hidden or whatever (since items on the map save as well), and your at like 50000 to 60000 objects, very close to the limit. So now that I explained that, I need an alternative if one exists, to my building system. Currently a bunch of objects appear in a tab, they have the name and icon of the turf you want to build, so you click it and you know exactly what your building. Whats a way I can do this -without- using objects but still retain the point and click functionality and knowing what the thing your building looks like before building it? [edit] Oh my god...A revelation. I guess I am answering my own question here. Make a global list of whatever, add all the objects to it, then give everyone a tab to view the objects in that list and build them. Whew hopefully it works |
In response to Dragonn
|
|
Dragonn wrote:
[edit] Oh my god...A revelation. I guess I am answering my own question here. Make a global list of whatever, add all the objects to it, then give everyone a tab to view the objects in that list and build them. Whew hopefully it works Yep! That's what I was about to suggest too. |
In response to Dragonn
|
|
Dragonn wrote:
Each of those obj/Builds are added to your character's contents. They then appear in a tab called "Build", [...] I suggest using a separate list for these kinds of things then, rather than contents. Even if you're not using contents otherwise, it's kind of tidier. (Of course, I suppose you're no longer going to be adding them to a mob-owned list, but the above is correct for other things as well) [edit] Oh my god...A revelation. I guess I am answering my own question here. Make a global list of whatever, add all the objects to it, then give everyone a tab to view the objects in that list and build them. Whew hopefully it works Exactly. You're on the right path thinking about these things on your own, planning and designing is an important part of programming. The key point here is that you don't need the objects to be different from player to player, and they are only used visually as it is. As you've figured out, in your current implementation, each player uses a new object, but they're in fact all the same, so multiples are unneeded. |
In response to Dragonn
|
|
Dragonn wrote:
[edit] Oh my god...A revelation. I guess I am answering my own question here. Make a global list of whatever, add all the objects to it, then give everyone a tab to view the objects in that list and build them. Whew hopefully it works Just for the future, this concept is known as "caching", which I'm sure you've heard of before. Any time you create a large batch of something which will be generated the same way every time, consider caching it globally and reusing it instead of generating it on the fly for each and every attempt to use it. |
In response to Jtgibson
|
|
Also... Turfs can be saved directly to save files, they just can be inside any other object besides their parent types. (You can't put a turf inside a mob, obj, etc. it crashes BYOND.)
Just something I thought I'd bring up, even though the problem might be fixed, but he didn't say yet. |