[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.

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

by Skamiz Kazzarch » Post

The idea was to still use visual = "item" which means that I wouldn't gain any more direct control over the texture. Additionally there is the issue of paramtype2 = "meshoptions". It seems unlikely (Though I haven't tested it.) That the object can accurately change depending on a provided param2, so I would have to provide a mesh for each of those.

Noting of this is unsolvable of course, but it adds a significant amount of effort to the cost of making it happen.

Whereas a simple table is a simple table. And all anyone has to do to get support for their game/mod of choice is ask for it. (Preferably here, since I don't know how to get github to show me the issues on all my repos.)

I also have quite a bit of experience with writing formspecs, so I wouldn't find it too difficult to make this table configurable from withing the game, probably locked behind the 'server' priv me thinks.


Anyway I think I made my own preference more than known ;P . But if you say you really really want to try the holographs I will look into it. Probably on the weekend, when I have more time.

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

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

by MisterE » Post

you can scan the node def, determine if the node is a nodebox, model, or normal node. Set the entity's display accordingly, copying from the node. Then set the texture to a neon green solid color texture, and viola.

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

Whelp, turns out plants aren't displaying correctly anyway, so this was coming one way or another.
screenshot_20230204_143236.png
screenshot_20230204_143236.png (42.19 KiB) Viewed 490 times
edit:
Guess what. Snow layers also doesn't display correctly.
screenshot_20230204_145149.png
screenshot_20230204_145149.png (130.53 KiB) Viewed 487 times
Fixing that would require switching node box displays from one object, to a separate object for each box in the nodebox. That would also fix the Z-fighting on the inner sides of stairs, but ...

This was such a nice simple mod with less then 100 lines of code. Polishing out the details always turns out to be way more effort then the basic functionality.

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

if it turns out to be too much of a hassle getting the object method to work you could always display some particles around the node. that way you don't need to keep track of the object to remove it (using particle lifetime)

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

Keeping track of the objects and their locations is actually fairly easy. I am already doing it, so that if a touched node is mined I can remove the associated object before it would naturally run out of time.

The difficult / annoying part is analyzing the nodebox definition and spawning a cube for every box in it, with the correct scaling and position, then cutting out the correct texture parts so that there are no stretched pixels. The last part could be skipped by using an uniform texture, but that would make it harder to read the shape information.
screenshot_20230205_123707.png
screenshot_20230205_123707.png (112.63 KiB) Viewed 463 times
Particles might be viable...? I could spawn a bunch of them and set them to collide with nodes. That way they would naturally settle on the surfaces. But snow for example has a different collision box from it's visual shape, so they would sink into it and disappear. Also it wouldn't be possible to display nodes which don't have collision, like grass and torches, though personally I wouldn't mine them having that kind of drawback.
This would certainly be a very different approach to the whole concept of this mod, though no less valuable for it.

The main issue I foresee with it, is that it would require a bunch of particles to make each node discernible and, last I heard, particles are no more optimized then regular objects...

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

Progress update: I've got the shape down.
screenshot_20230206_095320.png
screenshot_20230206_095320.png (121.97 KiB) Viewed 444 times
Now I just have to do the texture cutout.

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

Got it working!
screenshot_20230206_122646.png
screenshot_20230206_122646.png (112.84 KiB) Viewed 437 times
That was... urgh.
The good news. Nodeboxes now don't struggle with Z-fighting and there is a shape only mode. (Enable in settings.)
The bad news: The new method assumes all textures are 16*16 pixels, because Minetest is quite awful about giving programmers information about media.
In rare scenarios textures might not be applied correctly.
Game might or might not crash if it encounters a nodebox which isn't pixel aligned. That would have to be tested.
It will also almost certainly cash if someone defined their nodeboxes wrong. (from max sizes to min sizes, instead of from min to max as it should be)

Display of plantlike and raillike nodes is still wrong, but since it didn't work correctly to begin with I am not dealing with it right now.

Also discovered another bug in the lighting of objects, apparently they now can only reach half brightness from maximum. Joy. ...

Since the mod isn't particularly worse of then it was before, I will probably leave it at this for a while.

User avatar
LRV
Helper
Posts: 378
Joined: Mon Dec 19, 2016 17:29
GitHub: Mooncarguy
In-game: Mooncarman Mooncarguy

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

by LRV » Post

Skamiz Kazzarch wrote:
Sun May 07, 2023 09:09
Mods I would like to have moved:
[...]
viewtopic.php?f=9&t=26903
Topic follows the requirements and was therefore moved to 'Mod Releases'.
This is a cool signature. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests