Frustration can be a good thing
by Rob Parton · 03/06/2007 (12:07 pm) · 11 comments
The last few days I've grown bored at work without a lot to do. When I get home I fiddle with some interiors, trying to come up with a nice crypt or dungeon level. However, no matter how much I try to make it look acceptable to me, it always comes up short.
The solution: a tileset. In theory, I should only have to make each tile once, and then just paste them together in a mission to get the right layout!
I started sitting around on my lunchbreak (if 9pm counts as lunch), and came up with the 14 basic tiles:

I started making the tiles in Quark at 12pm today. After about 30 minutes, I had all 14 basic tiles done:

Every tile is exactly 8 Torque units wide, so placing them is relatively easy. So easy in fact that it's faster to just draw the level layout in tiles on paper or even in MSPaint, and then just write the MIS file in Notepad... The only small issue I had was when rotating some tiles, but it didn't take long to piece that together either.
This is an extremely basic tileset. It doesn't include doors, stairs, windows, anything like that. It would be very easy to add more tiles, or prefab rooms as well.
But for now, here's a few shots of the tileset in action, from a number of angles.
Again: This only took me 30 minutes in Quark!



I think I may take some time off from doing interface coding and instead make a few tilesets. :)
The solution: a tileset. In theory, I should only have to make each tile once, and then just paste them together in a mission to get the right layout!
I started sitting around on my lunchbreak (if 9pm counts as lunch), and came up with the 14 basic tiles:

I started making the tiles in Quark at 12pm today. After about 30 minutes, I had all 14 basic tiles done:

Every tile is exactly 8 Torque units wide, so placing them is relatively easy. So easy in fact that it's faster to just draw the level layout in tiles on paper or even in MSPaint, and then just write the MIS file in Notepad... The only small issue I had was when rotating some tiles, but it didn't take long to piece that together either.
This is an extremely basic tileset. It doesn't include doors, stairs, windows, anything like that. It would be very easy to add more tiles, or prefab rooms as well.
But for now, here's a few shots of the tileset in action, from a number of angles.
Again: This only took me 30 minutes in Quark!



I think I may take some time off from doing interface coding and instead make a few tilesets. :)
About the author
#2
DIFs in DIFs were a portaling problem, but I did not have a problem connecting DIF pieces (unless they overlapped and caused portal confusion).
Cool!
03/06/2007 (12:35 pm)
@DaveDIFs in DIFs were a portaling problem, but I did not have a problem connecting DIF pieces (unless they overlapped and caused portal confusion).
Cool!
#3
- Performance may lag w/ too many small interiors pasted together as one large unit (in game).
- You may encounter some weird cases where the player drops through a crack between two pieces (even when it doesn't look like there is a crack). This is likely just a minor misalignment and I would check the position of your pieces. Using even floating-point values and offsets (1.0 vs. 1.125) is best.
- As Dave mentioned, you lose the benefit of portals unless you make bigger tiles (each having their own portalized zones).
- Also as dave mentioned, you may see some odd lighting issues (w/ leaks and shadows), however TGE 1.5 is much improved in this respect. The biggest issue I can see is portalized areas where the portal does not admit ambient light. In this case, because the portal has to be offset from the edge you may get little 'lit gaps' between sections. If what I am saying is unclear, try creating a few portalized pieces and disable ambient light on all portals surrounding a 'room'. You'll see what I mean. (Of course, don't forget to put a light source in the room if you do this.)
Regardless, I'm looking forward to more posts from you on this topic. I have a shelved project where I wanted to use this technique but I put it off for other work. (Imagine that.).
@ Dave - Yes, you are right. In older versions of the engine, having two interiors overlapping would crash the engine. This no longer occurs in 1.42 or 1.5.
Note: You could even see this problem with interiors that were next to eachotyer if their offsets were some odd floating-poing value. Why? Rounding error would sometimes cause oddly aligned interiors to overlap.
One often encountered this issue while editing and moving an interior by hand.
Hall Of Worlds - For Gamers
EdM|GPGT
PS - I haven't verified what happens w/ overlapped portalized zones.
03/06/2007 (12:41 pm)
@Rob - Cool idea. Note: You may run into some of the following issues:- Performance may lag w/ too many small interiors pasted together as one large unit (in game).
- You may encounter some weird cases where the player drops through a crack between two pieces (even when it doesn't look like there is a crack). This is likely just a minor misalignment and I would check the position of your pieces. Using even floating-point values and offsets (1.0 vs. 1.125) is best.
- As Dave mentioned, you lose the benefit of portals unless you make bigger tiles (each having their own portalized zones).
- Also as dave mentioned, you may see some odd lighting issues (w/ leaks and shadows), however TGE 1.5 is much improved in this respect. The biggest issue I can see is portalized areas where the portal does not admit ambient light. In this case, because the portal has to be offset from the edge you may get little 'lit gaps' between sections. If what I am saying is unclear, try creating a few portalized pieces and disable ambient light on all portals surrounding a 'room'. You'll see what I mean. (Of course, don't forget to put a light source in the room if you do this.)
Regardless, I'm looking forward to more posts from you on this topic. I have a shelved project where I wanted to use this technique but I put it off for other work. (Imagine that.).
@ Dave - Yes, you are right. In older versions of the engine, having two interiors overlapping would crash the engine. This no longer occurs in 1.42 or 1.5.
Note: You could even see this problem with interiors that were next to eachotyer if their offsets were some odd floating-poing value. Why? Rounding error would sometimes cause oddly aligned interiors to overlap.
One often encountered this issue while editing and moving an interior by hand.
Hall Of Worlds - For Gamers
EdM|GPGT
PS - I haven't verified what happens w/ overlapped portalized zones.
#4
03/06/2007 (2:22 pm)
I've always thought it would be neat to do something like this, to generate random missions for a FPS.
#5

[IMG]http://i129.photobucket.com/albums/p220/lmaceleighton/CrossSection.jpg[/IMG]
http://i129.photobucket.com/albums/p220/lmaceleighton/CrossSection.jpg
Hope the pic work...if not ill be back to put it in...one of these will work i hope:)
PS id be happy to help with any problems related to DIF object in general:)
03/06/2007 (4:12 pm)
I use a similar method, and Ive never had any problems with connecting DIF's together....In fact as far as I know this is the way they were meant to be used. I have done MOD's in Unreal, Quake, and Half-Life, and they all use BSP style blocks, or in the case of Torque, they call it a DIF. What ever the engine uses for a naming convention isn't important, but I think you would have less problems for those of you that are, to make sure that the DIF's have LOD's built into them, with blocks that are going to be together I would make sure they have the same amount of LOD's though. That's what I do...well here Ill show a couple of things I did...same method as above:)
[IMG]http://i129.photobucket.com/albums/p220/lmaceleighton/CrossSection.jpg[/IMG]
http://i129.photobucket.com/albums/p220/lmaceleighton/CrossSection.jpg
Hope the pic work...if not ill be back to put it in...one of these will work i hope:)
PS id be happy to help with any problems related to DIF object in general:)
#7
If you run into frame rate issues, this might be an idea to keep in mind.
The strong point of your approach would of course be randomly created dungeons which would be, as the kids say, hella cool.
Looking forward to more posts from you on this subject.
Cheers!
Fredrik S
03/06/2007 (6:08 pm)
Rob, it's a neat idea and one that I tried earlier, but eventually the lack of portals forced me to discount this idea. What I did instead was save the pieces in Quark as prefabs instead, then just dragged the pieces into maps as needed. If you run into frame rate issues, this might be an idea to keep in mind.
The strong point of your approach would of course be randomly created dungeons which would be, as the kids say, hella cool.
Looking forward to more posts from you on this subject.
Cheers!
Fredrik S
#8
03/07/2007 (12:31 am)
I also did something similar to this a while back, though your DIFs are a lot better. In the end though what would probably be the best approach if your trying to rapidly develop content for dungeon generation would be to instead generate the layouts into a .map file, rather than as a bunch of DIFs in game and then compile the map as a single dif. The performance will be much better that way and the only loss is that it can't be generated at run time.
#9
03/07/2007 (1:14 am)
Cool, reminds me of the system Neverwinter Nights 1 & 2 uses for dungeons.
#10
Some of those interiors dont seem to be like interiors as they are not having walls on each side. it will be better to use completely enclosed units with doors and portals. Also with such a small size they will definately put an extra load on polygons and culling and hence slower game.
03/07/2007 (2:56 am)
you can add lights in those interiors itself thru quark.Some of those interiors dont seem to be like interiors as they are not having walls on each side. it will be better to use completely enclosed units with doors and portals. Also with such a small size they will definately put an extra load on polygons and culling and hence slower game.
#11
03/13/2007 (9:15 pm)
For the skelly pack I'm going to do something like this. I was just reading this thread for issues. I am doing larger sections all portalised and see what sort of performance I will get. I will adjust the editor to grid snap too to make editing easier.
Torque 3D Owner Dave Young
Dave Young Games
Cool!