August catchup 🎉
Since the last update, a lot has happened - as usual. The main feature that I've been focusing on was adding pathfinding to the engine, as well as polishing and making tools to facilitate porting Quake maps.
Of course, I've been doing other improvements to the editor and the engine along the way.
Reached 1000 Commits 🤯
During August, we also hit a milestone of 1000 commits. Nuake came a long way in 4 years, and it's nice to go back to put in perspective the progress that has been made.
Nuake before it was called Nuake
Nuake's state at the 1000th commit
Navigation Mesh Volumes
A crucial part of any game is path finding. Without it, you can't make convincing AI for your characters. You need to be able to generate a navigation mesh from your level's geometry, and then query that mesh to generate the simplest path between two points.
I've decided to implement Recast&Detour, a library that is used in a bunch of game engines and has been the best open source solution for years.
Along this shiny new library comes a shiny new component: NavMesh Volumes
.
I took inspiration from Unreal Engine's volumes, and found them quite intuitive to visualize how your navigation mesh occupies your scene. You simply define a bounding box, configure a couple properties and click generate.
Path finding
Now that you have your navigation mesh generated. You can access it in your scripts to make various queries.
First, you fetch the entity that contains the navigation mesh you wish to query. Then you get a reference to the component NavMeshVolumeComponent
which you can then use to perform various queries(Like finding the path between two points).
This is how you would generate a path between two points in C#:
void Update(float dt)
{
Entity navMeshEntity = GetEntity("navMeshVolume");
NavMeshVolumeComponent navmesh = navMeshEntity.GetComponent<NavMeshVolumeComponent>();
// Generate a path between two points
const Vector3 start = new Vector3(0, 0, 0);
const Vector3 destination = new Vector3(0, 0, 10);
List<Vector3> waypoints = navmesh.FindStraightPath(start, destination);
}
One you have your path(which is list of 3D points), you are free to use it however you want. Using my tiny testing project, I made an enemy with a character controller that move along the path, that gets generated whenever I press a specific key, to the player's position.
This is not game, just a simple test scene to showcase the pathfinding.
Tooling
A goal of mine with the Nuake UX has been to keep it as minimal as possible and straight to the point. I want to make sure that Nuake looks and feel simple to use, without hiding features for the more advanced users.
I want to make the experience of making games straightforward, clean and uncluttered. Almost like a toy, but that has a lot of functionalities if you have the curiosity to dig deeper.
While working on the AI module of Nuake, I have found that debugging visually was not as smooth as I wanted. I didn't have a proper debug renderer that was exposed to the scripting API. I had it implemented in the engine but never took the time to make it better, which made it not fun to use.
I have exposed and revamped the DebugRenderer
to the C# API. You can now draw useful gizmos through your entity scripts. This was super useful to have while working on this feature.
// This will draw a line between start & end in red for 10 seconds.
const Vector3 start = new Vector3(0, 0, 0);
const Vector3 end = new Vector3(10, 2, 0);
const Vector4 color = new Vector4(1, 0, 0, 1); // red
const float lifeTime = 10.0f; // Will display for 10s
Engine.DrawLine(start, end, color, lifetime);
// This is how to draw a path!
List<Vector3> path = navmesh.FindStraightPath(start, end); // Find path using navmesh
for(int i = 0; i < path.Count - 1; i++)
{
// Will draw each path segments from the navigation mesh
Engine.DrawLine(path[i], path[i + 1], color, lifetime);
}
This snippet shows you how to draw a simple line, and then draw a path generated by the navigation mesh volume.
This is how it looks in game! Neat.
Physics
The new physics API now exposes some neat new functions. You can now do shape sweeps! The following shapes are supported:
- Box
- Sphere
- Capsule
- Cylinder
Spot lights
I have implemented a new type of light : Spot lights! They also cast shadows 👻
C# Improvements
You can now expose fields and properties to the editor using a new attribute Exposed
. Not all types are supported but a good amount is. All fields with this attribute will show in the properties of the .NET Script component and if you edit these values, they will be set when you start your game.
These are of course serialized and will dynamically update when you compile your scripts.
It also supports Prefabs and Entity as types :)
Visual Studio Extension
I took the time to create a new Visual Studio extension to enhance the C# workflow. The extension is available in the Extension store. You can find it as NuakeVSTools
on the marketplace and is currently in preview. I will continue to improve it as I work on the C# implementation.
It's pretty useful and makes it more fun to create new scripts. It contains script templates for you to choose from when adding new elements in your visual studio solution.
Quake map importer
A couple months ago, I worked on a WAD converter that automatically converts WADs into Nuake materials. This makes the process of porting your quake maps into Nuake a lot better.
Yes, I imported E1M1.
The importer
The importer's job is simply to parse your quake .map
file, switch the map configuration to your project's Trenchbroom configuration and then fix all the texture references to their corresponding PBR materials(usually found under /Materials/
).
Before this tool was made, you had to manually open your .map
file and fix all the paths manually in a text editor and It took forever. It is now accessible under Tool
in the menu bar.
If you also went through the process of configuring your entities, every entity in your map should have been replaced with the corresponding prefabs. 🥳
Project Wizard 🧙♂️
I'm also focusing on making the onboarding experience for Nuake more welcoming for new users. I have made this new project wizard when creating a new project. You can also choose a custom accent color to customize the editor on a per-project basis.
I also plan on creating project templates to get a jump-start. This feature isn't implemented yet.
Editor Improvements
These are not all the improvements I have done, but the main ones that I remember working on. They are in no particular order, just little improvements that I found neat to showcase :)
Drag & Drop
You can now drag & drop 3D models in the viewport to place them. You get a little preview of the model but it's not 100% accurate yet as it would be too taxing to import the model at 100% quality dynamically.
Status bar
I got tired by the lack of visual feedback when performing certain actions. The console output was not enough to give feedback to the user. I added a status bar at the bottom of the editor that can display a bunch of information without getting in the way.
The best part is that I can change the color of it if some action need to stand out.
Prefab thumbnails
This might seem like a silly feature but it required me to refactor the renderer to be able to render any scene at any time. The renderer was dependent on the state of the engine to be able to draw a frame.
It is now entirely modular and can be used to render any scene at any time. It is still a very crude implementation, and I want to be able to render in real-time the animations in those prefab.
Better action bar
I also improved a little bit the action bar - or whatever it's called. The bar that does stuff.
Oh and I also made the play button turn purple when you enter into play mode. Just another visual cue that something happened!
Pause & Resume
The pause button has been there for years, but it never actually worked. Why? Because I never actually needed it. When I started working on Jolt I ended up needing it to debug collider behaviors.
After implementing it, it turned out to be a really nice feature to have, especially to take screenshots and fly around the game.
C# Build Errors
Build errors are now displayed in the logger. That's it
Closing words
I know I've been rather silent on the updates, but I've been hard at work to finalize and ship an official alpha release. This is only a small subsets of the features that I implemented and I've been falling behind on the blog posts. I have a whole backlog of features to talk about.
I have a couple of posts already in the work and I will try to focus a lot more on communication in the near-future as we approach alpha.
A roadmap will also follow and official documentation for Nuake is also in the work! Samples will follow as well.
Thank you, Antoine💖