Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / ascii generated 3D dungeons

Author
Message
CresCo
16
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 2nd Aug 2010 21:29
I got this idea from a game creation toolkit called zgameeditor wherein a 3d FPS maze was generated from ascii characters in a .txt file, and I've been working on implementing it in DBPro but I'm a bit stuck. What I need to be able to do is have the program open a file, iterate over the characters inside, and for every character that matches a certain ascii code generate a specified 3D object (such as a wall, door, or passable floor) at coordinates that would update with the iteration. The trouble I'm encountering is twofold:
First, I am new to I/O in DarkBasic and I'm not certain which Read__ function I should be using to take in a single ascii character per iteration.
Secondly, I'm not sure how I should handle the iteration itself-- how might I instruct DBPro to read in one character at a time, moving right one character after each read-in, and then move down to the next line when it came to the end of the current one? I suppose the break condition would be simple enough [just put a set character at the end of my "dungeon" in the .txt file and instruct DBPro to end its loop and close the file when that character is reached] but I don't know about the interim.

Thanks all,

CCJ

CresCo Games: makers of fine software since 2004
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 3rd Aug 2010 00:14
Have look at the Huge Dungeons Tutorial available on this page:

DarkBASIC Professional Tutorials
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 3rd Aug 2010 02:45
Hi, I posted something in the code snippets that will help you since it does that in 2d which can be modified to 3d.
http://forum.thegamecreators.com/?m=forum_view&t=173382&b=6&p=0

If it hasn't exploded yet, I haven't touched it.

Login to post a reply

Server time is: 2026-07-25 08:29:58
Your offset time is: 2026-07-25 08:29:58