Page 1 of 2
How to make animated sprites in GRFMaker?
Posted: 06 Dec 2007 14:55
by Purno
Eh... title should be clear enough
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.
Re: How to make animated sprites in GRFMaker?
Posted: 07 Dec 2007 01:29
by PikkaBird
There's no such thing as an "animated sprite". You need to be more specific about what you're trying to do.
Re: How to make animated sprites in GRFMaker?
Posted: 07 Dec 2007 15:06
by Villem
I think he is meaning something akin to animated steamers?
Re: How to make animated sprites in GRFMaker?
Posted: 07 Dec 2007 18:35
by Purno
Vemarkis wrote:I think he is meaning something akin to animated steamers?
Yes. Thanks.
Re: How to make animated sprites in GRFMaker?
Posted: 07 Dec 2007 20:50
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 (7.62 KiB) Viewed 2393 times
Re: How to make animated sprites in GRFMaker?
Posted: 07 Dec 2007 22:24
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

Re: How to make animated sprites in GRFMaker?
Posted: 07 Dec 2007 23:03
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.

Re: How to make animated sprites in GRFMaker?
Posted: 07 Dec 2007 23:15
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.
Re: How to make animated sprites in GRFMaker?
Posted: 08 Dec 2007 12:17
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.
Re: How to make animated sprites in GRFMaker?
Posted: 08 Dec 2007 17:32
by jvassie
Heres the thing you should use in GRFMaker
Re: How to make animated sprites in GRFMaker?
Posted: 08 Dec 2007 17:48
by Purno
It works, but it's terribly slow. Is there a specific value I gotta change to speed it up?
Re: How to make animated sprites in GRFMaker?
Posted: 08 Dec 2007 20:46
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)
Re: How to make animated sprites in GRFMaker?
Posted: 08 Dec 2007 20:49
by Purno
Aye, but variable 46 isn't in the list, can I savely assume that means GRFMaker doesn't support var46 yet?
Re: How to make animated sprites in GRFMaker?
Posted: 08 Dec 2007 20:57
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)
Re: How to make animated sprites in GRFMaker?
Posted: 08 Dec 2007 23:09
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

)
Re: How to make animated sprites in GRFMaker?
Posted: 09 Dec 2007 04:52
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.
Re: How to make animated sprites in GRFMaker?
Posted: 09 Dec 2007 17:21
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).
Re: How to make animated sprites in GRFMaker?
Posted: 09 Dec 2007 19:37
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*
Re: How to make animated sprites in GRFMaker?
Posted: 09 Dec 2007 20:17
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).
Re: How to make animated sprites in GRFMaker?
Posted: 09 Dec 2007 22:10
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.