User Tools

Site Tools


Sidebar



Minetest Forum
Content Database
Git Repository
Bug Tracker
Website

dev:proposals:paintertool

Painter Tool

Dario's Proposal

In the last developer conference we've talked about a possible creation of “dev teams” focused on certain parts of the mod.

Since that conference i “joined” the “Livery Team” currently leaded by @Blockhead. The livery customization and in general the artistic part is the weak part of this mod, but things might change.

I have some ideas to implement this, one of them is the Train Painter Tool.

What does this item have?

Well you have 2 possible type of customization, the first being the Simple Configuration (SC), and the second being the Advanced Configuration (AC).

What changes between SC and AC?

The Simple configuration is the one that we currently have on the painter tool of the Bike mod. The advanced configuration is completely new and it will allow you to choose from various skins (inspired by the ones of the real companies like DB, FS, OBB etc) through a list that will show you the prewiew of the skins applied to the locomotive or wagon.

Ok but the skins? How do i tell the tool that those are the skins for that locomotive?

All the skins for a certain loco are going to be on the “textures” folder of the locomotive mod. In the painter tool code there will be a list for that locomotive where we are going to write the name of the file of the skin.

OK nice but how can i integrate my own skins for that wagon/loco?

You'll need to put the skin file in the “textures” folder and insert the name of the file of the skin inside the list.

Do you have an image of the new painter tool?

Yes i do, we all have the formspec of the SC and i made a prototype of the AC:

Blockheads's Proposal

Research

Each livery mod comes with its own modus operandi and assumptions. The 3 significantly different mods I considered are:

  1. JRE-E231: Just one RGB colour option
  2. DlxTrains: Different entirely-different texture options. No colour options.
  3. Multi-Component/Doxy: A series of components that are layered and colorized with multiply.

As complicated or featureful as Multi-Component is, it's not suitable for all applications. For instance, in order to paint wagons like DlxTrains, one would need to make each different livery a different 'component', and promise not to color it with anything except 100% white, and promise not to paint multiple components.

Conclusions

I do not believe it is the role of the advtrains core to dictate how liveries are formatted, calculated and applied. There are simply too many ways to do it, none of which could suit everybody. I do believe however that going forward we should have:

  1. A standardised 'train painter' tool that implements basic functionality as a kind of router between the core and wagon mods. We can't keep using the bike painter.
  2. Possibly a standardised train painter formspec, but with totally custom formspec-code provided by the wagon mod embedded within it, leaving only a wagon preview, a close button and save and load buttons as standard features. See my sketches.
  3. The wagon preview again is up to the code of the wagon mod, or at least up to the mod to pass something back to the train painter.

The formspec on_submit is again handled by the wagon mod to allow it to work its own magic. The train painter simply shows what the wagon mod has registered will be shown by calling into the wagon mod's code. Wagons that want the same painting methods can use library functions from e.g. a future version of multi_component_liveries. Other wagons that want to do their own thing can do so.

The formspec sketches

  1. The JRE-E231, in its current iteration, should support recolouring with just a single set of RGBA sliders, plus a small colour palette for selecting preset colours such as the Yamanote line colours.
  2. The DlxTrains wagon livery tool can instead by replaced by the train painter. The train painter will offer the liveries available for that wagon from a selectlist, as well as aging options in another list.
  3. The Konstal 105N and other multi_component_liveries wagons can show a layer & component editor. Layers can be moved up and down with arrows. They have their shape available as a visual icon, plus the name next to the icon. Each layer has a set of RGB sliders, and a button to delete that layer. At the bottom of the layer stack is a selectlist listing all components, and an Add button to add it at the top of the stack.

Load/Save will act like the train copy tool: it will save the livery info onto the stack metadata, and allow it to be restored onto the same type of wagon (or compatible other wagons). It will give an error for incompatible wagons.

… Further discussion to take place at the conference (soon TM)

56i's Proposal

I propose that first, we begin by copying the bikes tool to stop forcing people who wish to colour their trains to have to install another mod which is unrelated to what they want to do.

Then, as time progresses, Blockhead's proposal is implemented.

Then, as even more time progresses, all systems are merged into one:

  • You have components for all trains (a single one for single-component trains), which is compatible with the Konstal.
  • You have presets, which are compatible with DLXtrains system
  • You have RGBA sliders, which are compatible with the E231 system.

When these systems are merged, it makes future livery additions easier as they can fit with a paradigm instead of inventing their own.

Below is a sketch of the formspec:

One can clearly see how it is arranged. The left controls the colour, the centre the component the colour is applied to (Listed are wheels, body and doors, but the specific components can change) and on the right some presets (pictured are those suitable for replicating the london underground).

Also, there is a save button which can save the livery to a slot, and adds the livery to presets.

Any region can be greyed out or reduced to one item. For DLXtrains, maybe only the preset is enabled, and for the E231, only the Colour is applied.

The method of applications are as such:

Method Description Usecase
/colour <train ID> command brings up the formspec. Either owning the train or colour_train privelages are required to be able to run the command Remotely changing an entire train's colour
Paintbrush an inventory item which can be used to paint a train through right-clicking, saves between uses For when you want to colour a specific carriage
Train right-click menu As above, does not save When you cannot use a paintbrush
LuaATC A series of commands which let you do various editing Automatically colouring trains

Also, and i know this is a stretch, but the livery painter should work on LuaATC controlling elements the same way it does to the E231. This helps prevent confusion with nearby LuaATC controlling elements.

An API to change the colour of the LuaATC controller from within is also a good idea, which allows it to give live information on state (red means a train is now approaching a station, pink it has stopped, and red that a train is departing, and then blue when it has no control of a train event.ID == nil).

dev/proposals/paintertool.txt · Last modified: 2022-06-29 08:44 by 56independent