Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • entries
    901
  • comments
    5,558
  • views
    743,066

About this blog

Learn about game development technology

Entries in this blog

Some sample LE3 code

Here's some LE3 code for a simple program. The Graphics / Window stuff is not worked out 100%, and it's a little tricky because of the different operating systems and different kinds of windows.   I think we'll see a little more consistency across various languages with the LE3 syntax. It was suggested that the C syntax use the following scheme: verb-class-noun SetEntityPosition() GetMaterialTexture() I agree with this suggestion.   SetGraphicsDriver( OpenGLGraphicsDriver() ); Cre

Josh

Josh

Lua binding in Leadwerks 5

The Leadwerks 5 API uses C++11 smart pointers for all complex objects the user interacts with. This design replaces the manual reference counting in Leadwerks 4 so that there is no Release() or AddRef() method anymore. To delete an object you just set all variables that reference that object to nullptr: auto model = CreateBox(); model = nullptr; //poof! In Lua this works the same way, with some caveats: local window = CreateWindow() local context = CreateContext(window) local world =

Josh

Josh

Common Bottlenecks

Leadwerks 4.3 brings a big performance boost to your games. In this blog I am going to talk about some of the common problems you can eliminate to make your games run faster. When slow performance is encountered, it is typically one really bad mistake that is slowing everything down. Here's a few common bottlenecks for performance you can create in your games, how to identify them, and how to fix them. Shadow Updates Shadow rendering is cheaper than regular renders because no text

Josh

Josh

Using Multiple Entity Scripts in Turbo Game Engine

During development of Leadwerks Game Engine, there was some debate on whether we should allow multiple scripts per entity or just associate a single script with an entity. My first iteration of the scripting system actually used multiple scripts, but after using it to develop the Darkness Awaits example I saw a lot of problems with this. Each script used a different classname to store its variables and functions in, so you ended up with code like this: function Script:HurtEnemy(amount) if s

Josh

Josh

Vehicle Development

I've made progress with the new vehicle system and it is shaping up nicely. The vehicle wheels consist of a slider joint with a spring (the strut) connected to a pivot, connected to the wheel by a hinge joint (the axle). If the wheel can be steered, an additional pivot is inserted between the strut and axle, with a motorized hinge to control steering. There were two big problems in addition to this that need to be solved in order to make a vehicle that is stable at high speeds. First, the m

Josh

Josh

One Little Thing

A couple weeks ago I replaced the Object::SetHook() function with an Object::AddHook() function. The difference is subtle but significant. SetHook() supported a single hook function but AddHook() supports multiple hook functions for each hook ID, that will be called in sequence. Syntax AddHook(const int& hookid, void* hook) Example #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; de

Josh

Josh

Unit Testing

I've spent the last few days writing simple examples for every single command in Leadwerks 3. Not only does this make the documentation more friendly, it also acts as a final test to make sure all the commands work the way they say they should. I make the C++ example and then Chris converts it to Lua (and tells me what I did wrong!).   I didn't realize it at first, but this really showcases the strength of API design of Leadwerks. Since you get full control over the execution and flow of a

Josh

Josh

S-M-R-T

I've made more progress on the model editor. I needed it to be able to resave models after making changes. First, I started with an Entity::Save function that would save all entities in the GMF format. "But wait", I thought, "I can save all entities in the GMF format!" Then I thought, even better, I can simply write a Serialize() virtual class function in the base object and extend it for each class, so that instead of writing this: stream->WriteFloat(position.x); stream->WriteFloa

Josh

Josh

Small behavioral change

In the next beta update, the way entity fields work in the script properties will be a little different. Instead of dragging an object from the scene tree onto the field, you will type in the name of the object (or copy and paste the name from the object's name field). This is being done to make the behavior more intuitive. After working with both approaches, I find the new way much easier to use.     This does however mean that an object that is used in this manner must have a unique na

Josh

Josh

Why Small Companies Succeed

The development of Leadwerks3D seemed like an impossible task at first. Not only did I need to write a new 3D engine entirely in C++ mostly by myself, but I had to make it run on four platforms (Android, iOS, Windows, and Mac), with a scalability all the way from the fixed-function pipeline up to the very latest hardware tessellation features. All logical sense told me this was impossible. Even large companies with 100 programmers or more haven't yet been able to put out a 3D engine with the

Josh

Josh

One Last Thing

In this blog I'm going to explain the evolution of the entity and physics system in Leadwerks 3.   In Leadwerks Engine 2, physics bodies and character controllers are both separate entity classes. If you want a model to be physically interactive, you parent it to a body entity. If you want a model to walk around with physics, you parent it to a character controller body.   In Leadwerks 3 I decided to give physics properties to all entities. This means all entities can use commands like Ge

Josh

Josh

New beta update available

A new update is available with the following changes:   Player collision against terrains is now working really nicely. In general, the player controller has become very solid and accurate. It's also quite a bit faster than before.   An experimental feature lets you make CSG brushes the child of another object and check a "shape hint" option in the physics properties. This will use any attached CSG brushes to build a new compound convex hull for that model. This is best used to make pref

Josh

Josh

Beta update available

An update is available on the beta branch on Steam. This only updates the compiled executables for Lua, only on Windows. Optimization I've rewritten the way lights and objects affect each other. In the old mobile renderer it was necessary to store a list of lights that affect each entity, because it was using a forward renderer and had to send the information for the nearest four lights to the object's shader to calculate lighting. This was a complicated task and is not needed with a defer

Josh

Josh

Open to the Public

The last few weeks have been interesting as we've been figuring out where Leadwerks 3 fits into the game development landscape.   The good: The feedback from the Leadwerks 3 users has been more positive than anything I've ever seen. People love using it. All the care and attention to the tools has really paid off. The return of constructive solid geometry is a huge win. At the upgrade pricing, we're doing a lot of sales. Leadwerks 3 makes more in a week than Leadwerks 2 made in a mont

Josh

Josh

Water beta now available

An update is now available on the beta branch which adds water. This can be controlled in the scene properties or in code with the following commands: World::SetWaterMode(bool mode) World::SetWaterHeight(float height) World::SetWaterColor(float r, float g, float b, float a) bool World::GetWaterMode() float World::GetWaterHeight() Vec4 World::GetWaterColor()   You must update your project to get new EXEs and shaders. All model shaders have been modified to handle the slice plane used whe

Josh

Josh

Three improvements I made to Leadwerks Game Engine 5 today

First, I was experiencing some crashes due to race conditions. These are very very bad, and very hard to track down. The problems were being caused by reuse of thread returned objects. Basically, a thread performs some tasks, returns an object with all the processed data, and then once the parent thread is done with that data it is returned to a pool of objects available for the thread to use. This is pretty complicated, and I found that when I switched to just creating a new return object each

Josh

Josh

Moving forward with Leadwerks Engine 2.4 and Leadwerks 3.0

I feel like you guys are owed an explanation of our long-term strategy, and now that I have definite plans I am happy to reveal them to you.   I've been spending a lot of time in the Silicon Valley area, and have learned a lot about business. We've been investigating external investment. I believe we could raise pretty much any amount of money we want, based on the fact we already have an existing business that is self-sustaining, and we have a great strategy. However, money does not necess

Josh

Josh

Further down the rabbit::hole

Let's start with some code for making instances and unique copies of a material: Material* mat1 = new Material; mat1->SetColor(0,0,1,1); Material* mat2 = mat1->Copy(true); Material* mat3 = mat1->Copy(false); mat1->SetColor(1,0,0,1); mat1 and 2 will be red. mat3 will be blue. Shaders, textures, and entities work the same way.   Drawing commands are in. I like how OpenGL3 gets rid of all the built-in matrix stuff and just lets you deal with pure matrix multiplication. It

Josh

Josh

What light through yonder Windows breaks?

This is the final output of Leadwerks 3 on Windows.   When you choose "Windows" in the Publish dialog, a few options appear. Press OK and your game's installer is created.   The installer looks like this. You can replace the installer images with your own if you like:

Josh

Josh

The Financials of Custom Content

The Leadwerks Merc character, who I think will go down in history over the next few years second only to the infamous "Crawler", is an experiment. First of all, I wanted a completely custom-made character to developer AI with. This ensured that I was able to get the model made exactly to my specs so that we would have a template for other characters to follow. Fortunately, the script I wrote can easily be used with other models like Arteria's Strike Troop.   The quality of this model is rea

Josh

Josh

How infinite terrain can be implemented in Leadwerks Engine 5

Gamers have always been fascinated with the idea of endless areas to roam.  It seems we are always artificially constrained within a small area to play in, and the possibility of an entire world outside those bounds is tantalizing.  The game FUEL captured this idea by presenting the player with an enormous world that took hours to drive across: In the past, I always implemented terrain with one big heightmap texture, which had a fixed size like 1024x1024, 2048x2048, etc.  However,

Josh

Josh

Multipass Rendering in Leadwerks 5 beta

Current generation graphics hardware only supports up to a 32-bit floating point depth buffer, and that isn't adequate for large-scale rendering because there isn't enough precision to make objects appear in the correct order and prevent z-fighting. After trying out a few different approaches I found that the best way to support large-scale rendering is to allow the user to create several cameras. The first camera should have a range of 0.1-1000 meters, the second would use the same n

Josh

Josh

Collision Decisions

As I was implementing the collision commands for Leadwerks3D, I noticed a few things that illustrate the differences between the design philosophies of Leadwerks Engine and Leadwerks3D.   You'll easily recognize the new collision commands, although they have been named in a more verbose but logical manner: void ClearCollisionResponses(); void SetCollisionResponse(const int& collisiontype0, const int& collisiontype1, const int& response); int GetCollisionResponse(const int& c

Josh

Josh

Darkness Awaits

Leadwerks3D will ship with a finished game demo to demonstrate how to use the software. Darkness Awaits is a third-person dungeon explorer with a 45 degree view. It's like a cross between Diablo and Legend of Zelda: A Link to the Past. This is an idea I had back in my very early days of game development, before I even learned to program. This was originally done in the Quake 1 engine. It didn't really go anywhere, but what we had was awesome. You could run around and shoot skeletons with f

Josh

Josh

×
×
  • Create New...