Releasing New Object Graphic - Begginer Tutorial

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
fridaemon
Engineer
Engineer
Posts: 71
Joined: 27 Oct 2019 21:06
Contact:

Releasing New Object Graphic - Begginer Tutorial

Post by fridaemon »

Hello everyone ;)

I play OpenTTD for years. After GarryG contacted me with ideas for his new graphics, I decided to gradually start creating my own graphics. I started with objects (for me the simplest graphic). During the shopping, I realized that in the cities there are no shopping centers. So I've created two ones for now. I had no idea where to start, but in the end I created something. GarryG sent me folder with needed files and created .grf file for me, but In the future I'd like to do it alone.

I started this topic because if someone else wanted to create something of his own to know where to start.

My OpenTTD friend told me to install NML 5, but I lost in the 1st step. I downloaded ir from https://www.openttd.org/downloads/grfco ... atest.html , extract folder to D:\openttdgraphic\... , and now what? :shock:

I created websites in CSS and HTML so programming is not so far from me. But I never (maybe 2-5 times very earlier) code in Command Promt. Can somebody help me with it, please? I'm Windows 10 User.

My first graphics:
Image

Image
------------------------------------------------------------------------
Image
IN 1.0 EDIT YOU CAN EXCEPT:
Beach Objects * Shopping Centres * Shops
Underground Passenger Entrances * Garage Entrances

User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3173
Joined: 24 Apr 2007 09:37
Location: NSW Australia

Re: Releasing New Object Graphic - Begginer Tutorial

Post by Emperor Jake »

fridaemon wrote:
04 Aug 2020 18:04
My OpenTTD friend told me to install NML 5, but I lost in the 1st step. I downloaded ir from https://www.openttd.org/downloads/grfco ... atest.html , extract folder to D:\openttdgraphic\... , and now what?
You said you need NML, but what you actually downloaded there is GRFCodec. NMLC and GRFCodec are different programs, and while both are essential for any GRF creator, NMLC is the one you want, get it here: http://bundles.openttdcoop.org/nml/releases/0.4.5/ (I'm not sure where to find windows binaries for newer versions so if someone could point me in the right direction...) Everything's moved to github now so here: https://github.com/OpenTTD/nml/releases

Here's now to install it: https://www.tt-wiki.net/wiki/NMLTutorial/Installation

Now NML doesn't need to be coded in the command prompt. Just use a text editor such as notepad++. The only command you'll be needing is something along the lines of

Code: Select all

nmlc -c --grf mygrf.grf mygrf.nml
Once that's all set up, here's the tutorial on coding Objects: https://www.tt-wiki.net/wiki/NMLTutorial/Object

Hope this helps :)
Last edited by Emperor Jake on 05 Aug 2020 11:34, edited 1 time in total.

perverted monkey
Engineer
Engineer
Posts: 61
Joined: 02 Mar 2009 02:07

Re: Releasing New Object Graphic - Begginer Tutorial

Post by perverted monkey »

:D Nice shopping centers.
But flipping the image doesn't suffice because then shading is wrong. You will have to redraw and/or reshade.

User avatar
fridaemon
Engineer
Engineer
Posts: 71
Joined: 27 Oct 2019 21:06
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by fridaemon »

Emperor Jake wrote:
05 Aug 2020 04:44
Hope this helps :)
Perfect! Love you! :lol: I've just created my first grf file :D
I had just one problem with downloading nml folder - I had to few times press resume in downloading beacouse of this error.
Image
------------------------------------------------------------------------
Image
IN 1.0 EDIT YOU CAN EXCEPT:
Beach Objects * Shopping Centres * Shops
Underground Passenger Entrances * Garage Entrances

User avatar
fridaemon
Engineer
Engineer
Posts: 71
Joined: 27 Oct 2019 21:06
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by fridaemon »

perverted monkey wrote:
05 Aug 2020 06:01
But flipping the image doesn't suffice because then shading is wrong. You will have to redraw and/or reshade.
Thanks for the warning, I honestly didn't think of that. :) I'll repair it.

If anyone have any advice, come with it :)
------------------------------------------------------------------------
Image
IN 1.0 EDIT YOU CAN EXCEPT:
Beach Objects * Shopping Centres * Shops
Underground Passenger Entrances * Garage Entrances

User avatar
jfs
Tycoon
Tycoon
Posts: 1241
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Releasing New Object Graphic - Begginer Tutorial

Post by jfs »

The newer NML downloads are here: https://github.com/OpenTTD/nml/releases

User avatar
Chataigne
Engineer
Engineer
Posts: 15
Joined: 20 Apr 2018 08:01
Location: Lyon, France

Re: Releasing New Object Graphic - Begginer Tutorial

Post by Chataigne »

Hey, very nice shopping center ! :D

I'm planning to create some shopping center/supermarket too for my new project "European Building Set" viewtopic.php?f=26&t=87346
I coded some grf file for me, with NML and particulary for house set. If you need help to code this building i can help you :wink:

User avatar
fridaemon
Engineer
Engineer
Posts: 71
Joined: 27 Oct 2019 21:06
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by fridaemon »

Thanks to you, Chataigne, and to all here :))) I'm impatiently waiting for your graphics :twisted: GarryG helps me with coding, Now I can create grf file, edit and add other buildings here, but only in 2x2 size. I need templates for other sizes - 1x1, 2x1, 1x2 for now. Can u send me them? And coding for these templates like an object. Or If you have any link with this informations, I'll be happy about it :)
------------------------------------------------------------------------
Image
IN 1.0 EDIT YOU CAN EXCEPT:
Beach Objects * Shopping Centres * Shops
Underground Passenger Entrances * Garage Entrances

User avatar
Chataigne
Engineer
Engineer
Posts: 15
Joined: 20 Apr 2018 08:01
Location: Lyon, France

Re: Releasing New Object Graphic - Begginer Tutorial

Post by Chataigne »

I know much more NML for house set than object. Here is the template i use for a 1x1 house size :
Template_House 1x1.nml
(2.89 KiB) Downloaded 23 times
Template_house1x1_ground.png
Template_house1x1_ground.png (1.92 KiB) Viewed 1155 times
Template_House1x1_building.png
Template_House1x1_building.png (3.33 KiB) Viewed 1155 times

Making a 1x2, 2x1 or 2x2 is not quite different than the 1x1. just change "HOUSE_Size_1x1" by the one you want in

Code: Select all

item(FEAT_HOUSES, BUILDING001, 01, HOUSE_SIZE_1X1)
and assume that your next house ID is the second part of the building. You will have

Code: Select all

item(FEAT_HOUSES, BUILDING001, 01, HOUSE_SIZE_1X2)
/* first part of the house*/ 
 item(FEAT_HOUSES, BUILDING002, 02, HOUSE_SIZE_1X2)
 /* second part of the house */ 
Last edited by Chataigne on 06 Aug 2020 12:41, edited 1 time in total.

User avatar
fridaemon
Engineer
Engineer
Posts: 71
Joined: 27 Oct 2019 21:06
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by fridaemon »

Or is here a way how to extract grf file to nml, gfx and lang files. I'd like to see source codes of objects and learn it.
------------------------------------------------------------------------
Image
IN 1.0 EDIT YOU CAN EXCEPT:
Beach Objects * Shopping Centres * Shops
Underground Passenger Entrances * Garage Entrances

User avatar
fridaemon
Engineer
Engineer
Posts: 71
Joined: 27 Oct 2019 21:06
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by fridaemon »

Chataigne wrote:
06 Aug 2020 12:39
Thanks =)
------------------------------------------------------------------------
Image
IN 1.0 EDIT YOU CAN EXCEPT:
Beach Objects * Shopping Centres * Shops
Underground Passenger Entrances * Garage Entrances

User avatar
Chataigne
Engineer
Engineer
Posts: 15
Joined: 20 Apr 2018 08:01
Location: Lyon, France

Re: Releasing New Object Graphic - Begginer Tutorial

Post by Chataigne »

Unfortunately there is no way to extract a NML file from a GRF. You can extract to a NFO (i don't understand anything to NFO :lol: ) and gfx in png for exemple using grfcodec.

For object i can show you this exemple i do :
Template_Object.nml
(2.83 KiB) Downloaded 22 times
Template_Object.png
Template_Object.png (3 KiB) Viewed 1141 times

User avatar
kamnet
Moderator
Moderator
Posts: 7298
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by kamnet »

fridaemon wrote:
06 Aug 2020 12:41
Or is here a way how to extract grf file to nml, gfx and lang files. I'd like to see source codes of objects and learn it.
If it's in NML, then most likely whoever wrote it still has the original source code. Just politely ask them if you can look at it.

User avatar
2TallTyler
Traffic Manager
Traffic Manager
Posts: 167
Joined: 11 Aug 2019 18:15
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by 2TallTyler »

I learned nearly everything I know about NML from the NML specs on TT-Wiki.

Looking at other people's code is also helpful. My industry set includes objects of various sizes (code) and my town set replaces all base game houses and adds a lot of new logic (code). Both use built-in sprite numbers instead of new sprites, but the item definitions may help you.

User avatar
GarryG
Tycoon
Tycoon
Posts: 3761
Joined: 14 Feb 2015 00:44
Location: Newcastle, Australia

Re: Releasing New Object Graphic - Begginer Tutorial

Post by GarryG »

These might be of use to you guys .. when making objects and other things for OpenTTD the old way if the item was larger then 1x1 you had to cut it in pieces to code it is. Your template be something like this for a 2x1 object.
template_2x1_001.png
template_2x1_001.png (3.18 KiB) Viewed 1032 times
But some time back Quast65 and I worked on a way so no need to do that.
Now the templates be like this.
test1x2x4_1.png
test1x2x4_1.png (2.74 KiB) Viewed 1032 times
We had them all uploaded on forum a few years ago but they be buried some where in all those pages of my objects and other locations, so if like here they are again.

This has 2x2, 2x3, 3x3 and 4x4 sizes.

Hope they help.
Attachments
Sprite_Templates_Objects.rar
(331.07 KiB) Downloaded 25 times
Soot Happens
Screenshot Of The Month Winner March 2020
All my projects are GPLv2 License unless stated.
Auz Road Sets: viewtopic.php?f=29&t=87335
Auz Project Releases: viewtopic.php?f=67&t=84725
Auz Trains: http://www.tt-forums.net/viewtopic.php?f=26&t=74193
Auz Industry Sets: http://www.tt-forums.net/viewtopic.php?f=26&t=74471
Auz Objects: viewtopic.php?f=26&t=75657
Auz Bridges: viewtopic.php?f=26&t=75248
Auz Stations: viewtopic.php?f=26&t=76390
Auz Tracks: viewtopic.php?f=26&t=82691
Auz Subway Stations: viewtopic.php?f=26&t=85335

User avatar
GarryG
Tycoon
Tycoon
Posts: 3761
Joined: 14 Feb 2015 00:44
Location: Newcastle, Australia

Re: Releasing New Object Graphic - Begginer Tutorial

Post by GarryG »

Here the 2x1 I forgot to add to the others.

Also done similar for Industries as well in size1x2, 1x3, 2x2, 2x3, 3x3, 4x4, 6x6, 8x8 and 12x12. Let us know if want these as well.

Cheers
Attachments
ObjectsTest1x2_4views.rar
(43.22 KiB) Downloaded 24 times
Soot Happens
Screenshot Of The Month Winner March 2020
All my projects are GPLv2 License unless stated.
Auz Road Sets: viewtopic.php?f=29&t=87335
Auz Project Releases: viewtopic.php?f=67&t=84725
Auz Trains: http://www.tt-forums.net/viewtopic.php?f=26&t=74193
Auz Industry Sets: http://www.tt-forums.net/viewtopic.php?f=26&t=74471
Auz Objects: viewtopic.php?f=26&t=75657
Auz Bridges: viewtopic.php?f=26&t=75248
Auz Stations: viewtopic.php?f=26&t=76390
Auz Tracks: viewtopic.php?f=26&t=82691
Auz Subway Stations: viewtopic.php?f=26&t=85335

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5742
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Releasing New Object Graphic - Begginer Tutorial

Post by wallyweb »

fridaemon wrote:
06 Aug 2020 12:41
Or is here a way how to extract grf file to nml, gfx and lang files. I'd like to see source codes of objects and learn it.
If a GRF is licensed under GPL, then the source code must be readily/easily available. Ideally it should be included with the distribution, but as I understand it, it is also acceptable to substitute a link that points to the repository that includes the source code. Check the readme file that should also be included with the distribution.

User avatar
fridaemon
Engineer
Engineer
Posts: 71
Joined: 27 Oct 2019 21:06
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by fridaemon »

Hello again, I'm back and working and testing. I have to go to work and do houseworks so my time here is limited :D
Now I have few shops, still demos. The first one is Tesco Market from Poland Building set. I combine my graphic with AuzCarParks and AuzObjects. viewtopic.php?f=26&t=75657


Image
fridaemonobjects.grf
(214.94 KiB) Downloaded 45 times


First - I have few questions, again:
Image
  • 1. As you can see - Fridaemons: Shops. How can I change it? It's two different sets. See nothing in .lang and .nml.
  • 2. How can I do in one grf file few submarks? For example In the set AuzAddons there are: OfficeBuildings / Terminals / Truck Bays / ...
  • 3. How can I do only 1 or 2 views of object? My opinion is - num_views change to 1 or 2, delete spritelayout_blablablal_t1_view2-4;
    }
    Image
  • 4. How can I have non-snow versions? Just remove this code?

    Code: Select all

    building {
            sprite: spriteset_hotel_t1_SNOW(0);
            hide_sprite: nearby_tile_height(0, 0) < snowline_height;
            xoffset: 0; //from NE edge
            yoffset: 0; //from NW edge
            zoffset: 0;
            xextent: 16;
            yextent: 16;
            zextent: 16;
        }
------------------------------------------------------------------------
Image
IN 1.0 EDIT YOU CAN EXCEPT:
Beach Objects * Shopping Centres * Shops
Underground Passenger Entrances * Garage Entrances

User avatar
fridaemon
Engineer
Engineer
Posts: 71
Joined: 27 Oct 2019 21:06
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by fridaemon »

My plans till the end of 2020 with this project:
  • create it as industrial addition set - accept (/produce?) goods, accepting and producing passengers - have no idea how to do it
  • create underground parking addons
  • create oldschool markets
  • add shopping markets from other sets If I'll get permission from authors. There is some users which created some buildings and never release them.
------------------------------------------------------------------------
Image
IN 1.0 EDIT YOU CAN EXCEPT:
Beach Objects * Shopping Centres * Shops
Underground Passenger Entrances * Garage Entrances

User avatar
fridaemon
Engineer
Engineer
Posts: 71
Joined: 27 Oct 2019 21:06
Contact:

Re: Releasing New Object Graphic - Begginer Tutorial

Post by fridaemon »

Now I'm working on underground garage entries. I wanted to create my markets first and after this garages for them. But I started with Industrial garages.
Image
Attachments
coffee1_32.png
coffee1_32.png (37.4 KiB) Viewed 578 times
garage2_32.png
garage2_32.png (35.99 KiB) Viewed 578 times
------------------------------------------------------------------------
Image
IN 1.0 EDIT YOU CAN EXCEPT:
Beach Objects * Shopping Centres * Shops
Underground Passenger Entrances * Garage Entrances

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 28 guests