How to make animated sprites in GRFMaker?

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
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

How to make animated sprites in GRFMaker?

Post by Purno »

Eh... title should be clear enough :tongue:

How to make animated sprites in GRFMaker?

A simple line of NFO code which I can input in GRFMaker would be sufficient too I guess.
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
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: How to make animated sprites in GRFMaker?

Post by PikkaBird »

There's no such thing as an "animated sprite". You need to be more specific about what you're trying to do.
User avatar
Villem
Tycoon
Tycoon
Posts: 3310
Joined: 28 Aug 2003 09:38

Re: How to make animated sprites in GRFMaker?

Post by Villem »

I think he is meaning something akin to animated steamers?
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Re: How to make animated sprites in GRFMaker?

Post by Purno »

Vemarkis wrote:I think he is meaning something akin to animated steamers?
Yes. Thanks.
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
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: How to make animated sprites in GRFMaker?

Post by AndersI »

I'd guess this part of the screen has something to do with it, but I don't know for sure. I'd suggest you set up a test sprite and see what happens...
Example21.png
Example21.png (7.62 KiB) Viewed 2395 times
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Re: How to make animated sprites in GRFMaker?

Post by jvassie »

Purno, if you around tomorrow, hit me up on it and ill show you how to do it :)

Got an example i can give you too :wink:
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
User avatar
dev|ant
Traffic Manager
Traffic Manager
Posts: 140
Joined: 30 Nov 2005 11:26
Location: melbourne.au

Re: How to make animated sprites in GRFMaker?

Post by dev|ant »

I just pulled this from one of my projects...

02 00 25 82 46 08 03 03 22 00 01 01 23 00 02 02 24 00 03 03 21 00

The bold IDs are for each frame. I don't remember any other details because I haven't coded nfo for about 5 months. :mrgreen:
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: How to make animated sprites in GRFMaker?

Post by DaleStan »

AndersI wrote:I'd guess this part of the screen has something to do with it, but I don't know for sure. I'd suggest you set up a test sprite and see what happens...
I'd be exceedingly surprised if that works. Unless I miss my guess, that modifies the <nument-1> or <nument-2> portion of a standard action 2, which cannot be used for animation. Variationals (usually on variable 46) are required for steamer animations.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: How to make animated sprites in GRFMaker?

Post by AndersI »

It was just a guess... Looking at the GrfMaker source, I can't find anything that substantiates that guess. Oh, well...

Why variable 46? What's variable 0A (Animation counter)? [...reading Wiki...] OK, now I get it. The Animation counter is not connected to the speed of the train, it's always ticking.
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Re: How to make animated sprites in GRFMaker?

Post by jvassie »

Heres the thing you should use in GRFMaker
Attachments
Animation.PNG
(59.13 KiB) Downloaded 71 times
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Re: How to make animated sprites in GRFMaker?

Post by Purno »

It works, but it's terribly slow. Is there a specific value I gotta change to speed it up?
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
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: How to make animated sprites in GRFMaker?

Post by AndersI »

Note that DaleStan mentioned variable 46, not 0A.

You can make it twice as fast by anding with 7F instead, and have the ranges 0-31, 32-63, 64-95, 96-127
Four times as fast by anding with 3F, ranges 0-15, 16-31, 32-47, 48-63
and so on.

And you can have more ranges for smother animation.

(If I have understood how it works)
Last edited by AndersI on 08 Dec 2007 20:51, edited 1 time in total.
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Re: How to make animated sprites in GRFMaker?

Post by Purno »

Aye, but variable 46 isn't in the list, can I savely assume that means GRFMaker doesn't support var46 yet?
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
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: How to make animated sprites in GRFMaker?

Post by AndersI »

Purno wrote:Aye, but variable 46 isn't in the list, can I savely assume that means GRFMaker doesn't support var46 yet?
Yes, so it seems. You could always look at the NFO to find the offset to the 0A byte, and insert a 'modify next sprite' instruction before the varaction2. This can be done with GrfMaker.

Or simpler, you could let GrfMaker produce the NFO, edit that byte manually and use grfcodec in the normal way.

(I might be able to add the var46 before Christmas, but no guarantee)
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Re: How to make animated sprites in GRFMaker?

Post by jvassie »

Purno, the best way to increase the speed of the graphics is to have more frames, 2 ways you can do that.

a.) The harder way, is to draw more stages, IIRC, it has to be 2, 4, 8, 16, 32 etc stages.
b.) The easier way is to just use the first for example four stages and repeat them. So for example instead of splitting 0-255 into 4 sections, split it into 8 sections and run the GFX IDs in the order like 01,02,03,04,01,02,03,04.

Hope that improves it :)

(PS sorry i wasnt around today like i said i would be :( )
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: How to make animated sprites in GRFMaker?

Post by DaleStan »

jvassie wrote:Purno, the best way to increase the speed of the graphics is to have more frames,
Why does more frames increase the speed? The counter will always count at the same rate, regardless of the number of frames (or even if it's zero.)
jvassie wrote:IIRC, it has to be 2, 4, 8, 16, 32 etc stages.
No, it doesn't.

And make sure you read the description of variable 46. Most notably, the useful portions thereof.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Re: How to make animated sprites in GRFMaker?

Post by Purno »

DaleStan wrote:
jvassie wrote:Purno, the best way to increase the speed of the graphics is to have more frames,
Why does more frames increase the speed? The counter will always count at the same rate, regardless of the number of frames (or even if it's zero.)
Making more frames differientating from each previous one does visually speed it up. Though, does this counter speed depend on vehicle speed?
jvassie wrote:IIRC, it has to be 2, 4, 8, 16, 32 etc stages.
No, it doesn't.

And make sure you read the description of variable 46. Most notably, the useful portions thereof.
Var46 doesn't seem to be supported by GRFMaker (yet).
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."
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: How to make animated sprites in GRFMaker?

Post by DaleStan »

Purno wrote:Though, does this counter speed depend on vehicle speed?
Did you read the documentation? What does it say?
Purno wrote:Var46 doesn't seem to be supported by GRFMaker (yet).
GRFMaker is not the only program that can be used to make GRFs. *gasp*
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Re: How to make animated sprites in GRFMaker?

Post by Purno »

DaleStan wrote:
Purno wrote:Var46 doesn't seem to be supported by GRFMaker (yet).
GRFMaker is not the only program that can be used to make GRFs. *gasp*
But it's the simplest tool to code GRFs out there on the internet, AFAIK. The only alternative I know is coding NFO, which is not an option for me. (Tried it, been there, gave up).
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
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: How to make animated sprites in GRFMaker?

Post by AndersI »

But it's not very complicated to code with variable 0A in GrfMaker, adding a comment before each of the lines (make the comment appear in the NFO), produce the NFO, open Notepad, locate the comments and change 0A to 46 in the next line, finally create the GRF with grfcodec.

OK, it's more complicated than having a GrfMaker that could do it right now, but we don't.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 15 guests