|
|
View previous topic - View next topic |
Author |
Message |
JimKurth Monkey-Butler
Joined: 01 Apr 2007 Posts: 53 Location: Houston, TX
|
Posted: Sun Jul 29, 2007 6:00 am Post subject: sprite file type |
[quote] |
|
Thinking for my project I want to include sprite files, which would contain multiple sprites of different sizes. To save memory and space (since it's QB at the moment), I'm considering of defining xx-many LONG integers and using each one to refer to the location in memory of the starting of the sprite. Example:
#define OBJ102 34522 = Object #102 is at byte 34522 in the file
#define NPC118 38 = NPC #1, frame 18 is at byte 38 in the file
This way, during different parts of the game, I can replace the location with the byte position of the start of that sprite, and not waste any more memory than needed. I guess this is just like a pointer except I'm setting the address, not the value there. Each sprite would contain a metadata header: it's ID and it's dimensions. Then the actual RGB data.
I think this could be the best way to go without unnecessary data files and use little space as possible (for example, every chapter in the game can have a maximum of 80 different object sprites, 50 different enemy sprites, 1 boss with 5 frames, 80 character frames) and just reference these defined values in the actual sprite file type. This could also be good because when I need to change the current frame on the screen to a different one, I just reference the byte location of that sprite and go straight there in the open file and use an asm routine to copy from 1 source to another.
My question is, is this practical for QB? I know I'm living in the ancient times but I'm destined to use it for this project. It was started around the same time as TheGame and I want to show off the skills using a compiler with a LOT of limitations.
Thanks for the input. I may not make an original game, or show original artwork (something noone has done in an RPG), or even have an original storyline. BUT, the fact is.... I don't really care about similarity. Any game can be great if programmed properly and
|
|
Back to top |
|
|
Ninkazu Demon Hunter
Joined: 08 Aug 2002 Posts: 945 Location: Location:
|
Posted: Sun Jul 29, 2007 6:32 am Post subject: |
[quote] |
|
This functionality is already part of PP256's file format and API. It stores sprites in just enough space they need and calculates the indices for them at load time. I don't know how useful the index swapping would be, but it sounds like a good experiment to see how diverse a map can be. Sprite loading is generally reaaaaaally fast, so dynamic loading while traversing the world might be a freakin sweet feature. Make MorrowindQB!
Cai's Quest 3 loaded the sprite files every frame, actually. Only slight slow-down was noticeable. Of course this was on an older machine that didn't fuck up DOS apps. My laptop sucks with those games now. DOSBox is acceptable, but really not the same.
|
|
Back to top |
|
|
|
Page 1 of 1 |
All times are GMT
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|