Jump to content

  • Log In with Google      Sign In   
  • Create Account

Leadwerks Developer Blog

What Programming Language Should You Learn To Get A Job In The Game Industry?

Posted by , 18 July 2016 - - - - - - · 1,434 views

If we count id Software’s game Quake as the beginning of real-time 3D games, then it can be said that the C programming language is the foundation of modern game design. The original Quake engine was written in C, using an interpreted C-like script language called “QuakeC” for game logic. By the time Doom 3 was in development, id Software had moved over to the C++ programming language, which adds object-oriented features. C++ today remains the foundation of most game engines and performance-intensive code libraries. For example, Unreal Engine now uses C++ exclusively. Unity3D provides a programming framework through the C# programming language, allowing the developer to access the engine’s internals, which are written in C++. Leadwerks Game Engine (my product) provides access to a single API using both C++ and Lua, allowing the developer to write performance-intensive code in C++, while light game logic can be easily scripted in Lua.


For someone starting out in the game industry with the intention of eventually getting a job working for a major studio, what is the best path to learning what you need to know? This article was written in an attempt to quantitatively answer that question.


A sample of all programmer job ads on GamaSutra.com was taken on July 14th, 2016. Each ad was searched for the terms “C++”, C#”, “Java” or “JS”, and “Lua”. If the term was found, the language was considered a requirement, for the purposes of this analysis.


Of the 46 job listings sampled, 39 (85%) required C++ experience, 15 (33%) required C#, eight (17%) required Java or JavaScript, and just four (9%) required Lua. The results show that C++ is by far the most sought-out skill employers look for when hiring programmers. A game developer who knows C++ has more than twice as many job opportunities as a C# programmer. This analysis also shows that although Lua is great for learning, it would be difficult to make a career out of it without additional C++ experience.
Posted Image


You can download an Excel file containing the raw data used for this analysis in the attachment below.

Attached Files

Banding and Dithering

Posted by , 17 May 2016 - - - - - - · 1,504 views

I came across a very interesting presentation that talks about how to avoid "banding" artifacts in game graphics. The author uses dithering to add noise to an image and break up the visible lines your eye can detect. This even works with audio. When noise is added to the mix, the original tune appears to become more high-fidelity than it actually is:



I was able to use this concept to improve the appearance of banding in shadow acne in a low-resolution spotlight with a large volume. Here is the original situation, purposely created to maximize the banding effect:


Posted Image


And here is the result when some slight dithering is added:


Posted Image


The trick to dithering is to know how much noise to add. If we add too much it starts becoming very apparent:


Posted Image


You want to calculate your noise amplitude as the difference between the two discrete levels you are trying to bridge. In the case of the spotlight shader, random noise is being added to the z coordinate of the shadow lookup, so I want the noise amplitude to be equal to the minimum depth difference the shadowmap can display. I calculated this as follows, but more experimentation is needed to make sure its right:

float noiselevel = 0.000001 * lightrange.y;
shadowcoord.z += rand(lightnormal.xy) * noiselevel - noiselevel * 0.5;
You also want to make sure your random seed is really random. Using the screen coordinate alone produces bad results because the same random seeds will stay in place as you look around and cause visible patterns. If you use the "currenttime" shader uniform the noise will constantly change as the camera stays still, resulting in a film grain effect. I find it is best to multiply the xy components of the fragment coordinate by some other vec2 value.


Here's another example with a directional light exhibiting a banding appearance due to a low angle on the ground:


Posted Image


And here is the improved image with dithering applied:


Posted Image


This code does not eliminate shadow acne, it just breaks it up with some random noise so that your eye can't as easily detect a continuous line.


The same technique can be used to improve the appearance of the new godrays shader I am working on. With only 16 samples for the rays, banding is very easily visible in this image.


Posted Image


When we add a random offset to the ray starting position, with an amplitude equal to the length of the distance between steps, banding disappears.


Posted Image


Of course more samples are always better, but even at higher sample counts, dithering makes a huge improvement in quality. Leadwerks Engine 2 actually used 64 samples, with worse results than what I got using just 16 samples above. The ease with which I can now modify shaders in Leadwerks Editor and see the results instantly really helped develop these techniques.

Leadwerks adds Oculus Rift support [beta]

Posted by , 28 November 2014 - - - - - - · 925 views
Leadwerks adds Oculus Rift support [beta] I've added Oculus Rift support to Leadwerks Game Engine. The feature is presently in beta, but very usable.

Enabling virtual reality mode in your game is very simple. Just add the Window::VRDisplay flag when your game's window is created, and the rest is automatic:
Window* window = Window::Create("My VR Game",0,0,1024,768,Window::Titlebar|Window::VRDisplay);
Or in Lua:
local window = Window:Create("My VR Game",0,0,1024,768,Window.Titlebar + Window.VRDisplay)
Four new commands will help you refine your VR experience:
Vec3 VR::GetHeadRotation()
Use this to modify the way your controls work. For example, use the player's head rotation to change the direction they move in when a key is pressed. You do not need to rotate the camera yourself, as this is done automatically.
Vec3 VR::GetHeadPosition()
This command is useful if you're doing any line-of-sight tests with the player.
void VR::Recenter()
Recenters the headset orientation according to the current position and rotation.
void VR::HideWarning()
Disable the Oculus warning popup, typically by pressing space or another key.

Attached Image

Beta Limitations
Oculus Rift beta support is presently only available for Windows, and does not yet allow 2D drawing in VR mode. We expect to have our implementation complete, for Windows and Linux, by the end of the year.

Leadwerks Game Engine can be purchased for 50% off during the Steam Exploration Sale.

A Week in Seattle: Steam VR, Gas Works, and the Strawberry Moon

Posted by , 16 June 2014 - - - - - - · 917 views

Last week I travelled to Seattle for a few days to lay some groundwork for the future of Leadwerks Software. During the week I tried out Valve's VR hardware, visited a gassification plant, and survived a trifecta of astrological phenomenon.

Steam VR
Although I attended Steam Dev Days, I did not get a chance to demo Valve's virtual reality hardware. I was invited by one employee to come back and check it out, so I decided to take them up on that offer last week.

Valve's VR is improved over the Oculus Rift because it has higher resolution screens, lower latency, and positional tracking. The combination of these factors are enough to push the stimulus over the tipping point to where your brain accepts it as reality. Donning the headset immediately transported me to another plane of existence. If Oculus Rift felt like looking through a Viewmaster, Steam VR was like plugging into the matrix. In fact, it was so real that it felt very alarming to look down and not have a body. I was led through a series of demos that were incredible and disturbing at the same time. At one point I was looking in a mirror at a levitating box with two hemispheres for eyes that mimicked the rotation of my head. The sense of disembodiment was alarming in a very visceral way. I never experienced anything like this with Facebook's less convincing VR technology. The Oculus Rift was interesting, but never raised existential questions in my mind.

Positional tracking inserts you into the scene and gives you a sense of space relative to objects. Objects in the foreground are especially real because you can move around them and see them up close from all angles. 3D modeling for virtual reality is going to be different from modeling for conventional 3D games. Small details need to be actual geometry, not just details baked into a normal map, or else they look like painted plywood. Because of the sense of space, small enclosed areas actually make a better setting for VR than large expansive fields, where your sense of position is diminished.

At one point I was face to face with a massive 20-foot tall model of a robot from Portal 2, and I felt the size of it in a way I simply wouldn't from an image onscreen. The positional tracking made the scale seem absolutely real. I stared up at it from below, and I knew at that point that VR is going to be huge. I'm still convinced I was actually there. I have the memory of that experience. It was just as real as the room I'm in now as I type this.Posted Image

Gas Works
In college I took a trip to visit some friends who moved to Seattle. (They moved there because they thought it would be fun, and we were all Nirvana / Soundgarden / Pearl Jam fans in high school.) That was my first visit to the emerald city. While there, we visited Gas Works park, the former site of a "gassification plant" where I presume they manufactured steampunk memorabilia:
Posted Image

I was inspired by the heavy industrial structures and the name stuck with me, and it influenced the naming of Leadwerks Software. I'm starting to feel like the Joker with my explanations of where the name comes from ("Did I ever tell you how I got these scars?...") but the fact is that I remembered the park but forgot the name until I saw it on a poster last week. And then I had come full circle. Gas Works. Leadwerks. Seattle. It all made sense, and I knew this is where the company belongs.

The Seattle area is home to Amazon, Microsoft, Valve, and 200 game studios. Not only are video games a major area industry, but PC gaming is very strong here. As a result, I don't have to explain to people what Steam is. I don't have to explain to them what a mod is. I attended a TechCrunch event Thursday night and my suspicions were confirmed. Conversations were easy and everyone knew right away what I was talking about. The opportunities that fit our particular strengths are to be found here. As of July, the company is relocating to Seattle.

Friday the 13th and the Strawberry Moon
My flight departed Seattle at 1:40 P.M., on what happened to be Friday the 13th. After an uneventful boarding we sat on the tarmac waiting to take off, when the captain announced the plane was low on hydraulic fluid. A few minutes passed and they announced the maintenance crew was checking a problem, and they would let us know if we were cleared to take off. They then announced we were returning to the boarding area and would be delayed. At this time I decided to adopt a new policy: I don't fly on planes that have known mechanical issues. I requested to reschedule my flight and took the next one home. My original flight did depart and arrive safely, as I figured it would, but in the face of incomplete information I'm not one to take stupid chances. Apparently Friday was also a full "strawberry moon" and a guy who worked at a coffee shop in the airport told me that Jupiter is doing some weird stuff. He was a barista after all, so I figured I should listen to him. I arrived safely that night on another flight. A strange end to a pivotal week.

Leadwerks Game Engine Launches in Ubuntu Software Center

Posted by , 27 May 2014 - - - - - - · 820 views

Now that the Kickstarter rewards are shipped from my campaign to bring Leadwerks to Linux, I'm getting distribution channels set up. Today Leadwerks Game Engine launched in the Ubuntu Software Center. This is a big deal for two reasons:
  • Linux users now have first-class rapid game development tools written natively for Linux.
  • We're bringing more games to Linux, like Rogue System.

You can check out a demo of Leadwerks on our site.

Posted Image

Leadwerks Workshop on Steam Launches Beta

Posted by , 20 March 2014 - - - - - - · 1,007 views

Leadwerks Workshop on Steam Launches Beta Previously, I described the goals and philosophy that were guiding my design of our implementation of the Leadwerks Workshop on Steam. To review, the goals were:
1. Frictionless sharing of items within the community.
2. Protection of intellectual property rights.
3. Tracking of the chain-of-authorship and support for derivative works.

In this update I will talk more specifically about how our implementation meets these goals.

Our implementation of the Steam Workshop allows Leadwerks developers to publish game assets directly to Steam. A Workshop item is typically a pack of similar files, like a model or texture pack, rather than single files:
Posted Image

To add an item to Leadwerks, simply hit the "Subscribe" button in Steam and the item will become available in a new section of the asset browser:
Posted Image

You can drag Workshop files into your scene and use them, just like a regular file. However, the user never needs to worry about managing these files; All subscribed items are available in the editor, no matter what project you are working on. When a file is used in a map or applied to a model, a unique global ID for that file is saved, rather than a file path. This allows the item author to continue updating and improving the file without ever having to re-download files, extract zip archives, or any other mess. Effectively, we are bringing the convenience of Steam's updating system to our community, so that you can work together more effectively. Here's one of the tutorial maps using materials from a sci-fi texture pack from the Workshop. When the map is saved, the unique file IDs are stored so I can share the map with others.
Posted Image

Publishing your own Workshop packages is easy. A built-in dialog allows you to set a title, description, and a preview image. You can add additional images and even videos to your item in Steam:
Posted Image

Leadwerks even has support for derivative works. You can create a model, prefab, or map that uses another Workshop file and publish it to Steam. Since Leadwerks tracks the original ID of any Workshop items you used, they will always be pulled from the original source. This allows an entirely new level of content authors to add value to items downstream from their origin, in a way similar to how Linux distributions have grown and evolved. For example, maybe you don't have the artistic skill to make every single texture you need for a house, but you can put together a pretty nice house model and pant it with another user's textures. You can then upload that model right back to the Workshop, without "ripping off" the texture artist; their original package will still be needed to load the textures. It's perfectly fine to change the name of your Workshop package at any time, and you never need to worry about your file names conflicting with files in other packages. (If you decide you want to change a lot of file names, it's best to just create a new package so that you don't interrupt the work of users "downstream" from you,)

Uninstalling a Workshop package just requires you to hit the "unsubscribe" button on the item's page in the Steam Workshop. No more hunting around for stray zip files! You can easily check out other users' work, use whatever you like, and unsubscribe from the packages you don't like, with no mess at all.

How Do I Get It?
The Leadwerks Workshop beta begins today. You must be a member of the Leadwerks Developer group on Steam to access the Workshop. A limited number of beta invites are being sent out. Once the system is completely polished, we will make it available to the entire Leadwerks community.

Building a Collaborative Content Production Pipeline - Part One

Posted by , 12 March 2014 - - - - - - · 1,060 views

Building a Collaborative Content Production Pipeline - Part One As the maker of a game engine primarily aimed at Indie game developers, I have the opportunity to observe behavior of many individuals working together. This allows me to observe interactions from a perspective the individual participants in the system sometimes can't see.

There are many steps in game development, that can be performed by people with different skill sets. The workflow for Leadwerks is designed on this premise. At its simplest, Leadwerks can be used as a visual design tool with mapping tools and the flowgraph editor for game logic. Beneath this lies the entity script layer, and then beneath this is the C++ API at its core.

Ultimately, my goal is to facilitate cooperation between different users who occupy different niches in the content production pipeline. Mappers, programmers, designers, and artists should be able to benefit from one another's work without entering into structured agreements. Ideally, they will all just churn away at what they are good at, like the cells in a human body keeping the organism healthy and productive.

Taking a very broad view of the matter, you really need three things to achieve that vision:
  • Free sharing of items within the community.
  • Protection of intellectual property rights.
  • Tracking of the chain-of-authorship and support for derivative works.
This is challenging because some of those goals may seem to contradict others. For example, if I upload a model on Turbosquid I certainly don't want someone else turning around and reselling it as their own work, because that violates my intellectual property rights. On the other hand, if we don't allow frictionless exchange of content, individuals further up the value chain never get a change to add their valuable contributions to the ecosystem.

That's why I'm taking a new design with this system, one that has never been done before. In my next update I will talk in more detail about my design and how this system will change the way content is produced.

Putting the finishing touches on Leadwerks for Linux

Posted by , 06 March 2014 - - - - - - · 957 views

I'm happy to say that Leadwerks now supports the entire process of making games natively on Linux. Let's take a quick tour through the process.

First, we create a new project in the project wizard. The project wizard will detect project templates (you can make your own) and let you make a game based on Lua script, or on a combination of C++ and script:

Posted Image

Step two is to make your game. Fortunately, you've got everything you need built into a single integrated editor, including script and shader debugging, automatic asset reloading, and built-in level design tools:

Posted Image

Once you have something you want to share, the project publisher will copy all required files into an export directory. Future feature idea: Add a call to a command-line tool to pack up .deb packages. Or better yet, allow any arbitrary executable to be run at the end of the publishing process.

Posted Image

I have some more testing to do before release, but things are looking good!

Building a recursive file system watcher for Linux

Posted by , 20 February 2014 - - - - - - · 1,780 views

Following my previous update about correcting file path cases, I am now able to load all our maps in Leadwerks. The power of this tool running natively on Linux is starting to show, if I do say so myself:

Posted Image

The next step is to implement a file system watcher to detect file changes. Leadwerks automatically monitors the current project directory, and will reload assets whenever the file changes. This allows you to keep an image open in an image editor like GIMP, and any time you save your changes will be reflected inside Leadwerks. It's a great workflow for artists and just the kind of feature I wanted to bring to Linux with this project.

Linux has a built-in file system watcher class called "inotify". Interestingly, this class was added to Linux in 2005, the same year the iPod was released, but there appears to be no connection. The "i" in "inotify" stands for "inode". Dennis Ritchie explains:

In truth, I don't know either. It was just a term that we started to use. "Index" is my best guess, because of the slightly unusual file system structure that stored the access information of files as a flat array on the disk, with all the hierarchical directory information living aside from this. Thus the i-number is an index in this array, the i-node is the selected element of the array. (The "i-" notation was used in the 1st edition manual; its hyphen was gradually dropped.)

The inotify system is pretty straightforward to implement, with a procedural C interface. One thing that tripped me up was an odd layout of the inotify_event structure. It actually has a char pointer built into the structure, so technically the structure does not have a determined length. I don't believe I have ever encountered this design before, but I also am usually dealing with std::string classes.

One drawback of inotify is that it isn't recursive. While searching for information on the design, I came across this post by Robert Love, one of the two guys who wrote it (the other being John McCutchan). I disagree with his rational for omitting recursion; just because the performance is not as optimal as he would like does not mean the end user's tastes and preferences will change. I can't imagine a scenario when you wouldn't want the system to work recursively, or at least have the option to. In any case, implementing a recursive watch system was fairly easy. The entire file watch system from zero to finished only took about half a day. So we can mark this as one of the features where I overestimated the time and complexity of implementation.

File creation, deletion, and modify events are now firing reliably so I am going to plug this code into the editor and start testing it out. Because the editor already works reliably on other Windows and OSX, I don't anticipate any problems. I do not have a firm release date yet, but as you can surmise, we are nearing completion of Leadwerks for Linux.

Linux Development Update

Posted by , 24 January 2014 - - - - - - · 853 views

With all the excitement of the Steam release and Steam Dev Days behind me, I have literally nothing else to work on but Linux and small bug fixes for the Steam users. Together with the recent solution of two long outstanding problems, the pace of development is picking up, and you can expect more frequent updates from me.

I started investigating the right-hand side panel. This contains four tabbed panels filled with various tools the editor uses. I noticed the bottom of the window was being hidden behind some mystery panel I didn't recognize. I added a function that colored the entire interface random colors every frame, which led to this amusing screenshot. Yes, this is actually a real development screenshot of Leadwerks for Linux.

Posted Image

Coloring the panels didn't reveal anything to me, but after looking through my code I soon found the culprit: a tabber widget had been created on the main window and forgotten, and it just didn't show up in front in the Windows version. So I put it out of its misery and everything was better.

The asset browser allows you to view all files in your Leadwerks projects. With recursive and search options, it can be used to quickly find any file or group of files. This had some miscellaneous problems with event handling I fixed.

Default fonts on Ubuntu are quite large compared to Windows and Mac, and this requires some reworking of UI elements. However, I haven't run into any places yet where this requires a significant redesign. I found that button images work best when the button is given a padding of 6 pixels. In other words, the button size minus 12 is how big the image should be.

Posted Image

With this part of the editor working nicely, it's starting to feel like a real application. Having an advanced tool like this that can run natively in Linux is pretty intriguing because it means being free from Windows and doing the kinds of things I want to do on Linux. So we're one step closer to delivering on the promise of this campaign. Stay tuned.