Thousand tiles based maps - "How to" using SGDK?
Moderator: Stef
Thousand tiles based maps - "How to" using SGDK?
Greetings,
I am trying to port my recently released Metal Slug port for Atari STE, to Sega Genesis/Megadrive
https://youtu.be/gyRBcTnn-5M
Its the first mission...
But the map is very detailed to load 4096 tiles into limited VRAM of this console.
Obviously a way to store, such example, 512 tiles, and dinamically modify these 512 tiles is needed to succesfully display the map on the screen for a Megadrive system.
I was thinking on a way, via C coding, of load the first 512 tiles, and when the map advances one column... check if the new column tiles are already present on the 512 loaded tiles, if not -> search for a free place on the 512 tile list and load the new one.
As well, each "discarded" column at left is being checked, if its tiles are not already present anymore on the screen, in order to mark these no more used tiles as free in order to be loaded when new columns at right demands.
Obviously, this is intended only for horizontal scroller, but it is a really complex tile dynamic loading code, but useful due to it is restricted to a maximum number of tiles on the VRAM.
Complexity can be crazy when 8 way scrolling is take into account,
Is there already a set of functions implemented in SGDK in order to effectively use thousand tiles based tilemaps?
Without require many hard to code very long functions?
Can be the BMP load functions useful due to these have the ability to specify VRAM tile starting?
Are these functions performance effective?
Atari Game Tools (Atari ST/STE) and Scorpion Engine (Conmodore A500 - A1200) have these capabilities already present, you can use these massive tile number based maps. And I am searching for similar functionalities such dinamically loading of VRAM tiles for Genesis/Megadrive
Thanks in advance,
If you can provide code samples, these will be more than welcome!
I am trying to port my recently released Metal Slug port for Atari STE, to Sega Genesis/Megadrive
https://youtu.be/gyRBcTnn-5M
Its the first mission...
But the map is very detailed to load 4096 tiles into limited VRAM of this console.
Obviously a way to store, such example, 512 tiles, and dinamically modify these 512 tiles is needed to succesfully display the map on the screen for a Megadrive system.
I was thinking on a way, via C coding, of load the first 512 tiles, and when the map advances one column... check if the new column tiles are already present on the 512 loaded tiles, if not -> search for a free place on the 512 tile list and load the new one.
As well, each "discarded" column at left is being checked, if its tiles are not already present anymore on the screen, in order to mark these no more used tiles as free in order to be loaded when new columns at right demands.
Obviously, this is intended only for horizontal scroller, but it is a really complex tile dynamic loading code, but useful due to it is restricted to a maximum number of tiles on the VRAM.
Complexity can be crazy when 8 way scrolling is take into account,
Is there already a set of functions implemented in SGDK in order to effectively use thousand tiles based tilemaps?
Without require many hard to code very long functions?
Can be the BMP load functions useful due to these have the ability to specify VRAM tile starting?
Are these functions performance effective?
Atari Game Tools (Atari ST/STE) and Scorpion Engine (Conmodore A500 - A1200) have these capabilities already present, you can use these massive tile number based maps. And I am searching for similar functionalities such dinamically loading of VRAM tiles for Genesis/Megadrive
Thanks in advance,
If you can provide code samples, these will be more than welcome!
Last edited by masteries on Sun Jul 18, 2021 8:41 am, edited 1 time in total.
Re: Thousand tiles based maps - "How to" using SGDK?
No. You will have to write your own.Is there already a set of functions implemented in SGDK in order to effectively use thousand based tilemaps?
Without require many hard to code very long functions?
Re: Thousand tiles based maps - "How to" using SGDK?
Thanks for the concise answer,
The smile on my face banished
![Sad :(](./images/smilies/icon_sad.gif)
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Thousand tiles based maps - "How to" using SGDK?
Hey,
I posted a reply but for some reasons it didn't arrived.
Well, to make it short indeed SGDK doesn't provide help for that, the MAP system doesn't support tile streaming (i already though about adding it but it would be rather complexe to handle that with multi-scrolling).
The "naive" way of doing that is to use the Sonic 3D approach : have a virtual map supporting a maximum of 4096 tiles but internally you use tilemap as a frame buffer (no duplicated tiles, an uniq tile id for each tile) and just stream tiles for each new column / new row of the fly. That limit the speed of the scroll speed as obviously you can't stream too many tiles per frame, also using that method you cannot compress your tiles data (well that might be possible but you won't achieving a good compression ratio anyway). For a MS style game the scrolling speed is not an issue as it's generally quite slow, you can even limit it to 4 px/frame max and so stream tiles on 2 frames.
I posted a reply but for some reasons it didn't arrived.
Well, to make it short indeed SGDK doesn't provide help for that, the MAP system doesn't support tile streaming (i already though about adding it but it would be rather complexe to handle that with multi-scrolling).
The "naive" way of doing that is to use the Sonic 3D approach : have a virtual map supporting a maximum of 4096 tiles but internally you use tilemap as a frame buffer (no duplicated tiles, an uniq tile id for each tile) and just stream tiles for each new column / new row of the fly. That limit the speed of the scroll speed as obviously you can't stream too many tiles per frame, also using that method you cannot compress your tiles data (well that might be possible but you won't achieving a good compression ratio anyway). For a MS style game the scrolling speed is not an issue as it's generally quite slow, you can even limit it to 4 px/frame max and so stream tiles on 2 frames.
Re: Thousand tiles based maps - "How to" using SGDK?
Your reply went to the duplicate thread in another subforum.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Thousand tiles based maps - "How to" using SGDK?
oh indeed thanks ! I should have moved the topic to the appropriate section, but now it has been replied here i guess we can just ignore the other topic (i don't have right to delete / move it)
-
- Newbie
- Posts: 6
- Joined: Mon Jul 24, 2017 8:24 pm
Re: Thousand tiles based maps - "How to" using SGDK?
I did this for a project of mine similar to how you described, although it took a long time and a few tricks to get it working at a decent speed. I might be able to put a code sample together some time.
Re: Thousand tiles based maps - "How to" using SGDK?
Thanks for your comment,pitcrawler wrote: ↑Mon Aug 02, 2021 7:53 pmI did this for a project of mine similar to how you described, although it took a long time and a few tricks to get it working at a decent speed. I might be able to put a code sample together some time.
I managed to write a horizontal only frame buffer based scroll, performance is good, but I am also interested on 8 way scrolling.
Probably your code can reveal useful tricks or techniques,
Re: Thousand tiles based maps - "How to" using SGDK?
Perhaps you should think to build a separate tool which handles all this. So in you program when the character reaches certain line it knows exactly which tiles and meta-tiles to update.
Regarding 8 directions scrolling, having up/down scroll not necessarily means any tile update. In Megadrive you can have planes 256/512 pixels tall.
Regarding 8 directions scrolling, having up/down scroll not necessarily means any tile update. In Megadrive you can have planes 256/512 pixels tall.
HELP. Spanish TVs are brain washing people to be hostile to me.