General performance improvements #1154

Open
opened 2021-02-20 12:29:19 +01:00 by kneekoo · 18 comments
Contributor

I've been recently hit by a (literally) breaking bug as a combination of Minetest and wpasupplicant (wifi client in Linux). I posted it in the Minetest forum and then GitHub, and I'll report it to the wpasupplicant package maintainers when I'm confident enough that it's actually wpasupplicant's fault and not mine for starting to use enchanted items around the time I updated that package.

While investigating the problem (and still looking into it) I uncovered a number of issues in MineClone 2 as well, and I hope the engine allows for some of the changes required for optimizations.

If anyone wants to help with testing performance-related issues, I highly recommend a slower computer because that's the best tool to easily notice what needs improvement. It also helps a lot to enable the "info" level of logging and have to ability to grep/parse through it from the terminal, considering the logging will become quite noisy.

  1. ABMs can impact performance. I don't know how to do profiling on this but I want to make a Python script to scan through the game's files for register_abm occurences, and report their interval. It will be trickier with AMBs for mobs, at least, but I'll see about it when I get there. If those familiar with the code have a better idea about this, please share it.

For now, I changed the water dripping interval from 2 to 4 seconds, just because they're purely decorative. I didn't notice an improvement so far, but once I can check and all the ABMs I might find something else that doesn't alter the gameplay.

Hoppers also check for items every second, so while we can't tweak that, when players build farms and automation, having lots of them will surely impact the performance, like it does in Minecraft. A suggestion here would be to have a small paragraph about performance in the game's README.md.

  1. The mobs need a spawn mob cap. This alone will contribute to better performance because currently we can end up with a large number of mobs, and along with other objects it can create a lot of lag, up to the point the game becomes unplayable or even crashes.

  2. The game needs the ability to "freeze" mobs that are farther than 32m from a player. This is mentioned in the despawning ranges of Minecraft, and it would be a nice performance win for us as well. They're only supposed to be active between 24-32 blocks around players. You can adjust the distances and check the log with my MineClone 2 Spawn Distance Analysis tool.

  3. We need more efficient spawning conditionals, so that the game spends the minimum amount of time while trying to spawn new mobs - see #1145.

  4. For enchanted items we have to find a way to only have data sent back and forth for items involved in actions - see #1144. I have no idea what the engine has in store for game developers, but this is the kind of thing that should be openly discussed with the Minetest developers, to find reliable ways to have and use customized items without killing the bandwidth.

The first thing that comes to mind is: what does the game send to the server and vice-versa? I don't have experience in building multiplayer games, but I think the data exchange for any items should be in the form of player_id, item_id, slot_id, action and target_id - just a few bytes. The attributes of each item are supposed to be on the server, and only changed through legitimate actions, to prevent cheating and needless client-server traffic other than rendering info. Something like this should be supported by the engine and implemented in games if we want proper multiplayer.


That's all I have for now. I'm glad that the performance is targeted for 0.72, and hopefully a few changes in the right places will improve the performance even without the need for engine changes. For the others, we should talk about them and have a clear plan, so we can take it to the Minetest developers.

I've been recently hit by a (literally) breaking bug as a combination of Minetest and wpasupplicant (wifi client in Linux). I [posted it in the Minetest forum](https://forum.minetest.net/viewtopic.php?f=6&t=26281) and then [GitHub](https://github.com/minetest/minetest/issues/10971), and I'll report it to the wpasupplicant package maintainers when I'm confident enough that it's actually wpasupplicant's fault and not mine for starting to use enchanted items around the time I updated that package. While investigating the problem *(and still looking into it)* I uncovered a number of issues in MineClone 2 as well, and I hope the engine allows for some of the changes required for optimizations. If anyone wants to help with testing performance-related issues, I highly recommend a slower computer because that's the best tool to easily notice what needs improvement. It also helps a lot to enable the "info" level of logging and have to ability to grep/parse through it from the terminal, considering the logging will become quite noisy. 1. ABMs can impact performance. I don't know how to do profiling on this but I want to make a Python script to scan through the game's files for `register_abm` occurences, and report their interval. It will be trickier with AMBs for mobs, at least, but I'll see about it when I get there. If those familiar with the code have a better idea about this, please share it. For now, I changed the water dripping interval from 2 to 4 seconds, just because they're purely decorative. I didn't notice an improvement so far, but once I can check and all the ABMs I might find something else that doesn't alter the gameplay. Hoppers also check for items every second, so while we can't tweak that, when players build farms and automation, having lots of them will surely impact the performance, like it does in Minecraft. A suggestion here would be to have a small paragraph about performance in the game's README.md. 2. The mobs need a [spawn mob cap](https://minecraft.gamepedia.com/Spawn#Java_Edition_Mob_Cap). This alone will contribute to better performance because currently we can end up with a large number of mobs, and along with other objects it can create a lot of lag, up to the point the game becomes unplayable or even crashes. 3. The game needs the ability to "freeze" mobs that are farther than 32m from a player. This is mentioned in the [despawning ranges](https://minecraft.gamepedia.com/Spawn#Despawning) of Minecraft, and it would be a nice performance win for us as well. They're only supposed to be active between 24-32 blocks around players. You can adjust the distances and check the log with my [MineClone 2 Spawn Distance Analysis](https://jsbin.com/hisijab) tool. 4. We need more efficient spawning conditionals, so that the game spends the minimum amount of time while trying to spawn new mobs - see #1145. 5. For enchanted items we have to find a way to only have data sent back and forth for items involved in actions - see #1144. I have no idea what the engine has in store for game developers, but this is the kind of thing that should be openly discussed with the Minetest developers, to find reliable ways to have and use customized items without killing the bandwidth. The first thing that comes to mind is: what does the game send to the server and vice-versa? I don't have experience in building multiplayer games, but I think the data exchange for any items should be in the form of player_id, item_id, slot_id, action and target_id - just a few bytes. The attributes of each item are supposed to be on the server, and only changed through legitimate actions, to prevent cheating and needless client-server traffic other than rendering info. Something like this should be supported by the engine and implemented in games if we want proper multiplayer. --- That's all I have for now. I'm glad that the performance is targeted for 0.72, and hopefully a few changes in the right places will improve the performance even without the need for engine changes. For the others, we should talk about them and have a clear plan, so we can take it to the Minetest developers.
5. Try out https://gist.github.com/anon55555/4dcaa39d19343c0f9f33ae3a245cfbd4
Author
Contributor

How?

How?

Usage is at line 39. As far as I can tell:
1 - compile the proxy c code.
2 - get server address and client address.
3 - run <proxy> <server address> <client address>
4 - open minetest and connect to client address.

I hope that helps.

EDIT: I forgot to backslash escape >.< sorry!

Usage is at line 39. As far as I can tell: 1 - compile the proxy c code. 2 - get server address and client address. 3 - run \<proxy\> \<server address\> \<client address\> 4 - open minetest and connect to client address. I hope that helps. EDIT: I forgot to backslash escape >.< sorry!

1 - compile the proxy c code.

Uhm no. The proxy is written in Go.

go get github.com/anon55555/mt

then download the proxy and use go run proxy.go ...

2 - get server address and client address.

"client address" is wrong, its the listen address, but i think you meant the correct thing

3 - run <proxy> <server address> <client address>

Its go run proxy.go dial:port listen:port

dial is the server address / port and listen is the the address / port that the proxy will open - then anybody can connect to this address / port

4 - open minetest and connect to client address.

client address listen address

> 1 - compile the proxy c code. Uhm no. The proxy is written in Go. `go get github.com/anon55555/mt` then download the proxy and use `go run proxy.go ...` > 2 - get server address and client address. "client address" is wrong, its the listen address, but i think you meant the correct thing > 3 - run \<proxy\> \<server address\> \<client address\> Its `go run proxy.go dial:port listen:port` dial is the server address / port and listen is the the address / port that the proxy will open - then anybody can connect to this address / port > 4 - open minetest and connect to client address. ~~client address~~ listen address

@EliasFleckenstein03 Thanks.

@kneekoo unrelated to mineclone2, but I've found that increasing "unload unused server data" can help with entity lag. I tested my changes by driving a boat around in circles:
10 - boats were pretty much unusable.
29 (default) - visible stutter.
60 - minimal stutter.

Tested on a Raspberry Pi 3.

EDIT: related issue:
https://github.com/minetest/minetest/issues/10985

EDIT2: It seems that ABM budget is important too, probably more so than unused server data. ( forgot I changed it until after running into MineClone2/MineClone2#1432 (minetest.conf bug)) I think we should consider overriding the default ABM budget.

@EliasFleckenstein03 Thanks. @kneekoo unrelated to mineclone2, but I've found that increasing "unload unused server data" can help with entity lag. I tested my changes by driving a boat around in circles: 10 - boats were pretty much unusable. 29 (default) - visible stutter. 60 - minimal stutter. Tested on a Raspberry Pi 3. EDIT: related issue: https://github.com/minetest/minetest/issues/10985 EDIT2: It seems that ABM budget is important too, probably more so than unused server data. ( forgot I changed it until after running into https://git.minetest.land/MineClone2/MineClone2/issues/1432 (minetest.conf bug)) I think we should consider overriding the default ABM budget.
LizzyFleckenstein03 added the
performance
label 2021-02-22 10:59:30 +01:00
Author
Contributor

Interesting, I only tried it on my Pi 4. :) I have both 3B and 3B+, so I might give it a spin. :D But it looks like it requires more RAM:

Unload unused server data server_unload_unused_data_timeout (int default 29)
How much the server will wait before unloading unused mapblocks.
Higher value is smoother, but will use more RAM.

My Pi 4 server has 2GB RAM, so it should be fine. I wonder why it would help, considering I get lag even when both me and my friend are stationary (within 10 blocks) for long periods of time, and /clearobjects helps.

Interesting, I only tried it on my Pi 4. :) I have both 3B and 3B+, so I might give it a spin. :D But it looks like it requires more RAM: > Unload unused server data server_unload_unused_data_timeout (int default 29) > How much the server will wait before unloading unused mapblocks. > Higher value is smoother, but will use more RAM. My Pi 4 server has 2GB RAM, so it should be fine. I wonder why it would help, considering I get lag even when both me and my friend are stationary (within 10 blocks) for long periods of time, and /clearobjects helps.
Author
Contributor
nicu@nas:~/Programare/Go$ go run minetest-proxy.go 192.168.2.137:30000 localhost:30000
# github.com/anon55555/mt/rudp
../../go/src/github.com/anon55555/mt/rudp/listen.go:65:17: undefined: net.ErrClosed
../../go/src/github.com/anon55555/mt/rudp/net.go:9:17: undefined: net.ErrClosed
../../go/src/github.com/anon55555/mt/rudp/net.go:29:22: undefined: net.ErrClosed
../../go/src/github.com/anon55555/mt/rudp/peer.go:95:19: undefined: net.ErrClosed
../../go/src/github.com/anon55555/mt/rudp/peer.go:111:10: undefined: net.ErrClosed
../../go/src/github.com/anon55555/mt/rudp/process.go:108:28: c.ackchans.LoadAndDelete undefined (type sync.Map has no field or method LoadAndDelete)
../../go/src/github.com/anon55555/mt/rudp/send.go:129:15: undefined: net.ErrClosed
../../go/src/github.com/anon55555/mt/rudp/send.go:159:8: p.ping.Reset undefined (type *time.Ticker has no field or method Reset)

The same happened when I tried 192.168.2.122:30000 as proxy. It looks like it's missing some headers/modules/libraries/etc.

``` nicu@nas:~/Programare/Go$ go run minetest-proxy.go 192.168.2.137:30000 localhost:30000 # github.com/anon55555/mt/rudp ../../go/src/github.com/anon55555/mt/rudp/listen.go:65:17: undefined: net.ErrClosed ../../go/src/github.com/anon55555/mt/rudp/net.go:9:17: undefined: net.ErrClosed ../../go/src/github.com/anon55555/mt/rudp/net.go:29:22: undefined: net.ErrClosed ../../go/src/github.com/anon55555/mt/rudp/peer.go:95:19: undefined: net.ErrClosed ../../go/src/github.com/anon55555/mt/rudp/peer.go:111:10: undefined: net.ErrClosed ../../go/src/github.com/anon55555/mt/rudp/process.go:108:28: c.ackchans.LoadAndDelete undefined (type sync.Map has no field or method LoadAndDelete) ../../go/src/github.com/anon55555/mt/rudp/send.go:129:15: undefined: net.ErrClosed ../../go/src/github.com/anon55555/mt/rudp/send.go:159:8: p.ping.Reset undefined (type *time.Ticker has no field or method Reset) ``` The same happened when I tried `192.168.2.122:30000` as proxy. It looks like it's missing some headers/modules/libraries/etc.

No, your Go version is too old. You need Go 1.16. You can use sudo snap install go --channel 1.16/stable to get the lastest version.

No, your Go version is too old. You need Go 1.16. You can use `sudo snap install go --channel 1.16/stable` to get the lastest version.
Author
Contributor

Bummer... I don't want to install snap for a test. Maybe I'll give it a shot in Ubuntu 20.10 in a VM.

Bummer... I don't want to install snap for a test. Maybe I'll give it a shot in Ubuntu 20.10 in a VM.

Nah, you can also get binaries directly from golang.org.

Nah, you can also get binaries directly from golang.org.
Author
Contributor

Ok, that was easy. Now I got this:

nicu@nas:~/Programare/Go$ go get github.com/anon55555/mt
go: downloading github.com/anon55555/mt v0.0.0-20210220163106-8b61ee961a91

nicu@nas:~/Programare/Go$ go run minetest-proxy.go 192.168.2.137:30000 192.168.2.122:30000
minetest-proxy.go:34:2: no required module provides package github.com/anon55555/mt/rudp: working directory is not part of a module
Ok, that was easy. Now I got this: ``` nicu@nas:~/Programare/Go$ go get github.com/anon55555/mt go: downloading github.com/anon55555/mt v0.0.0-20210220163106-8b61ee961a91 nicu@nas:~/Programare/Go$ go run minetest-proxy.go 192.168.2.137:30000 192.168.2.122:30000 minetest-proxy.go:34:2: no required module provides package github.com/anon55555/mt/rudp: working directory is not part of a module ```
LizzyFleckenstein03 added this to the Mobs migration project 2021-02-23 08:26:56 +01:00
LizzyFleckenstein03 added this to the 0.72.0 milestone 2021-02-23 08:32:38 +01:00
Author
Contributor

@EliasFleckenstein03 @ryvnf Take a look at this comment in the Minetest GitHub.

What do you think about it?

@EliasFleckenstein03 @ryvnf Take a look at [this comment](https://github.com/minetest/minetest/issues/10971#issuecomment-802387358) in the Minetest GitHub. What do you think about it?

I think the particle commands are because of coordinate leak protection or something.

I think the particle commands are because of coordinate leak protection or something.
Contributor

i'm not a python expert but I think I can write very basic script to get started:

collect_abm_intervals.py:

import re
from pathlib import Path

p = re.compile(r'interval[\s\t]*\=[\s\t]([\d\.]+)', re.DOTALL)

data=[]

for path in Path('../mods').rglob('*.lua'):
	with open(path, 'r') as file:
		match = re.search(p, Path(path).read_text())
		if hasattr(match, 'group'):
			data.append([float(match.group(1)), path])

data = sorted(data)

for i in range(len(data)):
	print(data[i])

I've placed it in MineClone2/tools and that's why all paths are relative (e.g. ../mods) and the result is:

[0.1, WindowsPath('../mods/ITEMS/mcl_portals/portal_end.lua')]
[0.25, WindowsPath('../mods/ITEMS/mcl_tools/init.lua')]
[0.5, WindowsPath('../mods/ENTITIES/mobs_mc/ender_dragon.lua')]
[0.5, WindowsPath('../mods/ENTITIES/mobs_mc/shulker.lua')]
[0.5, WindowsPath('../mods/ENTITIES/mobs_mc/wither.lua')]
[0.5, WindowsPath('../mods/ITEMS/mcl_cauldrons/init.lua')]
[1.0, WindowsPath('../mods/CORE/mcl_explosions/init.lua')]
[1.0, WindowsPath('../mods/ENTITIES/mcl_mobs/api.lua')]
[1.0, WindowsPath('../mods/ENTITIES/mcl_mobs/mount.lua')]
[1.0, WindowsPath('../mods/ENTITIES/mobs_mc/2_throwing.lua')]
[1.0, WindowsPath('../mods/ENTITIES/mobs_mc/snowman.lua')]
[1.0, WindowsPath('../mods/ENTITIES/mobs_mc/vex.lua')]
[1.0, WindowsPath('../mods/HELP/mcl_tt/snippets_base.lua')]
[1.0, WindowsPath('../mods/ITEMS/mcl_colorblocks/init.lua')]
[1.0, WindowsPath('../mods/ITEMS/mcl_core/functions.lua')]
[1.0, WindowsPath('../mods/ITEMS/mcl_enchanting/init.lua')]
[1.0, WindowsPath('../mods/ITEMS/mcl_farming/hoes.lua')]
[1.0, WindowsPath('../mods/ITEMS/mcl_hoppers/init.lua')]
[1.0, WindowsPath('../mods/ITEMS/mcl_portals/portal_nether.lua')]
[1.0, WindowsPath('../mods/ITEMS/mcl_potions/init.lua')]
[1.0, WindowsPath('../mods/ITEMS/mcl_sponges/init.lua')]
[1.0, WindowsPath('../mods/ITEMS/mcl_throwing/init.lua')]
[1.0, WindowsPath('../mods/ITEMS/REDSTONE/mcl_comparators/init.lua')]
[1.0, WindowsPath('../mods/ITEMS/REDSTONE/mcl_observers/init.lua')]
[1.0, WindowsPath('../mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua')]
[2.0, WindowsPath('../mods/ENTITIES/drippingwater/init.lua')]
[2.0, WindowsPath('../mods/ENTITIES/mobs_mc/skeleton+stray.lua')]
[2.0, WindowsPath('../mods/ENVIRONMENT/mcl_weather/rain.lua')]
[2.5, WindowsPath('../mods/ENTITIES/mobs_mc/villager_illusioner.lua')]
[2.5, WindowsPath('../mods/ENTITIES/mobs_mc/witch.lua')]
[3.0, WindowsPath('../mods/ITEMS/mcl_fire/init.lua')]
[3.5, WindowsPath('../mods/ENTITIES/mobs_mc/blaze.lua')]
[3.5, WindowsPath('../mods/ENTITIES/mobs_mc/ghast.lua')]
[4.0, WindowsPath('../mods/ENTITIES/mobs_mc/3_shared.lua')]
[5.0, WindowsPath('../mods/ENVIRONMENT/mcl_weather/weather_core.lua')]
[8.0, WindowsPath('../mods/ITEMS/mcl_core/nodes_liquid.lua')]
[11.0, WindowsPath('../mods/ITEMS/mcl_mushrooms/small.lua')]
[12.0, WindowsPath('../mods/ITEMS/mcl_flowers/init.lua')]
[15.0, WindowsPath('../mods/ENTITIES/mobs_mc/villager_evoker.lua')]
[15.0, WindowsPath('../mods/ENVIRONMENT/mcl_weather/skycolor.lua')]
[15.0, WindowsPath('../mods/ITEMS/mcl_farming/soil.lua')]
[17.0, WindowsPath('../mods/ITEMS/mcl_ocean/corals.lua')]
[17.0, WindowsPath('../mods/ITEMS/mcl_ocean/sea_pickle.lua')]
[30.0, WindowsPath('../mods/PLAYER/mcl_spawn/init.lua')]
[35.0, WindowsPath('../mods/ITEMS/mcl_end/chorus_plant.lua')]
[35.0, WindowsPath('../mods/ITEMS/mcl_nether/nether_wart.lua')]
[45.0, WindowsPath('../mods/ITEMS/mcl_ocean/kelp.lua')]
[50.0, WindowsPath('../mods/ITEMS/mcl_cocoas/init.lua')]

I don't think it's all and I don't think the script catches all of them, but here is some info and some script.
I think the idea is right.

i'm not a python expert but I think I can write very basic script to get started: __collect_abm_intervals.py__: ```python import re from pathlib import Path p = re.compile(r'interval[\s\t]*\=[\s\t]([\d\.]+)', re.DOTALL) data=[] for path in Path('../mods').rglob('*.lua'): with open(path, 'r') as file: match = re.search(p, Path(path).read_text()) if hasattr(match, 'group'): data.append([float(match.group(1)), path]) data = sorted(data) for i in range(len(data)): print(data[i]) ``` I've placed it in MineClone2/tools and that's why all paths are relative (e.g. ../mods) and the result is: ``` [0.1, WindowsPath('../mods/ITEMS/mcl_portals/portal_end.lua')] [0.25, WindowsPath('../mods/ITEMS/mcl_tools/init.lua')] [0.5, WindowsPath('../mods/ENTITIES/mobs_mc/ender_dragon.lua')] [0.5, WindowsPath('../mods/ENTITIES/mobs_mc/shulker.lua')] [0.5, WindowsPath('../mods/ENTITIES/mobs_mc/wither.lua')] [0.5, WindowsPath('../mods/ITEMS/mcl_cauldrons/init.lua')] [1.0, WindowsPath('../mods/CORE/mcl_explosions/init.lua')] [1.0, WindowsPath('../mods/ENTITIES/mcl_mobs/api.lua')] [1.0, WindowsPath('../mods/ENTITIES/mcl_mobs/mount.lua')] [1.0, WindowsPath('../mods/ENTITIES/mobs_mc/2_throwing.lua')] [1.0, WindowsPath('../mods/ENTITIES/mobs_mc/snowman.lua')] [1.0, WindowsPath('../mods/ENTITIES/mobs_mc/vex.lua')] [1.0, WindowsPath('../mods/HELP/mcl_tt/snippets_base.lua')] [1.0, WindowsPath('../mods/ITEMS/mcl_colorblocks/init.lua')] [1.0, WindowsPath('../mods/ITEMS/mcl_core/functions.lua')] [1.0, WindowsPath('../mods/ITEMS/mcl_enchanting/init.lua')] [1.0, WindowsPath('../mods/ITEMS/mcl_farming/hoes.lua')] [1.0, WindowsPath('../mods/ITEMS/mcl_hoppers/init.lua')] [1.0, WindowsPath('../mods/ITEMS/mcl_portals/portal_nether.lua')] [1.0, WindowsPath('../mods/ITEMS/mcl_potions/init.lua')] [1.0, WindowsPath('../mods/ITEMS/mcl_sponges/init.lua')] [1.0, WindowsPath('../mods/ITEMS/mcl_throwing/init.lua')] [1.0, WindowsPath('../mods/ITEMS/REDSTONE/mcl_comparators/init.lua')] [1.0, WindowsPath('../mods/ITEMS/REDSTONE/mcl_observers/init.lua')] [1.0, WindowsPath('../mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua')] [2.0, WindowsPath('../mods/ENTITIES/drippingwater/init.lua')] [2.0, WindowsPath('../mods/ENTITIES/mobs_mc/skeleton+stray.lua')] [2.0, WindowsPath('../mods/ENVIRONMENT/mcl_weather/rain.lua')] [2.5, WindowsPath('../mods/ENTITIES/mobs_mc/villager_illusioner.lua')] [2.5, WindowsPath('../mods/ENTITIES/mobs_mc/witch.lua')] [3.0, WindowsPath('../mods/ITEMS/mcl_fire/init.lua')] [3.5, WindowsPath('../mods/ENTITIES/mobs_mc/blaze.lua')] [3.5, WindowsPath('../mods/ENTITIES/mobs_mc/ghast.lua')] [4.0, WindowsPath('../mods/ENTITIES/mobs_mc/3_shared.lua')] [5.0, WindowsPath('../mods/ENVIRONMENT/mcl_weather/weather_core.lua')] [8.0, WindowsPath('../mods/ITEMS/mcl_core/nodes_liquid.lua')] [11.0, WindowsPath('../mods/ITEMS/mcl_mushrooms/small.lua')] [12.0, WindowsPath('../mods/ITEMS/mcl_flowers/init.lua')] [15.0, WindowsPath('../mods/ENTITIES/mobs_mc/villager_evoker.lua')] [15.0, WindowsPath('../mods/ENVIRONMENT/mcl_weather/skycolor.lua')] [15.0, WindowsPath('../mods/ITEMS/mcl_farming/soil.lua')] [17.0, WindowsPath('../mods/ITEMS/mcl_ocean/corals.lua')] [17.0, WindowsPath('../mods/ITEMS/mcl_ocean/sea_pickle.lua')] [30.0, WindowsPath('../mods/PLAYER/mcl_spawn/init.lua')] [35.0, WindowsPath('../mods/ITEMS/mcl_end/chorus_plant.lua')] [35.0, WindowsPath('../mods/ITEMS/mcl_nether/nether_wart.lua')] [45.0, WindowsPath('../mods/ITEMS/mcl_ocean/kelp.lua')] [50.0, WindowsPath('../mods/ITEMS/mcl_cocoas/init.lua')] ``` I don't think it's all and I don't think the script catches all of them, but here is some info and some script. I think the idea is right.
Author
Contributor

@EliasFleckenstein03 Here's a thought about item metadata. What if enchanted items get an ID? Their attributes would be stored on both the server and the client, and only send the ID between the client-server.

Of course, on adding/removing enchantments, the item gets synced on the server, and if the item is destroyed, it gets removed from both client and server - all based on ID. This would be much more efficient if possible.

@EliasFleckenstein03 Here's a thought about item metadata. What if enchanted items get an ID? Their attributes would be stored on both the server and the client, and only send the ID between the client-server. Of course, on adding/removing enchantments, the item gets synced on the server, and if the item is destroyed, it gets removed from both client and server - all based on ID. This would be much more efficient if possible.

Maybe, but what if the server installs a mod that adds an enchantment and removes another mod that added an enchantment? Ids are a double-edged sword. Also, backwards compatibility. What do we do about old ItemStacks? I'm against this.

Maybe, but what if the server installs a mod that adds an enchantment and removes another mod that added an enchantment? Ids are a double-edged sword. Also, backwards compatibility. What do we do about old ItemStacks? I'm against this.
Member

@EliasFleckenstein03 Here's a thought about item metadata. What if enchanted items get an ID? Their attributes would be stored on both the server and the client, and only send the ID between the client-server.

mc is a mess with content IDs, I dont think we should recreate this limitation xD

> @EliasFleckenstein03 Here's a thought about item metadata. What if enchanted items get an ID? Their attributes would be stored on both the server and the client, and only send the ID between the client-server. mc is a mess with content IDs, I dont think we should recreate this limitation xD
Author
Contributor

Maybe, but what if the server installs a mod that adds an enchantment and removes another mod that added an enchantment? Ids are a double-edged sword. Also, backwards compatibility. What do we do about old ItemStacks? I'm against this.

Wait, I'm not sure we're clear on this. The items keep the same data structure on both the server and client. It's just that the client-server would pass the item IDs between them when we use the items, instead of the sending the whole metadata. And whenever an item's properties gets updated, it would have to be replicated on the other side - this prevents inconsistencies.

I'm not sure what you mean by old ItemStacks, considering enchanted items are not supposed to stack. Do you mean stacks that were possible in the development release that I tested and got me high RAM usage?

> Maybe, but what if the server installs a mod that adds an enchantment and removes another mod that added an enchantment? Ids are a double-edged sword. Also, backwards compatibility. What do we do about old ItemStacks? I'm against this. Wait, I'm not sure we're clear on this. The items keep the same data structure on both the server and client. It's just that the client-server would pass the item IDs between them when we use the items, instead of the sending the whole metadata. And whenever an item's properties gets updated, it would have to be replicated on the other side - this prevents inconsistencies. I'm not sure what you mean by old ItemStacks, considering enchanted items are not supposed to stack. Do you mean stacks that were possible in the development release that I tested and got me high RAM usage?
cora removed this from the 0.72.0 milestone 2022-02-15 05:46:10 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#1154
No description provided.