The Daily Click ::. Forums ::. Klik Coding Help ::. Random Dungeon Generation
 

Post Reply  Post Oekaki 
 

Posted By Message

nivram



Registered
  20/07/2006
Points
  171
16th April, 2012 at 16/04/2012 00:11:30 -

The example mfa can be found here, it will be under Q-R:
http://www.castles-of-britain.com/mmf2examples.htm

What I would like to happen is for the player only to be able to exit or enter a room through a door. The Player would also need to be able to still walk the passages.

The mfa uses the Dungeon Object Extension.

Any help would be appreciated.

Marv



 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
16th April, 2012 at 16/04/2012 01:11:38 -

Personally, I wouldn't use the dungeon object to position the doors - it looks stupid having doors in the middle of junctions, or taking up whole squares when the rooms don't have walls, etc. I think you could come up with a much better way of doing it yourself.

You have two alternatives:

A. Have walls and doors both take up an entire square - so you'd need to surround rooms with a solid wall 1 square thick. That's easy enough - you just check each room square and if any of the adjacent squares are also room squares, make it a wall (or door) instead.

B. Have walls and doors on the lines between squares (eg. http://members.quicknet.nl/lm.broers/images/hquest5.jpg ). In this case, you could use an array to assign squares a "room ID" - so all the squares in one room have the value "1", all the squares in another have the value "2", all the corridor/other squares have a value "0", etc. You then don't allow the player to move to a square with a different value, except via doors. I think there's probably an extension to help with that (Advanced Gameboard object?), but if not, I've done it before without.

To illustrate the difference:
http://incubation.mendelsohn.de/forum/457-4sdw.png
The top image is a map from the board-game "Space Crusade", which uses method B; the bottom image is the same map converted for the PC game "Incubation", which uses method A.

Either way, you'd probably need to use a pathfinding extension to verify that a path can be found from the starting point to the exit, and add another door or two if not.

 
n/a

nivram



Registered
  20/07/2006
Points
  171
16th April, 2012 at 16/04/2012 03:33:40 -

Thanks for your input.

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm
   

Post Reply



 



Advertisement

Worth A Click