[Mod] Ingame Clocks and Timers [mtimer]

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

NO11 wrote:
Thu Feb 04, 2021 18:42
How do I get the timer to start at 00:00, that would be useful for a speedrun, for example (mineclone2)?
You could use the session duration (/mtimer sd) for that. This displays the time since you logged in to the server or started the singeplayer world. Just set it to {hours}:{minutes}:{seconds} because by default only hours and minutes are shown. Then configure timer display to only show {sd} and set position, size, etc. as wanted.

Image

Since mTimer is no speedrun timer it is only exact to a second based on server ticks. You might want to use LiveSplit for exact time tracking of speedruns.
Attachments
f.jpg
f.jpg (277.82 KiB) Viewed 2588 times

User avatar
NO11
Member
Posts: 42
Joined: Sat Dec 26, 2020 22:24
GitHub: NO411
In-game: NO11
Location: Germany

Re: [Mod] Ingame Clocks and Timers [mtimer]

by NO11 » Post

Thank you, now it works. Now only change "session duration" into "Timer" in the locale :)

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

No, "Session Duration" is correctly describing what {sd} is for.

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

NO11 wrote:
Thu Feb 04, 2021 19:56
Thank you, now it works. Now only change "session duration" into "Timer" in the locale :)
Oh, but great idea with the timer. I'll look into this but likely not before the weekend.

https://gitlab.com/4w/mtimer/-/issues/10

Feel free to add your comments/suggestions on that over at GitLab.

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

NO11 wrote:
Thu Feb 04, 2021 18:42
How do I get the timer to start at 00:00, that would be useful for a speedrun, for example (mineclone2)?
So … based on your idea I implemented a custom timer that can be set up as needed and allows arbitrary (re)starting and stopping. The timer can be an actual timer, a countdown, or can run in continuous mode.

Since this is a beta implementation as of today there is no CDB release with the custom timer. You can try it directly in the Git version hosted on GitLab. The readme there already contains all the information that is needed.

Please keep in mind that the timer is only exact to the second calculated from server ticks. LiveSplit is still the better option for speedruns.

User avatar
NO11
Member
Posts: 42
Joined: Sat Dec 26, 2020 22:24
GitHub: NO411
In-game: NO11
Location: Germany

Re: [Mod] Ingame Clocks and Timers [mtimer]

by NO11 » Post

Thank you!

User avatar
NO11
Member
Posts: 42
Joined: Sat Dec 26, 2020 22:24
GitHub: NO411
In-game: NO11
Location: Germany

Re: [Mod] Ingame Clocks and Timers [mtimer]

by NO11 » Post

Is it possible to use the settings made by one for other worlds? For example, I want the timer to always be yellow.

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

Yes, Check the readme, there are some configuration options available.

https://gitlab.com/4w/mtimer#default-co ... ver-admins

User avatar
NO11
Member
Posts: 42
Joined: Sat Dec 26, 2020 22:24
GitHub: NO411
In-game: NO11
Location: Germany

Re: [Mod] Ingame Clocks and Timers [mtimer]

by NO11 » Post

ok thanks, i missed that, sorry.

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

Good news, everyone!

mTimer got a massive visual and technical overhaul based on playtesting and indirect feedback. All formspecs are now much less crammed and dull, the main menu and all buttons and windows got fresh new icons, and most dialogs got some convenience functionality added!

Image

Just wait for CDB release to be pushed or grab the latest Git version. All configuration options are taken over to the new style (except “HUD Element Size” which is now “HUD Element Scale” because that’s the technically better term for what it does).

As always: See readme for more information. Also, the first post was slightly updated.
Attachments
main_menu.png
main_menu.png (46.13 KiB) Viewed 2588 times

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

Here’s an update!

If you run into issues with mTimer and you need to reset the configuration you already could use the reset button. But if the reset for whatever reason does not work and mTimer still acts weird it is now possible to forcefully remove all mTimer-related configuration from the player meta data and have it rewritten on next rejoin.

Image

Just pull the latest Git version or wait for the CDB update to be distributed.
Attachments
reset_everything.png
reset_everything.png (96.22 KiB) Viewed 2588 times

freefall
Member
Posts: 19
Joined: Mon Dec 21, 2020 12:20

Re: [Mod] Ingame Clocks and Timers [mtimer]

by freefall » Post

Hi there,

just installed that mod. Really great work. Thanks so much.

Two issues I came across:

I first installed it to my local instance. Everything was perfect. After that, I installed it to our server. In that environment, I get a number of error messages concerning icons not found. All icons in the menu have been replaced by "replacement images". Any idea what is wrong?

The other question: I prepared a configuration section for minetest.conf. Is it correct by design that I have to "reset" all settings to activate the default settings from the conf file? And I configured a 3 for mtimer_hud_element_size. That doesn't work. Size keeps at the smallest until I configure it in the menu.

Appreciate your help.

CU,

freefall

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

freefall wrote:
Fri Jan 28, 2022 09:21
I first installed it to my local instance. Everything was perfect. After that, I installed it to our server. In that environment, I get a number of error messages concerning icons not found. All icons in the menu have been replaced by "replacement images". Any idea what is wrong?
Any chance you use an older version of Minetest for your server? You need a version on at least this pull request's commit state: https://github.com/minetest/minetest/pull/9065 because mTimer uses this feature for organizing texture files. In general, only the current officially released version is tested against.
freefall wrote:
Fri Jan 28, 2022 09:21
Is it correct by design that I have to "reset" all settings to activate the default settings from the conf file?
Absolutely, yes! The player is in full control of everything after logging in for the first time.

If you change the values in the configuration files and reload the server the old player-set settings remain intact. In order to apply the changed values players either need to soft-reset or to hard-reset the settings. When not changing to version of mTimer with different options a soft-reset usually is absolutely fine.

This also affects singleplayer worlds, because the player-based configuration is stored as player meta data and Minetest does not differ between multiplayer servers and singleplayer worlds when it comes to player meta data.
freefall wrote:
Fri Jan 28, 2022 09:21
And I configured a 3 for mtimer_hud_element_size. That doesn't work. Size keeps at the smallest until I configure it in the menu.
Does this happen with a new account that never was on the server before, too? Have you restarted the server after changing the option?

freefall
Member
Posts: 19
Joined: Mon Dec 21, 2020 12:20

Re: [Mod] Ingame Clocks and Timers [mtimer]

by freefall » Post

First off, thanks for your lightning fast response.
Linuxdirk wrote:
Fri Jan 28, 2022 13:12
Any chance you use an older version of Minetest for your server?
Yes, server is still on 5.3.0. I already raised the ticket this morning since I was expecting something like that.
Linuxdirk wrote:
Fri Jan 28, 2022 13:12
freefall wrote:
Fri Jan 28, 2022 09:21
Is it correct by design that I have to "reset" all settings to activate the default settings from the conf file?
Absolutely, yes! The player is in full control of everything after logging in for the first time.
Does that mean that each player is "in control of everything"? We want to start a timer visible for all players in a multiplayer environment. So for us, the admin should be in charge of setting the time and starting the countdown, effective for all players.
Linuxdirk wrote:
Fri Jan 28, 2022 13:12
freefall wrote:
Fri Jan 28, 2022 09:21
And I configured a 3 for mtimer_hud_element_size. That doesn't work. Size keeps at the smallest until I configure it in the menu.
Does this happen with a new account that never was on the server before, too? Have you restarted the server after changing the option?
Yes, a new account has the same issue. And yes, I've restarted the server several times.

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

freefall wrote:
Fri Jan 28, 2022 13:38
Does that mean that each player is "in control of everything"? We want to start a timer visible for all players in a multiplayer environment. So for us, the admin should be in charge of setting the time and starting the countdown, effective for all players.
Sorry, but this is not possible. The custom timer is based on the individual player's setup. Players can start, restart, or stop the timer at any point and are able to change the type of the timer and all timer values.

You could use a mod to modify the player's meta data so it matches your needs but you have to rely on the players for not changing the timer as they like.

But this sounds like a fun little weekend project :)
freefall wrote:
Fri Jan 28, 2022 09:21
Yes, a new account has the same issue. And yes, I've restarted the server several times.
Could you please provide more details here? https://gitlab.com/4w/mtimer/-/issues/24 I'll investigate on this when I'm at home again.

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

freefall wrote:
Fri Jan 28, 2022 13:38
*ping* :)

It turns out that the issue came from wrong documentation. Fixed the documentation already, simply use mtimer_hud_element_scale = 3 (instead of …_size). Everything else regarding on when configuration options are applied stays valid, though.

freefall
Member
Posts: 19
Joined: Mon Dec 21, 2020 12:20

Re: [Mod] Ingame Clocks and Timers [mtimer]

by freefall » Post

Linuxdirk wrote:
Sun Jan 30, 2022 21:00
[...] simply use mtimer_hud_element_scale = 3 (instead of …_size).
Great. Thank you. Unfortunately, after all, this mod doesn't serve my needs.

Did you consider the idea of a server side timer for all multi-players? Would that be possible? ;)

cu,

freefall

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Miniontoby » Post

freefall wrote:
Mon Jan 31, 2022 08:21
Linuxdirk wrote:
Sun Jan 30, 2022 21:00
[...] simply use mtimer_hud_element_scale = 3 (instead of …_size).
Great. Thank you. Unfortunately, after all, this mod doesn't serve my needs.

Did you consider the idea of a server side timer for all multi-players? Would that be possible? ;)

cu,

freefall
I got a csm (client side mod) to show me the ingame time on my hud at all servers which I join without servers having to install anything and they don't even know I have it

I could rewrite the mod so it works as an client sided mod, but you will be missing some features I think...
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

CSM was a mistake and should be abandoned as soon as possible. That’s the only statement you get from me regarding this :)

User avatar
Blockhead
Member
Posts: 1623
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Blockhead » Post

It would definitely be possible to make an integrated CSM plus server mod and sync them with modchannels, but clearly you won't be getting it from Linuxdirk given the above comment :)
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

Blockhead wrote:
Thu Feb 17, 2022 03:31
It would definitely be possible to make an integrated CSM plus server mod and sync them with modchannels, but clearly you won't be getting it from Linuxdirk given the above comment :)
Both statements are true :) I have a strong opinion against CSM in it's current form and implementation state.

But since you still need a server mod: using a CSM makes no sense because it doesn't give you any benefit. It simply doesn't worth the hassle. Setting up client-side mods is fortunately not super trivial.

Also: servers can disable the usage of CSM: https://github.com/minetest/minetest/bl ... 1589-L1605

User avatar
Blockhead
Member
Posts: 1623
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Blockhead » Post

Linuxdirk wrote:
Thu Feb 17, 2022 13:43
But since you still need a server mod: using a CSM makes no sense because it doesn't give you any benefit. It simply doesn't worth the hassle. Setting up client-side mods is fortunately not super trivial.

Also: servers can disable the usage of CSM: https://github.com/minetest/minetest/bl ... 1589-L1605
I disagree that it gives you zero benefit, but yes it's a lot of hassle. Firstly, you can keep per-server configuration which is one thing I don't think is possible locally with CSMs (how can you tell what server or singleplayer world you are on?).

More importantly, mods that want to update HUDs frequently can definitely benefit. As long as the information is already available to the client, the client can have a high refresh rate. For instance, mtimer, postool and poshud all display at least some information available to the client, namely the player's position and the in-game time. At the same time, the refresh interval for these huds ranges around 0.1-2 seconds, which is nowhere near real-time. Add network latency on top of that. If the client did the rendering of those elements it already knows about (position, time etc) and could have accurate prediction on other information the server has sent (advtrains railway time), then it could both save server CPU cycles and make the player experience better.

Yes, there is a lot of complexity to this approach. No, I don't believe in the defeatist attitude that client side modding is bad, despite the potential pitfalls. Without CSM you can't improve the client prediction features past that of what the base engine provides, and a client with good prediction is a way better user experience. It's already established that, for instance, functionality for mobs won't make it into the base game. Nobody is thinking advtrains is going to get such treatment either. But these mods and others would look way better with good prediction: mobs wouldn't rubber band around in the presence of network latency, nor would trains visibly come off the rails.

Sorry this turned into rant, but I just had to correct you when you said "no benefit" which is too absolute.

Lastly: Not sure who decided there's no flag to restrict map downloading but a variety of anti-CSM flags. Honestly restrictions like the CSM flags and hud flags are nothing more than bothersome and probably encourage using cheat clients, but I guess in principle that you should create a client that will act in good faith as a baseline.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Ingame Clocks and Timers [mtimer]

by Linuxdirk » Post

Blockhead wrote:
Thu Feb 17, 2022 17:10
I disagree that it gives you zero benefit,
It’s you right to do so. Have a nice evening!

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests