Update!
It's been a while since the last blog post, but fear not, a lot has happened since then. I felt like I didn't have enough features and improvements for a proper blog post for the last couple months. However, it quickly turned into having too much to write about! Anyway here are the cool new features and improvements that I implemented since the last update.✨
Features
- C# support
- Spatialized Audio
- Triggers
- Post-processing
improvements
- Material thumbnails
- Wad Converter
- Selection outline
- Editor improvements
C# support
⚠️ This is a work in progress and it will probably change a bit while I'm fleshing out the feature
This is a big one! I'm super excited about this feature and it's something that I've been wanting for a while. C# is an incredibly popular language for game development, so it only made sense to implement it.
The experience of using a solid language in Nuake has been refreshing to say the least. Do not worry though, Wren is still a solid language that I want to support along side C#.
You can now generate a visual studio solution from the editor and Nuake will build your scripts before starting the game automatically.
There is still a lot to be done to make it good. It's still a bit rough which doesn't make the user experience as smooth as it could be, but I'm overall happy with how it's turning out so far.
Here is an example of an entity script. There are 4 methods that you can override(same as Wren) and some physics callback.
using Nuake.Net;
public class Player : Entity
{
// Called when the entity spawns
public override void OnInit() {}
// Called every frame
public override void OnUpdate(float timestep) {}
// Called every fixed step
public override void OnFixedUpdate(float step) {}
// Called when the entity is killed
public override void OnExit() {}
// Optional physics callback
public override void OnCollision(Entity entity) {}
}
What's neat with C# is that it allows to make an API that is clean and easy to use.
For example, you can do something like this with the type checking:
using Nuake.Net;
public class Enemy : Entity
{
public void Damage(float amount) {}
}
public class Player : Entity
{
public void Respawn() {}
}
public class SpikeTrap : Entity
{
// ⚠️ This is the neat part ⚠️
public override void OnCollision(Entity entity)
{
if(entity is Enemy)
{
(entity as Enemy).Damage(10.0f);
}
else if(entity is Player)
{
(entity as Player).Respawn();
}
}
}
Another thing I want to experiment with is making a plugin API available in C#, which will allow anyone to extend the editor using C#. This is something I'm really excited about.
Spatialized Audio
I didn't get to showcase any of the audio system in the past, but we have spatialized audio in!
Using the AudioEmitter
component in your scene, you can play audio globally or in 3D space.
The active camera will be used as the listener. There is currently no audio mixer, but it is something that is planned.
Audio effects will also be added along the mixer. The current library I'm using also enables me to place audio colliders but it's not a priority at the moment.
Here you can hear two audio emitters placed around the scene
Triggers
Using the different collider shapes available, you can place a shape and use it as a trigger. Along with that, you can now use collision callbacks in your scripts to trigger different events.
For example, making a teleporter🚪 that moves the player when he enters the trigger.
I made a small game the other day to test out the current state of the engine and ended up using triggers on weapons⚔️ to register hits and it worked out surprisingly well. Of course, the triggers move according to their parent, so the animations were driving the actual hitbox which is very cool.
The hit detection is using triggers on the swords, and another trigger is placed under the level that respawns the enemies and the player.
Post processing
I've had time to work on rendering and adding new effects to the renderer. I've been wanting to take prettier sceenshots for the website. Depth of field, barrel distortion and vignette has been added as optional post-processes in the environment properties of every scene.
There is an auto-focus feature for the depth of field but it's very jarring since it doesn't have any kind of smoothing when the focus changes. Nonetheless, it can make some pretty cool visuals. 📸
This screenshot features depth of field, reflections, AO, bloom, vignette and barrel distortion
WAD converter
Trying to import quake maps into nuake has been a painfully slow process for far too long. Having to manually convert WADs into images was necessary because only standard file formats are supported.
I was on the fence on wheter or not I wanted to natively support WADs at runtime. The fact that I'm using PBR materials for rendering means that each material has various properties. If I natively supported WADs then I would make those properties unavailable because a WAD only contains textures.
I decided on making a converter that converts any WAD into a list of materials. All of this available in the file browser by
right-clicking a file and selecting Convert to materials
.
This will create a folder and create a new material file for every texture in your WAD. Every texture that contains fullbright pixels, will be made emissive for you automatically.
The .map
files you will be using in your scene will automatically look for those materials.
Material thumbnails
You can now preview the different materials available in your project through the filebrowser.
A sphere with your material applied will be rendered and used as an icon for every .material
file
found in your project's folder.
This is a small feature, but will be a stepping stone for rendering other types of assets(models, prefabs, scenes).
In the filebrower, you can now preview roughly what a material might look like in a 3D context.
Selection outline
In the viewport, a pretty outline will be applied to the entity you've selected. That is all.
I'm planning on exposing this system to the user so that outlines can be used in-game. It could be useful for games, like an x-ray effect or highlighting an object using an outline. I could also pipe the outline pass in the emissive buffer to make a glowing effect. 🤷🏼
The outline of a selected object
Various editor improvements
I'm also constantly improving the editor interface and user experience as I'm working on other features.
You can now open a .map
from the file browser and it should open Trenchbroom for you if you have set up the path to the executable in your project properties.
The same goes for .sln
file if you happen to be using C# in this project. Visual studio should open right up.
Some new thumbnails for files also made their way in the file browser, more to come of course.
There is still a lot to improve, but it's coming along nicely.
Quick screenshot of the editor
Livestreaming 🔴
Recently, I started streaming when I'm working on cool features on the youtube channel. This will also serve as a way to showcase the current progress of the engine outside of the blog post.
If you want to be notified when I'm going live, I will be posting the link in the discord server. You can also subscribe to the youtube channel to get notified.
Here is the most recent one:
I'm not the best at explaining stuff...