Page 1 of 2

Entity wipe

Posted: Thu Feb 23, 2012 7:29 am
by Axel_Hamsen
I've noticed that sometimes all items on the ground (as entities) gets wiped even though they have only been there for a sec or 2. For example when I harvest wheat. Now, my suggestion is that you change that function. Instead of wiping all items once every 10 min or so (dunno how often it does that) maybe you could set some time before the entities vanish? I've also died once, where all my items were gone when I came back. (Yes, I went back to the correct place, and it hadn't been more than 1 min tops)

Other suggestions or corrections are of course welcome.

Re: Entity wipe

Posted: Thu Feb 23, 2012 7:31 am
by The-Jack-DeCk
Axel_Hamsen wrote:I've noticed that sometimes all items on the ground (as entities) gets wiped even though they have only been there for a sec or 2. For example when I harvest wheat. Now, my suggestion is that you change that function. Instead of wiping all items once every 10 min or so (dunno how often it does that) maybe you could set some time before the entities vanish? I've also died once, where all my items were gone when I came back. (Yes, I went back to the correct place, and it hadn't been more than 1 min tops)

Other suggestions or corrections are of course welcome.
Not exactly sure what you mean by this, I never see entities get wiped "after a sec or 2."

Re: Entity wipe

Posted: Thu Feb 23, 2012 8:37 am
by Axel_Hamsen
Can't really describe it any other way. If you detroy some wheat, and let it be untouched on the ground, it can disappear in within a time span of 1 sec and 5 minutes. And sometimes people lose quite a lot of items due to this. I know I did.. A diamond pickaxe with Eff IV, Frtn III and Unbr III. I was so sad after losing that.

Re: Entity wipe

Posted: Thu Feb 23, 2012 9:04 am
by JonColmanator
Not meaning to sound harsh or anything, and even though I don't know Intelli's code or Minecraft's code that well, here's what I think of this idea (assuming my assumption is correct):

At this moment, if what Axel says is true, the server has one entity removal timer, which is global for all entity (items, that is, not people). That means one timer affects every dropped item on the server. This takes a certain amount of memory, lets call this memory 'x'. That is, the timer consumes x memory.

Now, if we were to attribute an entity removal timer to each and every item that is dropped on the server. So each item dropped consumes x memory with this timer alone.

Now, lets say that Joe Bloggs was running along with an inventory absolutely full of items (including armour), when he got snuck up on by a creeper and died. Luckily, all of his items were spared from the explosion. But of course, each item has an individual timer which consumes memory x. There are 64 items to a stack, and 36 stacks in an inventory and 4 items in armour. So you are looking at ((64*36)+4)x memory being consumed by that unfortunate death. That amounts to 2308x. To keep track of things, this is 2308 times the memory that a global timer would consume. Already, you can see that this idea will be quite memory consuming as it is.

Now, although this statistic was thought up from my head, I'm sure players will roughly agree with my estimate. At the time where the number of players playing on the server is about 60-70, within the space of 10 minutes about 2 or 3 players get killed by some monster or some tragic accident. So, if you are suggestion a 10 minute timer, you're looking at a mean of 4616x to 6924x memory being consumed (assuming every death is carrying full inventory, this is a worst case scenario in this situation). Of course, the real value to this will vary.

So, can you see that if you assign a timer to each entity, the server could be demanding nearly 7000 times more memory for the indivual timers than with a global timer. Not having a go, just letting you know the downsides to this idea.

Fun fact: if we decided to cram 100 players into the server, fill all their inventory up completely (including armour), then they all die, that's 230,800 times the memory of a global timer. That's a lot. Never gonna happen, but it's a lot.

Re: Entity wipe

Posted: Thu Feb 23, 2012 9:14 am
by The-Jack-DeCk
I'm really confused here.


Items despawn, that's part of minecraft. Other than that, I don't know anything about items disappearing on minerealm. I have never seen a dropped item vanish within 1 minute of it's exsistance, let alone a few seconds.

Re: Entity wipe

Posted: Thu Feb 23, 2012 10:05 am
by Prodigy9
JonColmanator wrote:Now, lets say that Joe Bloggs was running along with an inventory absolutely full of items (including armour), when he got snuck up on by a creeper and died. Luckily, all of his items were spared from the explosion. But of course, each item has an individual timer which consumes memory x. There are 64 items to a stack, and 36 stacks in an inventory and 4 items in armour. So you are looking at ((64*36)+4)x memory being consumed by that unfortunate death. That amounts to 2308x. To keep track of things, this is 2308 times the memory that a global timer would consume. Already, you can see that this idea will be quite memory consuming as it is.
Don't stacks of items count as a single entity when dropped? Pressing Q repeatedly would result in different entities, but dropping an entire stack (as happens when killed) results in a single entity which gets picked up all at once when someone touches it. So the maximum memory from a full inventory + armor set dropping would be 40x. Still a considerable increase from the current system, but not as bad as 2308x.

Re: Entity wipe

Posted: Thu Feb 23, 2012 10:08 am
by Axel_Hamsen
I see your point in the amount of memory used. I was also thinking of an alternative, and maybe I've come up with something useful.
Instead of putting a timer on each item, maybe put a timer on each chunk. This way, chunks that doesn't have any entities on them, will not start the timer.

Lets for example say I haven't been online for some time, and I log in and start harvesting wheat. I manage to punch a lot of wheat in very little time, and half is still laying around on the ground when suddenly everything vanishes in front of me due to the world wipe.
But if instead there was a timer on the chunk it wouldn't happen, because no entities would have been dropped since my last visit (since I'm quite far away from spawn, it's at least very unlikely), and the timer would just have started when the first entity dropped.

Maybe the timer should reset every time an entity is dropped, so that it would not wipe at all, until the chunk had been inactive for 5 minutes.

I must admit, that I do not know what the current code is either, but I do know that all entities in quite a big area gets wiped at the same time, even on different chunks. I also do not know how hard it would be to code this idea, but it would eventually solve future problems.

Re: Entity wipe

Posted: Thu Feb 23, 2012 12:41 pm
by bcbarton
I saw this happen before too. The first time I saw it was when Intelli used this function when we first switched to the new map in order to clear the items that were not decaying and reduce lag. The second time was months later when an iron ore disappeared immediately after it dropped without going in to my inventory. It's possible that Intelli is still regularly using a global search-and-destroy routine but I doubt it because even that causes lag when clearing entities.

Re: Entity wipe

Posted: Thu Feb 23, 2012 2:44 pm
by Axel_Hamsen
What I know for sure is, that I've seen it 3 times already and I've only been playing on this server for 2 weeks or so. I really like this server, and it seems to be one of the best out there, without being insanely complicated to figure out (although I still wish for /sethome1 and /sethome2 and so on to be implemented) so it's a shame whenever something sad as me, losing my pickaxe happens :'(

Re: Entity wipe

Posted: Thu Feb 23, 2012 2:53 pm
by hvrock13
I've experienced the complete opposite; I've died before, considered what I lost to be not worth going back for immediately, and the next day (not minecraft day; real day) I go by that location and my items are still there. A whole 24+ hours later.