Archive for the ‘Work Log’ Category

Progress - CSG Mania

Saturday, December 22nd, 2007

So today I got an idea for how to make the carving as minimally damaging as possible. The subtraction routine will now sort all of the brush faces that it will be cutting with by their size before doing anything. This allows the largest (and generally the most influential) faces to cut first which should mean that the little brushes that are generated by the small detail faces will cut as little of the level as possible. I also hooked up undo/redo on the subtraction routine so you can experiment to your hearts content to get the best cuts.

I fixed a bug - or rather, an oversight - in the subtraction code so that you can now subtract multiple brushes from the world at once.

I’m adding a bunch of other CSG options now that subtraction is working:

Subtract From World
You knew about this one already. Subtracts the selected brushes from the world.

Clip Against World
Clips the selected brushes against the world geometry. This is basically the opposite of “Subtract From World”. This is nice for nicking an edge off a brush or adding an angled corner.

csgclipagainstworld.jpg

Merge
Merges all selected brushes into the best shape possible. If you select very different looking brushes and merge them, you won’t get great results but if you select chunks in a wall (for example) it will merge them together into a single optimized brush very nicely.

csgmerge.jpg

Split
This will perform a ring cut from a selected edge on a brush. This effectively splits a brush into 2 brushes across the middle of the selected edge.

ringcut.jpg

I’m working on others but we’ll have to see how they turn out.

CSG Subtraction

Friday, December 21st, 2007

I knew I was close yesterday and I was right. I was able to get this working today after fixing a long standing bug in my splitBrushWithPlane routine (it would sometimes create extra faces - now I know why and it won’t do that anymore). The subtraction routine is good! It will subtract the selected brushes from the world and it only subtracts them from brushes that are actually being intersected by the selected ones. This means that you don’t have to hide the rest of the level before subtracting. Want to drill a hole through your level? Go ahead! It’ll work.

A small peek:

csgsubtraction.jpg

Progress

Thursday, December 20th, 2007

I added a few options to the texture browser this morning. You now have various filters you can apply to the browser:

ALL
Just like it is now - shows every texture loaded.

IN USE
Only shows textures that are actually being used in the level. This is hella useful for optimizations and reducing the number of textures used. Just this morning I noticed I was using several textures that almost looked alike. So you select one, hit SHIFT+T to select it everywhere in the level, and click the other texture that looks like it. Bingo, the first texture leaves the “in use” view and you’re using one less texture!

MRU
Or “Most recently used”. Shows you the textures that you have been clicking on in the browser, with the most recently clicked near the top. This is great for promoting consistency in the level. If you use the MRU filter as you texture your level you can reuse textures pretty darned efficiently.

I also started into brush carving but it’s not working just yet. Hopefully will have screen shots of that soon!

Edges

Wednesday, December 19th, 2007

Sometimes I make myself happy. When I started ToeTag I was determined not to have the traditional set of modes that most editors have. You know: brush, face, edge and vertex. When you go into each mode you can only select those kinds of things and none of the others.

With ToeTag, I’ve managed to implement all of those editing modes but in a completely modeless way. When you select a brush, it highlights but then it also draws it’s edges and vertices. Selecting those will highlight them and you can drag them freely. As for faces, SHIFT clicking any face in the world will select it and you can select as many as you like without having to select the brushes first. This is wonderful for texturing an area as you don’t need to be concerned with which brush owns which face. Just hold down SHIFT and grab the faces you want to work with.

Edges started working this morning. I implemented them in a somewhat cheeky manner. I allow you to click an edge in the viewports and then behind the scenes the editor selects the 2 corresponding vertices that make up that edge. As a final step, the drawing code will draw a thick highlighted line between any 2 selected verts that make up an edge. So it appears as though there is a real edge selection/dragging mode built in but in reality you’re just selecting and dragging vertices in pairs rather than individually.

Usability Features

Monday, December 17th, 2007

I added a number of usability features that will speed up the mapping process this morning. These are small things but they really add up.

CMD+T will find the texture on the currently selected face in the texture browser and scroll it into view.

CMD+C will copy the selected face to the clipboard, including all of it’s alignment information.

CMD+V will paste that information onto all selected faces. This is a quick way to match up a group of faces so that they all look identical. (of course, copy/paste still works for entities - the editor is smart enough to know the difference between entities and faces when it sees them on the clipboard)

SHIFT+T will select all faces that have the same texture on them as the currently selected one. If no faces are selected, all faces that match the currently selected texture in the browser will be selected.

This stuff doesn’t sound complex or all that interesting but it makes a world of difference when you’re actually editing a level.

Sample Level

Sunday, December 16th, 2007

I’m working on a replacement “start” level for Quake that I will probably bundle with the editor when I release it. It’ll be one of the sample levels. I’m really enjoying using ToeTag now and it’s quite good as a level editor. It has some rough edges, no question, but on the whole it’s very good. Much better than anything I used back in the day, that’s for sure. Here’s some shots of the sample level as it stands:

testlevel1.jpg

testlevel2.jpg

testlevel3.jpg

testlevel4.jpg

As you can see from the visual evidence, the editor is solid at this point. This level was made completely in ToeTag, from scratch.

It’s true what they say about eating your own dog food. Making this sample level has uncovered many holes and problems with the editor that I might not have noticed otherwise. The more I use it, the better the code gets.

Next up are some major improvements for the texture browser. It needs it.

Small Update

Friday, December 14th, 2007

I got my mip mapping code working in the WAD save routine (that sort of code sucks a lot more when the images are palette based) so now everything exports properly and looks good inside of Quake. Over the weekend I’m going to finish up the WAD management system and try to round out some of the other rough usability edges that I have remaining.

My goal is to have an editor that works decently enough that I could work on a level over the week of xmas. Kind of an aggressive goal but that’s half the fun, right?

Here’s a shot of a test level that I made using ToeTag. It’s using a WAD that was exported from ToeTag so you can see that it doesn’t mangle anything and the mip maps look good. Hooray!

preview1.jpg

WAD Management

Thursday, December 13th, 2007

I took a walk into the WAD code this morning and decided to get that system up and running. The editor could already load WADs (obviously) but now it can also save them out. The menu for textures includes an option to “Append WAD…” which will load the textures in a new WAD and merge them into the existing set you have loaded. You can then save this newly merged WAD out to disk under a different name. And it works! Well, once I add code to do the mipmapping it will, but the basics are in place at least.

I’m going to add some basic features like importing textures from external files (PNG, BMP, etc), exporting textures to individual files, and deleting textures from the loaded set. This should give enough flexibility that you could create your own custom WADs pretty easily!

Face Dragging

Wednesday, December 12th, 2007

I got smart face dragging working yesterday. This is the nice thing that QERadiant does where you click in the 2D view and drag and it figures out which face to pull automatically. In ToeTag you’ll hold down CONTROL and COMMAND to activate this. Here’s a video of it in action:

I’ve never embedded a QuickTime video before. Let’s hope this works!

Key/Values

Tuesday, December 4th, 2007

Key/value editing is in and working now.

entitykeyvalues.jpg

Works the way I want it to after a lot of futzing.  If you have multiple entities selected with the same key but differing values, you get this sort of display: 

entitykeyvalues2.jpg

See how the value for angle is “??”  That means the value is different for each func_door selected.  If you change the “??” to something else, then all selected entities will get that value.  If you don’t touch it, they all retain their original values.Next thing to do is entity creation from scratch.  Got a few ideas on that one…