Getting started with NoesisGUI in WaveEngine 2.4.0

In WaveEngine 2.4.0 we added support for NoesisGUI, which is a rendering engine for interfaces defined in the XAML language, most commonly known for its usage in Windows Presentation Foundation.

In this tutorial, you will learn how to add an interface designed in XAML to a WaveEngine project using NoesisGUI.

Continue reading Getting started with NoesisGUI in WaveEngine 2.4.0

New FileMesh, MaterialComponent and MeshRenderer components

In the new WaveEngine 2.4.0, the model load process has been improved, so there are some important changes that you should know when working with models.

The following components are deprecated. You will able to use them in WaveEngine 2.4.0 by retro-compatibility but they will be removed in a future release.

  • Model
  • ModelRenderer
  • MaterialsMap

These have been replaced by the following components:

  • FileMesh: This component replaces the Model component and allows loading of a single mesh inside a model.
  • MeshRenderer: This component replaces ModelRenderer drawable3D.
  • MaterialComponent: This component replaces MaterialsMap component. It is marked as “AllowMultipleInstances” so you can add multiple MaterialComponent instances to an entity.

Continue reading New FileMesh, MaterialComponent and MeshRenderer components

WaveEngine 2.3.1 to 2.4

This article is a brief guide to solving the majority of problems that you will find when you upgrade your game project from WaveEngine 2.3.1 version to 2.4.

Although WaveEngine has an upgrade tool that runs when you open an old game project with the current WaveEditor 2.4, you can find some issues listed below.

An important point to bear in mind is that Model, ModelRenderer and MaterialsMap components are deprecated, so you should begin to use FileMesh, MeshRenderer and MaterialComponent respectively. For more details, you can read the following article.

TaskSchedule

WaveEngine 2.3.1

  
WaveServices.TaskScheduler.CreateTask(preloadAction);

WaveEngine 2.4

  
WaveBackgroundTask.Run(preloadAction);

WaveEngine 2.3.1

  
WaveServices.Dispatcher.RunOnWaveThread(() =>

WaveEngine 2.4

  
WaveForegroundTask.Run(() =>

Network extension

WaveEngine 2.3.1

  
networkService.HostMessageReceived

WaveEngine 2.4

  
networkService.MessageReceivedFromClient

WaveEngine 2.3.1

  
networkService.ClientMessageReceived

WaveEngine 2.4

  
networkService.MessageReceivedFromHost

Find Entities

WaveEngine 2.3.1

  
entity.FindAllChildrenByTag("Enemies");

WaveEngine 2.4

  
entity.FindChildrenByTag("Enemies", true);

 

Using Wave Services from Visual Editor.

In WaveEngine the use of Services can be very useful when developing your applications / games. And, as you can create and register your own services you can add cross-scene and global elements that provide useful logic, like score managers,  entry points to native libraries, and much more. However, until now, Visual Editor didn’t allow you to register your own services, so you had to do that from code. That could cause problems: Creating components that use custom services could be tricky to debug in our Visual Editor, or depending on your code, it may directly provoke malfunctions in your scene.

Luckily, WaveEngine 2.40 has introduced the possibility of registering and setting up your custom services, as well as some Wave Extension services.

Continue reading Using Wave Services from Visual Editor.

Build a Simple OpenVR application

OpenVR is an API and runtime that allows access to VR hardware from multiple vendors without requiring applications to have specific knowledge of the hardware they are targeting. This repository is an SDK that contains the API and samples. The runtime is under SteamVR in Tools on Steam.

This article describes the necessary steps you should follow to build, load, and run a simple WaveEngine application on the OpenVR platform.

Continue reading Build a Simple OpenVR application

New async/await features

We have improved the async/await support in WaveEngine 2.4.0 by replacing our Dispatcher and TaskScheduler services with a custom implementation of .Net TaskScheduler and creating some useful helpers.

Porting project

The biggest change is the substitution of Dispatcher and TaskScheduler services. The new way to execute code in the foreground or background threads is by using the new helper methods from WaveForegroundTask and WaveBackgroundTask static classes.

To port current projects using the new classes, we need to change the following:

  • If you are using WaveServices.Dispatcher, you must replace it to use WaveForegroundTask.

  • If you are using WaveServices.TaskScheduler, you must replace it to use WaveBackgroundTask.

Both new ways to execute code return a .Net Task, which integrates easily with async .Net code.

Foreground and Background threads

Before we start to review the new included features, it is good to know these details:

  • When a task is executed in the Foreground thread, like with the Dispatcher service, it is executed in the next update cycle.
  • With the Background thread, the tasks are executed sequentially in a specific thread that can access the graphic resources. This allows us, for example, to load textures. The old TaskScheduler executes the code in a .Net thread and without taking concurrency issues into account when accessing the graphic context. In comparison, this new service ensures that each task is executed in the same thread and sequentially.

ConfigureWaveAwait

One useful helper introduced in the new WaveEngine version is the ConfigureWaveAwait extension method.
It allows us to configure how the await continuation is handled. Just as the .Net ConfigureAwait extension method allows us to configure if we want that the continuation of the await is executed on the captured context, the method ConfigureWaveAwait allows us to configure where the await continuation is executed: in the Foreground or the Background thread.

A simple way to test this new method is to load an image from a URL into a sprite:

The WaveTaskContinueOn enum also includes other options. The Default option acts as if the ConfigureWaveAwait has not been used, and the ThreadPool option acts as if the ConfigureAwait(false) from .Net has been used.

Async/await and GameActions

With the inclusion of GameActions, WaveEngine has acquired an excellent way to define a flow of actions that is integrated perfectly with the common scenarios in a game (like animations, play sounds, wait for a condition, etc.).

In this release, we have included the AsTask extension method that simplifies the way that .Net Tasks and GameAction interact with each other.

A simple sample using all of these new features:

I hope you find it useful when you want to use async code in your game. It is the first step and we will work to include new async APIs and features in next releases.

NinePatch native support

WaveEngine 2.4.0 includes official native support for NinePatch textures (also known as 9-slice). To know more about what that kind of textures is, read our previous post about it.

As this version allows you to add textures and mark them as “NinePatchType: FromTexture”. This option will be automatically selected if your texture has the extension “*.9.png”.

When this mode is selected, the exporter will extract the stretch and content regions from the texture and remove them from the final asset. Keep it in mind if you need power of two textures (e.g., if your final texture must be 256×256, the source image size must be 258×258)

Continue reading NinePatch native support

New OpenGL adapter on Windows

In WaveEngine 2.3.1 we have added a new adapter on Windows for OpenGL, this allows WaveEngine developers to run their games using DirectX and OpenGL on Windows. This will be really handy to adapt their assets (like shaders or textures) faster to our OpenGL platforms (Linux, MacOS, iOS and Android).

Continue reading New OpenGL adapter on Windows