darker nights for all players
darker nights for all players
hi, is there a way to make nights darker for all players on server?
with some friends we have a survival and pvp server, and we would like to make the nights darker so that, together with the illumination mod, players are forced to use torches to walk in the dark and thus be more vulnerable to being detected by other players.
with some friends we have a survival and pvp server, and we would like to make the nights darker so that, together with the illumination mod, players are forced to use torches to walk in the dark and thus be more vulnerable to being detected by other players.
cdb_71b6f99a808c
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: darker nights for all players
I found your opponent. https://irc.minetest.net/minetest/2021-04-28#i_5815708
The server should have no control about client-side settings. If brightness is an issue, change the sky to pitch black and the node textures as well.
The server should have no control about client-side settings. If brightness is an issue, change the sky to pitch black and the node textures as well.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: darker nights for all players
While it technically might be: Is lighting really something that should belong to the client?
For server owners creating the perfect world for people to explore changing brightness of the night (and day) should be possible.
- Hume2
- Member
- Posts: 709
- Joined: Tue Jun 19, 2018 08:24
- GitHub: Hume2
- In-game: Hume2
- Location: Czech Republic
Re: darker nights for all players
If lighting is supposed to belong to the client only, then everyone turns the brightness to maximum, so torches become completely useless.
On the other hand, notice that lighting can be easily overriden by a hacked client. All mapblocks are sent to the client regardless of whether they are lit or not. So it is relatively easy to write a hack which makes you see perfectly in dark.
On the other hand, notice that lighting can be easily overriden by a hacked client. All mapblocks are sent to the client regardless of whether they are lit or not. So it is relatively easy to write a hack which makes you see perfectly in dark.
If you lack the reality, go on a trip or find a job.
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: darker nights for all players
A hacked client isn't even needed here. You can always set your operating system's gamma value to whatever you want without the server owner can do anything against it. Except: when the server owner can lower brightness on server-side so there is one color only so gamma does not work because there are no color differences. Nodes in complete darkness should not be transferred to the client, of course.
But it's not about making life a tad harder for cheaters, it's about creating a consistent and interesting experience to legitimate players.
Re: darker nights for all players
it's override_day_night_ratio()
Here's my try: https://github.com/TheTermos/islands/bl ... eather.lua
See how it works here
Both want about the same thing - control over the setting.Krock wrote: ↑Wed Apr 28, 2021 19:35I found your opponent. https://irc.minetest.net/minetest/2021-04-28#i_5815708
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: darker nights for all players
According to the Lua API documentation it controls the ratio between night and day, basically shifting sunrise and sunset to different times of the day. As far as I understand this has nothing to do with the brightness of the night.
Re: darker nights for all players
That's not how it works, and the docs don't seem to say that.
Code: Select all
* `override_day_night_ratio(ratio or nil)`
* `0`...`1`: Overrides day-night ratio, controlling sunlight to a specific
amount.
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: darker nights for all players
Can't test right now, but according to the meaning of the word "ratio" I highly doubt that you can change the minimum/maximum light level of the night with that.
Edit: Just tested, and yes, setting 0 makes it extremely dark. Awesome. So the function name is just plain wrong.
Nice find btw. :)
To use it a mod could run every X seconds and check the time of the day and when it’s above/below a certain value it could iterate over all players and set the “ratio” to the desired value to make the night darker or reset it for the day.
Re: darker nights for all players
yes, this how https://github.com/xenonca/ptime does it. very helpful mod for creative servers
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o
Re: darker nights for all players
cdb_71b6f99a808c
Re: darker nights for all players
I finally left it like this and it looked pretty good, I based it on the source code of the Islands mod to do this.
Islands mod by Termos: https://github.com/TheTermos/islands/bl ... eather.lua
Thanks :)
Islands mod by Termos: https://github.com/TheTermos/islands/bl ... eather.lua
Thanks :)
Code: Select all
-- Hacer que las noches sean mas oscuras
darkernight = 0
local function get_adjusted_light(atime)
atime = atime or minetest.get_timeofday()
-- 24 horas es igual a un entero, 0 = media noche, 0.5 = medio dia
if atime > 0.1875 and atime < 0.8125 then -- Si cumple, la ilumincion estara por defecto (muy brillante)
-- 04:30 19:30
return nil
elseif atime > 0.1840 and atime < 0.8160 then
-- 04:25 19:35
return 0.15
elseif atime > 0.1805 and atime < 0.8195 then
-- 04:20 19:40
return 0.1
elseif atime > 0.1770 and atime < 0.8230 then
-- 04:15 19:45
return 0.05
else
return 0 -- si ninguna de las anteriores se cumple llegara la oscuridad casi total, durara entre 19:45 y 04:15
end
end
minetest.register_on_joinplayer(function(plyr)
plyr:override_day_night_ratio(get_adjusted_light())
end)
minetest.register_globalstep(function(dtime)
darkernight = darkernight + dtime
if darkernight > 3 then
darkernight = 0
local curtime = minetest.get_timeofday()
local prefs = minetest.get_connected_players()
for _,plyr in ipairs(prefs) do
plyr:override_day_night_ratio(get_adjusted_light(curtime))
end
end
end)
cdb_71b6f99a808c
Re: darker nights for all players
It does require clients to play along, if you want them "forced to use torches to walk in the dark" but if your players are looking for that experience, then they won't turn up the brightness settings. Just make sure you're playing with good people, and everyone will either keep things dark, or they won't take advantage of other players if they can see at night. People actually do enjoy the excitement of dying in the darkness after losing their only torch, especially when they can share the video of them panicking afterwards.
-
- Member
- Posts: 107
- Joined: Wed Jun 30, 2021 14:53
- GitHub: AmyMoriyama
Re: darker nights for all players
I already can't see anything in minetest night, even with a torch and the mod to make it light the way. I am one to jack up my gamma so I can see something instead of an endless void.
That being said, there is no way to stop players from seeing in the dark if they are determined enough.
That being said, there is no way to stop players from seeing in the dark if they are determined enough.
- Linuxdirk
- Member
- Posts: 3218
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: darker nights for all players
Yes, when there are no color differences changing gamma won’t help. But since the client gets all nodes a modified client could simply display them anyways without the darkness.
The client can do whatever the client wants with the data the server sends it without the server owner being able to stop the client. The only way preventing the client using the data is not sending the data which is basically impossible right now.
But modified clients should not be considered when creating a server experience otherwise there is no reason in setting up a server.
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests