forums

TNT Basic Forums > Programming Q&A
Random Maps
< Last Thread     Next Thread >
Author
Thread        Post A Reply

04-08-2008 23:07

Posted by:
Hatch

Location:
'Merca

Click Here to Email Hatch   Find more posts by Hatch

I don't know how active this community is anymore, but I suppose there's no harm in posting.

I should first make it clear that I'm much more an artist than a coder, but I know just enough about programming to be dangerous. TNT Basic looked simple enough that even I would be able to make sense of it and put some of my pixel art tiles to use. So far this has proved to be true. That said...

I'm trying to make a graphical roguelike. For some reason I decided to start with random map generation, but suddenly realized I have absolutely no clue where to begin. I mean, I've got a sprite displaying on screen, and I've got tiles up and scrolling, etc., etc. It seems I'll have to have a single map for all randomizations and use Set Map Tile in combination with a bunch of instructions to accomplish the task. It's the bunch of instructions that I'm stuck on. Even just a high-level explanation about how this is normally done in ANY language would be enormously helpful; I don't even need code or even pseudo code.

Thanks for reading!

04-09-2008 00:52

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

Hi Hatch - you could do this a couple of ways.

The way I did it for Dinky Dungeon (which can be found at: http://www.frankenspud.com/) was to just make a TON of pre-made maps
then choose a map randomly and eliminate it from being chosen again. The reason I did this was because it is VERY easy to knock together a map in TNT because of the built-in map editor. I made 50 unique maps in about 2 hours.
Not too painful.

Otherwise you would probably want to build a map based on say 10 or so different floor tiles (plain, wall, open door, locked door, stairs up, stairs down, chest, etc....) Making tiles perfectly square makes life easier.
BUT you want to make sure that you don't just build a bunch of dead-ends.
You want your character to be able to travel across a level somehow......
You could do this by setting up a series of different room shapes and sizes that interlock doors/passages regardless of where they are placed, '+' and 'T' intersections, etc..... Once you design 20 or 30 or so 'room/passage' types, you can randomly assign them to a place using a weighted system so you get more hallways than rooms or some such thing.

I could knock up a quick example of something basic that you could look over if you needed. Just let me know.


cheers

barry

04-09-2008 02:11

Posted by:
Hatch

Location:
'Merca

Click Here to Email Hatch   Find more posts by Hatch

Hey Barry--Thanks so much for the reply!

Those are great suggestions. The first one is so simple I'm sure I would have never thought of it! I'm going to turn the problem over in my head for a bit while I work on other things. I'll post here once I've made a decision for the sake of closure ;)

On a side note, I've played DinkyDungeon before and I had no idea it was made in TB! Very inspiring. It's always seemed like such a wonderful gem on the otherwise largely barren independent Mac game scene. Keep it up!

Again, thanks very much for the help.

04-09-2008 06:38

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

Thanks for the nice words Hatch!

Anything I can do to help - just post here.

There may not be a ton of active people here - but every one of them is truly helpful....

-barry

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.