[Mod] Light Tool [0.4] [light_tool]
Re: [Mod] Light Tool [0.4] [light_tool]
I tried it. This is a very good attempt at a flash light mod. Keep up the good work :)
My [mods]
Re: [Mod] Light Tool [0.4] [light_tool]
Good mod, now we can make horror survive games :)
Re: [Mod] Light Tool [0.4] [light_tool]
XD Yeah
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP
Re: [Mod] Light Tool [0.4] [light_tool]
Awesome so useful
-
- Member
- Posts: 70
- Joined: Wed Dec 16, 2020 16:52
- GitHub: doxygen-spammer
Re: [Mod] Light Tool [0.4] [light_tool]
Hi! I like this mod, because it theoretically makes it fun to explore huge caves.
I installed it and changed the light_tool:light_tool’s beam range from 20 to 200. Unfortunately the beam goes only about 64 nodes, or 80 nodes while using the binocular’s zoom.
I believe the code in this mod (light_tool.light_beam()) works correctly, and light sources are placed properly. By placing default:glass instead, I can easily verify that all light sources are placed at some time, they are just not visible directly. I assume that the server also properly calculates light levels immediately.
I think the server just does not send mapblock updates for blocks farther than 4 or 5 blocks. I tried to increase various range limits in the server/singleplayer configuration, but these have no effect. Adding calls to minetest.load_area() and such in the mod does not help either. (Why should it? The area is already loaded...)
player.send_mapblock() should theoretically do it, but I can’t call send_mapblock() because I don’t have any accepted parameters (“UserData expected”) for it. :(
Does someone know how to tell the server to perform proper updates for a specific area?
A first mitigation might be always place a light source in the player, even if there are obstacles.
I think it can be fixed with not using position rounding, but precise eye offset and so on. Maybe do a raycast from the eye position to the farthest possible beam position, search the first obstacle, then place light sources between eye position and obstacle. I’m trying to make a patch for that.
I installed it and changed the light_tool:light_tool’s beam range from 20 to 200. Unfortunately the beam goes only about 64 nodes, or 80 nodes while using the binocular’s zoom.
I believe the code in this mod (light_tool.light_beam()) works correctly, and light sources are placed properly. By placing default:glass instead, I can easily verify that all light sources are placed at some time, they are just not visible directly. I assume that the server also properly calculates light levels immediately.
I think the server just does not send mapblock updates for blocks farther than 4 or 5 blocks. I tried to increase various range limits in the server/singleplayer configuration, but these have no effect. Adding calls to minetest.load_area() and such in the mod does not help either. (Why should it? The area is already loaded...)
player.send_mapblock() should theoretically do it, but I can’t call send_mapblock() because I don’t have any accepted parameters (“UserData expected”) for it. :(
Does someone know how to tell the server to perform proper updates for a specific area?
I observed this problem too. It makes the screen flicker, which is uncomfortable to me in general.ShadMOrdre wrote: ↑Thu Aug 15, 2019 20:04When standing next to any node, like with my side up against a cave wall, even when pointing into completely open space, the light beam goes dark.
A first mitigation might be always place a light source in the player, even if there are obstacles.
I think it can be fixed with not using position rounding, but precise eye offset and so on. Maybe do a raycast from the eye position to the farthest possible beam position, search the first obstacle, then place light sources between eye position and obstacle. I’m trying to make a patch for that.
-
- Member
- Posts: 70
- Joined: Wed Dec 16, 2020 16:52
- GitHub: doxygen-spammer
Re: [Mod] Light Tool [0.4] [light_tool]
I prepared a patch to fix the flashlight becoming dark when a wall is adjacent to the player: https://github.com/Extex101/light_tool/pull/5
The change is minimal, and simply uses floating point instead of integer. get_eye_offset() didn’t work, but adding (0, 1, 0), like you do it now, should be fine.
The change is minimal, and simply uses floating point instead of integer. get_eye_offset() didn’t work, but adding (0, 1, 0), like you do it now, should be fine.
-
- Member
- Posts: 1233
- Joined: Tue Oct 23, 2012 12:59
- GitHub: Dragonop
- IRC: Dragonop
- In-game: Dragonop
- Location: Argentina
Re: [Mod] Light Tool [0.4] [light_tool]
Really nice mod! really cool for exploring caves, mostly now they are as dark as ever
-
- Member
- Posts: 70
- Joined: Wed Dec 16, 2020 16:52
- GitHub: doxygen-spammer
Re: [Mod] Light Tool [0.4] [light_tool]
I learned how to use player:send_mapblock() properly, and it actually updates lightning to the player over long range. A 200 meter flashlight is now possible. But I would like to find a way to make it less performance demanding, sending all affected blocks every time causes heavy lags...
-
- Member
- Posts: 70
- Joined: Wed Dec 16, 2020 16:52
- GitHub: doxygen-spammer
Re: [Mod] Light Tool [0.4] [light_tool]
I made some experiments with player:send_mapblock() to allow long range flashlights. They didn’t have positive results.
My last PR changes the way temporary light nodes are removed. Instead of removing them in every step, they are now removed when a 200ms node timer expires, so this timer can be extended while the player is not moving. This reduces the network traffic when the player is moving slowly, because no map blocks change when no light nodes are removed.
A positive side effect is that light nodes now live long enough to trigger automatic map block updates by the server, even outside the 48 node range. This makes 200m flashlights working. There is still some delay, so the illuminated area makes funny trails. I tried to reduce this delay with some kind of block update scheduler, but that didn’t work.
Do you think it makes sense to add some long range flashlights by default? I am thinking of these:
My last PR changes the way temporary light nodes are removed. Instead of removing them in every step, they are now removed when a 200ms node timer expires, so this timer can be extended while the player is not moving. This reduces the network traffic when the player is moving slowly, because no map blocks change when no light nodes are removed.
A positive side effect is that light nodes now live long enough to trigger automatic map block updates by the server, even outside the 48 node range. This makes 200m flashlights working. There is still some delay, so the illuminated area makes funny trails. I tried to reduce this delay with some kind of block update scheduler, but that didn’t work.
Do you think it makes sense to add some long range flashlights by default? I am thinking of these:
- Mini flashlight: 20 meters, craftable from only coal, copper, and tin (and surface materials).
- Midi flashlight: 40 meters, requires iron.
- Maxi flashlight: 70 meters, requires gold.
- Super flashlight: 110 meters, not blocked by daylight, requires mese.
- Ultra flashlight: 150 meters, not blocked by daylight, requires diamonds.
-
- Member
- Posts: 70
- Joined: Wed Dec 16, 2020 16:52
- GitHub: doxygen-spammer
Re: [Mod] Light Tool [0.4] [light_tool]
I made some resamples of this mod’s light_tool_light_tool.png as textures for the mentioned five flashlights. I don’t claim they are good, I’m not experienced with textures or pixel art.
What do you think?
Edit: The last picture is the original.
What do you think?
Edit: The last picture is the original.
- Attachments
-
- tools.png (10.45 KiB) Viewed 1003 times
Re: [Mod] Light Tool [0.4] [light_tool]
Being mainly blue is better because it shows something modern. Brown staff with lighter head could be something else on a wooden staff. I run with HDX textures, so high res is better to me.
-
- Member
- Posts: 70
- Joined: Wed Dec 16, 2020 16:52
- GitHub: doxygen-spammer
Re: [Mod] Light Tool [0.4] [light_tool]
Here are the textures with blue handles. Do they look more modern now? I actually like the blue handles.
More horrible pixmaps: these are some craft items for the different flashlights. It’s a bronce disk, which is coated with tin by putting it in a furnace, and then it is a tin reflector. For the next tier, you coat it with gold the same way.
It’s just some gameplay to make it a bit more complicated to get these powerful tools. :)
More horrible pixmaps: these are some craft items for the different flashlights. It’s a bronce disk, which is coated with tin by putting it in a furnace, and then it is a tin reflector. For the next tier, you coat it with gold the same way.
It’s just some gameplay to make it a bit more complicated to get these powerful tools. :)
- Attachments
-
- tools_blue.png (10.3 KiB) Viewed 1003 times
-
- mirrors.png (9.32 KiB) Viewed 1003 times
Re: [Mod] Light Tool [0.4] [light_tool]
Yes. I like them better also.
-
- Member
- Posts: 1233
- Joined: Tue Oct 23, 2012 12:59
- GitHub: Dragonop
- IRC: Dragonop
- In-game: Dragonop
- Location: Argentina
Re: [Mod] Light Tool [0.4] [light_tool]
I really like your textures!doxygen_spammer wrote: ↑Tue Dec 22, 2020 18:58Here are the textures with blue handles. Do they look more modern now? I actually like the blue handles.
...
More horrible pixmaps: these are some craft items for the different flashlights. It’s a bronce disk, which is coated with tin by putting it in a furnace, and then it is a tin reflector. For the next tier, you coat it with gold the same way.
...
It’s just some gameplay to make it a bit more complicated to get these powerful tools. :)
They are good, don't worry about it, you clearly have at least one artistic bone in your body haha
Looking forward to seeing the recipes, seems like you've done your research and the light tools will be interesting to craft
Keep it up! Love your mod
-
- Member
- Posts: 70
- Joined: Wed Dec 16, 2020 16:52
- GitHub: doxygen-spammer
Re: [Mod] Light Tool [0.4] [light_tool]
For now, there is a version at https://github.com/doxygen-spammer/ligh ... -tool-2000 for testing. It also contains a list of crafting recipes.
Note that this is Extex’s mod, I’m just expanding it. :)Love your mod
-
- Member
- Posts: 1233
- Joined: Tue Oct 23, 2012 12:59
- GitHub: Dragonop
- IRC: Dragonop
- In-game: Dragonop
- Location: Argentina
Re: [Mod] Light Tool [0.4] [light_tool]
Haha true, still, love the original, and your expansion of itdoxygen_spammer wrote: ↑Wed Dec 23, 2020 21:36For now, there is a version at https://github.com/doxygen-spammer/ligh ... -tool-2000 for testing. It also contains a list of crafting recipes.
Note that this is Extex’s mod, I’m just expanding it. :)Love your mod
Re: [Mod] Light Tool [0.4] [light_tool]
Ooh, interesting idea, maybe something like getting the light levels at the players position and using that for the reflectors light beam, it'll need some changes to the api but it's an interesting ideadoxygen_spammer wrote: ↑Tue Dec 22, 2020 18:58More horrible pixmaps: these are some craft items for the different flashlights. It’s a bronce disk, which is coated with tin by putting it in a furnace, and then it is a tin reflector. For the next tier, you coat it with gold the same way.
It’s just some gameplay to make it a bit more complicated to get these powerful tools. :)
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP
Who is online
Users browsing this forum: No registered users and 56 guests