How to code vehicles (in short)?

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

User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: How to code vehicles (in short)?

Post by Zephyris »

toooomas wrote:Actually the program (game) needs some kind of boundaries (bounding boxes) for vehicles. Without those the further development is quite limited, if the vehicles length can only be always 1/2 of the square. But this is something for the developers to discuss.
The program does have bounding boxes for vehicle, it just doesn't support bounding boxes larger than half a tile (and without serious revamping of how tunnel entrance work this won't change).
akaction
Engineer
Engineer
Posts: 50
Joined: 25 Feb 2010 09:18
Location: Russia, Moscow

Re: How to code vehicles (in short)?

Post by akaction »

maquinista wrote:That's true, the bus position needs some tweaking.
...
The shadow it's a grey color semi transparent. I don't know how to render a black semitransparent shadow.
So, what shall i do with sprites?
Reduce length of the bus in 2 times? (do a half of the length)
Decrease contrast for shadows (make them less clear)?
Do not go with the flow, do not go against the flow, go across it, if you want to reach the coast (С)Vantala
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: How to code vehicles (in short)?

Post by Zephyris »

The length of the bus I posted is about as long as you can make a vehicle with no graphical glitches. The limit is 64px for the longest side.
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: How to code vehicles (in short)?

Post by maquinista »

I think that is better if You don't change the size. I will code it with a not visible articulated part. This will allow the bus to have their own space in the game.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
akaction
Engineer
Engineer
Posts: 50
Joined: 25 Feb 2010 09:18
Location: Russia, Moscow

Re: How to code vehicles (in short)?

Post by akaction »

Ok, it is great. What about shadow? shall i try to change colour and ransparency?
Do not go with the flow, do not go against the flow, go across it, if you want to reach the coast (С)Vantala
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: How to code vehicles (in short)?

Post by maquinista »

akaction wrote:Ok, it is great. What about shadow? shall i try to change colour and ransparency?
I don't know. I use blender. Can You post a screenshot with the settings?
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
akaction
Engineer
Engineer
Posts: 50
Joined: 25 Feb 2010 09:18
Location: Russia, Moscow

WRONG! 3dmax settings

Post by akaction »

This is not-working settings for the light (which created shadow)
Attachments
Settings1.png
Settings2.png
Settings2.png (16.91 KiB) Viewed 2860 times
Settings3.png
Settings3.png (14.41 KiB) Viewed 2860 times
Last edited by akaction on 17 Mar 2010 09:13, edited 1 time in total.
Do not go with the flow, do not go against the flow, go across it, if you want to reach the coast (С)Vantala
akaction
Engineer
Engineer
Posts: 50
Joined: 25 Feb 2010 09:18
Location: Russia, Moscow

Re: How to code vehicles (in short)?

Post by akaction »

This is settings for the rendering (Customize->Preferences->Rendering)
Attachments
Render_setup.png
Render_setup.png (32.81 KiB) Viewed 485 times
Do not go with the flow, do not go against the flow, go across it, if you want to reach the coast (С)Vantala
User avatar
neob
Chief Executive
Chief Executive
Posts: 687
Joined: 29 Dec 2009 02:56

Re: How to code vehicles (in short)?

Post by neob »

i am not sure if its was already suggested or will be any help with what you need
but here: http://wiki.openttd.org/32bit_Graphics_ ... umentation

there is a template for 3Dmax, i assume it includes all the default lighting/shading/etc values we use.
Image
akaction
Engineer
Engineer
Posts: 50
Joined: 25 Feb 2010 09:18
Location: Russia, Moscow

Re: How to code vehicles (in short)?

Post by akaction »

neob wrote:i am not sure if its was already suggested or will be any help with what you need
but here: http://wiki.openttd.org/32bit_Graphics_ ... umentation

there is a template for 3Dmax, i assume it includes all the default lighting/shading/etc values we use.
Thanks. I saw it. But there are 2 problems with that template: 1)render time ~ 5 min/sprite (in my template only 5 sec/sprite) 2) axis of the coordinates : when i am roating my vehicle it broke the form of vehicle (distort geometry)

That is what i have with this "Wiki" template:
Attachments
standart_teemplate.png
standart_teemplate.png (10.81 KiB) Viewed 2833 times
Do not go with the flow, do not go against the flow, go across it, if you want to reach the coast (С)Vantala
akaction
Engineer
Engineer
Posts: 50
Joined: 25 Feb 2010 09:18
Location: Russia, Moscow

Re: How to code vehicles (in short)?

Post by akaction »

Maquinista, i created another 3 different set of sprites:
1) light_plane_and_another_shadows.zip - full set of sprites with another settongs (i changed 4 parameters)
2) Another_alpha.zip - in this set i "played" with alpha channel
3) 1 sprite with Wiki template.

Can you code them and check if shadows appears or not?
Attachments
light_plane_and_another_shadows.ZIP
Sprites for coding and checking. It is just a pictures
(516.1 KiB) Downloaded 89 times
Another_alpha.ZIP
Sprites for coding and checking. It is just a pictures
(115.06 KiB) Downloaded 84 times
Wiki_template.png
Wiki_template.png (16.61 KiB) Viewed 2809 times
Last edited by akaction on 13 Mar 2010 19:57, edited 1 time in total.
Do not go with the flow, do not go against the flow, go across it, if you want to reach the coast (С)Vantala
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: How to code vehicles (in short)?

Post by maquinista »

The shadow should be a partially transparent black. The second file works good.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
akaction
Engineer
Engineer
Posts: 50
Joined: 25 Feb 2010 09:18
Location: Russia, Moscow

Re: How to code vehicles (in short)?

Post by akaction »

Thank you! Excellent news! so here is the full set of sprites with changed alpha channel. If it OK, then i share my template and settings for 3DsMax.
Attachments
Liaz_5292v4(shadows).ZIP
Full set of sprites
(462.38 KiB) Downloaded 88 times
Do not go with the flow, do not go against the flow, go across it, if you want to reach the coast (С)Vantala
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: How to code vehicles (in short)?

Post by maquinista »

I'm coding the bus. I think that the shadow of the sprites looks good. :D

The buses leave a space between the two vehicles. I will fix the positions.
Attachments
Bus screenshot.
Bus screenshot.
bus_screenshot4.JPEG (75.83 KiB) Viewed 2708 times
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
akaction
Engineer
Engineer
Posts: 50
Joined: 25 Feb 2010 09:18
Location: Russia, Moscow

Re: How to code vehicles (in short)?

Post by akaction »

Wow, it looks great. From my point of view shadows are very realistic for normal sun lighting. Shadows can`t be very strong (to dark) otherwise lighting of the gress, roads and etc. shall be more brighten (because of the rays of the sun).

I think the space (gap) between buses is OK. They never park (stop) to close to each other. But it looks like that you code space after the bus (not before it). The buses have gap between each other but there is not any space between the first bus and train (the bus is standing over the roadway gate). But if it is dificult to code than it is not a problem. Bus look beautiful and that is enough for the game.
Do not go with the flow, do not go against the flow, go across it, if you want to reach the coast (С)Vantala
Antonio1984
Transport Coordinator
Transport Coordinator
Posts: 282
Joined: 02 Apr 2009 21:57

Re: How to code vehicles (in short)?

Post by Antonio1984 »

Wow...in my opinion this bus is the best veichle in OpenTTD...
One question: I use GRVTS..is it possible to replace only the bus with this version (keeping the rest like tram, etc)?
I like very much the Zephirys design, don't hold it against me, but this bus is superior...
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: How to code vehicles (in short)?

Post by Zephyris »

Antonio1984 wrote:Wow...in my opinion this bus is the best veichle in OpenTTD...
One question: I use GRVTS..is it possible to replace only the bus with this version (keeping the rest like tram, etc)?
I like very much the Zephirys design, don't hold it against me, but this bus is superior...
No, either you would get glitches due to this bus's length, you would have to recode GRVTS, or you would have to rerender this bus shorter.

But if you make this bus shorter then it is simple; download a copy of the GRVTS tar and replace the sprites you want to replace.
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: How to code vehicles (in short)?

Post by maquinista »

akaction wrote:The buses have gap between each other but there is not any space between the first bus and train (the bus is standing over the roadway gate)
It will be fixed, the screenshot is only a preview.

About GRVTS: You can use two sets at the same time.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: How to code vehicles (in short)?

Post by maquinista »

I have coded the bus. The farm building will be coded tomorrow.

It has some problems on bridges and tunnels, but a city bus doesn't cross too many bridges or tunnels.
Attachments
Russian_vehicles.tar
GRF+TAR file.
(518.5 KiB) Downloaded 123 times
Bus.
Bus.
bus_screenshot5.JPEG (24.08 KiB) Viewed 2662 times
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
User avatar
Ben_Robbins_
Tycoon
Tycoon
Posts: 1234
Joined: 20 Nov 2005 01:56
Location: Abu Dhabi, UAE

Re: How to code vehicles (in short)?

Post by Ben_Robbins_ »

The bus looks great, no dought about it. The comparison though between light setup's is meaningless since you have set up the materials to excel in the 2nd light setup. The train sprites that appear in your most recent image for example use that same light setup and don't appear a blinding white. A real comparison would be nice to see, ideally for a range of objects with varied spacing, tone and colour. Importantly can we get true black and white? Search back for light setup topics.

Cutting the render time down so dramatically is great to see, but not something that fussed me too much, since I fill render times modelling other things, but as long as there is no compromise in renders, and possibilities then it's a great development.

(I'm partly disappearing again! PM if anyone needs anything from me. I'll be back and contributing as soon as I can be)
Ben
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: GarryG, Google Adsense [Bot] and 17 guests