Skip to main content
Topic: Create a 3D tutorial for addons (Read 21526 times) previous topic - next topic

Create a 3D tutorial for addons

Hello all  ;)

as you have seen, Gauthier has wrote a big Step by Step tutorial about addons creating. ( More info here : http://www.simutrans-france.fr.nf/doku.php?id=en:creation_daddons)

One thing left to this tutorial ( even if it's very well) :  3D.

Then, to complete the tutorial and because I'm really noob in 3D for simutrans, Does anyone have the time and knowlegde to write this tutorial ?

Thanks ;)

You can write it in English, French ( or Spanish if you don't speak English, I will translate it, But sorry for the Germans, I don't speak German  ;D )

I hope someone is interrested  :)

Re: Create a 3D tutorial for addons

Reply #1
that's a nicely detailed tutorial.

Which program did you have in mind for 3D?

for google sketchup, a single tile is setup like so



 

Re: Create a 3D tutorial for addons

Reply #4
I've done some tutorials about Blender and Zeno has some stuff too. The point is that Blender has many more options and procedures than a painting program, so probably it would be a basics tutorial, that should be completed with a specific manual of Blender.

Re: Create a 3D tutorial for addons

Reply #5
The purpose of the tutorials I made is to learn everything, if someone doen't know anything, he can use the tutorial. So if a 3D tutorial is made to complete the pixel-art one, evertything must be explained.

Perhaps a software simpler than blender should be better.

Re: Create a 3D tutorial for addons

Reply #6
As I see it, It's not a matter of complexity but the wide range of possible actions. In a painting program, to create a box, you just need to draw the edges and fill the surfaces. With Blender, you can create a plane and then extrude it, create a box or even create eight vertex and join them through lines and faces. So, from my point of view, it's nearly impossible to write a 3D tutorial that covers every aspect, as many of them are related only with Blender. However, you could write about the most common techniques that would help you to create 3D stuff for Simutrans, but not about everything. For that, there're great Blender manuals for newbies.


Re: Create a 3D tutorial for addons

Reply #8
For google sketchup (free version), it's not too hard to setup the screen for simutrans.
Simply load this template file I made in sketchup and play around with it.
It's easy replicate so you can make your own file and start from scratch.
http://files.[ simutrans [dot] us (site down, do not visit) ]/files/get/Y53kHA0l89/simutrans-template.skp

I haven't found any better way to do it currently, but to render different rotations, select your entire screen with drag select, right click and select "create group", copy it, paste it and then rotate it with the rotate tool. It's best to have a 'base tile' at the floor for each of your objects so that it is easier to scale your renders.

For first time users, you should change some settings, as shown.


To recreate the 'camera aligning prism'


For now, Let's just try and create something 3D in sketchup. It doesn't matter what it is, but simply play around with it. In this example, I've made a very simple house, but once you get used to sketchup, you should easily be able to create much more complex objects.



To render an object in simutrans style graphics change the following settings.
1: Menu: Camera -> Parallel Projection
2: Menu: Window -> Shadows
Shadow settings
- Display shadows: On
- Time: 13:30
- Date: 11/8
- Light: 80 (personal preference)
- Dark: 45 (personal preference)
- Use sun for shading: (optional)
- On faces: off
- On ground: on
- From edges: off
3: Menu: View -> Display edges: off, Display profiles: off (on for comic)
4: Menu: View -> Face style: Shaded with textures
5: Menu: View -> Axes: off
6: Toolbar -> Pointer Arrow -> Right click on blue face of triangular prism to the left with "Align View" and Select "Align view".
7: Toolbar -> Hand icon -> Pan camera to fit your creation on screen.
8: Toolbar -> Zoom (magnifying gl**** icon) or use your mouse wheel to zoom in and out.

A proper zoom level for rendering can be a bit difficult to reproduce if you're using the free version, so this is a bit of trial and error, but you want to work with a render size that's at least 2x larger, or 4x, than the pak tile size you are working with. For pak128 you want that blue square to be somewhere between 253 and 258 pixels large when you render it.

To render, there are two options. One is simply the "Print screen" key, which will give you a render that has no smoothing (Anti-Aliasing) done to it. The other option is to go to Menu -> File -> Export -> 2D Graphic -> <insert name>.png. The export method will give AA, but since the image will be shrunk and given AA anyways, it's quicker to just paste your screen captures into an image editing program directly.


 Now that the files are rendered, you should open them up in your favourite picture editing program so you can piece together your images properly.

 First you should cut away the tile you want and make sure it is a square. The square in the background should be a perfect square, or pretty close to it. It's not too important if the background square is off by 1 or 2 pixels since you will be deleting it, all that matters is that your image is properly aligned inside the square. It's best if you first cut away the background from your main image and it's easier to separate the background from your object if there is no smoothing done to the edges. That's why I recommend using the screen shot instead of exporting. If your image editing program supports transparencies, use that so that there are no coloured background pixels on your main image. If your program doesn't have that, fill the background in with a high contrast colour, like magenta or lime green or cyan that's easy to distinguish.

Comparison of screen capture vs. exported render:


 So now you have a square cut away and the next step is to resize it to fit your pak tile size. Once you separate your image from the background, resize it using "bi-cubic", "lanczos3" or whatever claims to be the slowest and best, but never use anything with "nearest" or "linear". This is where it becomes important that you rendered your image in 2x or 4x size. The resizing function gives better results when resizing images if it's a simple number, like 50% or 25% of original size instead of 28.5%, 66.67% etc.

Once you have resized the image, you should clean up the edges, as this is unavoidable when using a resize that has AA. After cleaning up the edges, fill in the background with simutrans transparent blue, R231, G255, B255 (E7FFFF).

Tip 1: Render as many rotations and objects that fit on your screen at once. Much faster to do all the above steps when you have tools like magic wand and batch resize.
Tip 2: You can actually do both print screen and render through export and mix them together. Use the edges of the print screen and the core of the export.
Tip 3: You can do the same when resizing. Do a resize with 'nearest' and also a resize with 'bicubic'. Use the magic wand tool to select the background of the 'nearest' resize layer, then select the bicubic resize layer, hit delete, then merge the two layers. You'll now have crisp edges and a smooth core.
Tip 4: You don't have to use simutrans transparent blue during the render, as done in the template. Render with whatever colour gives high contrast.




the 2D tutorial on the site already covers a lot of the 2D section for 3D renders, so there's no need to replicate it.

please, avoid double-posting ~vilvoh


Re: Create a 3D tutorial for addons

Reply #10
I can give screenshots later today.



Re: Create a 3D tutorial for addons

Reply #13
done and done :)

feel free to edit my guide and images as needed



Re: Create a 3D tutorial for addons

Reply #16
Blender : Maybe difficult to use at the beginning, but with tutorial this is for me the best and the most powerfull  :)
I think this could have some promise. Someone could build a .blend file with all the camera placements and one lamp already in the proper place, and then the artist would only have to build the building. The blend file could also include a rendering platform (ground in the neutral color, unshaded) that displays when rendered and a staging platform (in the same place) that shows the placement for buildings and the heights of different floors, which would not be rendered.
A tutorial would still be needed to explain the techniques (though not the basics of Blender. There are plenty of tutorials out there for that) useful for ST artists.
--Skreyola
You can also help translate for your language with SimuTranslator.

Re: Create a 3D tutorial for addons

Reply #17
The Blender base scene is available at graphics.simutrans.com...link. It's a set of simple master scenes with lightings and different tile sizes, from 64x64 (1 tile) to 384x384 (6x6)

Btw, there's also a google sketchup template for Simutrans at g.s.c... link


Re: Create a 3D tutorial for addons

Reply #19
@vilvoh: Thank you. You're awesome. You are always creating cool stuff for ST. Thank you.
--Skreyola
You can also help translate for your language with SimuTranslator.

Re: Create a 3D tutorial for addons

Reply #20
Thanks skreyola but the google sketchup template is not mine... :)

Re: Create a 3D tutorial for addons

Reply #21
the template on g.s.c. is mine too, actually.
I totally forgot it was on there.
it should be exactly the same as the one I uploaded to files.


Re: Create a 3D tutorial for addons

Reply #23
The Blender base scene is available at graphics.simutrans.com...link. It's a set of simple master scenes with lightings and different tile sizes, from 64x64 (1 tile) to 384x384 (6x6)

Btw, there's also a google sketchup template for Simutrans at g.s.c... link

Interesting. I have not had a chance to look at those yet, but how do they deal with rotations? And is there a standard export process for minimising the time that it takes to get those from Blender to Simutrans-compatible .png files?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: Create a 3D tutorial for addons

Reply #24
The procedure I use is to rotate the camera K times, to get the k views of the object. There must be some way to automatize this process, maybe through a script.

If I remember correctly, Zeno made a Blender script with a similar approach. It creates K cameras, instead of rotating the whole camera set, and then, the script renders the scene from all of them, generating several png images.

Code: [Select]
def getSceneObject( scn, obName ):
for ob in scn.objects:
if ob.name == obName:
return ob
 
return None

# render from all 8 cameras
def RenderAll(BaseFileName):

scn = Scene.GetCurrent()
cont_esc = scn.getRenderingContext()

# Render EAST view
cam = getSceneObject( scn, 'E' )
scn.setCurrentCamera(cam)
cont_esc.render()
cont_esc.saveRenderedImage(BaseFileName + '_E',0)

# Render NORTH-EAST view
cam = getSceneObject( scn, 'NE' )
scn.setCurrentCamera(cam)
cont_esc.render()
cont_esc.saveRenderedImage(BaseFileName + '_NE',0)

# Render NORTH-EAST view
cam = getSceneObject( scn, 'N' )
scn.setCurrentCamera(cam)
cont_esc.render()
cont_esc.saveRenderedImage(BaseFileName + '_N',0)

# Render NORTH-EAST view
cam = getSceneObject( scn, 'NW' )
scn.setCurrentCamera(cam)
cont_esc.render()
cont_esc.saveRenderedImage(BaseFileName + '_NW',0)

# Render NORTH-EAST view
cam = getSceneObject( scn, 'W' )
scn.setCurrentCamera(cam)
cont_esc.render()
cont_esc.saveRenderedImage(BaseFileName + '_W',0)

# Render NORTH-EAST view
cam = getSceneObject( scn, 'SW' )
scn.setCurrentCamera(cam)
cont_esc.render()
cont_esc.saveRenderedImage(BaseFileName + '_SW',0)

# Render NORTH-EAST view
cam = getSceneObject( scn, 'S' )
scn.setCurrentCamera(cam)
cont_esc.render()
cont_esc.saveRenderedImage(BaseFileName + '_S',0)

# Render NORTH-EAST view
cam = getSceneObject( scn, 'SE' )
scn.setCurrentCamera(cam)
cont_esc.render()
cont_esc.saveRenderedImage(BaseFileName + '_SE',0)
Render.CloseRenderWindow()

Re: Create a 3D tutorial for addons

Reply #25
This script looks like and old version of mine, but isn't. Mine needs a camera (Cam) and a sun (Sol) - only one of each. The scripts places the cam & sun in the correct place and orientation for each of the eight scenes, and renders each of the eight views. Distances and lights were calculated for Pak128 standards, feel free to adapt this values in the script to your needs.

Btw, the vehicle/object must be facing left in standard blender view (1) to match the name suffixes indicating object direction :)

Re: Create a 3D tutorial for addons

Reply #26
AEO, an introduction to SKP is needed, can you write it ?

hmm, I don't think an intro is needed as it is one of the simplest 3D programs to learn and when doing a fresh install of the program, it already gives a semi-auto guide.
Myself, I learnt all the commands through the sketchup help: http://sketchup.google.com/support/

in the menu bar, clicking on Window -> Instructor will give the semi-auto guide.



Re: Create a 3D tutorial for addons

Reply #29
AEO I don't understand ANYTHING when you speak about "bicubic", "laczos3", "nearest", "[the thing which is after]", I also saw that you speak about layers, etc ...

which picture editing program do you use ??? ? I really don't understand anything of that ...

Well, layers should be possible in GIMP or photoshop. The layer tip is really aimed at people who know how to use GIMP or photoshop and understands how to use layers and magic wand tools. Perhaps it should be renamed 'advanced user tip'?

The bicubic, linear and lancoz3 are resizing methods. Linear/Bilinear gives hard edges, Bicubic and lancoz3 gives a smoother image.
resize dialogue in photoshop.
In the menu bar: Image > Image size


resize dialogue in GIMP


Re: Create a 3D tutorial for addons

Reply #31
sure, no problem, feel free to edit my tutorial as you see fit.
The only thing that needs to be mentioned is that the background colour needs to be properly cleaned around the edges.


Re: Create a 3D tutorial for addons

Reply #33
Thanks skreyola but the google sketchup template is not mine... :)
Did you make the blend file? That was the main focus of my comment.

If not, thanks anyway for linking to them, and thank you for all the other things you build for ST. :)
--Skreyola
You can also help translate for your language with SimuTranslator.

Re: Create a 3D tutorial for addons

Reply #34
Yes, the set of blend scenes is mine.. :)