[Mod] Touch [1.3] [touch]

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

[Mod] Touch [1.3] [touch]

by Skamiz Kazzarch » Post

A small mod that makes it possible to navigate in total darkness.
Image
Punch a node in darkness with your empty hand to make it vissible for a few seconds.

Dependencies: none
Git: https://github.com/Skamiz/touch
Download: https://github.com/Skamiz/touch/archive/main.zip
License: MIT

Known issues:
stairs and such sometimes have Z-fighting on inner sides
Attachments
darkness.png
darkness.png (19.57 KiB) Viewed 1902 times
Last edited by Skamiz Kazzarch on Fri Jan 20, 2023 07:26, edited 3 times in total.

Grubler
Member
Posts: 98
Joined: Wed Nov 06, 2019 03:01
In-game: Grubler

Re: [Mod] Touch [1.0] [touch]

by Grubler » Post

Woah woah woah, is this what I think it is?!

I am gonna try this out, yo.

After trying it out: It seems really hard to see what it is doing some times, but whatever is going on seems promising, perhaps, to me.

It seems to treat different blocks differently, and maybe textures as well? I noticed it sometimes may make blocks darker rather than lighter as well. (Like when I tried it in a cobblestone dungeon area it was putting many dots on the floor, but only a few lines on the walls, which was hard to use. I thought maybe my textures were a problem so I changed it to default, and it seemed to show even less if maybe didn't show anything at all in that cobblestone area, but when I tried to go to a smooth stone area it did work on some parts of it, and it still worked the same when I changed textures back to what I had before for those smooth stones.) Maybe I will try to see what you are doing with this.

I looked at the script and I am not sure what is going on... uhh.. but maybe you do, so thanks for trying and stuff. For real, yo.

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.0] [touch]

by Skamiz Kazzarch » Post

Grubler wrote:
Mon Jun 21, 2021 21:06
It seems to treat different blocks differently, and maybe textures as well? I noticed it sometimes may make blocks darker rather than lighter as well.
I noticed this too, but have no idea what's causing it. My best guess is that it's some engine side problem.

What's going on is this: When you punch a block (with an empty hand while standing in darkness) it spawns an object which simulates the nodes apparence. It uses the glow property to make it vissible even though it is dark.

Code: Select all

glow = 0,
        -- Add this much extra lighting when calculating texture color.
If you go in the code on line 26 you can increase the glow value to make the object more visible.
Also on line 17 you can set how many seconds before the object deletes itself.

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.1] [touch]

by Skamiz Kazzarch » Post

New version.
Fixed most cases in which the touch would darken a node instead of brightening it.
Added ingame settings. You now can configure:
- How long a node stays visible.
- Under which light level the touch mechanic starts.
- Minimal brightnes of the touched node.

Grubler
Member
Posts: 98
Joined: Wed Nov 06, 2019 03:01
In-game: Grubler

Re: [Mod] Touch [1.1] [touch]

by Grubler » Post

I am not quite seeing the lines you are suggesting in what I downloaded from the link at the start of this thread. I guess I can try to mess with what I am seeing in what I have.

(Now I see there are other files in there.

I changed the brightness to 5 instead of 2 and it made the cobblestone be lit up like you would expect instead of being dark and weird. Seemed to help. Still testing.

It is sort of a surreal sort of feeling to be having these blocks appear in the middle of total darkness all around you and try to walk on them, because otherwise there may be a drop. Almost like playing a different game in a dream sequence or something. Thank you very much for making this. It actually did help me get out of a cave. I imagine, since it is actually changing the way a block looks, that other players would maybe be able to see the blocks you touch and make this happen to? )

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.1] [touch]

by Skamiz Kazzarch » Post

Grubler wrote:
Tue Jun 22, 2021 17:57
I am not quite seeing the lines you are suggesting in what I downloaded from the link at the start of this thread.
I have since uploaded a new version, you can now use the ingame settings menu to change the values.

One thing to keep in mind is that the brightened node still uses the original texture, so if your cobblestone is very dark it will still be hard to see.

The brightened node (actually a spawned object pretending to be a node) is equally visible to all players, so you will be able to see other players touched nodes and they will be able to see yours.

I didn't expect this when I started on this mod but the effect of the few visible nodes in otherwise total darknes is very nice. I imagine you could build a whole gamemode on this premise of stumbling around in the dark, feeling out the world around you. Or at least a sequencce in an adventure map.

Overall quite happy how this turned out. Especially given that the code is only some ~50 lines of code.

Grubler
Member
Posts: 98
Joined: Wed Nov 06, 2019 03:01
In-game: Grubler

Re: [Mod] Touch [1.1] [touch]

by Grubler » Post

Trying to dig with your hand can be a bit strange, though.

Maybe I can see how it is if it doesn't stay very long.

Grubler
Member
Posts: 98
Joined: Wed Nov 06, 2019 03:01
In-game: Grubler

Re: [Mod] Touch [1.1] [touch]

by Grubler » Post

It seems to have stopped working for cobblestones and the mossy variant. Maybe due to something I changed somewhere.

Update: Actually it is all stair blocks, because I added them to do something on punch. Not sure what I may do to try to keep both features. Maybe if it is possible to apply the on punch thing to an item rather than the stairs.

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.1] [touch]

by Skamiz Kazzarch » Post

Try adding minetest.node_punch(pos, node, puncher, pointed_thing) to your 'on_punch' function, (and make sure that the variables use the same names as your 'on_punch'. That should kick in the necessary callbacks for my mod to work.

Grubler
Member
Posts: 98
Joined: Wed Nov 06, 2019 03:01
In-game: Grubler

Re: [Mod] Touch [1.1] [touch]

by Grubler » Post

Use that instead of the on_punch?

Update: Adding that to the thing inside the on_punch seems to have worked, yeah. Not even sure what is going on. Thank you very much.

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.2] [touch]

by Skamiz Kazzarch » Post

update: Touched nodes now disappear immediately when dug.

Been sitting on this update for months, but now I finally have git set up on the new pc.

Grubler
Member
Posts: 98
Joined: Wed Nov 06, 2019 03:01
In-game: Grubler

Re: [Mod] Touch [1.2] [touch]

by Grubler » Post

Do you play with it yourself and stuff? Just wondering.

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.2] [touch]

by Skamiz Kazzarch » Post

Only technically. I barely play minetest at all. Mostly I just write mods for it.

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Touch [1.2] [touch]

by MisterE » Post

I tested it, and it just doesnt seem to work at all...

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.2] [touch]

by Skamiz Kazzarch » Post

Are you using an empty hand?
If so you can try going to Settings. -> All Settings
Image
Increasing touch brightening increases how strong the effect is.
Increasing maximal touch light increases the threshold on which it triggers.
By default the effect is very weak and only triggers in absolute darkness, so if you are in a bright room it just might not be visible on your monitor.
Attachments
Screenshot from 2021-09-30 08-13-09.png
Screenshot from 2021-09-30 08-13-09.png (16.55 KiB) Viewed 1902 times

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Touch [1.2] [touch]

by MisterE » Post

When I tried it I was in absolute darkness and using my hand. Will try again just to make sure

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Touch [1.2] [touch]

by MisterE » Post

Yes so... I tested again, and the result is that if I punch a node in darkness then nothing seems to happen. However, if I punch a node and then immediately light up the area with a torch , I see that the touch node entity has been created, but it has no texture and is completely black.

I am using it in an environment with lots of other mods so to test, I tried it again in a vanilla minetest game, and got the same results

I am using linux mint, MT 5.5.0-dev

This issue seems similar to another issue: liil's animal mobs all are modeled incorrectly: only one of the textures is shown in Linux Minetest, the others all appear as white textures. (in this case its black tho \:| )

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.2] [touch]

by Skamiz Kazzarch » Post

Did you try increasing touch brightening? Try setting it to 15.
As I said, the default value makes it only a little bit brighter. (Can you see the stone nodes in the screenshot in the first post?)
I extra re-downloaded the mod from the repo and tried it on un-modded MTG earlier and it worked just fine. (On Ubuntu. Though that shouldn't be relevant.)

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Touch [1.2] [touch]

by MisterE » Post

ok, I see... Maybe my screen is too dim to see it at the default light level. Anyhow, setting it to 15 works thx! its going on my server :)

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.3] [touch]

by Skamiz Kazzarch » Post

Update:
'facedir' nodes like stairs now show the correct rotation when touched.

With the caveat that the fix for https://github.com/minetest/minetest/issues/12686 has been merged in only after 5.6.1 . Thus, unless you use a dev version, this mod is still non-functional for now.

User avatar
RobotZombieWizGirl
Member
Posts: 14
Joined: Wed Jan 18, 2023 22:42
GitHub: RobotZombieWizardGirl
In-game: RobotZombieWizardGirl

Re: [Mod] Touch [1.3] [touch]

by RobotZombieWizGirl » Post

Something I would recommend is maybe modifying the texture displayed on the entity to make it less obvious what the node is, as you normally wouldn't be able to tell apart types of stone just by touching them. Perhaps overlaying a semi transparent "holograph" mask would be good, as it would mimic the effect that games like to use for special senses (i.e. eagle vision from assassin's creed black flag).

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.3] [touch]

by Skamiz Kazzarch » Post

RobotZombieWizGirl wrote:
Sun Jan 22, 2023 20:46
~snip~
First: I don't think there is a simple way to do that. To get the object to look like the touched node I am using a feature written into the C++ engine. At no point do I actually interact with the node definition or it's textures, so there isn't really a way for me to change the objects appearance.

Second: And this is also very important to me. Are you making a feature request, for something that you personally would like to use? Or are you just making suggestions about what could be done?

I am generally happy to accommodate the former, if it's in the scope of the mod and doesn't require too much extra effort (which unfortunately seems to be the case here) to implement.
If it is the later... .
I have some two dozen mods in various stages of completion. Each with 5 - 20 TODO notes about what needs/should/could be done yet, plus some 20 more ideas I will come up with while working on it. No, that is not an exaggeration.
A lack of ideas is not a problem I have, so I am not going to spend my time on ideas of other people, if I don't know for sure, that that work isn't simply going to waste.

User avatar
RobotZombieWizGirl
Member
Posts: 14
Joined: Wed Jan 18, 2023 22:42
GitHub: RobotZombieWizardGirl
In-game: RobotZombieWizardGirl

Re: [Mod] Touch [1.3] [touch]

by RobotZombieWizGirl » Post

Skamiz Kazzarch wrote:
Wed Jan 25, 2023 18:11
First: I don't think there is a simple way to do that...
If you were to implement the idea and couldn't be bothered changing to the cube visual and using the node's textures, you could always use the damage_texture_modifier object property and have the object hit itself for 0 damage in its' update function. That seems like a dirty hack, and it is, but minetest doesn't have good ways to implement a lot of stuff.
Second: Are you making a feature request..?
I would prefer it because it would make the mod less game-breaking (currently you can use it to find ores in total darkness by just running and spamming left-click). Why do you care about that though? You should take suggestions based on how much you like them and whether you think they improve your mod, not because people want it.

User avatar
Skamiz Kazzarch
Member
Posts: 613
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: [Mod] Touch [1.3] [touch]

by Skamiz Kazzarch » Post

RobotZombieWizGirl wrote:
Mon Jan 30, 2023 05:56
Why do you care about that though? You should take suggestions based on how much you like them and whether you think they improve your mod, not because people want it.
Because.. I like it when people enjoy my mods?
Taking your request as an example, I personally don't care for such a feature. I think if someone spends some time handling rocks (like the player character does) they would actually be able to tell apart different types. I don't think running around in the darkness and searching around for ores is any more viable or game breaking then running around and spamming torches, which reveal much more area then this mod. For that mater who in their right mind runs around in complete darkness anyway?

But like, non of that maters?
You request isn't unreasonable and it's not my job to tell you how to enjoy your game. You also aren't asking for anything out of scope of the mod and now that I had an idea how to implement it in a way that doesn't require enormous effort, why wouldn't I take some time to implement it?
I write my mods because I think they do something cool or fulfill a functionality I want, but I publish them because, hey, maybe someone else will also enjoy this content. Which is like a free bonus to the feeling of accomplishment of creating the mod in the first place. Aaand I am probably not conveying this right, but...
What I am trying to get at is, adding something to my mod, because someone wants it, is in itself an improvement to the mod, because the purpose of the mod being here is that people enjoy it

I just don't care for people coming along with their 'cool new idea' ™ that they just thought of and which they will forget by the next day, because implementing a feature which nobody actually wants is just a waste of time.


Anyway, the idea I mentioned and then the other one I thought of while writing this post.
1) I could just have a simple override table which maps nodes to other nodes they will display as. e.g. Every time you touch an ore, it will just display as stone. This could be even mostly automated by scanning for registered ores of type "scatter", which should cover at least 90% of all cases.

2)This one would be a lot trickier, and I am not 100% sure that it would completely work out. It should theoretically be possible to scan for all node drawtypes and all nodebox shapes, then register a new node for every variation with the 'holographic' texture. Instead of displaying the nodes themselves I could just show the corresponding holograph node.
This way, all texture is lost and only the shape information remains. But I don't know if it would work for things like plants and such.

Your thoughts? preferences?


Changing to the 'cube' visual doesn't seem viable, since it only works for cubes. And sure, I could just use multiple cubes for nodeboxes, but positioning and texturing them correctly seems like it would require a lot of effort, and how would you represent things like plants, or nodes which use meshes, etc...

As for the self damaging, yeah, supper hacky, I'm hoping you like one of my ideas better.

P.S. And since you kept talking about this mod as if you were currently using it I finally realized that the engine bug that broke it has been fixed. As long as you have shaders turned on... *sigh* Seems like I need to open a new bug report.

User avatar
RobotZombieWizGirl
Member
Posts: 14
Joined: Wed Jan 18, 2023 22:42
GitHub: RobotZombieWizardGirl
In-game: RobotZombieWizardGirl

Re: [Mod] Touch [1.3] [touch]

by RobotZombieWizGirl » Post

option 2 actually sounds way easier from a design standpoint because it doesn't depend on anything arbitrary or game-specific. for example, custom lua mapgens would completely break the ore scan method.
for plants you just need to make sure it displays with the right visual scale, and use the texture composition <image.png>^[multiply:black^[mask:<holograph.png>^[makealpha:0,0,0. this will clip the holograph texture to the shape of the original texture to avoid ugly square plants. this assumes a fully opaque holograph.png (otherwise it's not possible) so you can use ^[opacity:127 to make it semi-transparent afterward, if you want.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot], Nininik and 9 guests