Traincraft logo
Home Download Create Wiki

Warning, this page is intended for people who wish to contribute content to the mod or make add-ons for it.
It's intentionally bland because it doesn't need to be pretty.

Table Of Contents:
- Necessary Tools
- Bugs
- Pro tricks
- Upcoming changes
- Official style rules
- 3rd Party add-ons

- Scaling tool

Necessary tools:
Modeling program:
- SMP Toolbox: https://chiel.games/SMPToolbox.zip (Note: the dev of Toolbox took down the download link so Chiel, one of our admins, is hosting this mirror).
- FMT: a new multiplatform modeling tool made by Fexcraft, with all the features and then some of SMP Toolbox, it's suggested you use this instead:
https://github.com/Fexcraft/FMT-Standalone/releases

If you are making your own content pack there is partial support for .obj and .json formats, but these will not be accepted for official releases.

External image editor (pick one, listed in order or recommendation from most to least):
- Paint.net: https://www.getpaint.net/
- Gimp:https://www.gimp.org/downloads/
- Krita: https://krita.org/en/
- Piskel (incapable of texture noise, but doesn't require downloading): https://www.piskelapp.com/
- Other opacity/alpha layering supported image editors.


Bugs
- The in-game render does face culling, which means the back-faces of geometry, aka the texture on the inside of the cube, is fully invisible. SMP Toolbox however does not use any form of culling. This can be disabled on a per-part basis with the animation system.
--- You can read more on how exactly face culling works here: https://www.khronos.org/opengl/wiki/Face_Culling
- Parts intended to animate, such as wheels and pistons, will have their "offset" defaulted to the center unless otherwise defined.
-- defining the offset will let you control where the animation centers.
- If you make the texture resolution larger than what's mapped in SMP Toolbox you can't go back to editing the texture with the paint tools in toolbox.
--- Also if you do that be sure to check "Allow HD Texture" in the editor under Model -> Model Settings.
- We can't load the config files for seats, hitboxes, collision points, gun points, etc, it has to be done manually in the entity file.
- If you are attempting to implement the model yourself:
--- SMP Toolbox does not automatically set the part names of geometry, these have to be written manually in the exported java file, but write them anyway so you know which part is which, CTRL-F is your friend.
--- The default package and imports are incorrect in the output java file, they will have to be fixed to match the content pack you are implementing them into.
--- With SMP Toolbox we only support the "As Flans Java Model Large Model Fix" export.
--- For FMT we have our own dedicated Trains-in-Motion (TiM)/Traincraft export option. (Thanks Ferdinand!)
- Sometimes textures will show z-fighting or stippling, like in the following image, the bottom two cases are fixed automatically by the game render, however the top one is not fixed by the render because neither cube is flat.



Pro tricks
- The face culling mentioned before can be used for things like having windows on different positions to better suit outside look vs inside view, or different kinds of layering.
-- Try making cubes inside-out to really cheat interior part counts!
- Use alpha layering (Opacity) in an external image editor to make certain pixels invisible. It must be full alpha, so it's best to use a selection tool and press delete on the parts you want invisible. Partial alpha support is in the works, but the game render is jank.
- Shapeboxes allow you to edit each corner's exact position with great detail and it's no extra overhead versus a standard box, however this can distort textures.
- You can copy and paste parts between SMP Toolbox instances using the options under the edit menu.
- If you want your texture to be more detailed, multiply the base resolution using an external editor.
---NOTE: Technically you can also do this by making the box bigger and stretching it down with shapeboxes, but this makes texture noise VERY difficult, and would break the automated texture noise when we get it working (and MoW stuff if we ever do it).
- Holding right click and pressing W, S, A ,or D will allow you to pan the camera in SMP Toolbox.


Upcoming features!
- Parts will support animations and perform other graphical features using tags in the geometry name.
-- all animations are followed by a number, which can be manipulated in the entity file to modify the animation.
Here's a list of planned tags:
1. "lamp" for lights that will render in a cone.
2. "lantern #" for lights that glow in a sphere.
3. "glow" for parts that glow without actually emitting light (a vat of lava for example).
4. "smoke" for train exhaust such as a chimney, these cubes are not rendered, only used as a spawn point of sorts.
5. "steam" for steam exhaust such as a piston valve, these cubes are not rendered, only used as a spawn point of sorts.
6. "door swing" doors that would swing left or right.
7. "door slide" for doors that slide open and closed like on a modern tram or underground rail.
8. "scaleinventory" will scale the height of the cube based on how full the inventory is.
8.1. "scaleblockinventory" is the same except it will use the texture of the first block in the inventory.
9. "rendercrate #" is used to render a cube based on the percentage of inventory filled, this percentage is defined by how many different groups there are.
-- The # defines it's group number this allows multiple parts to represent the same value.
10.1. "renderblock" the same as above but using the texture of the block. Each group will use a different block in the inventory, so the first group will use the first block, second uses the second, and so on.
11. "liveryimg #" is used to display a custom livery image such as a company logo, entries with the same number will display the same logo that is defined in the GUI.
12. "nocull" will disable the face culling for that part.

Official content rules
- Models must be made with a supported modeling program (listed above)
- Textures should not be shaded, let the render handle that.
- The RGB values of the colors should be between 30 and 225 before noise.
--otherwise noise and lighting can make things blindingly bright, or void dark.
- Texture mapping need be an optimized resolution.
-- If the mapping has a lot of empty space try and reduce the mapped texture size under model settings.
- Flat cubes must be textured on both sides or use the nocull tag.
- The player is 9 microblocks wide and 21 microblocks tall (65% of normal size), 5 microblocks for legs, however width for transports is still required to be around 20 to 24 range in most cases for consistency sake.
- The wheels should be 11 or 12 microblocks apart to line up with rails.
- Seats should be able to fit the player.
-- This often means making the seats wider than they should be and reducing the rows/columns of seating.
-- For cars with individual passenger rooms it's common practice to only have one row of rooms for this reason.
- nameplates and numberplates must be on their own separate geometry.
- All pantographs should be modeled in the 'up' position, and angled parts should have their angle from rotation.
-- This will allow the animator to raise and lower them realistically once support is added.
- Texture noise must maintain a 1 pixel per microblock ratio, even if the rest of the texture does not.
- Larger cylinders such as boilers or large chimneys must be done as octagons.
- Octagons should be done using cubes and triangle shaped cubes.
-- With FMT you can make octagons using the clinder tool, it's much easier and more efficient to render.
- Details in the cabin and on the exterior are to be done using mainly textures and alpha layering instead of actual geometry.
- It is advised to keep trains and rollingstock around 200 parts.
-- This design is not only focused on keeping the old feel of TC but also keeping in mind users with weak computers.



3rd party content packs
- Your pack your rules, just consider this guide as "experienced advice."
- If you would like to be featured, please contact us on discord.
---NOTE: being featured will require the add-on being hosted on a reliable source such as curseforge.
---ADITIONALLY: Eternal will need to double over the mod to be sure it doesn't contain anything malicious or inapproporate, Traincraft is a kid-friendly community!
---IMPORTANT: don't forget if you list TC as a dependency on curseforge, it will automatically show on our dependants page.

This calculator works by taking your desired in-game width, and dividing that by the actual width, to create the proper scales for everything else.
Model train scales can be used alongside actual train scales.
If the dimensions you have are not in milimeters, google has an inbuilt calculator for that.
In-game width in microblocks:
Real width in milimeters:
Real length in milimeters:
Real height in milimeters: