gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Thoughts on advance wars 2 menu effect

#43844 - revengero - Fri May 27, 2005 7:48 am

Hey everyone,
I'm making a menu system at the moment and was looking at advance wars 2, and in particular the character selection screen in the war room. Check out the animating film strip the characters are on. Any ideas how they did this? Harware scrolling seems out of the question so im assuming its frame by frame animation... thoughts??

#43939 - strager - Sat May 28, 2005 1:12 pm

I have the game, and I don't know what you are talking about. If you can, please post pics.

#43942 - Quirky - Sat May 28, 2005 2:05 pm

I have the cart in my GBA at the moment. The effect looks like a film-reel that scrolls at ~30 degrees to the horizontal.

One way to do it would be to increment X for the left-right scroll and DMA to the Y scroll register the correct value on each HBlank. Or it may be even simpler and could be done with a few tiles drawn to look as if on an angle, and then palette swaps for the 'scrolling'.

The character portraits are probably drawn in another layer (sprites or bg, doesn't matter).

I'll see if I can dump the rom and what VBA reveals.

[Edit - seems as if VBA doesn't run it without patching...]

#43972 - DekuTree64 - Sat May 28, 2005 8:55 pm

I've never played the game so I don't know what it looks like, but judging by Quirky's description, it sounds like a case of clever-programmer-and-artist.

Is the film strip drawn so it runs 4 pixels over, 1 pixel up, 4 over, 1 up, to get the slanted effect? And is each character portrait about 4 chars wide?
If so, then it's probably just drawn that way to begin with, and the code says scroll horizontally by x pixels, and vertically by x/4 pixels.

Then to get continuous scrolling in one direction, since each 4-char wide portrait would slant up exactly 1 char (32 wide, rising 1 pixel for every 4 horizontal = rise 8 total), you can just swap each portrait into the screen data when it comes on screen, moved up/down 1 char from its neighbor.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#43987 - Lord Graga - Sat May 28, 2005 10:51 pm

Googles image-search for Advance Wars 2 Menu returned this image:

http://www.icculus.org/~zakk/aw212.png

#44011 - Kyoufu Kawa - Sun May 29, 2005 10:09 am

Try the War Room next time.

#44077 - strager - Mon May 30, 2005 1:18 am

If you are using text mode, just make a couple of tiles. Two tiles' width should span one tile's height. Example:
Code:

  <- Two  tiles ->
  1234567812345678
1               ..
2             ....
3           ......
4         ........
5       ....**....
6     ......**....
7   ..............
8 ................

That's the top; just flip the tile horizontally and vertically for the bottom. And, of course, add the little dots (*) and the images (darkened?) to make it look more film real.

The reason I didn't understand is because I didn't read the word 'Warroom.'
Silly me.

#44078 - APL - Mon May 30, 2005 1:30 am


_________________
-Andy L
http://www.depthchasers.com

#44086 - DekuTree64 - Mon May 30, 2005 2:06 am

Haha, all that complicated speculation and it looks like the holes are on a completely different layer than the flim strip itself, just scrolling along to make it look like the dark strip part is moving.
I love little visual tricks like that :)
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#44091 - APL - Mon May 30, 2005 4:53 am

Perhaps this is a stupid newbie question, but the holes are transparent, if they're on a seperate layer how are they making it so you can see the background un-modifed through the holes? Wouldn't the holes have to be part of the same layer as the 'dark' areas of the film?
_________________
-Andy L
http://www.depthchasers.com

#44096 - DekuTree64 - Mon May 30, 2005 6:59 am

Only half transparent like the film strip, but white instead of black. The way the blending works, if 2 layers are set in the first target selection in BLDMOD, whichever one is on top gets blended with the second BLDMOD target.
It sort of draws all the layers before any blending takes place, so the light holes overwrite parts of the dark strip, and then the result gets blended with the sky layer below.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#44782 - Steve++ - Sun Jun 05, 2005 6:50 am

It sounds like everyone is overlooking the simplest explanation: It's likely to be using a rotated background layer.

#44798 - strager - Sun Jun 05, 2005 2:32 pm

But it isn't. I explained how it is put together in one of my previous posts.

#44867 - Steve++ - Mon Jun 06, 2005 9:50 am

You did? How do you know how it's put together? Did you hack the ROM?

#44880 - Kyoufu Kawa - Mon Jun 06, 2005 2:46 pm

VisualBoy Advance, and the truth (and map/tile viewers) shall set you free, my syntaxsugar-enriched friend.

#44882 - strager - Mon Jun 06, 2005 2:58 pm

Link to the post: http://forum.gbadev.org/viewtopic.php?p=44077#44077

And yes, KK, I did use VBA's toold :-)