Ragnar Engine

This is a videogame engine, created with the purpose of making videogames and also improve as programmers

Download as .zip Download as .tar.gz View on GitHub

Ragnar Engine

Ragnar Engine is a Video Game Engine created by Lucas Pérez and Oriol Bernal. Two students from the university Universitat Politècnica de Catalunya (CITM).

The purpose of this project is to create a friendly-user, well optimized Game Engine for the subject “VideoGame Engines” from the 3rd year. The short term plan is to implement the basic features of a Game Engine, such as loading models, working in a 3D environment, etc… For the long term, we would love to create a game with this Video Game Engine

Team Members

Core subsystem (Audio)

We had to implement the Audio core subsystem with WWise. The main objective was to be able to play sounds/musics, etc… in our game engine, aswell as creating some reverb zone and some audio settings, like pitch, volume… Also, another objective from this subsystem was to properly learn how WWise API works.

Audio in depth

The audio subsystem had three main goals:

- Two background music that could blend between each other in a loop:

We did this by basically controlling both the music options in WWise. WWise has many functionalities, including one that lets you create playlist for your sounds, so it’s as easy as creating a sequence and telling Wwise how to play them and in which order. When you do this, as soon as you play the music in the engine, the functions from Wwise have the information on how to play them and in which order.

- Spatial audio:

The main goal of this objective was to be able to listen the sound effects/music depending on the listener´s position. This is also done easily by the WWise API, but you have to do some code aswell. In the WWise API you have to go to the “Positioning” tab and check the 3D Spatialization aswell as the Attenuation. With this options, WWise knows how to play the music depending on the listener´s position. But this is not it, you have to go to the source code and implement a position and orientation for the listener, so WWise knows how to calculate the distance. We did this with a simple function that asks for 2 parameters: the UUID from the gameobject and it´s position. Once you call the function correctly, WWise will register the gameobject’s position and will know how to treat it.

- Special effect (Reverb):

The assignment asked for a tunnel effect in some area of the game. This was very difficult because there’s not a lot of information on the subject. To create this effect, we had to go to the WWise API and create two different busses, one for the normal audio, and another audio bus that contains an effect called “WiseRoomReverb” which simulates a tunnel sound with echo. The trick is that you need to swap the bus via code depending on the listener’s current position. For this, we created a class called AudioReverbZone which creates an AABB simulating a collider zone, when the listener enters this zone, we call our audio singleton to use a function which is called CheckReverbGameObject(). This function loops between all reverb zones to check if the listener is inside any of the colliders from the reverb zones. If the listener is inside, we swap the busses from the audio to the one with the reverb effect.

- Extra Functionalities:

We added some extra functionalities so it’s not a pain to use the audio, this functionalities include:

Video demonstration

This video demonstrates how the Audio System works, and it’s utilities.

License

MIT License

Copyright (c) 2021 Oriol Bernal Martinez & Lucas Perez Garcia

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.