Dungeon Walk-thru …
For those following the Dungeon Builder progress, here’s a video showcasing what it can do so far … there are still some issues with the render system … namely it rendering some things too early … and rendering some things incorrectly … but otherwise, the overall code base is almost finalized and it’s just a matter of tweaking and squishing bugs …
You can find the Dungeon Builder video by clicking the picture below:
UPDATE: Added a link to the second Demo, which show cases some corrected render glitches, and what I believe to be the ‘beta’ version of the render system
Updates to TGB Dungeon Builder
I’ve spent the past week cleaning up the Dungeon Builder code, 15 minutes here, 15 minutes there … and have taken it from “prototype code” to “alpha code” … it’s now much cleaner looking, a hell of a lot easier to work with, and makes damn near perfect sense now … and boy, let me tell you … going from prototype to alpha … WHAT A BITCH … I damn near lost it a few times … couldn’t figure out what the hell I was thinking when I wrote some of the code, only to find out … most of the code that was giving me headaches didn’t work and wasn’t rendering stuff anyhow … I must have just left it in there when I was doing the prototype “just in case” … and figured “its not putting stuff on screen, who cares …” and kept going …
But now the code has a fairly easy to follow structure … and I’ve even created an Image Map mock-up that I’m using …
To see more “pretty” pictures, continue reading …
TGB Dungeon Builder
For those of you who remember the original “3D” dungeon crawlers, such as Stonekeep, Eye of the Beholder, Lands of Lore or Bard’s Tale … this might be of interest to you.
I saw a post on the GG forums a couple days ago, and it peaked an interest … and, being me, I had to scratch the itch … so I started working on it. I’ve got some pretty decent progress so far, especially for a few hours of prototyping work … Images are attached for your viewing pleasure.
The general concept is this, using a 2D Tile-Layer (multiple layers, possibly?), the “player”can move around a “pseudo-3D” environment. Basically, using 2D Sprites, which are custom made (I’ll tell you how a little further down …), we draw the first set of sprites and only show a portion of them, to simulate ‘being in the room’, then we draw the next set of sprites … at a reduced size, and butted up against the previous sprites on the X/Y coords … and we repeat this process until we feel we have a good ‘distance’ in front of us (for my tests, 6 rooms seems about the extent of viewable distance with -my- artwork — other artwork may allow for up-to maybe 10 rooms?).
The trick is … if we have a 512×512 seamless tiling texture, and we skew the right side of it so that the right edge is only 256 tall and perfectly centered (128-384) and then we squish the graphic’s width and divide by 4 (512/4 = 128) … we wind up with a … Perspective Tile … Nice, eh?
Now, if we take the image we just created, and duplicate it so we now have 4 copies … then rotate one, place it ontop of the first so the top-left edges are have the same coords, then flip the next one and make it so the top-right corners are touching the one we just rotated … then rotate the next and smack it down at the bottom… we have a ‘pseudo-3D’ room.
Now, if it were only this simply in code, right?
Well, it sort of is … difference is, the code should be intelligent enough to draw the right texture in the right place, and only draw a texture when it should …
Say what?
Yeah, ok … so, we build a 2D Tile-Layer, and every three horizontal squares are a ‘room’ … the left tile is the left wall and the right tile is the right wall, and the center tile represents the floor/ceiling (eh?) … so, if we use this to determine what artwork to draw, the previous example still applies, we just don’t make 4 copies of the same image anymore, we make copies of the images we want to draw …
So what about drawing rooms in front of us? Well, the same logic as mentioned above applies, but, we have to just simply scale our images … given the 512×512 to 128×512 image example i mentioned, our scale is literally 50% (hence the simplicity of the image I made for testing). We scale everything down by 50% … and just make sure that our left-wall image (the basis of our coordinates) is in the right place … which would be the width of the wall before it, minus the width of the current wall divided by four … why? I honestly don’t remember off hand… haha …
I intend to have a much more detailed description, and hopefully some more useful screenshots in the near future….
Here’s a diagram of the general concept:

A working “prototype” layout, completely faked in Level Builder with scaling and positioning of artwork

This is actually ‘rendered’ with some code that looks at a 2D Tile-Layer to know what to draw …

And here we are after another hour of coding, with a hallway and a t-junction … all determined from a 2D tile-layer.





