HUD/mcl_hbarmor: Armor bar is hidden and unhidden in global step, causing server to send useless HUDUPDATE packets #111

Closed
opened 2021-07-11 01:01:11 +02:00 by erle · 17 comments
Owner
What happened?

When the automatic hiding of the armor bar is enabled, it is is hidden or unhidden in each game tick, even if it was already hidden or unhidden.

This causes a ridiculous amount of unnecesary HUDUPDATE packets sent from the server to the client.

What did I expect?

I expected the armor bar to be only hidden or unhidden if the players armor state changed.

How to get it to happen
  1. In Minetest with Mineclonia commit 9f086a9242 create a new world with the singlenode mapgen.
  2. Exit Minetest.
  3. In Bourne shell, start Minetest with the command minetest --verbose 2>&1 >/dev/null |grep TOCLIENT_HUDCHANGE.
  4. Enter the new world in Mineclonia commit 9f086a9242.
  5. Wait about 30 seconds.
  6. Verify that a line is printed that ends with cmd 75 (TOCLIENT_HUDCHANGE) count and a number.
  7. Exit Mineclonia.
  8. In mods/HUD/mcl_hbarbor/init.lua, change the line mcl_hbarmor.autohide = true to mcl_hbarmor.autohide = false.
  9. Enter the new world in Mineclonia commit 9f086a9242 with the change from step 8.
  10. Wait about 30 seconds.
  11. Verify that a line is printed that ends with cmd 75 (TOCLIENT_HUDCHANGE) count and a number.
  12. Verify that the number seen in step 6 is higher than the number seen in step 11 by about several hundred. Post both numbers when verifying the bug.
Environment

Mineclonia Version: 9f086a9242

Minetest Version: some 5.5-dev (this likely does not matter)

##### What happened? When the automatic hiding of the armor bar is enabled, it is is hidden or unhidden in each game tick, even if it was already hidden or unhidden. This causes a ridiculous amount of unnecesary HUDUPDATE packets sent from the server to the client. ##### What did I expect? I expected the armor bar to be only hidden or unhidden if the players armor state changed. ##### How to get it to happen 1. In Minetest with Mineclonia commit 9f086a9242292be1044ee128ff9d54ce2fad3c07 create a new world with the singlenode mapgen. 2. Exit Minetest. 3. In Bourne shell, start Minetest with the command `minetest --verbose 2>&1 >/dev/null |grep TOCLIENT_HUDCHANGE`. 4. Enter the new world in Mineclonia commit 9f086a9242292be1044ee128ff9d54ce2fad3c07. 5. Wait about 30 seconds. 6. Verify that a line is printed that ends with `cmd 75 (TOCLIENT_HUDCHANGE) count ` and a number. 7. Exit Mineclonia. 8. In `mods/HUD/mcl_hbarbor/init.lua`, change the line `mcl_hbarmor.autohide = true` to `mcl_hbarmor.autohide = false`. 9. Enter the new world in Mineclonia commit 9f086a9242292be1044ee128ff9d54ce2fad3c07 with the change from step 8. 10. Wait about 30 seconds. 11. Verify that a line is printed that ends with `cmd 75 (TOCLIENT_HUDCHANGE) count ` and a number. 12. Verify that the number seen in step 6 is higher than the number seen in step 11 by about several hundred. Post both numbers when verifying the bug. ##### Environment Mineclonia Version: 9f086a9242292be1044ee128ff9d54ce2fad3c07 Minetest Version: some 5.5-dev (this likely does not matter)
erle added the
bug
unconfirmed
labels 2021-07-11 01:01:11 +02:00
Author
Owner

This code from HUD/mcl_hbarmor/init.lua hides or unhides the armor bar:

-- update hud elemtens if value has changed
local function update_hud(player)
	local name = player:get_player_name()
	--armor
	local arm = tonumber(mcl_hbarmor.armor[name])
	if not arm then
		arm = 0
		mcl_hbarmor.armor[name] = 0
	end
	if mcl_hbarmor.autohide then
		-- hide armor bar completely when there is none
		if must_hide(name, arm) then
			hb.hide_hudbar(player, "armor")
		else
			hb.change_hudbar(player, "armor", arm_printable(arm))
			hb.unhide_hudbar(player, "armor")
		end
	else
		hb.change_hudbar(player, "armor", arm_printable(arm))
	end
end
This code from `HUD/mcl_hbarmor/init.lua` hides or unhides the armor bar: ``` -- update hud elemtens if value has changed local function update_hud(player) local name = player:get_player_name() --armor local arm = tonumber(mcl_hbarmor.armor[name]) if not arm then arm = 0 mcl_hbarmor.armor[name] = 0 end if mcl_hbarmor.autohide then -- hide armor bar completely when there is none if must_hide(name, arm) then hb.hide_hudbar(player, "armor") else hb.change_hudbar(player, "armor", arm_printable(arm)) hb.unhide_hudbar(player, "armor") end else hb.change_hudbar(player, "armor", arm_printable(arm)) end end ```
Author
Owner

If I am right about this causing HUDUPDATE packet spam, setting mcl_hbarmor.autohide to something falsy should drastically reduce the rate of packets sent.

If I am right about this causing HUDUPDATE packet spam, setting `mcl_hbarmor.autohide` to something falsy should drastically reduce the rate of packets sent.
erle changed title from HUD/mcl_hbarmor: Armor bar is hidden and unhidden in global step, causing HUDUPDATE packet spam to HUD/mcl_hbarmor: Armor bar is hidden and unhidden in global step, causing server to send useless HUDUPDATE packets 2021-07-11 04:53:20 +02:00
Author
Owner

Packet count for step 6 (mcl_hbarmor.autohide = true): 1845

Packet count for step 11 (mcl_hbarmor.autohide = false): 1500

The packet count is for 30 seconds.

Edit: The difference is 345 packets in 30 s or 11.5 packets/s.

Packet count for step 6 (`mcl_hbarmor.autohide = true`): 1845 Packet count for step 11 (`mcl_hbarmor.autohide = false`): 1500 The packet count is for 30 seconds. **Edit:** The difference is 345 packets in 30 s or 11.5 packets/s.
Member

i can't really confirm this:

with autohide=true

2021-07-11 05:18:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1565
2021-07-11 05:19:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1743
2021-07-11 05:19:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2086

with autohide=false:

2021-07-11 05:23:10: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1376
2021-07-11 05:23:40: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1500
2021-07-11 05:24:10: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1495

i mean theres no question we got a hudchange problem but this doesnt seem to be it.

EDIT:
I'm getting a larger sample.

i can't really confirm this: with autohide=true ``` 2021-07-11 05:18:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1565 2021-07-11 05:19:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1743 2021-07-11 05:19:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2086 ``` with autohide=false: ``` 2021-07-11 05:23:10: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1376 2021-07-11 05:23:40: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1500 2021-07-11 05:24:10: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1495 ``` i mean theres no question we got a hudchange problem but this doesnt seem to be it. EDIT: I'm getting a larger sample.
Member

Ok so maybe there is something to it:
Samplesize 10 for

autohide=true:
2021-07-11 05:35:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1943
2021-07-11 05:36:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2079
2021-07-11 05:36:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2142
2021-07-11 05:37:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2149
2021-07-11 05:37:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2142
2021-07-11 05:38:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2156
2021-07-11 05:38:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2142
2021-07-11 05:39:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2156
2021-07-11 05:39:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2128
2021-07-11 05:40:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2093

Median: 2142

autohide=false
2021-07-11 05:28:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1401
2021-07-11 05:29:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1505
2021-07-11 05:29:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1530
2021-07-11 05:30:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1540
2021-07-11 05:30:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1530
2021-07-11 05:31:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1535
2021-07-11 05:31:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1535
2021-07-11 05:32:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1535
2021-07-11 05:32:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1535
2021-07-11 05:33:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1485

Median: 1530

Ok so maybe there *is* something to it: Samplesize 10 for ##### autohide=true: ``` 2021-07-11 05:35:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1943 2021-07-11 05:36:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2079 2021-07-11 05:36:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2142 2021-07-11 05:37:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2149 2021-07-11 05:37:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2142 2021-07-11 05:38:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2156 2021-07-11 05:38:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2142 2021-07-11 05:39:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2156 2021-07-11 05:39:48: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2128 2021-07-11 05:40:18: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 2093 ``` Median: 2142 ##### autohide=false ``` 2021-07-11 05:28:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1401 2021-07-11 05:29:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1505 2021-07-11 05:29:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1530 2021-07-11 05:30:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1540 2021-07-11 05:30:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1530 2021-07-11 05:31:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1535 2021-07-11 05:31:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1535 2021-07-11 05:32:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1535 2021-07-11 05:32:56: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1535 2021-07-11 05:33:26: INFO[Main]: cmd 75 (TOCLIENT_HUDCHANGE) count 1485 ``` Median: 1530
Author
Owner

If the difference @cora determined is even remotely accurate, the needless armor bar hiding and unhiding accounts for a full quarter of the HUDCHANGE spam.

I would expect 2 or 3 other interface elements to be implemented in a similar broken way.

If the difference @cora determined is even remotely accurate, the needless armor bar hiding and unhiding accounts for a full quarter of the HUDCHANGE spam. I would expect 2 or 3 other interface elements to be implemented in a similar broken way.
cora added
confirmed
and removed
unconfirmed
labels 2021-07-11 17:27:20 +02:00
Author
Owner

I think this should just be turned off, with a TODO comment added to it.

I think this should just be turned off, with a TODO comment added to it.

I would expect 2 or 3 other interface elements to be implemented in a similar broken way.

Almost all the other HUDCHANGE spam is from the health and breath statbars.

> I would expect 2 or 3 other interface elements to be implemented in a similar broken way. Almost all the other HUDCHANGE spam is from the health and breath statbars.

Could HUDCHANGE spam be fixed by wrapping the hud API with something that doesn't call hud_change when a hud field isn't actually changed?

Could HUDCHANGE spam be fixed by wrapping the hud API with something that doesn't call hud_change when a hud field isn't actually changed?
Author
Owner

Could HUDCHANGE spam be fixed by wrapping the hud API with something that doesn't call hud_change when a hud field isn't actually changed?

@anon5 I think the hud bars mod actually should do that, but it does not.

However, I also think that fixing the problem at the source is preferable.

> Could HUDCHANGE spam be fixed by wrapping the hud API with something that doesn't call hud_change when a hud field isn't actually changed? @anon5 I think the hud bars mod actually should do that, but it does not. However, I also think that fixing the problem at the source is preferable.
Author
Owner

I made a shell script I called analyze-packet-spam:

#!/bin/sh -eu
# This script takes a minetest log with at least INFO log level and
# outputs the MINETEST network protocol packet count per second.
#
# To collect such a log file of minetest running for 10 minutes, run:
# timeout 600 minetest --info >log.txt 2>&1 >/dev/null
#
# To get packet counts from that file, run:
# ./analyze-packet-spam <log.txt

TEMPFILE=$(mktemp /tmp/minetest.analyze-packet-spam.XXXXXXXX)

grep -F 'INFO[Main]: cmd' \
 |while read DATE TIME _ _ PACKET_ID PACKET_NAME _ PACKET_COUNT; do
  TIMESTAMP=$(date +%s --date "${DATE} ${TIME%:}")
  PACKET_NAME=${PACKET_NAME#(}
  PACKET_NAME=${PACKET_NAME%)}
  VARIABLE=PACKET_COUNT_"${PACKET_NAME}"
  eval "$( echo $VARIABLE=\$\(\( \${$VARIABLE:-0} + ${PACKET_COUNT} \)\) )"
  printf '%s ' \
   "${TIMESTAMP}" \
   "${VARIABLE}"
  eval echo \$${VARIABLE}
done >"${TEMPFILE}"

TIMESTAMP_START=$( <"${TEMPFILE}" head -n1 |cut -d' ' -f1 )
TIMESTAMP_END=$( <"${TEMPFILE}" tail -n1 |cut -d' ' -f1 )
DURATION=$(( 30 + ${TIMESTAMP_END} - ${TIMESTAMP_START} ))

PACKET_NAME_SEEN=''
<"${TEMPFILE}" tac \
 |while read _ PACKET_NAME PACKET_COUNT; do
  case "${PACKET_NAME_SEEN}" in
   *"${PACKET_NAME}"*)
   ;;
   *)
    PACKET_COUNT_PER_SECOND=$(
     printf '1k %s %s /p' "${PACKET_COUNT}" "${DURATION}" \
      |dc
    )
    printf '%s\t%s\n' "${PACKET_COUNT_PER_SECOND}" "${PACKET_NAME}"
    PACKET_NAME_SEEN="${PACKET_NAME_SEEN} ${PACKET_NAME}"
   ;;
  esac
 done

unlink "${TEMPFILE}"

Playing Mineclonia for 10 minutes with armor bar autohiding turned on yielded this:

0	PACKET_COUNT_TOCLIENT_SET_STARS
0	PACKET_COUNT_TOCLIENT_SET_MOON
0	PACKET_COUNT_TOCLIENT_SET_SUN
.1	PACKET_COUNT_TOCLIENT_NODEMETA_CHANGED
0	PACKET_COUNT_TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO
0	PACKET_COUNT_TOCLIENT_SET_SKY
.1	PACKET_COUNT_TOCLIENT_BREATH
37.8	PACKET_COUNT_TOCLIENT_HUD_SET_FLAGS
58.0	PACKET_COUNT_TOCLIENT_HUDCHANGE
.2	PACKET_COUNT_TOCLIENT_ADD_PARTICLESPAWNER
0	PACKET_COUNT_TOCLIENT_SHOW_FORMSPEC
.3	PACKET_COUNT_TOCLIENT_PLAY_SOUND
66.3	PACKET_COUNT_TOCLIENT_ACTIVE_OBJECT_MESSAGES
2.3	PACKET_COUNT_TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD
.1	PACKET_COUNT_TOCLIENT_TIME_OF_DAY
.8	PACKET_COUNT_TOCLIENT_INVENTORY
.4	PACKET_COUNT_TOCLIENT_REMOVENODE
.2	PACKET_COUNT_TOCLIENT_ADDNODE
6.1	PACKET_COUNT_TOCLIENT_BLOCKDATA
0	PACKET_COUNT_TOCLIENT_INVENTORY_FORMSPEC
0	PACKET_COUNT_TOCLIENT_HUDRM
0	PACKET_COUNT_TOCLIENT_HUDADD
0	PACKET_COUNT_TOCLIENT_CHAT_MESSAGE
0	PACKET_COUNT_TOCLIENT_FORMSPEC_PREPEND
0	PACKET_COUNT_TOCLIENT_UPDATE_PLAYER_LIST
0	PACKET_COUNT_TOCLIENT_CLOUD_PARAMS
0	PACKET_COUNT_TOCLIENT_HUD_SET_PARAM
0	PACKET_COUNT_TOCLIENT_MOVEMENT
0	PACKET_COUNT_TOCLIENT_DETACHED_INVENTORY
0	PACKET_COUNT_TOCLIENT_PRIVILEGES
0	PACKET_COUNT_TOCLIENT_ITEMDEF
0	PACKET_COUNT_TOCLIENT_ANNOUNCE_MEDIA
0	PACKET_COUNT_TOCLIENT_NODEDEF
0	PACKET_COUNT_TOCLIENT_FOV
0	PACKET_COUNT_TOCLIENT_MOVE_PLAYER
0	PACKET_COUNT_TOCLIENT_HP
0	PACKET_COUNT_TOCLIENT_CSM_RESTRICTION_FLAGS
0	PACKET_COUNT_TOCLIENT_AUTH_ACCEPT
0	PACKET_COUNT_TOCLIENT_HELLO

Playing Mineclonia for 10 minutes with armor bar autohiding turned off yielded this:

0	PACKET_COUNT_TOCLIENT_SET_STARS
0	PACKET_COUNT_TOCLIENT_SET_MOON
0	PACKET_COUNT_TOCLIENT_SET_SUN
.1	PACKET_COUNT_TOCLIENT_NODEMETA_CHANGED
0	PACKET_COUNT_TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO
0	PACKET_COUNT_TOCLIENT_SET_SKY
0	PACKET_COUNT_TOCLIENT_BREATH
39.3	PACKET_COUNT_TOCLIENT_HUD_SET_FLAGS
44.1	PACKET_COUNT_TOCLIENT_HUDCHANGE
.2	PACKET_COUNT_TOCLIENT_ADD_PARTICLESPAWNER
.2	PACKET_COUNT_TOCLIENT_PLAY_SOUND
67.7	PACKET_COUNT_TOCLIENT_ACTIVE_OBJECT_MESSAGES
2.0	PACKET_COUNT_TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD
.2	PACKET_COUNT_TOCLIENT_TIME_OF_DAY
.6	PACKET_COUNT_TOCLIENT_INVENTORY
.3	PACKET_COUNT_TOCLIENT_REMOVENODE
.1	PACKET_COUNT_TOCLIENT_ADDNODE
3.6	PACKET_COUNT_TOCLIENT_BLOCKDATA
0	PACKET_COUNT_TOCLIENT_INVENTORY_FORMSPEC
0	PACKET_COUNT_TOCLIENT_SHOW_FORMSPEC
0	PACKET_COUNT_TOCLIENT_FORMSPEC_PREPEND
0	PACKET_COUNT_TOCLIENT_SRP_BYTES_S_B
0	PACKET_COUNT_TOCLIENT_UPDATE_PLAYER_LIST
0	PACKET_COUNT_TOCLIENT_CLOUD_PARAMS
0	PACKET_COUNT_TOCLIENT_HUD_SET_PARAM
0	PACKET_COUNT_TOCLIENT_HUDADD
0	PACKET_COUNT_TOCLIENT_MOVEMENT
0	PACKET_COUNT_TOCLIENT_DETACHED_INVENTORY
0	PACKET_COUNT_TOCLIENT_PRIVILEGES
0	PACKET_COUNT_TOCLIENT_ITEMDEF
0	PACKET_COUNT_TOCLIENT_ANNOUNCE_MEDIA
0	PACKET_COUNT_TOCLIENT_NODEDEF
0	PACKET_COUNT_TOCLIENT_FOV
0	PACKET_COUNT_TOCLIENT_MOVE_PLAYER
0	PACKET_COUNT_TOCLIENT_HP
0	PACKET_COUNT_TOCLIENT_CSM_RESTRICTION_FLAGS
0	PACKET_COUNT_TOCLIENT_AUTH_ACCEPT
0	PACKET_COUNT_TOCLIENT_HELLO
I made a shell script I called `analyze-packet-spam`: ``` #!/bin/sh -eu # This script takes a minetest log with at least INFO log level and # outputs the MINETEST network protocol packet count per second. # # To collect such a log file of minetest running for 10 minutes, run: # timeout 600 minetest --info >log.txt 2>&1 >/dev/null # # To get packet counts from that file, run: # ./analyze-packet-spam <log.txt TEMPFILE=$(mktemp /tmp/minetest.analyze-packet-spam.XXXXXXXX) grep -F 'INFO[Main]: cmd' \ |while read DATE TIME _ _ PACKET_ID PACKET_NAME _ PACKET_COUNT; do TIMESTAMP=$(date +%s --date "${DATE} ${TIME%:}") PACKET_NAME=${PACKET_NAME#(} PACKET_NAME=${PACKET_NAME%)} VARIABLE=PACKET_COUNT_"${PACKET_NAME}" eval "$( echo $VARIABLE=\$\(\( \${$VARIABLE:-0} + ${PACKET_COUNT} \)\) )" printf '%s ' \ "${TIMESTAMP}" \ "${VARIABLE}" eval echo \$${VARIABLE} done >"${TEMPFILE}" TIMESTAMP_START=$( <"${TEMPFILE}" head -n1 |cut -d' ' -f1 ) TIMESTAMP_END=$( <"${TEMPFILE}" tail -n1 |cut -d' ' -f1 ) DURATION=$(( 30 + ${TIMESTAMP_END} - ${TIMESTAMP_START} )) PACKET_NAME_SEEN='' <"${TEMPFILE}" tac \ |while read _ PACKET_NAME PACKET_COUNT; do case "${PACKET_NAME_SEEN}" in *"${PACKET_NAME}"*) ;; *) PACKET_COUNT_PER_SECOND=$( printf '1k %s %s /p' "${PACKET_COUNT}" "${DURATION}" \ |dc ) printf '%s\t%s\n' "${PACKET_COUNT_PER_SECOND}" "${PACKET_NAME}" PACKET_NAME_SEEN="${PACKET_NAME_SEEN} ${PACKET_NAME}" ;; esac done unlink "${TEMPFILE}" ``` Playing Mineclonia for 10 minutes with armor bar autohiding turned on yielded this: ``` 0 PACKET_COUNT_TOCLIENT_SET_STARS 0 PACKET_COUNT_TOCLIENT_SET_MOON 0 PACKET_COUNT_TOCLIENT_SET_SUN .1 PACKET_COUNT_TOCLIENT_NODEMETA_CHANGED 0 PACKET_COUNT_TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO 0 PACKET_COUNT_TOCLIENT_SET_SKY .1 PACKET_COUNT_TOCLIENT_BREATH 37.8 PACKET_COUNT_TOCLIENT_HUD_SET_FLAGS 58.0 PACKET_COUNT_TOCLIENT_HUDCHANGE .2 PACKET_COUNT_TOCLIENT_ADD_PARTICLESPAWNER 0 PACKET_COUNT_TOCLIENT_SHOW_FORMSPEC .3 PACKET_COUNT_TOCLIENT_PLAY_SOUND 66.3 PACKET_COUNT_TOCLIENT_ACTIVE_OBJECT_MESSAGES 2.3 PACKET_COUNT_TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD .1 PACKET_COUNT_TOCLIENT_TIME_OF_DAY .8 PACKET_COUNT_TOCLIENT_INVENTORY .4 PACKET_COUNT_TOCLIENT_REMOVENODE .2 PACKET_COUNT_TOCLIENT_ADDNODE 6.1 PACKET_COUNT_TOCLIENT_BLOCKDATA 0 PACKET_COUNT_TOCLIENT_INVENTORY_FORMSPEC 0 PACKET_COUNT_TOCLIENT_HUDRM 0 PACKET_COUNT_TOCLIENT_HUDADD 0 PACKET_COUNT_TOCLIENT_CHAT_MESSAGE 0 PACKET_COUNT_TOCLIENT_FORMSPEC_PREPEND 0 PACKET_COUNT_TOCLIENT_UPDATE_PLAYER_LIST 0 PACKET_COUNT_TOCLIENT_CLOUD_PARAMS 0 PACKET_COUNT_TOCLIENT_HUD_SET_PARAM 0 PACKET_COUNT_TOCLIENT_MOVEMENT 0 PACKET_COUNT_TOCLIENT_DETACHED_INVENTORY 0 PACKET_COUNT_TOCLIENT_PRIVILEGES 0 PACKET_COUNT_TOCLIENT_ITEMDEF 0 PACKET_COUNT_TOCLIENT_ANNOUNCE_MEDIA 0 PACKET_COUNT_TOCLIENT_NODEDEF 0 PACKET_COUNT_TOCLIENT_FOV 0 PACKET_COUNT_TOCLIENT_MOVE_PLAYER 0 PACKET_COUNT_TOCLIENT_HP 0 PACKET_COUNT_TOCLIENT_CSM_RESTRICTION_FLAGS 0 PACKET_COUNT_TOCLIENT_AUTH_ACCEPT 0 PACKET_COUNT_TOCLIENT_HELLO ``` Playing Mineclonia for 10 minutes with armor bar autohiding turned off yielded this: ``` 0 PACKET_COUNT_TOCLIENT_SET_STARS 0 PACKET_COUNT_TOCLIENT_SET_MOON 0 PACKET_COUNT_TOCLIENT_SET_SUN .1 PACKET_COUNT_TOCLIENT_NODEMETA_CHANGED 0 PACKET_COUNT_TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO 0 PACKET_COUNT_TOCLIENT_SET_SKY 0 PACKET_COUNT_TOCLIENT_BREATH 39.3 PACKET_COUNT_TOCLIENT_HUD_SET_FLAGS 44.1 PACKET_COUNT_TOCLIENT_HUDCHANGE .2 PACKET_COUNT_TOCLIENT_ADD_PARTICLESPAWNER .2 PACKET_COUNT_TOCLIENT_PLAY_SOUND 67.7 PACKET_COUNT_TOCLIENT_ACTIVE_OBJECT_MESSAGES 2.0 PACKET_COUNT_TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD .2 PACKET_COUNT_TOCLIENT_TIME_OF_DAY .6 PACKET_COUNT_TOCLIENT_INVENTORY .3 PACKET_COUNT_TOCLIENT_REMOVENODE .1 PACKET_COUNT_TOCLIENT_ADDNODE 3.6 PACKET_COUNT_TOCLIENT_BLOCKDATA 0 PACKET_COUNT_TOCLIENT_INVENTORY_FORMSPEC 0 PACKET_COUNT_TOCLIENT_SHOW_FORMSPEC 0 PACKET_COUNT_TOCLIENT_FORMSPEC_PREPEND 0 PACKET_COUNT_TOCLIENT_SRP_BYTES_S_B 0 PACKET_COUNT_TOCLIENT_UPDATE_PLAYER_LIST 0 PACKET_COUNT_TOCLIENT_CLOUD_PARAMS 0 PACKET_COUNT_TOCLIENT_HUD_SET_PARAM 0 PACKET_COUNT_TOCLIENT_HUDADD 0 PACKET_COUNT_TOCLIENT_MOVEMENT 0 PACKET_COUNT_TOCLIENT_DETACHED_INVENTORY 0 PACKET_COUNT_TOCLIENT_PRIVILEGES 0 PACKET_COUNT_TOCLIENT_ITEMDEF 0 PACKET_COUNT_TOCLIENT_ANNOUNCE_MEDIA 0 PACKET_COUNT_TOCLIENT_NODEDEF 0 PACKET_COUNT_TOCLIENT_FOV 0 PACKET_COUNT_TOCLIENT_MOVE_PLAYER 0 PACKET_COUNT_TOCLIENT_HP 0 PACKET_COUNT_TOCLIENT_CSM_RESTRICTION_FLAGS 0 PACKET_COUNT_TOCLIENT_AUTH_ACCEPT 0 PACKET_COUNT_TOCLIENT_HELLO ```

Ideally, the Minetest engine wouldn't send HUDCHANGE packets if the field hasn't actually changed, because this would solve this problem for all Minetest games and mods.

I've opened an issue because I think this is the best solution, but a workaround could be used until this is implemented in the engine.

Ideally, the Minetest engine wouldn't send HUDCHANGE packets if the field hasn't actually changed, because this would solve this problem for all Minetest games and mods. I've opened [an issue](https://github.com/minetest/minetest/issues/11459) because I think this is the best solution, but a workaround could be used until this is implemented in the engine.

As a workaround, you could either make the hud bars mod not call hud_change when nothing has changed or wrap the HUD API.

As a workaround, you could either make the hud bars mod not call hud_change when nothing has changed or wrap the HUD API.
I think this was fixed in the upstream hudbars mod in https://repo.or.cz/minetest_hudbars.git/commitdiff/a44de6230bcde79b78749bc6024a5ee8614bc6c0.
Author
Owner

Thanks, @luk3yx! I tested this patch by Wuzzy and it removed the entire HUDUPDATE spam:

https://repo.or.cz/minetest_hudbars.git/patch/a44de6230bcde79b78749bc6024a5ee8614bc6c0

Thanks, @luk3yx! I tested this patch by Wuzzy and it removed the entire HUDUPDATE spam: https://repo.or.cz/minetest_hudbars.git/patch/a44de6230bcde79b78749bc6024a5ee8614bc6c0
Author
Owner

Now that PR #123 has been merged, I have rebased PR #122 to get a cleaner history.

Now that PR https://git.minetest.land/Mineclonia/Mineclonia/pulls/123 has been merged, I have rebased PR https://git.minetest.land/Mineclonia/Mineclonia/pulls/122 to get a cleaner history.
Author
Owner

I close this now because PR #122 was merged.

I close this now because PR https://git.minetest.land/Mineclonia/Mineclonia/pulls/122 was merged.
erle closed this issue 2021-07-23 13:08:20 +02:00
cora added the
packet spam
label 2021-09-13 14:57:27 +02:00
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
4 Participants
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: Mineclonia/Mineclonia#111
No description provided.