[WIP] INFRA by SAC

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
User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

[WIP] INFRA by SAC

Post by SAC »

INFRA Project


Currently available .grf's;

INFRA-Landscape;

¤ Version 0.0 (WIN) - Released October 17-2006 - DOWNLOAD HERE
¤ Version 0.0 (DOS) - Released October 17-2006 - DOWNLOAD HERE

INFRA-Landscape compatible with OTTD - Yes

Credits;

¤ RK, Coding Services
Last edited by SAC on 29 Feb 2012 09:36, edited 31 times in total.
Simuscape - Chose Your Destination;
Simuscape | Visual Studio | INFRA Diary

INFRA Downloads - Chose Your Destination;
Simuscape | INFRA - A World of its own

User avatar
Purno
Tycoon
Tycoon
Posts: 16663
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

Why don't you use command lines for GRFcodec? (in ms dos)
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."

User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Post by SAC »

Purno wrote:Why don't you use command lines for GRFcodec? (in ms dos)
Well, I'm not sure how to do that! I can draw things, but I'm a hopeless case as far as coding and all that stuff concerns! :?

User avatar
krtaylor
Tycoon
Tycoon
Posts: 11774
Joined: 07 Feb 2003 01:58
Location: Washington DC, USA
Contact:

Post by krtaylor »

Then I recommend you join one of the ongoing projects that strikes your fancy. You can draw to your heart's content, and let other people worry about the coding. The Planeset, for instance, could use plenty of help.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there

User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Post by SAC »

Sure, but I still need to be able to decode the grf's! :( On another note, can't say that planes are on my top priority list, but buildings of all sorts are :D Perhaps one or two trains or other vehicles as well!

User avatar
krtaylor
Tycoon
Tycoon
Posts: 11774
Joined: 07 Feb 2003 01:58
Location: Washington DC, USA
Contact:

Post by krtaylor »

SAC wrote:Sure, but I still need to be able to decode the grf's! :( On another note, can't say that planes are on my top priority list, but buildings of all sorts are :D Perhaps one or two trains or other vehicles as well!
Well, you don't necessarily have to decode the GRFs. Some of the sets-in-progress already have sets of sprites that you could start with, that are in a more useable format.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there

User avatar
Purno
Tycoon
Tycoon
Posts: 16663
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

If you need an example of sprites (for sizes, shading, whatever), feel free to use my sprites as example.
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."

User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Post by SAC »

Purno wrote:If you need an example of sprites (for sizes, shading, whatever), feel free to use my sprites as example.
Thanks Purno! Do you have them all collected in an convenient place? :)

Anyway, since no one here could help out, I tried to work this Wizard/Codec thing out myself. For some odd reason it worked first after I've put the Codec-files, inside the TTD-folder. Not sure if they're safe to continue to be there once I load the game, but I have them in a sep. folder so I can easily move them out!

Now, I've decoded the .grf's and can view them in my PSP-program. This however raises some questions since I now realize I can make changes to current grf's made by others. I decoded the DBXL-set and as far as I can tell - (I could be wrong of course) - I should be able to cut and paste between this set and other sets available to get a mixed variety which I've wanted for awhile. I suppose it won't do any harm as long as I keep this to myself and don't distribute it to others...or?

I was basically thinking of cutting and pasting so I don't get the modern livery of some trains in the DBXL-set, (i.e. getting rid of some of the red livery and instead keep the earlier colors).

I will of course try to draw my own replacements which can be used by others, but I need to figure out how to code things - unless there are people out there more than willing to do this rather than draw things :P

User avatar
Purno
Tycoon
Tycoon
Posts: 16663
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

SAC wrote:
Purno wrote:If you need an example of sprites (for sizes, shading, whatever), feel free to use my sprites as example.
Thanks Purno! Do you have them all collected in an convenient place? :)
You could try http://www.tt-forums.net/viewtopic.php?t=7649 :wink:

SAC wrote:Now, I've decoded the .grf's and can view them in my PSP-program. This however raises some questions since I now realize I can make changes to current grf's made by others. I decoded the DBXL-set and as far as I can tell - (I could be wrong of course) - I should be able to cut and paste between this set and other sets available to get a mixed variety which I've wanted for awhile. I suppose it won't do any harm as long as I keep this to myself and don't distribute it to others...or?

I was basically thinking of cutting and pasting so I don't get the modern livery of some trains in the DBXL-set, (i.e. getting rid of some of the red livery and instead keep the earlier colors).
When changing any of MB's graphics or NFOs, you can't release them :cry:
SAC wrote:I will of course try to draw my own replacements which can be used by others, but I need to figure out how to code things - unless there are people out there more than willing to do this rather than draw things :P
:mrgreen: I think there are some people that like coding above drawing.
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."

BobXP
Tycoon
Tycoon
Posts: 2720
Joined: 04 May 2003 11:00
Location: Torquay, England
Contact:

Post by BobXP »

SAC wrote:Sure, but I still need to be able to decode the grf's! :( On another note, can't say that planes are on my top priority list, but buildings of all sorts are :D Perhaps one or two trains or other vehicles as well!
Make sure GRFCODEC.EXE is in your TT folder

Then, browse to your TT folder in Windows Explorer and then type "command" in the address bar. This should give you a DOS window showing the path of your TT folder. Then enter the stuff below:

To decode something:

Code: Select all

grfcodec.exe -d <name of grf file, relative to tt folder>
To encode something:

Code: Select all

grfcodec.exe -e <name of grf file, relative to tt folder>
<!-- End Of Post !-->
Image

User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Post by SAC »

BobXP wrote:
SAC wrote:Sure, but I still need to be able to decode the grf's! :( On another note, can't say that planes are on my top priority list, but buildings of all sorts are :D Perhaps one or two trains or other vehicles as well!
Make sure GRFCODEC.EXE is in your TT folder

Then, browse to your TT folder in Windows Explorer and then type "command" in the address bar. This should give you a DOS window showing the path of your TT folder. Then enter the stuff below:

To decode something:

Code: Select all

grfcodec.exe -d <name of grf file, relative to tt folder>
To encode something:

Code: Select all

grfcodec.exe -e <name of grf file, relative to tt folder>
Thanks BobXP, but I've already managed to decode the grf's using the GRFWizard :D In fact, I also managed to extract the grf's from all the .exe-files I had stored inside my TTD-folder - which btw is a relief since I now don't have to use them anymore, but can place the actual .grf-files inside my folder instead. Rather convenient since I'm also able to turn them on or off at my own will - not to mention getting rid of the problems when trying to get rid of an .exe-file that lacks an undo-file :P

I love to draw so my next task will be to learn more about the way this game is built up - which could result in the ability to code new graphics on my own. However, I'm sure that's far from easy so I'll probably stick to drawing after all :D

User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Post by SAC »

Well, I'm still trying to learn how to implement new graphics into TTD, but there are some things that still confuses me - or which I don't quit understand.

I've decoded a lot of files, the original .trg-files along with some custom ones made by others. I've also extracted EXE-files and turned them into .grf-files instead which allows me to use them with more control, (which I've already explained in an earlier post).

Now, I've learned that I can easily make some changes to a decoded file and encode it again for use in the game - that is, as long as I don't change the actual size of the sprite/s! This add up to my first question?

What if I do want to change the size of a sprite, how do I determine this new size - and above all; how do I implement this change of size? As far as I can tell from what I've learned so far I assume it has something to do with the NFO-file! Just to make an example;

Let's say I want to use a custom graphic that originally was made for the sub-tropic climate. The NFO-file states the following;

Code: Select all

// Automatically generated by GRFCODEC. Do not modify!
// (Info version 4)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
    0 * 4	 07 00 00 00
    1 * 27	 08 02 FF FF FF FF 00 43 72 65 61 74 65 64 20 62 79 20 47 52 44 54 4F 47 52 46 00
    2 * 5	 0A 01 04 5A 11
    3 c:\d&s\al\sb\test\templetonwin.pcx 66 8 09 31 64 -31 0
    4 c:\d&s\al\sb\test\templetonwin.pcx 146 8 03 53 57 -29 -25
    5 c:\d&s\al\sb\test\templetonwin.pcx 210 8 03 103 56 -29 -75
    6 c:\d&s\al\sb\test\templetonwin.pcx 274 8 09 116 56 -29 -88
I'm not an expert here, but my guess is that something in the code above needs to be changed in order for the building to appear in the temperate climate instead. This raises another possible question; since this particular building was made for the sub-tropic climate in the first place, can I assume that it also contains values determined by conditions specifically for the sub-tropic climate - such as food requirements for instance?

This particular building has 4 sprites so I guess that the above code, field 3-6 are referring to these sprites since they are numbered 3-6 :P The text following these numbers describes the name of the pcx-file, and am I doing a correct assumption if I say that the numbers following somehow describes the size of the sprites? I'm terrible at maths so could anyone help me with a good description of how to actually bring out the size numbers properly - I mean this entire xyz thingie :oops:

My second question is a bit different! What if I draw a completely new sprite and want it in the game. How do I proceed? I can't obviosuly use GRFWizard since it requires a decoded file which it can encode again - or am I wrong? So, how do I make a .grf-file out of these new sprites?

Anyway, I try my best to actually understand the coding part, but I could really use some help here to move on with my task! :P Thanks in advance...

User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

  1. You can't change building properties with GRF files - so a lot of your post isn't possible/relevant.
  2. In the initial comments there is:

    Code: Select all

    spritenum pcxfile xpos ypos compression ysize xsize xrel yrel 
    which is there for a reason. Change the ysize and xsize to resize your sprites. These sizes are simply the size of the graphics in pixels.
  3. The sprites with the above formats are "real" sprites containing graphics. Ones with a * near the start of the line are pseudo-sprites containing other information.
  4. As for your second question, it depends on what you want to encode :wink:.

User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Post by SAC »

  1. You can't change building properties with GRF files - so a lot of your post isn't possible/relevant.
I understand that, but I had to ask to be sure! I'm new to this so I can't possibly be expected to understand it right away :P However, if I understand this right, in order to determine the specific climate a building is supposed to appear in I need to assign the applicable sprite numbers in the "trg-files" in my TTD-folder? Right?
[*]In the initial comments there is:

Code: Select all

spritenum pcxfile xpos ypos compression ysize xsize xrel yrel 
which is there for a reason. Change the ysize and xsize to resize your sprites. These sizes are simply the size of the graphics in pixels.
Okey, I'm sure they are, but I still can't figure it out completely - like I said, I hated this particular subject in school maths and never expected to have to use this calculation later on :cry: Anyway, I studied it more after reading your reply and this is what I figured out; (I'm referring to the 3rd-6th fields in the NFO-code);

Field 3- value 66. Didn't get this first but I now realize that this is the pixel size counted from the beginning of the sprite sheet to the first sprite - which happen to be the 3rd one. I counted the other ones and got them to be 146 (4th), 210 (5th) and 274 (6th). No dispute there, okey?

Field 3 - value 8 - which is the same for the rest of the fields as well. Well, I found that this is the size in pixels counted from the top of the sheet to where the sprites begins.

So basically, these two values will inform TTD where to find the sprites on the sheet? Right?

Field 3 - value 09, which is 03 for the 4th and 5th sprite and again 09 for the 6th. It referres to compression but I have no idea what it means :P

Field 3 - value 31. Well, according to the keywords - which are there for a reason :P - it's supposed to be the ysize. Hmm, you could easily say that these four last values makes me completely lost. I'm not sure how to messure these at all. I know you said "These sizes are simply the size of the graphics in pixels", and I'm sure it's true. But I can't figure this out by the sprites I have in front of me.....

...AND this would be how far I got until I realized why I couldn't get the numbers to add up properly. I simply discovered that I had the NFO-file of the "templeton-building" in front of me, but the wrong sprite sheet. :oops: :D :D I would have been more embarrased if I didn't know how easy it is to get things wrong by simple mistakes like this :D

So...with the correct sprite sheet in front of me I now realize that the ysize referres to the pixel sixe in height, and the xsize in widht!

The two last numbers, xrel and yrel, are those something I need to worry about at all? What do they refer to?
[*]The sprites with the above formats are "real" sprites containing graphics. Ones with a * near the start of the line are pseudo-sprites containing other information.
Okey! So I guess I don't have to worry about those then? What would be the case if I draw new graphics?
[*]As for your second question, it depends on what you want to encode :wink:.[/list]
[/quote]

Well, lets say a new building? Or a new bus?

User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

SAC wrote:However, if I understand this right, in order to determine the specific climate a building is supposed to appear in I need to assign the applicable sprite numbers in the "trg-files" in my TTD-folder? Right?
To decide which building yours will replace you need to find which sprite numbers in, for example, trg1.grf it will replace.
SAC wrote:So basically, these two values will inform TTD where to find the sprites on the sheet? Right?
They will tell TTD where the top-left pixel of the sprite is in the PCX file, yes.
SAC wrote:The two last numbers, xrel and yrel, are those something I need to worry about at all? What do they refer to?
Yes, they are, in case you change the size of the building. If you have the pair of values say -5 -8 for these then xrel is -5 and yrel is -8. If you change this to -6 -7 then the building will go left one pixel and down one pixel in the game. These values set the position of the sprite in the game. If you make the building one pixel taller then you will need to move it up one pixel in the game because positioning is measured from the top-left of the sprite.
SAC wrote:Well, lets say a new building? Or a new bus?
That's why I asked :mrgreen:. For a building (not a new building; that's not possible) you need an Action A and some real sprites (along with an Action 8 to start the GRF), just like what you posted before. For a new bus you need Action 8, Action 0, Action 1, real sprites, Action 2, Action 3 and Action 4 :mrgreen:. See why I asked now?

User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Post by SAC »

Okey, thanks! :D Not sure if I understood the Action part there, but I learn more as I move further! :P

At least I've learned a lot more using some of the tools available. A moment ago I managed to convert Zimmlock's latest DOS-files into Win-usable files using GRFWizard. It worked but it included a lot of decoding and encoding and decoding to make it work. The ability to use them as simple .grf-files instead of the original EXE-version is an improvement as far as my own gameplay concerns.

On another note, for being an old game I must say it appears to be built up in a very complicated way - in some parts even way to complicated than necessary! :evil:

User avatar
krtaylor
Tycoon
Tycoon
Posts: 11774
Joined: 07 Feb 2003 01:58
Location: Washington DC, USA
Contact:

Post by krtaylor »

That's because the GRF file actions aren't part of the original game. In the original game, the GRF files just contained the graphics and IDs, and the game controlled how they were used mostly. But we wanted the game to be able to do things it couldn't do at all originally, like matching-liveries, TE, and all sorts of other innovations. So the actions and pseudosprites were developed. The game doesn't know what to do with those; the Patch reads them, understands them, and applies them to the game. The complexity has to be there because we are trying to force a very old game to do all sorts of things it was never designed to do. If you designed the game from scratch, like OpenTTD, it would be much easier.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there

User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Post by SAC »

Oh, okey! That explains a lot! :D This means that I - in case I want to create my own trains and stuff - need to read and understand that huge txt-file about coding all those actions :P That is, if I want to do the coding myself!

Another question which I hope someone can answer;

About those pseudo sprites, what exactly does field 1, 2 , and 3 say with that code. Is it possible to specify so I can get a good picture of what I'm looking at - and hopefully be able to produce something like that myself! Does these three fields of codes change depending on what type of building it referres to - or are they the same for all building structures?

Please forgive me if I'm asking stupid questions, but we all have a learning curve...well, many of us anyway :D

User avatar
krtaylor
Tycoon
Tycoon
Posts: 11774
Joined: 07 Feb 2003 01:58
Location: Washington DC, USA
Contact:

Post by krtaylor »

SAC wrote:Oh, okey! That explains a lot! :D This means that I - in case I want to create my own trains and stuff - need to read and understand that huge txt-file about coding all those actions :P That is, if I want to do the coding myself!
Pretty much, yeah. This isn't the sort of thing you can just deduce how it works by looking at it.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there

User avatar
SAC
Tycoon
Tycoon
Posts: 1519
Joined: 03 Jun 2004 16:35
Location: Gothenburg, Sweden

Post by SAC »

Just for my own test purposes I've made some changes to already existing graphics - basically to get more familiar with the palette. I've focused on George's buses where I removed all those x-rated images :P :D and had them replaced by ads - which changes colors depending on company colors. I also made some adjustments to his Volvo 5000 models since one of the versions have a different engine placement in real life - something which makes the appearance a bit different at the rear end.

There's also a new bus included originally painted by Purno - also changed in some ways by me with a different color that doesn't change depending on color scheme - apart from the ads - which do! :D

Again, just a simple test purpose and nothing else!
Last edited by SAC on 29 Feb 2012 09:36, edited 3 times in total.

Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Google [Bot] and 6 guests