Jump to content
Entries in this blog
Our first character pack for Leadwerks has been released. The Zombie Character Pack DLC is now available on Steam for $29.99, with a 15% launch discount.
The Leadwerks Zombie Character Pack provides you with a horde of undead monsters to slay. Fight your way through the flesh-eating mob or pit them against each other in an all-zombie brawl to the death. All characters are fully scripted and ready to use in Leadwerks, with no programming required. Just drop them into your map and press play!
Five zombie character models from various walks of life.
Idle, death, walk, run, and two attack animations.
All associated materials, textures, and sounds.
Integration with default Leadwerks AI script.
Installing the DLC To install this DLC, select the Workshop > Manage AddOns menu in the main window. Select this DLC in the list, press the Install button, and your items will be available in the editor.
Visual Studio gives two options for creating C++ applications. Console applications use printed text to communicate with the user, harkening back to the pre-GUI days of DOS. The other option is a windowed application with a GUI interface, simply called "Win32 Project" in the Visual Studio project creation dialog.
A console application will use the regular old main function you know and love:
int main(int argc,const char *argv)
This is cross-platform compatible and runs on any operating system. A "Win32 Project", however, will use a special WinMain() function that only works on Windows:
WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR, int)
So if you don't want a black rectangle printing a bunch of lines of text, you have to use the WinMain() function. But, there is a way to fix this. We can change a console application to a windowed application in the Linker settings in the Visual Studio project settings. Change the Linker > System > Subsystem property to a windowed application.
There's also a way to force the program to use the cross-platform main() function. Change the setting Linker > Options > All Options > Entry Point to mainCRTStartup.
Although the application will no longer show a black text box, the printed output is still detectable by a parent application like the Leadwerks script editor.
However, if you create a .bat file to run your application, you can only pipe the output to a text file. The text will not be shown when the .bat file runs:
MyGame.exe > output.txt
Of course, any Leadwerks game will automatically write it's output to a text log already, so this is sort of redundant. Another consideration is you will not be able to see the output when you run your application from Visual Studio. Strange that VS doesn't support one of the most basic needs of an IDE, and has no known method of viewing the printed output of your program when you run it. However, if you want to get rid of that annoying black popup box, and you want your code to be cross-platform compatible, this is the way to do it.
In just three weeks, the Linux community has successfully funded the development of Leadwerks for Linux. This means we're going to bring Leadwerks 3.1 to Linux, with native support for developing Linux games...so Linux games can now be completely free from Windows.
Greenlight It's been an amazing few weeks. During this time, we also successfully completed our Greenlight campaign to make Leadwerks available on Steam and take advantage of features like the Steam Workshop. You can see from the graph below that our campaign did better than any other software in Steam we had data for. The votes look like they would have gone a lot higher, but Valve approved us early!
Megatextures I also had a chance to prototype the major feature of Leadwerks 3.1 I was most concerned about. I wanted to implement a new terrain system that would remove the limitations of our old one, and thought that a technique I call "dynamic megatextures" would be a good solution. Basically, this works like id Software's megatexture technology, only the virtual textures are generated on-the-fly rather than being paged from the hard drive. This means the entire terrain can be uniquely textured, but it doesn't require the hard drive space megatextures usually need:
Getting that knocked out of the way makes me confident we can deliver Leadwerks 3.1 for Linux according to our original vision.
Congratulations, Linux community! I'm happy to make Linux a core part of our company's focus moving forward.
The Leadwerks 2016 Winter Games Tournament is complete! This tournament brought some new types of games we haven't seen before, with a wide range of new games to try. Here's a review.
The Adventures of Relic Rick
You control the adventurer, Rick, who is on a hunt for an ancient artifact for his museum. During his search in an underground ruin, he feels an earthquake and, before he knows it, the ground caves in beneath his feet! Rick is then swallowed into a secret temple! Trapped inside, Rick must proceed forward through the newly discovered ruin using his wits to solve puzzles, collect keys, and survive to escape the labyrinth. Will he ever find a way out of this secret underground dungeon or will it become his permanent tomb? It is up to you to help guide Rick out of his unfortunate state.
Survive against waves of killer robot spiders, armed with an SMG and an endless supply of ammunition. How many waves can you survive? The visual design is simple but consistent and striking.
Gather the presents and bring them to the tree. Heavy post-processing effects and a rich atmosphere make this an environment worth exploring.
You're the pest-control snow-machine repair guy! Your career in life is to visit different places on your trusty boat and fix their machinery. This winter, you've received a special call out to Snow Town - their snow machine has broken down and they need you to re-set it!
An overhead shoot-em-up made with Leadwerks! Pilot your ship through a short level blasting enemies in your path.
The Hankinator's Ode to Alpha Dog
The Hankinator is back with another wacky game. You are a dog air-dropped into a viking village on a mission to bite as many people as possible.
The Lost and The Fallen
This interesting concept lets you lead your dog to locate a missing person. Locate the missing individual with the help of your dog. Should be possible to 'complete' the first single level but only intended as very early demo.
This science fiction FPS pits you against an endless onslaught of terrifying monsters. The level design is reminiscent of 1990's shooters. Try it now!
From the author:
You have gotten captured by evil scientist trying to experement on you, when you find guns and a way out, you find a monster that has not became so crazy as the other monsters, and he knows the way through the maze to the teleporter, you hope he will last, but he may become crazy on the way out.
An experimental first-person shooter from first-time author lbxr2000.
Explore the mountain base.
3rd Person Controller
This tech demo lets you control a character in third-person view, with lots of level interactions to try.
While not strictly a game, this is an interesting environment to explore.
Explore the surface of another planet.
Play the classic game "Pong" in a bright flashing futuristic 3D setting.
A beginning game made with Workshop content, with a cool menu.
Leadwerks has historically had a small group of customers outside of the game industry who use our software for simulations, training, and visualization. Customers using our software products include NASA, Lockheed Martin, Northrop Grumman, and the British Royal Navy. Today I am happy to announce that in response to overwhelming demand we are now offering our services to build custom VR applications with Leadwerks.
This puts us in head-to-head competition with other services firms who are mostly using the Unity3D engine to put out quick results. However, longstanding design decisions going back years have put Leadwerks Software in a position that gives us very strong advantages in the VR market. In this article I will explain how we are leveraging our unique competitive advantages to provide the most compelling results for your VR project.
Leadwerks vs. Unity3D for Virtual Reality
Most of our competitors have tried to take shortcuts by building on a platform with severe limitations, using the Unity 3D engine together with the C# programming language. This 3D engine is primarily used for mobile games, and the C# programming language was originally created for event-driven business applications.
We on the other hand have built our own 3D development system that is specifically designed to capture the maximum capabilities of VR. Our 3D engine is built specifically for high-end PCs, with graphical fidelity and performance as our overarching principles. We use the C++ programming language which is the standard for any computationally intensive code, including operating systems, device drivers, high-frequency trading software, and virtual reality applications, which must operate at a steady 90 frames per second to prevent nausea. Our development approach brings several significant competitive advantages we can now offer to you.
Virtually all major scientific and engineering libraries like MATLAB, etc. are written in C or C++. Because our VR development platform is written in pure C++ we can seamlessly integrate with all of your existing C and C++ code. For example, actual satellite control code could be compiled into a simulation and run seamlessly to test how the spacecraft would react to a variety of simulated conditions. All scientific and engineering code libraries are easily accessible from a Leadwerks project.
Competitors using C# and the Unity 3D engine will encounter roadblocks when they attempt to interface with C/C++ code. An intermediate wrapper has to be written that converts object-oriented code into procedural commands. This process is time-intensive and prone to breakage when APIs change with new versions. Integration of C/C++ code with Leadwerks, on the other hand, is instantaneous and seamless.
Nausea is a serious consideration in VR. If a discrepancy exists between the inputs received by the operator’s ocular and vestibular systems, it will result in motion sickness. An engineering tool designed to be used for long periods of time must maintain a steady 90 frames per second, allowing only 11 milliseconds for each frame render. Unfortunately, C# is a memory-managed language meaning it suffers overall slower performance, as well as periodic pauses in program execution while garbage collection is performed. All of our code is written in C++ and will perform at the maximum speed allowed by the hardware. This allows us to create richer VR applications with expanded capabilities while our competitors will run into performance problems that cause unpleasant physiological symptoms.
Benchmark showing execution time of C++ vs. C#.
Source Code Modification
Because we developed our own 3D engine we have full access to the entire source code and can make modifications to expand its capabilities (5). For example, we learned that some aerospace clients were experiencing problems with 32-floating point precision in some applications, so we re-compiled our software using 64-bit floating points, raising the maximum area we can simulate up to one cubic light year with sub-millimeter precision. Because our competitors do not have source code access to the 3D engine they are using, their ability to elastically scale their capabilities and customize their 3D engine for your needs will be greatly impeded.
Accuracy of Simulated Physics
Our software features a fast and stable Newtonian physics system that provides the most realistic physics simulation possible at real-time speeds. As the video above demonstrates, this can be used to simulate robotic arms and other moving mechanical features with a high degree of realism.
The Unity physics system was designed for games and runs on the graphical processing unit (GPU). GPUs are good at performing massive parallel processing computations but are not good at problems that involve a lot of data exchange. Unfortunately, colliding objects are a problem that involves a high degree of data exchange between threads, so the accuracy of the simulation is compromised. This has two significant consequences. First, physics in Unity tend to be much less stable than in Leadwerks, making it difficult to simulate complex jointed systems like a robotic arm. A video showing the difference can be seen here.
Rigid body stacking test: Leadwerks physics (green) are stable while Unity physics (yellow) spontaneously collapse.
Second, physics in Unity are non-deterministic. This means that each time a simulation is run, the result will be different, making it very difficult to predict outcomes. The Leadwerks physics system is deterministic and will provide the exact same result each time it is run, even if new objects are introduced into the simulation.
The competitive advantages we can put to work for your VR project are summarized below. Simply put, we can build applications that are bigger, faster, and have more capabilities.
Other firms using Unity
Leadwerks VR Services
Primary platform of 3D engine
Requires C# wrapper
Slower with GC pauses, results in nausea
Fastest possible performance
3D engine source code modification
Maximum range with sub-mm precision
One light year
If you are interested in taking advantage of our capabilities to build VR applications send us an email, or catch me at I/ITSEC later this week.
In evaluating possible company names I have come up with the following criteria which I used to choose a name for our new game engine.
Spelling and Pronunciation
The name should be unambiguous in spelling. This helps promote word-of-mouth promotion because when someone hears the name for the first time, they can easily find it online. Similarly, the name when read should be unambiguous in pronunciation. This helps the name travel from written to spoken word and back. Can you imagine telling someone else the name of this...establishment...and having them successfully type the name into a web browser?:
Shorter is Better
Everything else aside, fewer letters is generally better. Here is a very long company name:
And here is perhaps the shortest software company name in history. Which do you think is better?
The Name Should "Pop"
A good company or product name will use hard consonants like B, T, K, X, and avoid soft sounding letters like S and F. The way a name sounds can actually influence perception of the brand, aside from the name meaning. The name "Elysium", besides being hard to pronounce and spell, is full of soft consonants that sound weak.
"Blade Runner", on the other hand, starts with a hard B sound and it just sounds good.
The name should communicate the nature of the product or company. The name "Uber" doesn't mean anything except "better", which is why the company Uber originally launched as UberCab. Once they got to a certain size it was okay to drop the "cab" suffix, but do you remember the first time you heard of them? You probably thought "what the heck is an Uber?"
The Leadwerks Brand
So according to our criteria above, the name Leadwerks satisfies the following conditions:
The name "pops" and sounds cool.
It's not too long.
But here's where it falls short:
Ambiguity in spelling (Leadworks?)
Ambiguity in pronunciation. Leadwerks is pronounced like Led Zeppelin, but many people read it as "Leed-works".
The name doesn't mean anything, even if it sounds cool. It's just a made-up word.
These are the reasons I started thinking about naming the new engine something different.
New Engine, New Name
So with this in mind, I set out to find a new name for the new coming engine. I was stumped until I realized that there are only so many words in the English language, and any good name you come up will invariably have been used previously in some other context, hopefully in another industry or product type. Realizing this gave me more leeway, as I did not have to come up with something completely unique the world has never heard before.
Our early benchmarks indicate the new engine is a performance monster, with incredible results I did not even dream were possible. Together with the rapid development pipeline of Leadwerks, I knew I wanted to focus on speed. Finally, there was one name I kept coming back to for weeks on end. I was able to obtain a suitable domain name. I am now filing a trademark for use of this name, which requires that I begin using it commercially, which is why I am now revealing the name for the first time...
How does this name stack up?:
Unambiguous spelling and pronunciation.
The name "pops".
It communicates the defining feature of the product.
Now think about our goals for the new engine's name. Will people have any trouble remembering this name? Is there any ambiguity about what the product stands for, and the promise it makes? If two developers are at a Meetup group and one of them says "I made this with Turbo" is there any doubt what the promise of this product is, i.e. massive performance?
The name even works on a subconscious level. Anyone having trouble with their game performance (in other slow engines that aren't Turbo) will naturally wonder how fast it could be running in ours.
The fact that the name has a positive emotional response for many people and a strong connection to the game industry is a plus.
Turbo Game Engine is an unambiguous brand name that takes a stand and makes a clear promise of one thing: speed, which is incredibly important in the days of VR and 240 hz screens.
Leadwerks.com is now hosted on our own dedicated server located in Chicago, Illinois. It was found that this location gave the best overall results for our worldwide user base. We tested the new server in advance for a couple of days, and transferred the database right before switching the DNS, so no data should have been lost. Please submit a bug report if you experience any problems.
The Leadwerks server has a 500 gb secondary hard drive where site backups are automatically saved to, in addition to the manual backups I perform. The main site database is being downloaded manually every 3 days and saved on a 2 terabyte hard drive. Additionally, the databases are being uploaded to another remote server. Once a month the entire site will be downloaded (individual files) and burned onto several DVDs, as the ultimate fail-safe. Leadwerks.com and Werkspace are a website for you, the Leadwerks community. We will go to any lengths necessary to make sure your data is safe and protected.
We also have a new version of the website skin with an added search bar, visual improvements, and bug fixes. I'll be fixing up parts of the site and adding the documentation system back in, so keep an eye out for that.
Thanks to WiredTree and Invision Power Services technical support teams for their great support, and to Tom Christian for his work with the website skin.
Back around February I started working on a website update that included the following:
Responsive design everywhere.
Visual improvement of website.
Updated documentation system.
Tutorials for C++ programming basics.
Update forum software to new major version.
Forum moved to new URL.
All of that is now pretty much done. These changes improve the online Leadwerks experience and are independent from the software itself, so it was a good idea to get them done now.
Since September I've had more time to think about Leadwerks Game Engine 5, and although I am not completely sold on Vulkan, I think it's a good plan.
Leadwerks 5 is all about performance and user experience with VR as a prime target.
Separate threads for navmesh updating, physics, game logic, culling, and rendering. The rendering thread loops at a constant 60 or 90 (for VR) frames per second regardless of what your game is doing. This gives your game logic four times more time to run, while independently maintaining a constant framerate. The design I have in mind will make Leadwerks 5 the fastest game engine, ever, and choosing Leadwerks for VR will be a no-brainer.
Leadwerks Editor 5
A new editor will be written in C++ using Leadwerks GUI, which will give us the same appearance on Windows, Linux, and Mac. Functionality will be pretty close to the existing editor, but with more room to grow and a few improvements. Because it's written in C++ parts of the editor can be exposed to Lua, and an editor API will be provided for making Lua mods and plugins. By default, it will use a dark theme to be easy on the eyes. A standalone script editor may be provided as well.
PBR Material System with Substance Support
The lighting model will use a more advanced lighting equation and substance PBR materials (metalness and roughness) will be loaded natively.
The reference counting system in the Object class will be replaced with C++11 shared pointers. This gives you the performance of C++ with ease of use like a garbage-collected language.
The engine and editor will be released as a 64-bit build only.
More game templates will be provided. Fortunately we can add these now and updates for Leadwerks 5 will be minimal.
Source code to some parts of the engine and editor may be provided on the Leadwerks GitHub account. For example, I may make a standalone open-source script editor or publish some of the engine classes for the community to play with.
Leadwerks 5 will launch on Windows, Linux, and Mac. The improved compatibility of Leadwerks 5 means we could do crazy things like run the editor on an iPad, but I'm going to stick with what I know sells.
A standalone version that does not use Steam will be sold in bundles to companies that require this.
A monthly plan may be introduced at around $5-20 per month. Pricing for a perpetual license for the standard and pro editions would most likely be the same as now ($99-199), with a discount for early adopters / upgrades. The enterprise version would probably be about $1000 per seat with a discount for schools.
If you found this blog interesting, please consider using the social media share buttons below to share it.
In Leadwerks 4.3 we integrated GameAnalytics.com into our software, both in the editor and in the engine, as a tool developers can use to track their player statistics. A number of events were set up in the editor to fire when certain actions were performed, in order to gain better insight into how people were using Leadwerks. Here are the results.
The most popular primitives
Unsurprisingly, boxes are by far the most popular primitive created in Leadwerks Editor. The community has created more than 20,000 boxes since analytics were enabled. What blows my mind is that cylinders are actually the second-most commonly used primitive, rather than wedges. Users created 1753 cylinders but only 1358 wedges in the given time period! Even more shocking is that spheres are more popular than cones, with 985 spheres created versus just 472 cone primitives.
This causes me to question my assumptions of how people use Leadwerks, and how items in the interface should be prioritized.
The Workshop Store is used heavily
Leadwerks users installed more than 5000 items from the Workshop. It also looks like people install many items, as sometimes the number of installs exceed the number of times the Workshop interface is opened.
People buy Workshop items directly through the Steam Client
Although users are buying Workshop items in high quantities, it appears that their primary route is through the Steam store interface, rather than the built-in Workshop browser. People browse the items in the Steam client and then use the Workshop browser to install their purchased items. The numbers for Workshop Store purchases are much higher than the number of people clicking the buy button in the editor.
If you're interested in selling your 3D models or textures through the Leadwerks Workshop Store, it's easy to get started and you can earn money directly from Steam. Contact us to learn more or stop by the forum.
The Leadwerks 2 terrain system was expansive and very fast, which allowed rendering of huge landscapes. However, it had some limitations. Texture splatting was done in real-time in the pixel shader. Because of the limitations of hardware texture units, only four texture units per terrain were supported. This limited the ability of the artist to make terrains with a lot of variation. The landscapes were beautiful, but somewhat monotonous.
With the Leadwerks 3 terrain system, I wanted to retain the advantages of terrain in Leadwerks 2, but overcome some of the limitations. There were three different approaches we could use to increase the number of terrain textures.
Increase the number of textures used in the shader.
Allow up to four textures per terrain chunk. These would be determined either programmatically based on which texture layers were in use on that section, or defined by the artist.
Implement a virtual texture system like id Software used in the game "Rage".
Since Leadwerks 3 runs on mobile devices as well as PC and Mac, we couldn't use any more texture units than we had before, so the first option was out. The second option is how Crysis handles terrain layers. If you start painting layers in the Crysis editor, you will see when "old" layers disappear as you paint new ones on. This struck me as a bad approach because it would either involve the engine "guessing" which layers should have priority, or involve a tedious process of user-defined layers for each terrain chunk.
A virtual texturing approach seemed liked the ideal choice. Basically, this would render near sections of the terrain at a high resolution, and far sections of the terrain at low resolutions, with a shader that chose between them. If done correctly, the result should be the same as using one impossibly huge texture (like 1,048,576 x 1,048,576 pixels) at a much lower memory cost. However, there were some serious challenges to be overcome, so much so that I added a disclaimer in our Kickstarter campaign basically saying "this might not work"..
Previous Work id Software pioneered this technique with the game Rage (a previous implementation was in Quake Wars). However, id's "megatexture" technique had some serious downsides. First, the data size requirements of storing completely unique textures for the entire world were prohibitive. "Rage" takes about 20 gigs of hard drive space, with terrains much smaller than the size I wanted to be able to use. The second problem with id's approach is that both games using this technique have some pretty blurry textures in the foreground, although the unique texturing looks beautiful from a distance.
I decided to overcome the data size problem by dynamically generating the megatexture data, rather than storing in on the hard drive. This involves a pre-rendering step where layers are rendered to the terrain virtual textures, and then the virtual textures are applied to the terrain. Since id's art pipeline was basically just conventional texture splatting combined with "stamps" (decals), I didn't see any reason to permanently store that data. I did not have a simple solution to the blurry texture problem, so I just went ahead and started implementing my idea, with the understanding that the texture resolution issue could kill it.
I had two prior examples to work from. One was a blog from a developer at Frictional Games (Amnesia: The Dark Descent and Penumbra). The other was a presentation describing the technique's use in the game Halo Wars. In both of these games, a fixed camera distance could be relied on, which made the job of adjusting texture resolution much easier. Leadwerks, on the other hand, is a general-purpose game engine for making any kind of game. Would it be possible to write an implementation that would provide acceptable texture resolution for everything from flight sims to first-person shooters? I had no idea if it would work, but I went forward anyway.
Implementation Because both Frictional Games and id had split the terrain into "cells" and used a texture for each section, I tried that approach first. Our terrain already gets split up and rendered in identical chunks, but I needed smaller pieces for the near sections. I adjusted the algorithm to render the nearest chunks in smaller pieces. I then allocated a 2048x2048 texture for each inner section, and used a 1024x1024 texture for each outer section:
The memory requirements of this approach can be calculated as follows:
1024 * 1024 * 4 * 12 = 50331648 bytes
2048 * 2048 * 4 * 8 = 134217728
Total = 184549376 bytes = 176 megabytes
176 megs is a lot of texture data. In addition, the texture resolution wasn't even that good at near distances. You can see my attempt with this approach in the image below. The red area is beyond the virtual texture range, and only uses a single low-res baked texture. The draw distance was low, the memory consumption high, and the resolution was too low.
This was a failure, and I thought maybe this technique was just impractical for anything but very controlled cases in certain games. I wasn't ready to give up yet without trying one last approach. Instead of allocating textures for a grid section, I tried creating a radiating series of textures extending away from the camera:
The resulting resolution wasn't great, but the memory consumption was a lot lower, and terrain texturing was now completely decoupled from the terrain geometry. I found by adjusting the distances at which the texture switches, I could get a pretty good resolution in the foreground. I was using only three texture stages, so I increased the number to six and found I could get a good resolution at all distances, using just six 1024x1024 textures. The memory consumption for this was just 24 megabytes, a very reasonable number. Since the texturing is independent from terrain geometry, the user can fine-tune the texture distances to accommodate flight sims, RPGs, or whatever kind of game they are making.
The last step was to add some padding around each virtual texture, so the virtual textures did not have to be complete redrawn each time the camera moves. I used a value of 0.25 the size of the texture range so the various virtual textures only get redrawn once in a while.
Advantages of Virtual Textures First, because the terrain shader only has to perform a few lookups each pixel with almost no math, the new terrain shader runs much faster than the old one. When the bottleneck for most games is the pixel fillrate, this will make Leadwerks 3 games faster. Second, this allows us to use any number of texture layers on a terrain, with virtually no difference in rendering speed. This gives artists the flexibility to paint anything they want on the terrain, without worrying about budgets and constraints. A third advantage is that this allows the addition of "stamps", which are decals rendered directly into the virtual texture. This allows you to add craters, clumps of rocks, and other details directly onto the terrain. The cost of rendering them in is negligible, and the resulting virtual texture runs at the exact same speed, no matter how much detail you pack into it. Below you can see a simple example. The smiley face is baked into the virtual texture, not rendered on top of the terrain:
Conclusion The texture resolution problem I feared might make this approach impossible was solved by using a graduated series of six textures radiating out around the camera. I plan to implement some reasonable default settings, and it's only a minor hassle for the user to adjust the virtual texture draw distances beyond that.
Rendering the virtual textures dynamically eliminates the high space requirements of id's megatexture technique, and also gets rid of the problems of paging texture data dynamically from the hard drive. At the same time, most of the flexibility of the megatexture technique is retained.
Having the ability to paint terrain with any number of texture layers, plus the added stamping feature gives the artist a lot more flexibility than our old technique offered, and it even runs faster than the old terrain. This removes a major source of uncertainty from the development of Leadwerks 3.1 and turned out to be one of my favorite features in the new engine.
You can now view detailed sales records of your game assets in Leadwerks Marketplace. First, log into your Leadwerks account and navigate to the Leadwerks Marketplace main page. In the bottom-right, below the categories, a link to your paid files will appear.
Here you can see a list of all your paid items:
When you click on an item, you can see a list of people who have purchased it, along with sales dates.
If you wish to give a free license to any member for any reason, you can do so by clicking the "Generate Purchase" button. A window will pop up where you can type in the member's name and add the item to their account for free.
These tools give you more control over your game assets and better information on sales.
An update for Leadwerks Game Engine 4.5 has been pushed out on Steam. The following fixes have been made:
View projection for Oculus Rift VR headset is fixed.
Added VR.AButton, VR.BButton, VR.GripAxis for improved compatibility with Oculus Touch controllers.
Fixed terrain collision bug.
Added missing Workshop toolbar icons on Linux.
Fixed script editor not opening on Linux.
Fixed LoadAnimation bug.
Fixed missing fall damage on player controller.
This update is available now to all users.
An update for version 4.4 beta is now available. The Newton Dynamics library has been updated to the current version. Vehicles are temporarily unavailable, but everything else should work. The Newton DLLs have been moved into external DLLs, which allows the author of Newton to debug his own physics code in Leadwerks from Visual Studio.
You can get the update by opting into the beta branch on Steam.
Here's a look at the new vehicle system that is being developed. The API has been simplified so you simply create a vehicle, add as many tires as you want, and start using it. The AddTire() command now accepts a model and the dimensions of the tire are calculated from the bounds of the mesh.
int AddTire(Model* model, bool steering=false, const float spring=500.0f, const float springrelaxation = 0.1f, const float springdamping = 10.0f);
void SetGas(const float accel);
void SetBrakes(const float brakes);
void SetSteering(const float angle);
static Vehicle* Create(Entity* entity);
A script will be provided which turns any vehicle model into a ready-to-use playable vehicle. The script searches for limb names that start with "wheel" or "tire" and turns those limbs into wheels. If they are positioned towards the front of the car, the script assumes the wheels can be turned with steering. You can also reverse the orientation of the vehicle if the model was designed backwards.
There is one big issue to solve still. When a vehicle drives on flat terrain the tires catch on the edges of the terrain triangles and the whole vehicle bounces around badly. I'm looking into how this can be solved with custom collision overrides. I do not know how long this will take, so it might or might not be ready by Christmas.
I've begun implementing unicode in Leadwerks Game Engine 5. It's not quite as simple as "switch all string variables to another data type".
First, I will give you a simple explanation of what unicode is. I am not an expert so feel free to make any corrections in the comments below.
When computers first started drawing text we used a single byte for each character. One byte can describe 256 different values and the English language only has 26 letters, 10 numbers, and a few other characters for punctuation so all was well. No one cared or thought about supporting other languages like German with funny umlauts or the thousands of characters in the Chinese language.
Then some people who were too smart for their own good invented a really complicated system called unicode. Unicode allows characters beyond the 256 character limit of a byte because it can use more than one byte per character. But unicode doesn't really store a letter, because that would be too easy. Instead it stores a "code point" which is an abstract concept. Unfortunately the people who originally invented unicode were locked away in a mental asylum where they remain to this day, so no one in the real world actually understands what a code point is.
There are several kinds of unicode but the one favored by nerds who don't write software is UTF-8. UTF-8 uses just one byte per character, unless it uses two, or sometimes four. Because each character can be a different length there is no way to quickly get a single letter of a string. It would be like trying to get a single byte of a compressed zip file; you have to decompress the entire file to read a byte at a certain position. This means that commands like Replace(), Mid(), Upper(), and basically any other string manipulation commands simply will not work with UTF-8 strings.
Nonetheless, some people still promote UTF-8 religiously because they think it sounds cool and they don't actually write software. There is even a UTF-8 Everywhere Manifesto. You know who else had a manifesto? This guy, that's who:
Typical UTF-8 proponent.
Here's another person with a "manifesto":
The Unabomber (unibomber? Coincidence???)
The fact is that anyone who writes a manifesto is evil, therefore UTF-8 proponents are evil and should probably be imprisoned for crimes against humanity. Microsoft sensibly solved this problem by using something called a "wide string" for all the windows internals. A C++ wide string (std::wstring) is a string made up of wchar_t values instead of char values. (The std::string data type is sometimes called a "narrow string"). In C++ you can set the value of a wide string by placing a letter "L" (for long?) in front of the string:
std::wstring s = L"Hello, how are you today?";
The C++11 specification defines a wchar_t value as being composed of two bytes, so these strings work the same across different operating systems. A wide string cannot display a character with an index greater than 65535, but no one uses those characters so it doesn't matter. Wide strings are basically a different kind of unicode called UTF-16 and these will actually work with string manipulation commands (yes there are exceptions if you are trying to display ancient Vietnamese characters from the 6th century but no one cares about that).
For more detail you can read this article about the technical details and history of unicode (thanks @Einlander).
At first I thought "no problem, I will just turn all string variables into wstrings and be done with it". However, after a couple of days it became clear that this would be problematic. Leadwerks interfaces with a lot of third-party libraries like Steamworks and Lua that make heavy use of strings. Typically these libraries will accept a chr* value for the input, which we know might be UTF-8 or it might not (another reason UTF-8 is evil). The engine ended up with a TON of string conversions that I might be doing for no reason. I got the compiler down to 2991 errors before I started questioning whether this was really needed.
Exactly what do we need unicode strings for? There are three big uses:
Read and save files.
Display text in different languages.
Print text to the console and log.
Reading files is mostly an automatic process because the user typically uses relative file paths. As long as the engine internally uses a wide string to load files the user can happily use regular old narrow strings without a care in the world (and most people probably will).
Drawing text to the screen or on a GUI widget is very important for supporting different languages, but that is only one use. Is it really necessary to convert every variable in the engine to a wide string just to support this one feature?
Printing strings is even simpler. Can't we just add an overload to print a wide string when one is needed?
I originally wanted to avoid mixing wide and narrow strings, but even with unicode support most users are probably not even going to need to worry about using wide strings at all. Even if they have language files for different translations of their game, they are still likely to just load some strings automatically without writing much code. I may even add a feature that does this automatically for displayed text. So with that in mind, I decided to roll everything back and convert only the parts of the engine that would actually benefit from unicode and wide strings.
Second Try + Global Functions
To make the API simpler Leadwerks 5 will make use of some global functions instead of trying to turn everything into a class. Below are the string global functions I have written:
std::string String(const std::wstring& s);
std::string Right(const std::string& s, const int length);
std::string Left(const std::string& s, const int length);
std::string Replace(const std::string& s, const std::string& from, const std::string& to);
int Find(const std::string& s, const std::string& token);
std::vector<std::string> Split(const std::string& s, const std::string& sep);
std::string Lower(const std::string& s);
std::string Upper(const std::string& s);
There are equivalent functions that work with wide strings.
std::wstring StringW(const std::string& s);
std::wstring Right(const std::wstring& s, const int length);
std::wstring Left(const std::wstring& s, const int length);
std::wstring Replace(const std::wstring& s, const std::wstring& from, const std::wstring& to);
int Find(const std::string& s, const std::wstring& token);
std::vector<std::wstring> Split(const std::wstring& s, const std::wstring& sep);
std::wstring Lower(const std::wstring& s);
std::wstring Upper(const std::wstring& s);
The System::Print() command has become a global Print() command with a couple of overloads for both narrow and wide strings:
void Print(const std::string& s);
void Print(const std::wstring& s);
The file system commands are now global functions as well. File system commands can accept a wide or narrow string, but any functions that return a path will always return a wide string:
std::wstring SpecialDir(const std::string);
bool ChangeDir(const std::string& path);
bool ChangeDir(const std::wstring& path);
std::wstring RealPath(const std::string& path);
std::wstring RealPath(const std::wstring& path);
This means if you call ReadFile("info.txt") with a narrow string the file will still be loaded even if it is located somewhere like "C:/Users/约书亚/Documents" and it will work just fine. This is ideal since Lua 5.3 doesn't support wide strings, so your game will still run on computers around the world as long as you just use local paths like this:
Or you can specify the full path with a wide string:
LoadModel(CurrentDir() + L"Models/car.mdl");
The window creation and text drawing functions will also get an overload that accepts wide strings. Here's a window created with a Chinese title:
So in conclusion, unicode will be used in Leadwerks and will work for the most part without you needing to know or do anything different, allowing games you develop (and Leadwerks itself) to work correctly on computers all across the world.
An update is available for the new Turbo Game Engine beta.
Fixed compiling errors with latest Visual Studio version
Fixed compatibility problems with AMD hardware
Process is now DPI-aware
Added high-resolution depth buffer (additional parameter on CreateContext()).
Subscribers can download the new version here.
The Turbo Game Engine beta is updated! This will allow you to load your own maps in the new engine and see the speed difference the new renderer makes.
LoadScene() has replaced the LoadMap() function, but it still loads your existing map files.
To create a PBR material, insert a line into the material file that says "lightingmodel=1". Blinn-Phong is the default lighting model.
The red and green channels on texture unit 2 represent metalness and roughness.
You generally don't need to assign shaders to your materials. The engine will automatically select one based on what textures you have.
Point and spot lights work. Directional lights do not.
Setting the world skybox only affects PBR reflections and Blinn-Phong ambient lighting. No sky will be visible.
Physics, scripting, particles, and terrain do not work.
Variance shadow maps are in use. There are currently some problems with lines appearing at cubemap seams and some flickering pixels. Objects should always cast a shadow or they won't appear correctly with VSMs.
I had to include glew.c in the project because the functions weren't being detected from the static lib. I'm not sure why.
The static libraries are huge. The release build is nearly one gigabyte. But when compiled, your executable is small.
using namespace Leadwerks;
int main(int argc, const char *argv)
//Create a window
auto window = CreateWindow("MyGame", 0, 0, 1280, 720);
//Create a rendering context
auto context = CreateContext(window);
//Create the world
auto world = CreateWorld();
//This only affects reflections at this time
auto scene = LoadScene(world, "Maps/turbotest.map");
for (auto entity : scene->entities)
camera = dynamic_pointer_cast<Camera>(entity);
auto model = LoadModel(world, "Models/Damaged Helmet/DamagedHelmet.mdl");
model->Move(0, 1, 0);
//Create a camera if one was not found
if (camera == nullptr)
camera = CreateCamera(world);
camera->Move(0, 1, -3);
//Set background color
//Enable camera free look and hide mouse
//Create a light
auto light = CreateLight(world, LIGHT_POINT);
light->SetShadowMode(LIGHT_DYNAMIC | LIGHT_STATIC | LIGHT_CACHED);
light->SetPosition(0, 4, -4);
while (window->KeyHit(KEY_ESCAPE) == false and window->Closed() == false)
model->Turn(0, 0.5, 0);
if (window->KeyDown(Key::A)) camera->Move(-0.1, 0, 0);
if (window->KeyDown(Key::D)) camera->Move(0.1, 0, 0);
if (window->KeyDown(Key::W)) camera->Move(0, 0, 0.1);
if (window->KeyDown(Key::S)) camera->Move(0, 0, -0.1);
//Update the world
//Render the world
Today we are rolling out three new paid model packs by artist Nova Dimension.
The Urban Interior Pack contains everything you need to populate your decaying urban settings with fixtures, furniture, and survival supplies.
The Morgue Model Pack provides a creepy setting for horror or apocalyptic games. Just imagine how scary this could be with the right lighting and music.
Finally, the Old Furniture Pack provides an extended collection of every type of furniture prop imaginable, along with some old electronics like retro televisions and a radio.
All items are ready to use in Leadwerks. You can get each of these model packs now for $9.99.
Today we are releasing three new model packs in the Workshop Store.
The Candles Pack provides beautifully detailed candles and sconces to bring atmosphere to any horror game.
The Modern Furniture Pack includes numerous chairs, sofas, and a bar stool to populate any residential setting with.
The Old Wine Bottles Pack gives you a variety of bottles with two texture variations. Decorate your map with them or use them for target practice.
You can get these items by opening the Workshop interface in Leadwerks by selecting the Workshop > Browse Workshop menu item in the main window.
Our most recent game tournament was a smashing success. We had fewer entries this time, but they more than made up for it with the great quality of this round of games. Without further ado I am happy to present the entries...
Behind Enemy Lines
Wow! This game by burgelkat features a variety of missions from blowing up drug manufacturing facilities to sabatoging a plane. Although the same mechanic is usually used, the action never gets old and you will keep playing just to find out what will happen next. You may recognize the voice acting from our own Jorn Theunissen (Aggror) on the forum. You don't want to miss this one!
Nirvana is popular right now, and the SNES classic edition was just released. In case that's not enough 1990's nostalgia for you, here is the excellent Nightmare Prism by AngelWolf. Clever level design with lots of traps and well-placed enemies will keep you on your toes as you frag your way through three levels of hellish onslaughts.
Third on our list of games is an explicitly Halloween-themed title with tombstones and pumpkins aplenty. The Cemetery by Rozsoft is a short but suspenseful experience putting you into an old graveyard at night in search of your disappeared friends. Best played late at night with the lights out!
This title by member "FortifyThisMFker!" brings us back to the 90's shooter theme with a center-mounted gun and an arena of enemies. After dispatching your foes you can select an upgrade for your weapon, health, or suit, which makes for some interesting choices. But I've got to be honest, seeing the giblets fly is what really makes this game fun. Try it out!
In Exit Zed by mdgunn you will explore a scientific facility in search of zombies to high-five...except that the way you like to give high-fives is with your handy dandy fully automatic Bunsen burner tool (patent pending). The game is obviously unfinished and you might stumble across some doorways leading to nothingness, but the sound effect of your trusty scientific tool alone makes this worth playing.
Available in Leadwerks Game Launcher, Dissension is another nail-biting SciFi shooter from Garlic Waffle. Despite the cartoonish graphics, his games really frightening. This one is sure to keep you on the edge of your seat!
Garlic Waffle has gone into overtime and brought your TWO free games to play this tournament! In Sewer Survival you play to make it out of an underground prison. Expect clever puzzles, loads of enemies, and not a lot of hit points.
Here are the results of the Summer Games Tournament. Make sure you update your mailing address, because posters are being sent out immediately!
The arcade classic "Space Invaders" has been re-imagined with modern graphics and cute 3D aliens!
Constant is an abstract game about capturing cubes. Make sure you read the instructions!
Procedurally generated levels and a lot of interesting rooms make this FPS worth trying. Watch out for traps!
Summer is here, and you know what that means! Yes, it is time for another LEGENDARY game tournament. This year the theme is "Retro Gaming". Create a modern take on an arcade game hearkening back to the days of NES, Neo Geo, Sega, or just make anything you want. Either way, you get this totally radical poster as a prize!
How does it work? For one month, the Leadwerks community builds small playable games. Some people work alone and some team up with others. At the end of the month we release our projects to the public and play each other's games. The point is to release something short and sweet with a constrained timeline, which has resulted in many odd and wonderful mini games for the community to play.
WHEN: The tournament begins Thursday, June 21, and ends on July 31st at the stroke of midnight.
HOW TO PARTICIPATE: Publish your retro-or-other-themed game to the Games Showcase before the deadline. You can work as a team or individually. Use blogs to share your work and get feedback as you build your game.
Games must have a preview image, title, and contain some minimal amount of gameplay (there has to be some way to win the game) to be considered entries. It is expected that most entries will be simple, given the time constraints.
This is the perfect time to try making a VR game or finish that idea you've been waiting to make!
PRIZES: All participants will receive a limited-edition 11x17" poster commemorating the event. To receive your prize you need to fill in your name, mailing address, and phone number (for customs) in your account info.
At the end of the tournament we will post a roundup blog featuring your entries. Let's go!
You did it! Leadwerks 3.1 is coming to Linux.
As traditional gaming platforms are becoming more and more restrictive, software developers, hardware vendors, open-source coders, and gamers are working together to build a better future for gaming on the open platform Linux. I count myself fortunate to have found my place in this movement, and am very grateful that over 700 Linux gamers believed in this idea.
I'm driving over to the IGDA Summit today to sit in on a few sessions. Then I'm going to take a much-needed couple of days off and we'll hit the ground coding Monday morning. There's a lot of work to do before December, but our requirements are very clearly defined and the major technical hurdles have been knocked out. I have a pretty open development process and enjoy explaining the cool stuff we implement, so you'll be updated at every step along the way.
It's clear that the visual GUI designer stretch goal is something many people would like to have. The idea could probably use more refinement, and I'm not going to make spur-of-the-moment development decisions, but the feature is a very good candidate for future development.
Physical items will be shipped in August. I'll post an update here when items begin shipping. A poll will be sent out to gather shirt sizes and any other needed information.
For near-daily updates you can add Leadwerks on social networks:
Once again because it can not be said enough, thank you for backing this project. This is a win for not only the Linux operating system, but for PC gaming, which is finally getting the priority it deserves on Linux.
The following organizations helped achieve this outcome:
And of course, thank you to Kickstarter for providing the platform to support this funding model.
I'm pleased to announce the full stretch goals for the Leadwerks for Linux Kickstarter campaign:
$26,000 - Android + Ouya for All: We will provide all backers who pledged $100 or more with Android support. We’ll also add support for OUYA, the Android-based open game console. This will let you build games for Android and OUYA, without ever leaving the Linux operating system.
$30,000 - Blender integration: We want to integrate Leadwerks with the free 3D modeling package Blender. We’ll start with a Blender exporter that saves a model and all materials ready-to-use in Leadwerks, and look for other Blender features we can put to work in our engine.
$35,000 - 64-bit Builds: We’ll provide 64-bit builds of the Leadwerks engine library, along with the 32-bit library. (We decided to provide this for Linux by default. The stretch goal is for 64-bit builds on Windows and Mac.)
$45,000 - Visual GUI Editor: We want to build a fully integrated GUI editor right into Leadwerks. This will let you create game menus with buttons, sliders, switches, and more, in a fully skinnable GUI system. GUI elements will even integrate with our flowgraph system, so you can visually attach GUI elements to scripted events and C++ callbacks.
$55,000 - Oculus Rift + Omni in Linux: We want to integrate the great virtual reality headset Oculus Rift with Leadwerks, all running natively in Linux. We’ll even include support for the Omni VR treadmill, so Linux developers can create the full VR experience.
$85,000 - Broaden Your World: We’ll implement full 64-bit floating point math and streaming terrain data to create worlds beyond the limits of 32-bit floating point precision. Want to create detailed worlds ten times bigger than Crysis maps? We can make it happen.
$150,000 - Choose Two Flavors of Linux: Variety is the spice of life, and Linux is baked with plenty of it! We’ll work with the top two distros backers choose to provide full Leadwerks integration and ongoing support for two years.
$200,000 - Plugin-Free 3D Web Games: We’ll work with asm.js to compile Leadwerks in web-ready format so you can distribute 3D web games for supported browsers, with no proprietary plugins required.
Leadwerks Game Engine 4.4, scheduled for release soon, features some updated and enhanced visual effects. In this blog I will talk about some of the adjustments I made. Having "The Zone" scene that Aggror recreated actually helped a lot to see how shaders could be improved.
Bloom / Iris Adjustment / HDR
The bloom and iris adjustment shaders have been updated to give bloom a wider and softer blur. Iris adjustment is faster and more intense now, which will make the outdoors areas seem very bright when you are indoors, and the indoors areas will look very dark when you are outdoors.
The SSAO shader has multiple passes added to it, resulting in a much smoother yet crisp result.
A new vegetation shader called "groundrocks" will make objects align to the terrain. This lets you easily paint clusters of rocks all across a landscape, resulting in a nice chunky look that breaks up boring heightmap terrain.
Although several fog shaders have been available in the Workshop for some time, version 4.4 adds a built-in distance fog you can use to make spooky scenes.
The fog is built into several shaders in order to give correct reflections. It works great with water. Notice the reflection is also foggy, and the water itself is affected by fog, giving a nice misty look to the far side of the lake.
You can try Leadwerks Game Engine 4.4 right now by opting into the beta branch on Steam.