The back story for this node is that for the past while, I've been messing about with writing my very own 16bit rpg (think snes). I've gotten most of the image generation code working properly and so forth, so I can draw my purty pictures. I'm using a series of layers, with the first layer being the background made up of 64x64 terrain tiles, then layers of various objects, sprites, senery and so forth.
My problem is that I've run into an impasse as to how I can store a tile arrangement (a.k.a: "map"). I experimented with xml for a bit, but frankly its a huge pain in the ass, massively over kill for this app, and other reasons why I'm not using it. But I can't for the life of me think of another way I could store this data so It would be easily portable.
My current thinking runs along the lines of having a folder full of images, then just some how identifying each image in my map file, solely by some name, so I could keep the complexity of the map file down. But I'm really not sure even how I could implement that. So um, anyone have any suggestions?
Update: Most of my actual code for this is written in C++, utilizing openGL, so far. I have vauge plans to include a perl interpreter later, but I felt justified in asking here because I thought it was a very language non-specific question, dealing more with algorithms. The only reason I post this update is to help people not having to guess at how exactly I implemented it. (Of course, any C++ specific advice would be highly appreciated =] )
update (broquaint): marked off-topic
In reply to OT: Tile maps
by BUU
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.