Wesley1808 / ServerCore

A mod that aims to optimize the minecraft server.
75 stars 11 forks source link

Activation range not applied on item entities #89

Closed Kirisoup closed 1 month ago

Kirisoup commented 8 months ago

Describe the bug I don't know if this is intended or not, but items seems to not be affected by misc activation range (and other categories). I believe by not ticking items outside the range would dramatically increase performance in some scenarios? Providing a unique category just for items entities would also be lovely (like how zombies are in an unique category separated from monster)

Edit: Ok this should be a bug. Gonna test and see what is causing it.

Reproduce

Expected behavior

Versions ServerCore: 1.3.9 Minecraft: 1.20.1 (Quilt loader 0.23.0)

Mod incompatibilities

Wesley1808 commented 8 months ago

They should be affected by it. There are some exclusions though, like when the item entity is moving around it gets temporary immunity to it, preventing tons of item entities getting stuck in item sorters (especially in the nether) as there's no water.

If I might ask, what makes you think they aren't affected by it?

Kirisoup commented 8 months ago

They should be affected by it. There are some exclusions though, like when the item entity is moving around it gets temporary immunity to it, preventing tons of item entities getting stuck in item sorters (especially in the nether) as there's no water.

If I might ask, what makes you think they aren't affected by it?

Oh ok, so they won't be effected while moving.

I simply made a command block teleports an item above itself repeatedly, alongside a similar setup but with a minecart, then moved away, the minecart then stopped in midair while the item is still jumping

Kirisoup commented 8 months ago

But I also tested by summoning like a few hundreds of item entities to an extent that they have an obvious effect on server's mspt, and moved away. There was nearly no change at all with the mspt, untill the items moved out of the simulation distance.

Kirisoup commented 8 months ago

Are items supposed to somehow still be so performance impactful even if not ticking? If not, I'll try to test again with a clean install

Wesley1808 commented 8 months ago

I would recommend testing it with Spark to see what's causing the lag.

Wesley1808 commented 8 months ago

I've just tested this myself with 1562 item entities. Inside activation range it took ~43mspt, outside ~6.4ms.

Kirisoup commented 8 months ago

I've just tested this myself with 1562 item entities. Inside activation range it took ~43mspt, outside ~6.4ms.

Then it should likely be a compatibility issue on my side I guess.

I'll do some more tests when I'm back home

Wesley1808 commented 5 months ago

Its very possible this was caused by https://github.com/Wesley1808/ServerCore/commit/c106bb26f5c49d8720a7daf16b079f2758594906 as items were sometimes keeping horizontal movement in many decimal numbers.

My original test on this was with items spawned in through commands so they probably never had any horizontal movement to begin with.