The International Simutrans Forum

 

Author Topic: "You got a graphic - now what?" - Discussions  (Read 545 times)

0 Members and 1 Guest are viewing this topic.

Offline Leartin

  • Oh no, not him again!
  • Devotee
  • *
  • Posts: 1575
  • PAK-DEV P192C
  • Languages: DE, EN
"You got a graphic - now what?" - Discussions
« on: February 01, 2021, 03:01:27 PM »
This is the thread for discussions, questions and comments to the tutorial "You got a graphic - now what?"

Offline Isaac Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3911
  • Providing hosting for Simutrans projects
    • pc2.io
  • Languages: EN
Re: "You got a graphic - now what?" - Discussions
« Reply #1 on: February 02, 2021, 12:52:47 AM »
Posted it here: https://old.reddit.com/r/simutrans/comments/laiyzi/tutorial_you_got_a_graphic/ as I thought it might be of interest :)

Offline Vladki

  • Devotee
  • *
  • Posts: 3716
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: "You got a graphic - now what?" - Discussions
« Reply #2 on: February 02, 2021, 09:49:26 AM »
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.

Offline Leartin

  • Oh no, not him again!
  • Devotee
  • *
  • Posts: 1575
  • PAK-DEV P192C
  • Languages: DE, EN
Re: "You got a graphic - now what?" - Discussions
« Reply #3 on: February 02, 2021, 10:39:32 AM »
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.

Offline Ves

  • Devotee
  • *
  • Posts: 1820
  • Languages: EN, SV, DK
Re: "You got a graphic - now what?" - Discussions
« Reply #4 on: February 02, 2021, 03:16:25 PM »
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

Edit:
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"?
« Last Edit: February 02, 2021, 03:28:01 PM by Ves »

Offline Leartin

  • Oh no, not him again!
  • Devotee
  • *
  • Posts: 1575
  • PAK-DEV P192C
  • Languages: DE, EN
Re: "You got a graphic - now what?" - Discussions
« Reply #5 on: February 02, 2021, 05:09:12 PM »
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:
Code: [Select]
BackImage[0][0-1][0-1][0][0][0]Of the six brackets, two contain multiple numbers and need references. The others can be ignored:
Code: [Select]
          -  $0   $1   -  -  -
BackImage[0][0-1][0-1][0][0][0]=./myimage.<$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.
Code: [Select]
          -  $0   $1   -  -  $2
BackImage[0][0-1][0-1][0][0][0-4]=./myimage.<$0>.<$1+$2*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?
Code: [Select]
          $0   $1   $2   -  -  $3
BackImage[0-3][0-1][0-1][0][0][0-4]=./myimage.<$1+$0*2>.<$2+$3*2>
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
Code: [Select]
          $0   $1   $2   -  -  $3
BackImage[0-3][0-1][0-1][0][0][0-4]=./myimage.<$1>.<$2+$3*2+$0*10>
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.

Offline Ves

  • Devotee
  • *
  • Posts: 1820
  • Languages: EN, SV, DK
Re: "You got a graphic - now what?" - Discussions
« Reply #6 on: February 02, 2021, 07:04:26 PM »
Thank you very much, yes that does indeed make sense now. I think it would make a great addition to the existing shorthand descriptions.

Offline Leartin

  • Oh no, not him again!
  • Devotee
  • *
  • Posts: 1575
  • PAK-DEV P192C
  • Languages: DE, EN
Re: "You got a graphic - now what?" - Discussions
« Reply #7 on: February 08, 2021, 10:50:56 PM »
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...)