Formspec on surface

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Formspec on surface

by MirceaKitsune » Sat Nov 21, 2015 20:25

https://www.youtube.com/watch?v=LBfUVIhFaLc

https://www.youtube.com/watch?v=PxLNIvuHj00

This is a feature I've been thinking about for a bit now, and there are certainly other Minetest users who agree it would be awesome to have. There are many engines that support interactive surfaces: The best example is Doom 3 (idTech 4), famed for having screens around the map that players can manipulate and click buttons on. Then there's Second Life, which supports interactive web pages on surfaces which you can click / scroll / etc like in any browser.

What I'm trying to suggest for Minetest is a simpler implementation: Formspecs on surfaces. First of all, I'm wondering whether it's possible to dynamically generate a texture from a formspec, which can be applied to any drawtype or surface. And second, if we can detect where the player's crosshair is pointing on that texture, so buttons and input fields can be clicked on and selected.

What purpose would it serve? Well doh... realistic terminals of course! We could create node definitions for screens, containing formspecs that operate nearby devices or have other effects on the surrounding world (calling Technic mod here). One idea: Keypads that open locked doors when you introduce the right combination. Obviously we can already do this... just that the formspec floats in front of the player who clicks the screen, whereas with this ability it would appear on the actual surface and work as an in-game touchscreen.

Here's a crude mockup of how what I'm imagining would look like:

Image

snapshot9.png
snapshot9.png (941.33 KiB) Viewed 1564 times
 

User avatar
kaadmy
Member
 
Posts: 627
Joined: Thu Aug 27, 2015 23:07
GitHub: kaadmy
IRC: KaadmY
In-game: KaadmY kaadmy NeD

Re: Formspec on surface

by kaadmy » Sat Nov 21, 2015 21:00

+1 for this idea, but performance would suck ;)
Never paint white stripes on roads near Zebra crossings.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Re: Formspec on surface

by MirceaKitsune » Sat Nov 21, 2015 21:05

kaadmy wrote:+1 for this idea, but performance would suck ;)


Don't think it would have to: The texture would only need to be re-generated when there's a change. What would be harder is detecting where every nearby player's crosshair is pointing on the surface, to highlight buttons and process clicks... but that shouldn't be way too heavy either. As with most features, the real problem will be finding someone with the knowledge time and energy to do it ;)
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: Formspec on surface

by Sokomine » Sat Nov 21, 2015 23:09

Sounds cool at first, but might turn out to be more of an annoyance than help when actually playing. Navigating into a position so that the text can actually be read might quite often require noclip - a priv seldom granted on servers. Aiming at the right spot might also be tricky. And then there's clicking as such - left-click is usually digging, so that'd leave us with right-click - something we already got, although for the entire area.

I'm not sure if it's already possible to create i.e. 10 entities and let them hoover in front of a node and react to clicks. That way a keypad could be emulated.

Dynamic textures (especially with text) for inscriptions such as on signs would be far more helpful I think.
A list of my mods can be found here.
 

User avatar
benrob0329
Member
 
Posts: 1192
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
In-game: benrob03

Re: Formspec on surface

by benrob0329 » Sun Nov 22, 2015 03:13

MT would need a new texturing engine (I think) for this to be properly implemented. (Number one thing being dynamically textured nodes, number two being actual x/y/z of the crosshair on the node)
 

jin_xi
Member
 
Posts: 165
Joined: Mon Jul 02, 2012 18:19

Re: Formspec on surface

by jin_xi » Sun Nov 22, 2015 08:02

Sokomine wrote:I'm not sure if it's already possible to create i.e. 10 entities and let them hoover in front of a node and react to clicks. That way a keypad could be emulated.


you can already do this and you really only need one entity. you can figure out where on the entity the click was with a simple calculation, see painting mod for an example.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Re: Formspec on surface

by MirceaKitsune » Sun Nov 22, 2015 12:18

jin_xi wrote:you can already do this and you really only need one entity. you can figure out where on the entity the click was with a simple calculation, see painting mod for an example.


Now that I think about it, this could be done with a single entity to some extent! Well maybe: You can detect where on the entity the player clicks, but how do you dynamically update the texture and make multiple clickable items? A combined texture can be used and updated ("tex1.png^tex2.png") for some drawn items, but how do you do things like text? You also can't have input fields that you can type into directly, as you would if a real formspec was being emulated.
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Formspec on surface

by Hybrid Dog » Mon Nov 23, 2015 17:01

l think at first, infotext should be put to the node and not to the top left
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 2 guests

cron