Jump to content
  • entries
    941
  • comments
    5,894
  • views
    871,740

About this blog

Learn about game development technology

Entries in this blog

Properties Dialog

After putting together a pretty complete model of how the logic editor would work, I found myself unsatisfied with the properties dialog. I originally intended to make a standard properties dialog that opened in a separate window, with "OK", "Cancel", and "Apply" buttons. However, the logic editor and properties dialog were both being opened in separate windows that were a child of the main window, with no strict draw order between the two of them. I found it confusing to select an entity in

Josh

Josh

Entity Script System

We've had a lot of discussion with the community about the Leadwerks3D script system. The current design is based on a combination of user feedback, lessons learned from Leadwerks Engine 2, stealing ideas from other game engines, and my own judgement. Our goal is to make a really easy and powerful game scripting system, without overwhelming the user with complexity. With that said, I thought I would let you in on how the script system presently is working in our own builds, and the process of

Josh

Josh

Properties, Round 2

As I always do when making design decisions, I tried out several approaches to the properties dialog. Previously, I wrote about embedding it in the side panel, below the scene browser. I liked being able to quickly modify object properties, but I couldn't drag assets like textures and materials from the Asset Browser to the Properties Editor, because they were under different tabs in the side panel. Because of that, I popped the Properties Editor back into its own tool window.   The exper

Josh

Josh

Justify My Love (of Constructive Solid Geometry Modeling)

One thing I love about constructive solid geometry modeling is that texture mapping is sooooo much simpler than 3ds Max. Most of the time the automatic texture mapping works fine, and when you do need to adjust texture mapping by hand, CSG texture mapping tools are still much easier. The justify buttons line a texture up along a face, or a group of faces.   Although using these tools is fun and easy, programming them is another matter. I dreaded the implementation of the texture justify but

Josh

Josh

Something Old, Something New

The new CSG editor is coming along nicely. Yesterday I implemented CSG rotation and skewing, and today I got object center and edge selection working. 3D World Studio uses GL_SELECT mode to handle picking in orthographic viewports, but this stopped being supported in ATI drivers a few years ago! I implemented a CPU math routine for picking brush edges. In orthographics viewports, brushes can be selected by clicking their center or any edge, while models only use the center for selection. (T

Josh

Josh

Hammering out the CSG editor

CSG is a great way to quickly and easily produce levels, and the editor is even fun to write. I added another tab next to the scene and project tabs where you can select objects to create. The CSG texture mapping and smoothing controls also reside on this panel. I'm still playing around with the layout, but here is what I have now:   CSG brushes are now entities, and can be arranged in a hierarchy. Check out the scene hierarchy that gets created when you create a compound brush object (a

Josh

Josh

Totally Tubular

Today I implemented the last two compound primitives. Tubes are the same as in 3D World Studio, with parameters for the number of segments and thickness. Since the Leadwerks3D editor supports smooth groups, another new compound primitive has been added. A torus is a "donut" shape. These can be used to make curved pipes and other things. Here are the two compound primitives, side by side:   Smooth groups and new primitives in Leadwerks3D allow you to create new kinds of geometry which we

Josh

Josh

My old arch-nemesis: arches

Since brushes in Leadwerks3D are entities, and the Leadwerks3D editor gives you access to the entity hierarchy throughout a scene, we don't use "groups" like 3D World Studio had. Instead, when a compound brush is created, a parent pivot is created, and all brush segments are made a child of that. When you select any part of the hierarchy, the entire compound brush is selected (unless "Ignore Hierarchy" is turned on).   Since brushes can now have a 4x4 matrix, which wasn't the case in the pas

Josh

Josh

Snow Day

The last day of the season was today, so I was at North Star. We had a storm for the last three days, so the snow was pretty good, just sticky in some places. Even though it was a Sunday, crowds were not bad. Towards the end of the day, most people were hanging out at the lodge and the runs were completely empty. All in all, it was a pretty awesome day.

Josh

Josh

Smooth Move

Smoothing groups are one of the most frequently requested features for 3D World Studio, so I am happy to show you their implementation in Leadwerks3D, finally. Smoothing groups are usually stored as a bitwise flag. When two faces share a vertex at a certain position, if they have one or more smoothing groups in common, their vertex normal is calculated as if they are sharing a vertex.   I first attempted to write an algorithm based on edges, which worked great for cylinders but failed for ge

Josh

Josh

Leadwerks Gets Balls

The subject of spheres in 3D World Studio has been one of great levity (see here and here) around the Leadwerks community. I spent today finally implementing a CSG sphere primitive. This is a little different from creating a conventional triangle mesh sphere because each face is a single polygon with either three or four sides. Here's my scratch paper that got me through this process:   I'll spare you the mathematics and get right to the good stuff:   This completes the basic primitiv

Josh

Josh

Where the Pedal Hits the Metal

UML diagrams, object-oriented frameworks, and beautiful modular architecture are great things to develop, but sometimes you just need to make an application that real people can use. For me, that means you start with the behavior you want, and work backwards to make the code that does it. In the past I've considered fancy object-oriented mouse tool classes, but the style of editing I want is intuitive, easy, and fast, using the fewest number of mouse clicks possible to achieve a task. I think

Josh

Josh

Freaky Friday

Everyone's gone for the weekend, and I am still here, so it seems like a good time to stop and say hello to the community, who I have not been communicating with much lately.   We spent some time this week doing some market research, and investigating exactly why Leadwerks is different and unique. After that I feel like I have a much better picture of the game industry as a whole, and of our strategy going forward. That's the "big picture" stuff we CEO's do.   Meanwhile, back on the groun

Josh

Josh

Brushing Up on CSG

I feel like I've resolved the design challenges I was facing in my last blog. A menu item is always checked, specifying what the current object is that will be created when the user clicks on a viewport. There are two types of objects that can be created, brushes and entities. Brushes are constructive solid geometry objects that can be sketched out to quickly design a building. Entities are created at a point in space, and include lights, sounds, and particle emitters. As I have described i

Josh

Josh

Another Design Puzzle

I have the basis of CSG editing written into the engine. It was a bit challenging to figure out just how to structure the Brush class. We have a lightweight ConvexHull entity, which is used for the camera frustum. This is an invisible volume that changes frequently, and is used to test whether objects intersect the camera's field of view. I didn't want to bloat this class with a lot of renderable surfaces, texture coordinates, vertex normals, etc. I initially thought I would derive the Brus

Josh

Josh

Project Manager

The Project Manager lets you manage multiple Leadwerks projects. A project includes assets, scripts, code, code projects for Visual Studio, Xcode, and Eclipse, along with your game's executable. The Project Manager lets you view and switch between your different projects.   Projects can be exported into a .zip file for easy sharing and archiving. You can even have Leadwerks3D scan all source code files and only include the asset files that your game actually uses. (I'm still adding the p

Josh

Josh

Even Deeper

Lua's debug hooks are a little funny, because they don't appear to allow line-by-line calling of your own function. The description here is pretty vague: http://pgl.yoyo.org/luai/i/lua_sethook   The line and count hooks look like they might be what I wanted, but the docs have one big caveat: This makes me wonder what the point of these hooks even is. The way I have it set up now, "Step" continues to either the next Debug:Stop() call, or to the next point where a Lua function is called. N

Josh

Josh

In Like a Lion

I haven't actually had the Leadwerks3D editor running on OSX Lion until a few days ago. There were some underlying GUI issues that had to be updated to handle a few new ways that OSX Lion does things. The first run was pretty frightening, with random crashes and all sorts of visual inconsistencies. However, careful testing resulted in these issues being resolved one by one.   The most peculiar was a bug in which the editor would crash when a file request dialog was opened if, and only if, it

Josh

Josh

Back to Werk

In my last development blog, I wrote about some design problems I faced, and why I wasn't sure how to proceed. I've resolved these issues by building the debugger and game output display close to where they will be most likely to be used, the Script Editor.   I was pleased to find that my Lua debugger code I wrote about a year ago works perfectly. This allows breakpoints, code stepping, and the display of variable values in your game. It works with any Leadwerks3D executable, so you can e

Josh

Josh

On the Naming of Things

The design of the Leadwerks website involves organizing a lot of different kinds of data that are continually growing, including forum posts, blog entries, gallery images, videos, and downloadable files.   All this information was organized in categories, and sub-categories, and in some cases, sub-sub-categories. The depth of categorization made it impossible to follow all the information that was flowing through the site, and users frequently posted in the wrong place. We recently underwent

Josh

Josh

Design Confusion

Sometimes I run into situations where I don't really know how to structure things. I don't mind this, because it usually results in some really elegant design once I figure out what to do. I just play with ideas and try not to force anything, and when the right idea arises, I will recognize it.   Explaining a problem to someone else can help facilitate that process. How many times have you solved a difficult problem right after you posted a description of it on a forum somewhere? The proce

Josh

Josh

Viewport Navigation

I've got orthographic viewport navigation done. I decided to build some grid commands into the camera class so that the graphics driver itself can handle the grid rendering, rather than having the editor make a bunch of OpenGL calls in a callback function. The grid can be rendered from any angle, and the math was a little tricky, but I got it worked out. I paid extra attention to showing the border where the world ends. The sliders that pan the viewport are very accurate, and stop right at t

Josh

Josh

Moving Right Along...

I'm happily starting out on the CSG editor. The first step is to add a grid in the orthographic view modes so that you have a frame of reference. In Leadwerks Engine, the editor used some callbacks to call OpenGL commands to draw the grid. In the new system, Leadwerks3D, I added some per-camera commands to control the grid spacing, resolution, and colors. (You may safely ignore the mysterious black cube in the center.) This way the editor never has to call OpenGL commands directly, making r

Josh

Josh

A Story of IT

I generally categorize every aspect of Leadwerks as either "absolutely required" or not necessary. If it's categorized as the latter, I don't bother with it, and if it's categorized as the first, I pursue it with a dogged determination until it is done. This has served us well in many ways, like our vegetation rendering system and character controller.   However, this assumes I have full control and mastery over the product, or at least have someone working for me who does. This is almost a

Josh

Josh

Model Editor hierarchy editing

You can drag entities around in the model editor to rearrange the hierarchy. Now I just need to add an option to collapse a hierarchy, and the basic art pipeline will be done.   I had a difficult bug that was causing model hierarchies to be duplicated. At first I thought I was saving files wrong, but it turned out my entity copy routine was duplicating the hierarchy twice! Oh well, problem solved.

Josh

Josh

×
×
  • Create New...