08 Jun, 2009, KaVir wrote in the 61st comment:
Votes: 0
Runter said:
I'm not seeing a real issue with maintaining your lists in memory assuming the list is actually unique and not empty. Using ram is the price of maintaining that much data.

But it's not a price you have to pay - for long-term persistance, caching is going to start looking pretty appealing.

Runter said:
Another solution might be databasing these lists and caching access to them. This obviously presents its own set of difficulties to overcome.

That's a pretty good idea - leave it to the database to decide when items should be cached.
08 Jun, 2009, Davion wrote in the 62nd comment:
Votes: 0
When I developed a wilderness for ROM, all I kept in memory were the rooms that were necessary. As KaVir said, rooms are mostly just containers. If the container has something in it, leave the room. If it's empty, instead of moving the player, move the room. Handled things very nicely, and in a wilderness with an accessible sky, and explorable ocean, it kept RAM usage down to a minimum. You can always purge rooms after X amount of time. If you need some reason, instead of some trigger to wipe the room, create yourself some janitors to clean up the wilderness for you (vultures to eat corpses, thieves/bandits to grab lingering objects, etc).
08 Jun, 2009, flumpy wrote in the 63rd comment:
Votes: 0
Davion said:
If you need some reason, instead of some trigger to wipe the room, create yourself some janitors to clean up the wilderness for you (vultures to eat corpses, thieves/bandits to grab lingering objects, etc).


I love the idea of MOBs wandering around your virtual area clearing it out… thats so cool. Even better when your pcs might accidentally wander across a cleaner and be able to nab some loot off them!
08 Jun, 2009, Runter wrote in the 64th comment:
Votes: 0
Davion said:
When I developed a wilderness for ROM, all I kept in memory were the rooms that were necessary.

I think KaVir was arguing that it would be possible with a persistent implementation to have a situation where an unacceptable number of rooms could become necessary.
Of course, with implementations I've had in the past this wouldn't be an issue. But his argument was if persistent objects, or breadcrumbs, existed in increasing percentages on a 1 billion potential room mud it could be an issue to store all of these necessary rooms.
08 Jun, 2009, David Haley wrote in the 65th comment:
Votes: 0
flumpy said:
I love the idea of MOBs wandering around your virtual area clearing it out… thats so cool. Even better when your pcs might accidentally wander across a cleaner and be able to nab some loot off them!

Well, sure, but if we're worried about efficiently representing massive spans of wilderness, we probably don't want all these mobs actually wandering around. You could maybe have something where you instantiate them in a window of sorts around players, but outside of those windows, you probably want the objects to just disappear, not literally be picked up by some kind of scavenger.
08 Jun, 2009, Davion wrote in the 66th comment:
Votes: 0
David Haley said:
Well, sure, but if we're worried about efficiently representing massive spans of wilderness, we probably don't want all these mobs actually wandering around. You could maybe have something where you instantiate them in a window of sorts around players, but outside of those windows, you probably want the objects to just disappear, not literally be picked up by some kind of scavenger.


Eh, even with a few thousand roaming around, it'd still only count as as many rooms as there are mobiles (assuming the rooms move around with them). A few thousand rooms still isn't very much when you consider some games have 8k+ with full descriptions, progs, etc.
08 Jun, 2009, flumpy wrote in the 67th comment:
Votes: 0
Runter said:
Davion said:
When I developed a wilderness for ROM, all I kept in memory were the rooms that were necessary.

I think KaVir was arguing that it would be possible with a persistent implementation to have a situation where an unacceptable number of rooms could become necessary.
Of course, with implementations I've had in the past this wouldn't be an issue. But his argument was if persistent objects, or breadcrumbs, existed in increasing percentages on a 1 billion potential room mud it could be an issue to store all of these necessary rooms.


I can see that being an issue… scavengers would solve that tho with 0 size room containers being removed from the list of populated rooms?

Obviously you would have to produce efficient algorithms for said mobs so you could optimise object collection and therefore memory usage as well as for maximum gaming fun :)

kindof an in game meta garbage collection system.. woo
08 Jun, 2009, David Haley wrote in the 68th comment:
Votes: 0
Davion said:
Eh, even with a few thousand roaming around, it'd still only count as as many rooms as there are mobiles (assuming the rooms move around with them). A few thousand rooms still isn't very much when you consider some games have 8k+ with full descriptions, progs, etc.

A few thousand rooms? :tongue: This conversation about memory efficiency is only worth having with we have millions or more rooms: KaVir said something about a billion locations. That's (roughly) a 32k*32k grid.

So yes, if we're talking about a number of rooms on the order of magnitude of tens of thousands, do whatever you want, it hardly matters these days. But if you want hundreds of millions of locations, things get more complicated.
08 Jun, 2009, David Haley wrote in the 69th comment:
Votes: 0
For completeness's sake, if you have 1,000,000,000 rooms and 10,000 "cleaner mobs", that's only one mob per 100,000 points: probably not enough to be effectively cleaning things up.
08 Jun, 2009, Runter wrote in the 70th comment:
Votes: 0
David Haley said:
For completeness's sake, if you have 1,000,000,000 rooms and 10,000 "cleaner mobs", that's only one mob per 100,000 points: probably not enough to be effectively cleaning things up.


I think the cleaner mobs are nice for touch, but shouldn't be an actual solution to the problem. :P (not that you're advocating that.)

Then again if we're talking about a persistant time frame of hundreds of days we might be talking about something that could make a difference in a persistant world that slowly becomes cluttered. Also, it would make much more of a difference if a breadcrumb can be found in every 100 rooms instead of every say, 10,000 rooms.

But even with this presumably unguided process…it would still make more difference iwth an event system. Even if the event system tied in with a literal garbage collection AI of some kind.
edit: This way the AI isn't unguided and the magic required to make it work efficiently could be done easily.
08 Jun, 2009, David Haley wrote in the 71st comment:
Votes: 0
Yes, if you had some kind of AI driving the cleaners, you could more effectively cover space. If they were doing "random walk", you'd be in trouble, since random walk tends to favor staying in more or less the same place…
08 Jun, 2009, flumpy wrote in the 72nd comment:
Votes: 0
David Haley said:
Yes, if you had some kind of AI driving the cleaners, you could more effectively cover space. If they were doing "random walk", you'd be in trouble, since random walk tends to favor staying in more or less the same place…


I like the idea that the AI could be sophisticated, however you don't even have to have that sophisticated AI for it to work. If the scavenger appeared in a random room on the list and picked up the loot that had been there the longest / was worth the most and then made their way using the shortest path to the nearest shop, that would be pretty easy and quite cool. At the shop, they check the price, sell the goods and disappear or are recycled after a certain time lapse.

Again I don't think its a complete solution, but its a fun one ;)

[edit to add after thought]
08 Jun, 2009, Scandum wrote in the 73rd comment:
Votes: 0
flumpy said:
I can see that being an issue… scavengers would solve that tho with 0 size room containers being removed from the list of populated rooms?

Obviously you would have to produce efficient algorithms for said mobs so you could optimise object collection and therefore memory usage as well as for maximum gaming fun :)

Easier to just have objects decay after a set period of time, and objects where this wouldn't be realistic could simply vanish after a 24 hour period has passed.

What worked well in one game I played was a teleporting scavenging mob. That way you can methodically clean up rooms without it being overly obvious.
08 Jun, 2009, David Haley wrote in the 74th comment:
Votes: 0
Well, I didn't say the AI had to be sophisticated… I just said that having one would make things better. :wink: And really, I only had something simple in mind. In two example worlds (because obviously all of this always depends on the particular details of the situation)…

1- you have a list of objects that are lying around. For each object, pick the closest mob and assign it to that object, and then move to next object and repeat with all but the assigned mob(s). This of course is not optimal in terms of minimizing total mob movement to objects, but that's not really the point.
2- you don't have the list, so you need to optimize exploration. For each unexplored area, take the closest mob and move it toward that area. Or, take each mob and assign it a range, and have it cover that range more or less methodically. There are lots of approaches here of course.
08 Jun, 2009, KaVir wrote in the 75th comment:
Votes: 0
Scandum said:
Easier to just have objects decay after a set period of time, and objects where this wouldn't be realistic could simply vanish after a 24 hour period has passed.

I'd be inclined to agree - you can still spawn the occasional vulture to come down and nibble on corpses, but what you do behind the scenes (without PC witnesses) doesn't really matter.

Of course if all the objects are swiftly decaying (regardless of how you justify it in-game), you end up losing the "persistant world" feel that I was trying to capture.
08 Jun, 2009, David Haley wrote in the 76th comment:
Votes: 0
(BTW, it's persistent, not "persistant"… let's not get a repeat of effects vs affects and spawn a generation of misspellings! :tongue:)
08 Jun, 2009, Runter wrote in the 77th comment:
Votes: 0
KaVir said:
Scandum said:
Easier to just have objects decay after a set period of time, and objects where this wouldn't be realistic could simply vanish after a 24 hour period has passed.

I'd be inclined to agree - you can still spawn the occasional vulture to come down and nibble on corpses, but what you do behind the scenes (without PC witnesses) doesn't really matter.

Of course if all the objects are swiftly decaying (regardless of how you justify it in-game), you end up losing the "persistant world" feel that I was trying to capture.


Seems like we've came full circle in this discussion. :P
08 Jun, 2009, David Haley wrote in the 78th comment:
Votes: 0
I was gonna say, yeah… :lol: I guess timeouts are ok sometimes… (?)
08 Jun, 2009, KaVir wrote in the 79th comment:
Votes: 0
David Haley said:
I was gonna say, yeah… :lol: I guess timeouts are ok sometimes… (?)

Well I'm not saying there's a right or wrong, only that sometimes it's desirable to have persistent objects.

Perhaps it would be sufficient to differentiate between junk that's just left lying around (corpses left where they fell, loot lying out in the open, etc) and items that are specifically put there by a player (heads on pikes, buried corpses and treasure, etc). Buried/hidden items, in particular, wouldn't even need to be cached - they could simply be saved out to disk, and loaded up when a player spent time searching the room (come to think of it, doesn't Smaug have a feature like that?).
08 Jun, 2009, David Haley wrote in the 80th comment:
Votes: 0
KaVir said:
Perhaps it would be sufficient to differentiate between junk that's just left lying around (corpses left where they fell, loot lying out in the open, etc) and items that are specifically put there by a player (heads on pikes, buried corpses and treasure, etc).

I thought we'd already said this actually, that different things have different rates of decay. Regardless, yes, I think this is entirely sufficient for most purposes.
KaVir said:
Buried/hidden items, in particular, wouldn't even need to be cached - they could simply be saved out to disk, and loaded up when a player spent time searching the room (come to think of it, doesn't Smaug have a feature like that?).

It saves them to disk, but only as a persistence mechanism – it doesn't load them up on the fly like that.
60.0/181