[Mod] Time, Lag and Position HUDisplay [poshud]
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
[Mod] Time, Lag and Position HUDisplay [poshud]
Hello again,
This is a small server-side mod which displays the following information on a head-up display in the bottom right screen corner:
- Current game time
- Average and maximum lag time
- Current player position
License: LGPLv2.1
Uses code from minetest_time (kazea's code tweaked by cg72 with help from crazyR and Zeno) and mthudclock (https://gitlab.com/Rochambeau/mthudclock/tree/master, WTFPL)
Depends on nothing.
Download: https://github.com/orwell96/poshud/archive/master.zip
Git: https://github.com/orwell96/poshud
This is a small server-side mod which displays the following information on a head-up display in the bottom right screen corner:
- Current game time
- Average and maximum lag time
- Current player position
License: LGPLv2.1
Uses code from minetest_time (kazea's code tweaked by cg72 with help from crazyR and Zeno) and mthudclock (https://gitlab.com/Rochambeau/mthudclock/tree/master, WTFPL)
Depends on nothing.
Download: https://github.com/orwell96/poshud/archive/master.zip
Git: https://github.com/orwell96/poshud
- Attachments
-
- poshud.png (9.87 KiB) Viewed 1144 times
Last edited by orwell on Mon May 20, 2019 09:39, edited 1 time in total.
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
You can actually get the max_lag, using this hacky code I found here: https://github.com/Pitriss/overridemodp ... ster/munin
Another, different problem, is that max_lag is essentially worthless, since it doesn't say that much about actual server lag.
Code: Select all
local status = minetest.get_server_status()
local status_splitted = {}
for k, v in string.gmatch(status, "([_%w]+)=([%+%w%.]+)") do
status_splitted[k] = v
end
local uptime = status_splitted.uptime
local max_lag = status_splitted.max_lag
Play on Linuxworks server. We have got lots of trains.
My mods (Industrial Livestock Farming, Farebox and Faregate, Moving Walkways, Atm)
My mods (Industrial Livestock Farming, Farebox and Faregate, Moving Walkways, Atm)
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
I said, there's no convenient way to get this value. I know this approach, and the original unpublished version of this also used this code. I just didn't want to publish a mod that will likely break somewhen in the future.
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
I developed a mod that measures server lag far more accurately than the max_lag value calculated internally by the engine. (including a variety of different metrics like peak lag, mean short-term lag, mean long-term lag, current lag, etc.). It also has an API for use by mod developers. I kind of put the project on hold due to other things in my life at the moment, but I'll try to get it published soon!gpcf wrote: Another, different problem, is that max_lag is essentially worthless, since it doesn't say that much about actual server lag.
PS. Worth noting is that dtime itself is not a reliable nor accurate method for measuring server lag, because it doesn't always correspond to the elapsed time between server steps (I've performed a variety of tests comparing dtime vs minetest.get_us_time).
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
So, then, I'm looking forward to that.
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
Yes, I've made note to send you a PM when it's ready (I might also get your help testing it with your mod if that's okay).
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
@sorcerykid: Can you publish the mod, even if it is not ready, so we can reuse the ideas? Otherwise, we might be doing work in parallel, which is a waste of resources.
Play on Linuxworks server. We have got lots of trains.
My mods (Industrial Livestock Farming, Farebox and Faregate, Moving Walkways, Atm)
My mods (Industrial Livestock Farming, Farebox and Faregate, Moving Walkways, Atm)
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
Sure that's doable. I'm not at home right now, but when I return next week I'll publish it to my repository.
- BuckarooBanzay
- Member
- Posts: 437
- Joined: Tue Apr 24, 2018 05:58
- GitHub: BuckarooBanzay
- IRC: BuckarooBanzai
- In-game: BuckarooBanzai
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
I added some settings, configurable hud position, chat-toggle command and mapblock position to your mod.
The changes are split-up in 3 pull-requests:
https://github.com/thomasrudin-mt/poshud
I had a similar mod in planning but adding the features i needed in your mod was easier, thx :)
The changes are split-up in 3 pull-requests:
https://github.com/thomasrudin-mt/poshud
I had a similar mod in planning but adding the features i needed in your mod was easier, thx :)
- SwissalpS
- New member
- Posts: 6
- Joined: Tue Feb 09, 2016 17:44
- GitHub: SwissalpS
- IRC: SwissalpS
- In-game: SwissalpS
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
I have forked this mod and made a light version without the lag calculations.
Named the branch 'light' and changed the settings to poshud_light....
Thanks.
https://github.com/SwissalpS/poshud/ (checkout light branch)
Named the branch 'light' and changed the settings to poshud_light....
Thanks.
https://github.com/SwissalpS/poshud/ (checkout light branch)
:D
Re: [Mod] Time, Lag and Position HUDisplay [poshud]
It would be nice, if the mod would also display the current node name I am pointing to. So it could replace the debug info.
Who is online
Users browsing this forum: Desour and 26 guests