Graphics Workflow

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Graphics Workflow

Post by abregado »

So how do peeps create their terrain tilesets? I saw some references to 3dsmax and Blender, but do you really manually cut out all of the sprites and stick them into a tilesheet after rendering?

Is there an intellegent way to get from a 3d model to a newGRF without epic amounts of manual copy-paste labor?
If thats how its done then outrageous props go out to you guys for making this stuff (otherwise just regular props :) )
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Graphics Workflow

Post by Zephyris »

I've made terrain sets by both hand drawing and by 3D rendering. If you are going to hand draw them, just draw them in the sprite sheet layout. If you are going to render them then there is no need to combine them into a single spritesheet, just reference may different images which contain the individual tile sprites.

But if you think coding terrain sprites is the hard bit of making a graphics set you might have some surprises!
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Graphics Workflow

Post by PikkaBird »

abregado wrote:do you really manually cut out all of the sprites and stick them into a tilesheet after rendering?
As Zephyris said, "a tilesheet" isn't required. There's no reason grfcodec or NML can't read every single sprite from a separate file.
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: Graphics Workflow

Post by abregado »

Righto. I think I see how i can have a NML file read them from separate files... instead of one replace block for all the Grass Tiles, I would make one for each with different filenames.

Im pretty sure my newGRF is correct, once I have this Python version issue sorted out I should have some results.

Most of the terrain in zBase and other terrain newGRFs (RAWR) looks rendered in 3d with a textured plane. Does everyone use the same Blender (or other software) file to calibrate the lighting and positioning? Was there such a thing created to assist with zBase development?
User avatar
V453000 :)
President
President
Posts: 946
Joined: 01 Feb 2011 11:22
Location: Beer

Re: Graphics Workflow

Post by V453000 :) »

RAWR is created in 3ds max, rendered in Vray, and heavily edited in postproduction in After Effects ... I will be writing down the whole pipeline after I am done with the current version 0.0.2 but here is a short edition ...

Currently, one climate is done like this:

0. creating a model which has all 19 variations of sloped terrain - unwrapping the UVW mapping
- I work in centimeters, each of the planes is 1000x1000 cm, with 50cm extra added edge, so 1100x1100cm total (50cm is more than enough, I would have to try to tell how much is the "safe minimum" but I am fine with leaving it as that.
- height of the tile at the final-edge corner (shown as blue) is 224,589cm (-ish, someone around can probably dig the correct angle, but this works (: )
- height of the tile at the inner-edge corner (shown as yellow) is 204,156cm
- camera target is precisely at the center of the tile
- relative camera position to target is x= 2090,702cm, y=2090,702cm, z=1707,052cm with camera Lens set to 86,8mm, FOV to 23,431 degrees, and of course camera is set to Orthographic projection
- render to 256x256 or 256x320 for taller sprites (or moar? :) ) ... this is doable because the horizontal 256 always stays the same so it always fits
- that applies to all programs, not just 3ds max or blender

- note: each of the planes has 5% extra on every side, to allow cutting from the image without any transparency later

1. saving that mapping to png, mass-creating textures in after effects, with interlinking so e.g. if I change temperate grass, it will change everywhere it appears

2. separating the 19 tile models of the terrain

2. 19 separate cameras, each looking at that one plane

3. animating texture on all of the planes

4. 19 rendered cameras with (currently) 14 frames each (bulldozed lands, grass, rough grass kinds, rocky grass kinds, snow stages, water and water shores, city concrete tiles)

5. I take the separate images into After Effects, there I put them together into one large sprite sheet, cut them into non-antialiased sprites (important part; also, this is done twice - for x4 and x1 zoom, to make the hard edges correctly), colour-correct them (like manually adjust the brightness/darkness of hills, just for more clear look)

6. as an extra, my final output composition of each kind (like terrain, tracks, roads, farms, bridges, ...) comes in multi-frame animation where each climate/variation as one frame.

I think that is about everything you need to get landscape sprites done, for tracks I do some extra convenient stuff like I render tracks separately and compose actual terrain tiles under them, or for bridge heads I overlay them

I attach an example output sprite here (is too large for attachments) - 13 MB - https://dev.openttdcoop.org/attachments ... D_0000.png - hint: the order in which I sort sprites is the order in which the game sorts them so you can just load them by a template one by one and the sprite IDs will match (from my experience, it is useful to use same sorting as the game, saves a ton of re-ordering and re-sorting in postproduction etc.) ....... the sorting which type of terrain (mud, grass, water, ...) is I think also by the game, except the mud should be at the top before everything else; that is just a bug in my latest render :)

I personally think the postproduction is a must do, especially the cutting. Nobody cares if you got 1 file or 1000 separate sprites, but whether the edges of ground tiles are antialiased, matters a lot (alpha on ground tiles does bad things in the game). Also, if you have an option to render out perfect shapes without antialiasing, AND they will fit into the wtf pixel patterns that openttd accepts, you will not need the postproduction for cutting; I do not know such method however. Tell me if you discover it :P

I also add a zip with the tile masks. The x4 ones are originally from juzza1, the x1 ones are just taken from the original game just for that shape. They will be in the RAWR repository later, I just need to sort things out there, so I just attach it here so you could use it immediately :)

That is all for now, I think I will turn this into a quick and dirty wiki page on RAWR devzone, it is quite exhaustive what to do just to get things work.

P.S. Originally I had a different approach - I rendered a model of combined 19 tiles together, and then cut them from the whole render, but even sub-pixel imprecisions make the landscape look bad when put back together in the game, especially noticeable with tracks and similar precision-critical objects (RAWR 0.0.1 suffers from that)

P.P.S. NEVER ask me EVER how I got to those values XD [by testing and endless setting up]
Attachments
RAWR_tech_tileSetup.png
HOW TO RAWR - Tile/Camera setup
(85.7 KiB) Downloaded 3 times
A_0004.png
Old method - this is render, was then cut into separate pieces. Not precise enough. :)
(1.33 MiB) Downloaded 3 times
TILE_MASKS.zip
Them masks. NOTE: I am not sure if they are 100% perfect for the game, but they are probably as good as anything else, and I do not have anything better. It seems to work.
(91.85 KiB) Downloaded 100 times
ImageImageImage
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: Graphics Workflow

Post by abregado »

Wow, ok. I have a feeling Ill be dealing with a lot of the edge alpha problems the way I've done it.
I exported the zBase sprites and then cut the grass tiles out roughly to use as masks. Then I've arranged them in a usable way for editing in GIMP.

So far all of my changes have been hand drawn modifications to the tiles, so things wont match up perfectly as in a 3d approach.

I guess I will be spending a while discovering all of the pixel locational data for my tiles to put in the NML :( Actually I just realised that I cant even import this how I currently have them becasue the game will render the whole rectangluar area that I designate! Probably best to just use your Tile masks and start again! Do you also have the pixel locations for your masks?
Attachments
topotiles1.png
topotiles1.png (715.05 KiB) Viewed 699 times
User avatar
V453000 :)
President
President
Posts: 946
Joined: 01 Feb 2011 11:22
Location: Beer

Re: Graphics Workflow

Post by V453000 :) »

What do you mean by pixel locations?

Their position on the render? If you render separately 256x256, they fit, they have the same size (or centered, they might be 256*320)
Their XY offsets in NML? Yeah I have that template somewhere in RAWR, see the RAWR repository on devzone https://dev.openttdcoop.org/projects/rawr/repository

I would indeed suggest to redo cameras into separate tiles, not just because of finding positions of masks there, but also because of the precision it gives (it matters).
ImageImageImage
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: Graphics Workflow

Post by abregado »

V453000 :) wrote:What do you mean by pixel locations?
Yeah I ment the XY Offsets. Terminology fail.

I'll dig around in RAWR. Right now it seems my biggest issue is getting the nml encoder to install. First it was Python version issues and now it wont detect that I have Python Image Library installed. gah!
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Graphics Workflow

Post by planetmaker »

The posts concerning NML installation were moved to the NML thread: http://www.tt-forums.net/viewtopic.php? ... 4#p1146854
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: Graphics Workflow

Post by abregado »

thanks planetmaker
V453000 :) wrote:separating the 19 tile models of the terrain
Looking at your examples there are 23 tiles in each series. Why is that?

I've arranged the tile masks into one document to get the xy offsets working in game with flat color first. Once i get the compiler working properly ill just make a "blank" tileset based on the mask file to calibrate it.

Another question. Why do the last 4 of the tile masks have their tops masked?
User avatar
V453000 :)
President
President
Posts: 946
Joined: 01 Feb 2011 11:22
Location: Beer

Re: Graphics Workflow

Post by V453000 :) »

I have 23 types of terrain currently, that means:
3x Bulldozed land (completely bulldozed, and 2 transition stages to normal grass)
1x normal grass
1x rough tiles
1x extra rough tiles (only flat tiles matter)
2x rocky tiles
1x water and water shores
4x snow and transitions between snow/grass
1x city tiles
9x farm tiles (a cycle of tiles as farms animate)

I have 19 shapes/slopes/models for every of those 23 terrain types:
1x flat tile
4x tiles with 1 raised corner
4x tiles with 2 raised neighbouring corners
2x tiles with 2 raised opposite corners
4x tiles with 3 raised corners
4x tiles with full diagonal slope

This spritesheet shows that, except there are not the 9 farms, I do those separately now.
https://dev.openttdcoop.org/attachments ... D_0000.png

This render shows one type of terrain with all of the 19 tile types; I dont use this rendering anymore due to the terribly poor precision but it is nice to demonstrate stuff here :P
http://www.tt-forums.net/download/file.php?id=184615

RAWR is a mess now as I am redoing a lot of the systematic stuff, but when I sort it out and release 0.0.2, I will write a clear and unified documentation.

The last 4 masks are for tunnels and things that are taller than just a land tile :)

Ask away about anything that is unclear :)
ImageImageImage
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: Graphics Workflow

Post by abregado »

YESSS! COMPILATION SUCCESS!
Im seriously pleased with tonights work (even given the result ROFL!)
Extra props to you guys/gals for pioneering this stuff
Attachments
blerg.png
(751.41 KiB) Downloaded 1 time
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4766
Joined: 09 Sep 2007 05:03
Location: home

Re: Graphics Workflow

Post by Alberth »

Nice!

Sprites look like you need to raise them a tile-height in y direction.
Being a retired OpenTTD developer does not mean I know what I am doing.
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: Graphics Workflow

Post by abregado »

I think I will create a basic flat color grid tileset to help with the alignment. I see now what everyone means when there is alpha on the terrain!
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Amazon [Bot] and 12 guests