Isometric Tile Engine for the DS

Discussion in 'NDS - Emulation and Homebrew' started by Foxi4, Feb 16, 2012.

Thread Status:
Not open for further replies.
Feb 16, 2012
  1. Foxi4
    OP

    Reporter Foxi4 On the hunt...

    pip
    Joined:
    Sep 13, 2009
    Messages:
    22,705
    Location:
    Gaming Grotto
    Country:
    Poland
    I've ran into some issues while designing an engine of mine. No matter how much I stretch, I simply cannot place maps of decent size using standard Tile-cutting techniques as the perspective in-game would be Isometric. I was wondering if any of you ever worked on such an engine as I'd be interested in checking out your snippets.

    I've got a few ideas of my own but they're really more "thought bubbles" then real full-blown solutions, I'd love to see how you people would resolve said issue first to have a basic understanding what needs to be done.

    As of now, inputting tiles that are Isometric rather then standard sized leaves out alot of "space" that's essentially wasted, leading to a whole lot of VRAM and RAM wasting. Practically I could avoid that by putting a standard texture and just "tilting" it to achieve the right perspective but I'd much rather work in 2D on this project, simply for the "Retro Feel" reasons.

    Awaiting answers! :)
     
  2. elhobbs

    Member elhobbs GBAtemp Advanced Fan

    Joined:
    Jul 28, 2008
    Messages:
    667
    Country:
    United States
    I know you do not want to use 3d, but I would use gl2d. it techinally uses the 3d engine to display in 2d. any way I would store the tiles in vram packed in a 2d texture. I am guessing that you are using diamond shapes tiles. so you pack the tiles (depending on the size) into for example a 4x4 grid. that should leave space for a 3x3 grid in the empty spaces. you would still have wasted space along the top and bottom but it would be less. you would then need to render each tile as a diamond and use the correct texture coordinates. you could also store the tiles without the transparent corners in main memory and fix it when you move it vram - either some sort off span encoding or just hard coded fixed size algorithm. just my two cent after thinking about it for all of 2 minutes.
     
  3. Dirbaio

    Member Dirbaio GBAtemp Regular

    Joined:
    Sep 26, 2010
    Messages:
    158
    Location:
    Spain
    Country:
    Spain
    I think for stuff like this it's better to use the 2D engine.

    You can do something like use two BG's to display all the tiles, so that when putting the two together on screen, it looks like all the tiles are seamlessly together.
    [​IMG]

    So assuming you want 16x32 diamond tiles (I think it's the most reasonable size for the DS's screen) you can store them in VRAM at 8 tiles per diamond tile. So you can have 1024/8 = 128 different diamond tiles in total. (a BG can hold max 1024 tiles), and that'd use up just 64 KB of VRAM.

    Yes, it's true, diamond tiles waste half of the VRAM, but I don't see any easy way around that. As you say, you could just make one rotoscale BG of 16x16 tiles, and stretch it to look isometric, but that would look bad. Do you really need more than 128 diamond tiles for your maps?
     
  4. Foxi4
    OP

    Reporter Foxi4 On the hunt...

    pip
    Joined:
    Sep 13, 2009
    Messages:
    22,705
    Location:
    Gaming Grotto
    Country:
    Poland
    I actually overcame the issue, but thank you guys for your input.

    It wasn't that my maps were "too big" thus I ended up with too many tiles, it's just that the mapping software I used for putting my tiles together used bicubic resizing for some odd reason, f*cking up my tiles every single time it saved the outputted map. >>;

    I realized that this option is on, turned it off and I have more memory then I'd ever need. I'm also cutting the diamonds in a slightly different fashion then you guys are showing (refer to Blizzard's StarCraft tile system for more information, it's a fantastic method of turning standard rectangular tiles into diamond-shaped ones).

    Cheers, and the thread may be locked now. :)
     
Thread Status:
Not open for further replies.

Share This Page