Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Aug 20, 2018 8:56 am

All times are UTC




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Feb 27, 2018 8:06 am 
Offline
Engineer
Engineer

Joined: Sun Jan 28, 2018 10:04 pm
Posts: 4
What I want to know is where I can find a template square for drawing a building and what tools are necessary for making these outside of an image editor. My idea is to make landmarks of the U.S. as objects so I can place them into the game during the scenario editor stage to make the cities more unique. If there's a newgrf that already has these made that would work too. Thank you.


Top
   
PostPosted: Tue Feb 27, 2018 12:46 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1589
Location: The Netherlands
For NewObjects I advise using either:

*m4nfo:
http://www.ttdpatch.de/grfspecs/m4nfoManual/index.html (how to get started)
http://www.ttdpatch.de/grfspecs/m4nfoManual/index.html (the Objects-section of that manual)
And then look at examples, like the MariCo GRF
As far as I know, that is the only object-GRF coded in m4nfo (correct me please if I am wrong), however the creator of m4nfo (Michael Blunck) is active in these forums and may be able to help you out with further questions regarding m4nfo.

*NML:
https://www.tt-wiki.net/wiki/NMLTutorial (how to get started)
https://www.tt-wiki.net/wiki/NMLTutorial/Object (the Objects-section of that manual)
Loads of object-GRFs are made by using NML, some only have 1-tile objects, some have more larger surfaces.
When they are released with a GPL-license, the creators will also have to release the sources (code & graphics).
Look at the sources of those various GRFs, try to understand how it all works.
Some examples:
https://www.tt-forums.net/viewtopic.php?f=26&t=71786 (mostly 1-tile objects)
https://www.tt-forums.net/viewtopic.php?f=26&t=74510 (has various sized objects and also slope-aware objects)
https://www.tt-forums.net/viewtopic.php?f=67&t=75362 (has a lot of larger structures)
This is just a very small selection, loads more Object-GRFs can be found that use NML.

A lot of the "older" object-GRFs (like my ISR/DWE-objects) were made using NFO, but I think m4nfo or NML is a lot more easier to understand ;-)

For more specific questions regarding issues you may get when coding, ask them here:
https://www.tt-forums.net/viewforum.php?f=68

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Feb 27, 2018 5:37 pm 
Offline
Engineer
Engineer

Joined: Sun Jan 28, 2018 10:04 pm
Posts: 4
These definitely help out with the coding side of things but I was wondering where I'd find a template for making the art of the structures I want to make. If there is a template somewhere what restrictions are there? For example what's the highest I can draw them and what are the properties for backgrounds and floor textures and whatever else may be useful? Thank you.


Top
   
PostPosted: Wed Feb 28, 2018 2:44 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1589
Location: The Netherlands
Ah, ok I see.

Quote:
what restrictions are there

Well, OpenTTD is Tile based, so it has to fit either on one tile or on multiples of those tiles ;-)
Be aware, that for Objects it is only possible to code full squares or rectangles (so 2x2, 3x3 etc or 1x3, 2x3 etc), unlike for example industries where you can leave room for roads/tracks/waterways in between.
Maximum floorsize is I believe 15x15 tiles for objects.
Quote:
what's the highest I can draw them

255 pixels is I believe the highest a boundingbox of a single-tile sprite can be, so then you get no glitches/clipping issues. They can be drawn higher, but then you will get glitches and/or planes possibly flying through them.
For multitile graphics, you can use the high point of 255 pixels of the boundingbox from the tiles at the back. So lets say you have a 2x2, where you have a tower on the front tile, then you have some extra room regarding hight if you include the tower graphics into the back-tile. This may illustrate what I mean:
Attachment:
Test255.png
Test255.png [ 37.66 KiB | Viewed 303 times ]

So the tower is on the front-tile (in green), but as you can see, because of the backtile (in purple) you can get 31 pixels 'extra" hight without glitching issues if you include the tower graphics also on that tile.
So, a trick to safely get some extra hight ;-)
Quote:
floor textures

Basically, 3 options:
1. You draw full tile floors yourself.
2. You use the code to show base-set groundtiles (for example grass, concrete), these will automatically adapt to landscape-GRFs that replace base-set graphics.
So, lets say you have a drawing of a tree, that you want placed on grass. You then only have to draw the tree and use the code to get a grassy groundtile. So, you wont have to draw the grass and that grass will also adapt to the grass of the landscape-GRF a player may be using. Or, to how the grass looks in a different climate.
3. Use a combination of both, so lets say you have a structure that has a road going towards it (for example, going into the entrance of an underground parking). If you use the code to show a base-set road as the groundtile towards that entrance, that road will adapt to the road-set a player is using. It cant be used by roadvehicles ofcourse, but it looks nicer as it is the same road a player is currently using.
Quote:
properties for backgrounds

Not really sure what you mean by that ;-)
The perspective of OpenTTD does not really allow backgrounds (like horizons). The background is done by the tiles behind your structure.
Please elaborate a bit more about what you mean with backgrounds..

Finally, this may be an interesting read for you (page 55 to 57):
https://www.tt-forums.net/viewtopic.php?f=68&t=48891&start=1080#p1165354
It starts out with some stuff about single-tile slope-aware objects, also has some info about adding extra text, snow-awareness and finally it goes to multi-tile objects, with examples.
EDIT:
A shortcut ;-)
An example template of a 2x2 that is snow-aware and has extra texts for each of the 4 views can be found here:
https://www.tt-forums.net/viewtopic.php?f=68&t=48891&start=1120#p1168928

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.