Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: XiiDraco on January 04, 2013, 12:43:17 am

Title: Help with level files/save
Post by: XiiDraco on January 04, 2013, 12:43:17 am
I want to know how to make some sort of storage for a level that holds map data. like minecraft has block IDs and the block location. I need to have an x and y coordinate and ID value for evry block on the map, but dont know how to do that wih axe.

I apologize for my lack of expirience with axe, but hey thas what learning is for right?
Title: Re: Help with level files/save
Post by: TheNlightenedOne on January 04, 2013, 11:00:03 am
I'm no expert on this (by any means), but I suppose you could dedicate x bytes at the beginning of the file to define x and y lengths, and then store data sequentially. Like if you have a 5x5 Minecraft-ish world, that looks like this (d=dirt, c=coal, i=iron, g=gold):

ddddd
dcddc
iidgc
ggidd
gggdd

You could define it as "55ddddddcddciidgcggiddgggdd"
I doubt that this technique is very efficient (I came up with it myself :P), but AFAICT it will work, as long as your program that reads this can interpret it correctly and has the contents (in this example, d, c, i, and g) defined (possibly hard-coded?). AFAICT this could also be applied for a 3D environment... Although I'm almost sure there are better solutions... Please correct me if I'm wrong in any of this.