I want to make "Objects" for my current project

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
Maiconi
Engineer
Engineer
Posts: 4
Joined: 28 Jan 2018 22:04

I want to make "Objects" for my current project

Post by Maiconi »

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.
User avatar
Quast65
Tycoon
Tycoon
Posts: 2663
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: I want to make "Objects" for my current project

Post by Quast65 »

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:
viewtopic.php?f=26&t=71786 (mostly 1-tile objects)
viewtopic.php?f=26&t=74510 (has various sized objects and also slope-aware objects)
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:
viewforum.php?f=68
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Maiconi
Engineer
Engineer
Posts: 4
Joined: 28 Jan 2018 22:04

Re: I want to make "Objects" for my current project

Post by Maiconi »

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.
User avatar
Quast65
Tycoon
Tycoon
Posts: 2663
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: I want to make "Objects" for my current project

Post by Quast65 »

Ah, ok I see.
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.
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:
Test255.png
Test255.png (37.66 KiB) Viewed 1493 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 ;-)
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.
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):
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:
viewtopic.php?f=68&t=48891&start=1120#p1168928
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

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

Return to “Graphics Development”

Who is online

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