We're getting to a point where we need to establish the final directory structure for the new game engine, and start using it. Here's what you see when you open "C:\Leadwerks" (or on Mac, "\Applications\Leadwerks"):
The "Editor" folder contains the editor executable and support files.
The "Engine" folder contains header files, compiles libraries, and BlitzMax include files.
The "Help" directory contains local help files.
The "Projects" directory is where your projects go, by d
Physics works great with scaled entities:
For joints in the new engine, I am considering something fairly radical. In Leadwerks Engine 2, joints were just a class that wasn't an extension of the entity class. I was going to make a new Joint class that extends the Entity class. The problem is you would end up inserting a ton of intermediary joint entities into your model hierarchy, which would hurt the editor's ability to reload models on the fly.
What if joints were just a feature
This is just so cool. You can generate simple primitives for any entity. A convenient "Fit Shape" button will wrap the primitive around the entity, with an option to include the entity's children. However, the real power comes when you generate physics shapes from models. You can right-click on any model and get a menu to generate a physics shape. The polygon mesh and convex hull will look familiar if you've used the PhyGen tool in Leadwerks Engine 2. There's also a new option called "Conv
AI is always a fun programming topic, and it's even more fun when you're mixing a physics-based character controller with dynamic navmesh pathfinding.
We planned on using navmesh pathfinding from the very start of the design of the new engine. Because it was integrated from the very beginning our implementation works really nicely. Pathfinding is completely automatic and dynamic. There are no commands you need to call to make it work. When part of the scene changes, the navigation data f
The built-in level design tools in Leadwerks3D are great for quickly sketching out a game level. Most of this remains unchanged from the design of 3D World Studio, with a few extras like smooth groups and new primitive types:
When a point entity object type is selected in the side panel, the object creation widget changes to a simple cross hair:
The selection box with tabs that CSG brushes use are great for quickly moving, scaling, rotating, and shearing brushes, but they aren't tha
One of our design principles for Leadwerks3D is to make development fast. You need to be able to iterate and re-iterate quickly, to try out ideas and make adjustments in as few of mouse clicks as possible. A real-time properties editor is definitely one way to enable that. In the screenshot below, I can adjust the intensity and color of the light dynamically, and see the results instantly. It feels so responsive and natural.
I feel like this design philosophy gets us back to our roots wi
I don't have a clear and obvious subject for this blog, but I haven't posted in a while, so I wanted to write something. I've been getting in a lot of hours of development. My schedule on most days is wake up around 7, answer emails or test code on my Mac at home, then head over to the office at 10. Chris usually comes in right around then (we aren't too strict on schedules) and usually hangs around until around 6. I leave anywhere from 6-9 (and totally miss the rush hour traffic), go home,
Here's an example of how setting a debug hook in Leadwerks3D from a BlitzMax program saved me a lot of time stepping through code to figure out where something went wrong. When the engine encounters a fatal error, the hook is called, giving control back to the main program.
I can even step through the BlitzMax debugger and see which call to Leadwerks3D produced the error:
And it works with all supported languages. Little things like this make programming with Leadwerks3D very enjoy
The properties editor in Leadwerks3D is a live dialog. Your changes are shown instantly in the editor. If multiple objects are selected and their properties do not have the same values, the property interface will show an "indeterminate" state until the value is changed:
When an indeterminate value is changed, the new value is applied to all selected objects. Since they now have a matching value, it is now shown in the dialog. You can use this to move objects along a single axis, witho
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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