Autor
| SD Snatcher sprite (?) question
|
Mirg msx lover Mensajes: 84 | Publicado: Septiembre 13 2005, 13:44   |
I've been playing SD Snatcher again lately. While playing games, I always try to analyze how certain things were achieved, but I can't figure out how they made the main character's sprite. Is it a sprite or do they copy it from some other page on top of the map or something like that?
And another quick question: SD Snatcher is screen 5, right?
|
|
BiFi msx guru Mensajes: 3142 | Publicado: Septiembre 13 2005, 13:50   |
The player (and all enemies) are copied from part in VRAM... And yes, SD-Snatcher is SCREEN 5.
|
|
Mirg msx lover Mensajes: 84 | Publicado: Septiembre 13 2005, 14:01   |
Is that what they call software sprites, or is that another technique? I read about software sprites on the Parallax Nostalgia website (the ARC page). Or is "software sprites" just another name for a very very smart memory-copy routine?
Sorry for all the questions by the way, but I like learning a lot. I do read a lot of articles, websites and source codes (which I don't always understand yet), but asking the right questions always clears up so much.  |
|
BiFi msx guru Mensajes: 3142 | Publicado: Septiembre 13 2005, 14:10   |
Yes, these are also called software sprites. It saves the old state of that area somewhere in the VRAM, and copies the player on it with a logical copy where the transparency can be filetered out...
The hardware variant is fully done by the VDP. The programmer provides the locations, the color(s) and the shape of the sprite and the VDP just puts it there.
|
|
wolf_
 msx legend Mensajes: 4713 | Publicado: Septiembre 13 2005, 14:25   |
Softsprites are cool when the screen doesn't change smoothly/rapidly, like RPG's, puzzles etc. Aleste obviously uses hardware-sprites, for an obvious reason..
Softsprites are also bigger in mem than hardsprites, in sc5-format a 16x16 softsprite is 128 bytes (16*16/2) and you need to store the old screencontent somewhere as well. So each 16x16 softsprite costs you 16*16/2 *2 =256 bytes mem, whereas a single hardsprite costs you 32 bytes, or 48 bytes for line-colored sprites. A 'nice sprite', similar to Usas, Metal Gear, Vampire Killer etc. costs you 2*96 = 192 bytes.. using softsprites it would be 16x32/2 *2 = 512 bytes.
|
|
Mirg msx lover Mensajes: 84 | Publicado: Septiembre 13 2005, 14:38   |
Thanks, BiFi. The old state backup was something I was wondering about too. I thought there must be some neat trick to save the extra memory it costs, but there isn't one apparantly.
Wolf_, with "nice sprites" you mean four line-colored hardsprites, I assume? Two 16x16 sprites stacked on top of two more 16x16 sprites?
Is there some recommended reading on how the MSX's VDP works and how to program it? |
|
BiFi msx guru Mensajes: 3142 | Publicado: Septiembre 13 2005, 14:52   |
|
|
Mirg msx lover Mensajes: 84 | Publicado: Septiembre 13 2005, 14:57   |
Ah, "VDP Programming Tutorial". Perfect! Thanks!  |
|
wolf_
 msx legend Mensajes: 4713 | Publicado: Septiembre 13 2005, 14:58   |
I mean: the Usas/Vamp.k./MG chars are 16x32, which means 4 linecolored-sprites, using the OR-trick for the 3rd spritecolor on a line.
|
|
Mirg msx lover Mensajes: 84 | Publicado: Septiembre 13 2005, 15:17   |
Ah, that's what I thought you meant, except for the OR-trick bit. I assumed two colors per line. What's the OR-trick? (You don't have to go in detail if it's a bit much to explain. In fact, you don't have to answer at all, of course, heheh.)
I'm beginning to understand why BASIC's screen manipulation functions are so slow compared to assembly. In BASIC, every command is handled by the CPU, which has to translate BASIC screen functions to VDP-commands and then send them to the VDP, whereas in assembly, you can send commands to the VDP directly, right? |
|
wolf_
 msx legend Mensajes: 4713 | Publicado: Septiembre 13 2005, 15:23   |
the OR-trick gives you a third color when you have 2 sprites on a line..
look closely at the Usas/Vamp/MG chararcters.. there're max 3 colors on a row..
if sprite 1 has color 8, and sprite 2 has color 1, then the OR-color is 9
But if sprite 1 has color 7 and sprite 2 has color 1 then nothing is gained. So setting-up the palette of a game with sprites usually takes some attention..
( iirc  ) |
|
wolf_
 msx legend Mensajes: 4713 | Publicado: Septiembre 13 2005, 15:25   |
The idea is that each sprite has on/off-pixels, so each sprite-pixel gives you 2 options, for a single sprite it's 'sprite' or 'transparent' obviously..
Two sprites give you 4 options (2+2). One of them is 'transparent', so that leaves you with 3 options... hence, 3 colors..
|
|
Mirg msx lover Mensajes: 84 | Publicado: Septiembre 13 2005, 16:07   |
Hmm, I'm going to look that up somewhere. It sounds really useful. Is it a feature or a bug? I can imagine how annoying it would be if you're trying *not* to blend colors, heheh.
The last couple of days have had more reading than programming. Ah well, I've got all the time in the world to learn assembly and the MSX architecture. Maybe in the future I can even try programming something.  |
|
wolf_
 msx legend Mensajes: 4713 | Publicado: Septiembre 13 2005, 16:15   |
it's a feature... -iirc- it's setting some bit in the linecolor of a sprite.. dunno which one..
|
|
Mirg msx lover Mensajes: 84 | Publicado: Septiembre 13 2005, 16:16   |
Ah, great. I won't have much trouble looking it up, then. Thanks.  |
|
|
|
|