Computer Science Canada Megaman Map Storage |
Author: | Martin [ Thu Dec 30, 2004 12:31 pm ] |
Post subject: | Megaman Map Storage |
Right now, I'm working on a megaman-esque side scrolling adventure, and I was wondering if there was an efficient way to store the maps, and what textures these maps use. Things such as moving platforms and enemies are easy, since they can be included as extra information at the end of the file, but storing the actual map for a decently sized level is quite spacious. Anyone have any suggestions? |
Author: | wtd [ Thu Dec 30, 2004 12:49 pm ] |
Post subject: | |
A two dimensional array of structs (or equivalent) holding the data on each "square" is about as storage efficient as you can hope to get. |
Author: | Tony [ Thu Dec 30, 2004 1:12 pm ] |
Post subject: | |
I suppose that if certain parts of the level can be generated rather than stored, that would save you some space |
Author: | wtd [ Thu Dec 30, 2004 1:58 pm ] |
Post subject: | |
tony wrote: I suppose that if certain parts of the level can be generated rather than stored, that would save you some space
It's gonna eat more time and space figuring out how to make small optimizations than he'd save. |
Author: | Martin [ Thu Dec 30, 2004 4:47 pm ] |
Post subject: | |
I made everything into objects, and it makes it a lot easier. Map size's still a bit big, but it's acceptable for now. Thanks guys |
Author: | Andy [ Fri Dec 31, 2004 9:46 am ] |
Post subject: | |
hmm why not have a decoder to interprete the maps and then use simple numberings to represent different objects and decode it into the correct files to load |
Author: | Martin [ Fri Dec 31, 2004 11:30 am ] |
Post subject: | |
That's what it does do. <object ID> <x location> <y location> <script file target> |
Author: | Andy [ Fri Dec 31, 2004 11:51 am ] |
Post subject: | |
yea i dunno.. thats the best way i can think of |
Author: | thegoose [ Fri Dec 31, 2004 5:15 pm ] |
Post subject: | |
Use a tree, maybe? That way, if you have a bunch of stuff bundled together that's identical, they can become one node. Good thing about this is it takes logN time, almost instanteneous. Or just hash everything...There should be some good cordinate hashes. This way, it's very easy and quite fast to look into the part of the map that you are near. |
Author: | Martin [ Fri Dec 31, 2004 6:05 pm ] |
Post subject: | |
Oh yeah, the objects are hashed. It's looking quite reasonablely sized. Hopefully I'll have something to show off soon. |