[Mod] Hunger NG: A next generation hunger mod (hunger_ng)

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

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by Linuxdirk » Fri Feb 08, 2019 07:23

Please make sure to use the latest available Git versions of Minetest, Minetest Game, Hunger NG, and Hudbars. Make sure that Hudbars runs without any issues, make sure Hunger NG runs without any issues. Then enable both Hudbars and Hunger NG and provide the error message you get. Preferably over at GitLab. Thanks!
 

User avatar
runs
Member
 
Posts: 793
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by runs » Fri Feb 08, 2019 14:49

I use hbhunger with hudbar, and all OK. When I replace to hunger_ng, I get this error:

Code: Select all
2019-02-08 15:47:55: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'hunger_ng' in callback on_joinplayer(): .../games/bogart/mods/hunger_ng/system/hunger_functions.lua:26: bad argument #1 to 'get_player_by_name' (string expected, got nil)
2019-02-08 15:47:55: ERROR[Main]: stack traceback:
2019-02-08 15:47:55: ERROR[Main]:    [C]: in function 'get_player_by_name'
2019-02-08 15:47:55: ERROR[Main]:    .../games/bogart/mods/hunger_ng/system/hunger_functions.lua:26: in function 'get_data'
2019-02-08 15:47:55: ERROR[Main]:    ...games/bogart/mods/hunger_ng/interoperability/hudbars.lua:32: in function <...games/bogart/mods/hunger_ng/interoperability/hudbars.lua:30>
2019-02-08 15:47:55: ERROR[Main]:    /opt/minetest/bin/../builtin/game/register.lua:419: in function </opt/minetest/bin/../builtin/game/register.lua:399>
 

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

User avatar
texmex
Member
 
Posts: 1578
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex
 

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

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by Linuxdirk » Fri Feb 08, 2019 21:58

runs wrote:I use hbhunger with hudbar, and all OK. When I replace to hunger_ng, I get this error:

Found the issue (embarrassing typo) and fixed it. I also fixed the default hunger bar not being removed when enabling the hudbars mod. Just fetch the latest Git versions of everything.

texmex wrote:Have you ever thought of tracking basic nutrients individually? :)

Processing nutrients changes their nutritive value so I need to check that, too. Also I need to get all recipes to check what’s in them and need to check if the ingredients are made from basic nutrients, and so on … So for the sake of simplicity I rather not do this :)
 

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

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by Linuxdirk » Sat Feb 09, 2019 00:44

Attention modders!

The API changed a little. When getting the hunger information using hunger_ng.get_hunger_information you’ll get a slightly altered table back.

Also: all hunger data is now player meta data and no longer custom attributes because with Minetest 5.0.0 custom attributes are to be seen as deprecated!

In addition to that: Some of the (previous) custom attributes (now meta data) were renamed for better handling within the mod. You should not use them anyways :)

Just get the latest Git version and the Minetest 5.0.0 release candidate. An update via CDB will be available soon.
 

User avatar
Lone_Wolf
Member
 
Posts: 2185
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by Lone_Wolf » Sat Feb 09, 2019 20:24

This doesn't seem to be working with mobs_animal anymore. I got this mod and mobs_animal from the CDB. I use Minetest 5.0
 

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

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by Linuxdirk » Sat Feb 09, 2019 20:58

Sigh … those Lua patterns driving me insane one day … please get the last version and try. I’ll push a new release to the CDB soon.
 

User avatar
sfan5
Moderator
 
Posts: 3809
Joined: Wed Aug 24, 2011 09:44
Location: Germany
GitHub: sfan5
IRC: sfan5

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by sfan5 » Sat May 04, 2019 10:36

Right back where we were:
The 30 hud updates per second is too much, you should only call hud_change when the value actually changes.
(Here's how another mod solves this)
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)
 

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

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by Linuxdirk » Mon May 06, 2019 05:42

sfan5 wrote:The 30 hud updates per second is too much, you should only call hud_change when the value actually changes.

The problem is that the value could change all the time with every update. So I either check for changes and always change the HUD depending on the breath status or I add another player value that I need to load and check (and set) all the time.

Just created an issue but how much of a difference does this really make? Is it actually noticeable under real-word circumstances?
 

User avatar
sfan5
Moderator
 
Posts: 3809
Joined: Wed Aug 24, 2011 09:44
Location: Germany
GitHub: sfan5
IRC: sfan5

Re: [Mod] Hunger NG: A next generation hunger mod (hunger_ng

by sfan5 » Mon May 06, 2019 13:33

The "old hud value" would not be stored in a player attribute since it's not persistent.
Comparing an entry in a table every globalstep shouldn't be a problem.

Regarding performance impact, when I tested this in singleplayer it caused 30 hud updates per second (standing still and hunger didn't change).
If you consider a server with 20 players, this would be 600 packets sent per second. Now, any (decent) server network won't have a problem with this (won't be noticeable), but it's still lots of network traffic wasted for nothing.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)
 

Previous

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 4 guests