#40706 - ProblemBaby - Thu Apr 21, 2005 6:35 pm
Hi
Ive started to develop a game with a perspective like zelda 3
and Ive to make a good plan how to solve everything.
My first problem is map animation..
Is it ever used?
or is such things replaced with sprites?
But what about water and such stuff that can take up a lot of the screen then which method is best?, change the tile- or the map data?
and what about a torches? if its 24 in one room, and 1 in another.
I need to come up with some standard, when to do what, can someone help me out?
And do you have a nice mapeditor to recommend for this purpose?
Thanks
#40708 - Kyoufu Kawa - Thu Apr 21, 2005 7:13 pm
Go for tiles. It's what the big players use.
#40715 - DekuTree64 - Thu Apr 21, 2005 7:53 pm
Both work, and it usually depends on the type of game. For Zelda that has more ambient animations, I'd go with overwriting the tile data, because it's easier to code.
For something with more animations triggered by the player, swapping out an area of map data tends to work better.
For example, if you have 2 doors and you want one of them to open when the player touches it, you just swap out the map data where that door is. If you do it by tile data, you have to make sure each door uses all unique tiles, so overwriting one won't overwrite the other at the same time.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#40717 - ProblemBaby - Thu Apr 21, 2005 8:27 pm
Isnt it better in the door case or if the player lifts something from the map
like a bush, that it turns into an object thas is animated, and then change the map data. to floor or ground. I think I will go for that.
and change the tiledata for water and big things.
Maybe it is best to unpack it to EWRAM so it just is to copy it without having to unpack it from ROM.
Then Ive another question about animation Ive find out that the player
will need about 100 frames for all kind of moves and things he does.
he is 24x16 = 6 tiles, 6 * 100 = 600 tiles and thats about half of the whole memory, so I cant copy everything to the sprite memory, so I wonder if the GBA is fast enough to copy all this data, if 6 characters is displayed for example ive to copy 36 tiles?
#40719 - Lord Graga - Thu Apr 21, 2005 8:49 pm
For such a large amount of frames, you will have to transfer every frame whenever you need it. Use a fast memory transfer function for it.
#55237 - Palamon - Mon Sep 26, 2005 8:54 pm
I noticed this done for the metroid games, with the tile data for samus changing with every move.
What do you mean by a fast memory transfer function?
#55238 - poslundc - Mon Sep 26, 2005 9:04 pm
Palamon wrote: |
What do you mean by a fast memory transfer function? |
General ways to copy data:
1. Use a "for" or "while" loop.
2. Use memcpy().
3. Use the BIOS CpuCopy routine.
4. Write an optimized ARM assembly routine and place it in IWRAM.
5. Use the DMA.
Those are roughly in increasing order of speed, although depending on the circumstances there may be little or no difference, or even inversion of ranking.
Generally, for less than 32 bytes of data or so it's not worth using 3-5. The DMA is useful but not always interrupt safe and is often the source of unexpected hardware "problems", and since it halts the CPU anyway it won't provide a tremendous speed boost over option 4.
Dan.
#59385 - Ultima2876 - Tue Nov 01, 2005 7:57 am
Got any information on how one would go about doing number 4? ;P
#59390 - Cearn - Tue Nov 01, 2005 10:59 am
Try the routines in my core_asm.s (can also be found among the latest tonc code). memcpy32 and memset32 are basically CpuFastSet with extra code for when the number of words isn't a multiple of 8. memcpy16 and memset16 adds code for alignment-safe u16 copies/sets.
For course, you do need to know work with assembly files. Use something like "arm-elf-as -mthumb-interwork core_asm.s -o core_asm.o" to assemble, and add the following declarations
Code: |
void memcpy32(void *dstv, const void *srcv, u32 wdcount) CODE_IN_IWRAM;
void memset32(void *dstv, u32 wd, u32 wdcount) CODE_IN_IWRAM;
void memcpy16(void *dstv, const void *srcv, u32 hwcount);
void memset16(void *dstv, u16 hw, u32 hwcount);
|
#59451 - ScottLininger - Tue Nov 01, 2005 9:53 pm
Ultima2876 wrote: |
Got any information on how one would go about doing number 4? ;P |
Don't worry about #4 until you get it working in simple C. Performance might not be great, but you want to make sure you understand the logic and have some reliable code. Then you can worry about optimization.
:)
Scott