Monday, 16 September 2019

Update 3 - The big big biiiiig map

Update 3 - The big big biiiiig map

Could have been bigger

The map is big. It's a 32000x32000 pixels map. And it could have been bigger. You can make map as larg as 64000x64000 pixels. But it would take a lot of time to make such an enormous map. That's the main reason I made a smaller map. 

Almost the same size of a regular map in memory 

Also it's big, this map take only 6k of rom. A regular sonic map take about 5k. This map is 36x bigger in pixel than a regular sonic map but only 1.2x bigger in memory.

The secret

The map has a fractal structure. Which means it is devided into subparts. 
First of all there are tiles which are 8x8 pixels in size. 
Then you have metatiles which are 2x2 tiles in size.
Then you have clusters which are 8x8 metatiles in size.
Then you have super clusters which are 8x8 clusters in size.
Then finaly the map or hyper cluster which size vary. In this video it's 32x32 super clusters in size.



  A tile

 A metatile

 A cluster


 A super cluster

A minnor drawback

There is actualy a con to this map structure. Smaller maps take a lot of space in comparaison to large maps. For instance a 10240x512 will be 4k. It's 195 times smaller in pixel size than a 32kx32k map but only 1.5 smaller in memory. This is due to the fact that the size largely depend on the number of clusters. 1 cluster take 8x8=64 bytes. 60 of them take 60x64=3840byte almost 4k.

To fix this I need to devide the map even more. To have cluster made of sub clusters (or big metatiles) 


I hope to cut in half the amount of memory taken by clusters.

Behind the curtain

I had to do massive optimisation on the scroller. The part of the code that draw tiles as the camera moves in the games. I had to learn Z80 assembly. I actualy never realy coded in assembly before. I only had small experience with code made by the compiler. 

Also because I'm coding on a laptop with a bad posture, my back was begining to hurt me a lot.
So each days I need to do streching and yoga in order to continue coding. I really want to continue this project. I'll do what ever it takes to do it. Even if I have to meditate each day :)

What to do next?

The end goal ,like I said in the video is to make a fully functional 2d seamless open world engine for the master system. And for that now I need to be able to put objects in the scene/map.

I will also need to optimize the code, convert my c code into asm code.

11 comments:

  1. I found about this project when was checking SMS Power forums and it´s incredible and a dream coming reality. You plan to make a Patreon or something?

    ReplyDelete
    Replies
    1. At some point I will probably make a patreon. I'm still looking for the best way to get suppport for this project. What is the game you want to make on the master system?

      Delete
    2. I like platform games specially. I wanted to make a game like Wonder Boy séries based on my comics.

      Delete
    3. In my case, I would love to do various styles like black belt, double dragon, shinobi. if it was possible a game mixing both styles. I would like to help collaborate financially because making game for master system is my childhood dream

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. I’ve been seeking for more information about this thing. When can we see an update? I’m very excited to start using this already. ^^

    ReplyDelete
  4. Yes but I'm not updating this blog anymore. To much work.

    ReplyDelete
    Replies
    1. Do you ever plan on sharing this project for people to either continue or use as is? I'm sure there are a lot of people in different gaming communities that would like to continue this or at the very least, test it. I'm sure, with enough patience and effort, something could be made, even if only very basic.

      Delete