orwell96 / advtrains

Minetest Mod: Advanced Trains
https://forum.minetest.net/viewtopic.php?f=11&t=14726
GNU Lesser General Public License v2.1
42 stars 13 forks source link

Feature idea: train displays (display 'outside' text on the train instead of as infotext) #40

Open gbl08ma opened 7 years ago

gbl08ma commented 7 years ago

It is usual for trains, especially modern ones, to have displays above the windshields. These can be used to display the destination, line name, train number (e.g. on subway lines with multiple trains), a "out of service" message, or a combination of these. Since there are many possibilities, I think it would make sense to just accept a string for the message to display.

That display could be manually set by the conductor (a "wagon properties" formspec already exists), or with ATC commands (both Lua and non-Lua).

I'm not sure how it could be implemented: the most straightforward solution I see is having each wagon type have designated display locations (or none, for example in the case of steam trains...), and a texture with text would be attached to those locations (like signs and digilines LCDs do). These would then move with the wagon like the decoupling indicators on multi-wagon trains.

Even though a train could eventually have multiple displays, I think it will be simpler to implement if all displays show the same message. Trains without displays would just ignore the ATC commands for display setting.

gpcf commented 7 years ago

I think this requires a change in the engine to make it render text on stuff.

gbl08ma commented 7 years ago

No, I think you can just use the trick signs and display mods use, which is to have one texture per character, then composing that texture in a bigger one that's shown in front of the display/sign node. See my screenshot on #3 for an example.

It would have the advantage of being able to make the text look boxy as if it was shown on a low-resolution LCD.

gpcf commented 7 years ago

Can you release that mod? I really want to have those displays!

orwell96 commented 7 years ago

Having destination text on trains is actually very easy, since the trains are already entities. I can just settexturemod(). When I do this, there will also be such displays inside the trains, maybe I make them be displayed in the head-up display in passenger seats. I'll let this on the To-Do-List.

gbl08ma commented 7 years ago

Actually, I forgot to mention, but displays inside trains would be part of the idea (I thought that would be hard). But they would display different things from the outer displays. For example, in the subway system in my map, I was thinking of using them like this: Outer display - train destination (usually, the station at the end of the line) and number Inner display - next station indication (ATC rails would make this easy, also, it's extremely similar to how some real life systems do it) However, if making the inner and outer displays show different things is too hard, it's no big deal.

@gpcf it needs some polishing, right now the center part of the display (which acts as digiline receiver) is a different node than the two blocks to the side, I'll see if I can make those two sides spawn automatically, clean up the code a bit and release it.

orwell96 commented 7 years ago

That was what I was thinking of.

gpcf commented 7 years ago

@gbl08ma, I think it's better to release the half-finished mod now, so other people can have a look at the problems and try to fix them.

gbl08ma commented 7 years ago

@gpcf, see https://github.com/gbl08ma/textline