Author Topic: Help with level files/save  (Read 2392 times)

0 Members and 1 Guest are viewing this topic.

Offline XiiDraco

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 513
  • Rating: +32/-5
  • Forget the numbers, just call me, Recreation.
    • View Profile
    • Black-Lark Games
Help with level files/save
« 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?

Offline TheNlightenedOne

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 427
  • Rating: +16/-1
    • View Profile
Re: Help with level files/save
« Reply #1 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.
« Last Edit: January 04, 2013, 11:02:06 am by TheNlightenedOne »
"Eris" (Ndless 3.1)
"Keto" (Ndless 3.1)
"Luna" (AMS 3.10, HW4)
"Aurora" (2.55MP)