Time Nick Message 09:34 ANAND https://github.com/features/package-registry :O 09:46 ANAND My exams are around the corner, so I'll be unavailable for the next 25-30 days. Cya'll later! :) 14:22 Sokomine re 14:24 IhrFussel Hi guys =) 15:41 Krock ree 16:20 benrob0329 https://youtu.be/7YqcDmvgNrY 16:21 benrob0329 Making The Tree Farm - Ayums - Episode 4 16:53 IhrFussel Looping through all connected players and checking if their name is a key inside a certain table shouldn't lag the server right? 16:54 sfan5 no of course not 16:54 IhrFussel Also not when I run that check every step? 16:55 sfan5 no of course not 16:55 IhrFussel So I'm guessing it will take a few µs at best to execute 16:56 VanessaE it would be better to use on-join/on-leave and just track players' presence that way 16:58 VanessaE check if the player "is inside a certain table" and build a table of matching players at that point 17:00 IhrFussel Would it make a difference vs minetest.get_connected_players()? 17:00 VanessaE maybe not but it'd be faster 17:01 VanessaE too many "but it's fast enough *this* way" eventually becomes "it's too slow". 17:02 VanessaE basically, don't do in continuous realtime (== globalstep) that which can be coded to be event-driven 17:05 IhrFussel This is about a HP bar on the screen that needs to track the HP for a few secs before disappearing again ... so when the bar appears I store the player name and timestamp in the table and in globalstep I check if the player name exists and timestamp reached a few secs in the future and then remove the HUD from screen but if it didn't expire yet then I update the HUD for the player 17:07 IhrFussel My server step is set to 0.15 seconds so no the HUD will not be updated that much per sec 17:08 IhrFussel On average maybe 5 players will have the HUD enabled at the same time 17:10 IhrFussel And my average player count is 15-20 mostly ... so ~ 75% will just be skipped in the loop 17:15 VanessaE track HP ... a change in HP is an event you can react to, is it not? 17:15 VanessaE and can you not use minetest.after() to set the disappear delay? 17:16 IhrFussel It's not the player HP, it's mob HP 17:16 VanessaE isn't there a callback for when a mob takes damage, also? 17:18 Krock IhrFussel: well, as long your table is not a million indices long, that shouldn't be a problem. Not sure how efficient the key/value lookup is 17:19 Krock but for online players, say 30 it's never going to be a problem 17:21 IhrFussel I already use that callback but I need to track the HP also for a few secs even when you don't attack the monster anymore in case something/someone else attacked it else it looks bad 17:21 IhrFussel Here is a demo https://ihrfussels-server.de/hpdemo.mp4 17:25 Krock you could also attach an entity to the monsters and update it when it's hit. other players will then also see the condition of the monster