Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Megaman Map Storage
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Martin




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Thu Dec 30, 2004 12:49 pm   Post subject: (No 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.
Tony




PostPosted: Thu Dec 30, 2004 1:12 pm   Post subject: (No subject)

I suppose that if certain parts of the level can be generated rather than stored, that would save you some space Thinking
wtd




PostPosted: Thu Dec 30, 2004 1:58 pm   Post subject: (No subject)

tony wrote:
I suppose that if certain parts of the level can be generated rather than stored, that would save you some space Thinking


It's gonna eat more time and space figuring out how to make small optimizations than he'd save. Wink
Martin




PostPosted: Thu Dec 30, 2004 4:47 pm   Post subject: (No 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 Smile
Andy




PostPosted: Fri Dec 31, 2004 9:46 am   Post subject: (No 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
Martin




PostPosted: Fri Dec 31, 2004 11:30 am   Post subject: (No subject)

That's what it does do.

<object ID> <x location> <y location> <script file target>
Andy




PostPosted: Fri Dec 31, 2004 11:51 am   Post subject: (No subject)

yea i dunno.. thats the best way i can think of Confused
Sponsor
Sponsor
Sponsor
sponsor
thegoose




PostPosted: Fri Dec 31, 2004 5:15 pm   Post subject: (No 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.
Martin




PostPosted: Fri Dec 31, 2004 6:05 pm   Post subject: (No subject)

Oh yeah, the objects are hashed.

It's looking quite reasonablely sized. Hopefully I'll have something to show off soon.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: