Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

"You got a graphic - now what?" - Discussions

Started by Leartin, February 01, 2021, 03:01:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


This is the thread for discussions, questions and comments to the tutorial "You got a graphic - now what?"

Isaac Eiland-Hall


Instead of tilecutter (or cutting tiles according to the temlplate shown), one could also use the "modular building apporach" - I think used in some pak128.britain attractions and factories:
- prepare "modules" - buildings that fit on 1 tile, and look reasonably even if shown alone.
- then combine them to form a larger factory, attraction.

Also tilecutter is now broken, like if the cutting template got somehow inverted, and cutting away what should be left, and leaving what should be cut off.


Modular building approach is the next chapter ;) not quite as completely standalone buildings though.
Plans so far:
- Modular Buildings, introducing factories with their goods, productivity and expand
- Fields, including a mention to define buildings as fields
- Powerplant, explaining boosts and smoke
- Depot (icon, cursor, waytype)
- Station Extension (enables, capacity, why it might not show up in the game menu...)
- Stops (pretty much just an explaination of 2,4,8 and 16 rotations)
- harbours (4 and 16 rotations, multitile harbours)
- docks? (Never used them, might need some experimentation)

I have not planned for townhalls and monuments yet, but they might fit best as the very next chapters to be done with them, as they won't fit anywhere later.

After buildings, the vehicle segment starts. Not sure about everything else yet.


Thank you very much for spelling out the shorthand notation. This area of Dat-filing have been a complete mystery to me, and reading your nice guide has at least open the door a litle bit for me to understand.
However, did you make a mistake?
In the "very small example" you go through step by step how each parameter gets calculated, but something doesnt make sense to me:

In the very bottom part of the example

[ 0 ] [ 0 ]=2.0
[ 0 ] [ 1 ]=1.0
[ 0 ] [ 2 ]=0.0
[ 1 ] [ 0 ]=0.1
[ 1 ] [ 1 ]=1.1
[ 1 ] [ 2 ]=2.1

shouldnt it read:
[ 0 ] [ 0 ]=2.0
[ 0 ] [ 1 ]=1.0
[ 0 ] [ 2 ]=0.0
[ 1 ] [ 0 ]=2.1
[ 1 ] [ 1 ]=1.1
[ 1 ] [ 2 ]=0.1

Also, could you perhaps expand on what exactly the dollar sign ($) is doing?  Is the value increasing by that amount? For example, how will a given calculation be different with "$0", "$1" and "$2"?


Thx, fixed it, that was a mistake indeed.

The variables are hard to explain, since they are not really user friendly.
Say you have a 2x2 without rotations or seasons. So the parameter can be written like this:
Of the six brackets, two contain multiple numbers and need references. The others can be ignored:

          -  $0   $1   -  -  -

I think it's still easy to see that the images would be arranged in a square, with the northwest corner (0,0) being in the first row and column.

Now add seasons.

          -  $0   $1   -  -  $2

We use the same arrangement as before, and have the five seasons next to each other. The "times two" is because each single season takes up two columns worth of buildings.
So far, so good. But what if the building gets four rotations?

          $0   $1   $2   -  -  $3

Because rotations come before everything else, it's the first variable, hence is referenced by $0. Everything coming after it has to change designation. Else, the rotations here are added as rows, since square-ish sprite sheets are easier to look at. If they were added as columns, it would have been

          $0   $1   $2   -  -  $3

Why ten? Because the building is two tiles long and has 5 seasons, and 2*5=10. Or: Because before we added rotations, the spritesheet was 10 columns wide.

If that explaination is good enough, I'll see how I can work it in.


Thank you very much, yes that does indeed make sense now. I think it would make a great addition to the existing shorthand descriptions.


Just something I want to mention before someone else nitpicks: I'm aware that in addition to the "kraftwerk" name, "Power Plant" is also an option. I simply choose not to mention it, because it has to be written exactly like that - with capitals and space. But some discussions on the forums indicate that names shouldn't have spaces, since that messes with the translator, and since it can't hurt not to have them, the tutorial tells not to use them as well. Hence stating that there is a game functionality that requires someone to use them would be confusing and inconsistent. Personally, I haven't seen anyone use "Power Plant" in a name either, probably because you need to check the code to know about it (I knew that 'kraftwerk' wasn't the only option, but wouldn't have guessed space and capitals...)