Points of Required Attention™
Smaghetti, a new Super Mario Advance 4 editor, is currently in development! Check out the thread HERE!

Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,313,785
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 03-28-24 06:45 PM
Guest: Register | Login

0 users currently in ROM Hacking | 1 guest

Main - ROM Hacking - How was animation usually done in games? New thread | New reply


Aaendi
Posted on 12-29-09 08:08 PM Link | Quote | ID: 124500


Red Koopa
Level: 27

Posts: 26/131
EXP: 108895
Next: 7264

Since: 10-18-09

Last post: 4641 days
Last view: 4302 days
Since it's taking so long for me to get my so-called animation engine, to be finished and working correctly, I'm wondering how other games did the animation, since I know the way I'm doing it can't be the easiest way.


The way doing it is, I'm dividing the 16k of sprite patterns into 128 16x16 blocks. All 128 sprites in the oam are 16x16 pixels, and each are given a designated 16x16 block of v-ram. During NMI time, 32 of the 128 16x16 blocks are updated. On the first frame, sprites 0-31 are uploaded, followed be sprites 32-63, then 64-95, and lastly sprites 96-127. Every 4 frames if changes sprite pattern tables, where one pattern table is shown, while the other is being updated.

Then there is a sprite table that stores what sprite animation number and what screen coordinates to be displayed. The animation number points to a ROM address that has information on:

- how many little sprites make up the big sprite
- what are the ROM addresses for each sprite pattern
- what are the displacements of little sprite in relation to the big sprite
- what are the sprite attributes to each of the little sprites

but there is a catch. Since it takes 4 frames to update the pattern tables, the displacements and attributes of the little sprites have to be delayed 4 frames after the sprite patterns are uploaded, or else every oam sprite will be out of alignment with the v-ram sprite pattern, everytime an object is created or dropped.

Kawa
Posted on 12-29-09 09:14 PM Link | Quote | ID: 124504


CHIKKN NI A BAAZZKIT!!!
80's Cheerilee is best pony
Level: 138

Posts: 3089/5344
EXP: 30874186
Next: 788795

Since: 02-20-07
From: The Netherlands

Last post: 4469 days
Last view: 2605 days
Reserving dedicated space for all 128 sprites is just plain wrong from the start.

How animation is usually done (mind the present tense) depends on the game, really, but the GBA Metroid games for example were very heavy on object cluster-based animation, wherein each part of the larger sprite (arms, head, body, legs) were a single hardware sprite. Going by the many spritesheets I've seen, Castlevania games, at the very least since Rondo of Blood on the PCE, have used the same system.

Super Mario Bros 1 had a simple 2x3 mapping going that could fit most objects. Specialcase code handled those objects that seemed to be 2x2 or less, which was actually only a collission matter. Bowser was simply two of those stuck together in turn. Note that because it had no bankswitching, every single 8x8 tile in the whole game was loaded once on startup.

River City Ransom EX, with its fairly extensive character editor, had most if not all different eyes, hair pieces and color sets all at the same time. The only thing that changes about a given character is the pose, and some of those overruled the hair and eyes.


____________________
Wife make lunch - Shampoo
Opera - give it a spin
Spare some of your free time?
<GreyMaria> I walked around the Lake so many goddamn times that my sex drive was brutally murdered
Kawa rocks — byuu

Aaendi
Posted on 12-29-09 10:35 PM Link | Quote | ID: 124506


Red Koopa
Level: 27

Posts: 27/131
EXP: 108895
Next: 7264

Since: 10-18-09

Last post: 4641 days
Last view: 4302 days
I just thought of something. Did any game ever separate even and odd frames and switch back and forth between them?

I've always been curious how animation was done in games that have high framerates like DKC and Earthworm Jim.

Kawa
Posted on 12-29-09 11:09 PM Link | Quote | ID: 124508


CHIKKN NI A BAAZZKIT!!!
80's Cheerilee is best pony
Level: 138

Posts: 3090/5344
EXP: 30874186
Next: 788795

Since: 02-20-07
From: The Netherlands

Last post: 4469 days
Last view: 2605 days
DKC and Earthworm Jim were works of art, VRAM management-wise. I suggest you keep those far out of your mind.

____________________
Wife make lunch - Shampoo
Opera - give it a spin
Spare some of your free time?
<GreyMaria> I walked around the Lake so many goddamn times that my sex drive was brutally murdered
Kawa rocks — byuu

Aaendi
Posted on 12-30-09 02:36 AM Link | Quote | ID: 124522


Red Koopa
Level: 27

Posts: 28/131
EXP: 108895
Next: 7264

Since: 10-18-09

Last post: 4641 days
Last view: 4302 days
I think I have this figured out. I'll make every enemy and object (that appear in the same level) fit in the v-ram in designated spots, and use the dma to animate those v-ram tiles in a short repeating pattern.

Kawa
Posted on 12-30-09 11:52 AM Link | Quote | ID: 124536


CHIKKN NI A BAAZZKIT!!!
80's Cheerilee is best pony
Level: 138

Posts: 3091/5344
EXP: 30874186
Next: 788795

Since: 02-20-07
From: The Netherlands

Last post: 4469 days
Last view: 2605 days
That could work.

One method that I've seen is to have clusters of graphics about 1/4th of the total available, and each level specifies which of those clusters is to be loaded. This has the following tricks:
1) Level headers specify one cluster less than total, because the player will always be there.
2) Certain sets of enemies can be used together in a given level.
3) These chunks contain all the parts for the enemies they allow.
4) Large enemies may take up an entire chunk.

Also note that, depending on the player's state, you can upload another chunk for it. For example, you start Super Mario Bros 3 as regular, small Mario. The top chunk, which contains Mario's tiles, only has (most of?) small Mario's tiles, but no big. When you grab a Super Mushroom, that chunk is replaced with one that has (most of?) Super Mario's tiles. Depending on your actions, another chunk may be uploaded if all the tiles for a given form/costume don't fit in a single chunk.

A variant is used by the original Sonic the Hedgehog on the Genesis/Mega Drive, where each kind of "actor" had a hardcoded spot in VRAM that it'd try to put its graphics. Sonic himself, having a lot of animation frames, only loaded a small part of his total into his hardcoded part of VRAM, switching in other parts where needed, as Mario does in the above example. So the original Sonic wasn't "chunked" per se, but there were still certain "impossible" enemy combinations.

____________________
Wife make lunch - Shampoo
Opera - give it a spin
Spare some of your free time?
<GreyMaria> I walked around the Lake so many goddamn times that my sex drive was brutally murdered
Kawa rocks — byuu

Aaendi
Posted on 12-30-09 04:12 PM Link | Quote | ID: 124548


Red Koopa
Level: 27

Posts: 29/131
EXP: 108895
Next: 7264

Since: 10-18-09

Last post: 4641 days
Last view: 4302 days
http://img51.imageshack.us/img51/4143/spritevram.png

Here is how one frame of the v-ram will look like in my game. There are 16 explosion frames in my game, but there can be only 4 frames at the same time (this picture has frames 0, 4, 8, and 12).

That big guy is one of the enemies, I'm not sure yet if I can fit all his frames in there. I'll probably do the same thing I did with the explosions and use 16 walking frames but only allow 4 of them at the same time. If he is still too big, I might limit him to just one per screen in some areas.

Those shiney blue tiles, are for the windows of monorail train that will explode. When it explodes I'll replace them with a totalled version of the train.

Main - ROM Hacking - How was animation usually done in games? New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.015 seconds. (340KB of memory used)
MySQL - queries: 52, rows: 78/79, time: 0.011 seconds.