This update we continue down the path of gameplay implementation with cameras and audio systems! We’ve brought about lots of new features once again as well as various improvements to the editor, rendering pipeline, waypoints and a complete overhaul of the particle system (with a brand new particle editor)! This update marks a significant entry into Bright Engine’s development timeline, as it is now possible to test your game in the editor!
If you are interested in Bright Engine and want to snag up a free copy you are welcome to join the Discord community Ask questions to existing testers, get real time development progress updates or even download the engine to try it out for yourself!
Let's start these patch notes with something fancy: Particles! The particle system originally got its re-work back in version v012a which introduced a timeline editor as well as lots of other fancy settings. However, while the editor improved, the particles themselves were rather problematic, for example, there was no real control over how many particles spawned at one time, while making performance take a nosedive after only about 1000 particles being alive. So once again, particles got another re-work, except this time we completely ripped out the old system and wrote it from scratch including the particle editor!
The new design is consistent with the design of the editor itself, to make it more user friendly and it’s a lot more responsive! The graphical timeline editors are no longer restricted to a maximum of 10 nodes, color settings can be set on a gradient rather than a start and end point, and some brand new orbital movement settings. Gravity has now got a strength modifier to create some really weird behaviour, and you now have complete control over how particles spawn.
Performance is also something that caused a lot of headaches in the past and its significantly improved… a lot. With the original particle system, it would tend to drop fps with around 1000 particles in the scene and around 12,000 particles the fps would be less than 10 (and that's on a Nvidia GTX1070)! Thankfully this is no longer the case, and while we are far from finished with the optimisations they are a significant improvement with support for up to 350,000 particles compared to the original 12,000!
As a final note on particles, many members of the community complained that emitters couldn’t be rotated in the World Editor, so now they can and it works like a charm!
Next on the new feature list is Audio systems! You can now place audio areas throughout your zones, which act as sound emitters for both 2D and 3D sound or music! There is all the expected basic settings, such as volume panning, playback speed as well as completely control over the attenuation effect for 3D sound sources! In addition, the engine also takes into consideration both the velocity of the camera and the velocity of the audio area (if they are following a path, we’ll come to this a little later) to simulate a physically accurate Doppler Effect!
We are far from finished with Audio systems with plenty more to go. The groundwork for environmental effects is already in place and will be finished for the next update. This means you’ll be able to apply effects such as reverb or echo to your audio sources depending on your environment. An example of this would be the sound of a characters footsteps beginning to echo as they enter a cave.
The next two additions to the engine are a bit more complex and need some explaining. Camera Objects and Target Objects. Out of the two cameras is the most self explanatory. You can now place cameras throughout your zones which allow you to see the world through the eyes of the cameras themselves. There is support for both orthographic and perspective cameras (2D and 3D) as well as control over the basics, such as field of view and frustum width & height.
In addition, it's also possible to preview the camera’s viewpoint of the world, without having to set up any fancy scripts to run in game, with just the click of a button.
Target objects on the other hand needs further explanation, but hopefully we can show you just how powerful and useful these new objects are!
Target Objects are essentially invisible points in your game which store a position vector. That's it. But other objects can use that information to create some impressive results! For example, a camera can lock onto a specific target within the zone, and that target can be attached to a moving object, or in other words: Object Tracking! Another possible use would be moving objects uniformly along a path. You could just assign each object to a path, but if working with lots of objects this is rather inefficient since you are performing the movement calculation lots of times. Instead, use a Target. Assign each object to the Target, and then the Target to the path, you’ll get your objects moving, but only be performing the movement calculation once!
Hopefully these examples have helped explain the targets usefulness, and versatility, for both cut scenes as well as general application through your game!
As a final entry to the new features portion of these patch notes, we’d like to make an announcement. In-Editor Game Testing, is now possible! With the introduction of cameras, it's now possible to enter your game by specifying a primary camera. This just means setting up a camera, which will be used when the zone is loaded when playing. This could be a still camera in the world, a camera following a path, or a camera attached to a character model like you’d expect in most 3rd person RPG games.
It is worth noting, that once in-game, currently its not possible to do anything, since no scripting system is currently in place. But all the groundwork is set up so once scripting makes its entry (which is getting closer to the top of the to do list), it's only going to be only a short wait before controls and interactions within your world will be possible!
The shape of the paths can be determined by the user, with the options between Linear straight lines, great for mechanical movements for something like a robot, and Bezier which gives a more natural smooth movement which humans or cameras tend to follow!
Changes & Improvements
We’ve already mentioned paths a few times so far, so let's talk about what has changed with Waypoints. Waypoints were first introduced last update, and while the core of the code was in place, only lights could make use of them. Well not anymore, because now in addition to Lights, Models, Emitters, Audio, Targets and Cameras can be attached to a path.
We’ve also introduced some additional features which, when enabled, allow you to edit the rotation of an object following a path such that it inherits the rotational information of the nodes along the path.
To expand it even further, the rotation change can be interpolated, resulting in a more natural turn rather than a snapping turn. This coincidentally, made us stumble across a more efficient method of interpolating between two positions along a path improving performance at the same time.
The 3D cursor also got some action, in the last version, when an object was moving along a path, it pretty much did nothing, whereas now it allow you to editor the object’s offset values.
Some additional attention was given to the engine renderer, both visually and mechanically. 3D Models were the first to get some attention, starting with a complete overhaul of the Instancing system. Turns out we made some major mistakes in the original design (and frankly we’re amazed it even worked at all!). However, those mistakes have been corrected, and the result is… drumroll ... exactly the same! From a visual standpoint nothing has changed, but under the hood, things are running like a well oiled machine, as opposed to a rust bucket like before. Draw call time was cut, resulting in higher performance and it brought the end to some really weird bugs that would cause random crashes!
In addition, the clipping algorithms used in SSAO and Shadow passes were touched up to reduce calculation time, and about 12 redundant modelMatrix calculations were removed. After jumping into our barrel stress test scene, we found that overall performance hasn’t gone up that much, but a lot of messy and inefficient code was wiped out so that's a win for us none-the-less!
Textures were next to get some TLC. For a while now, textures, when rendered, seemed to constantly be blurry especially on terrain when looking at it from steep angles. We’ve finally put an end to it by introducing two new methods: Trilinear Interpolation and Anisotropic Filtering!
We also did a bit of work on the Bloom post processing effect. A common complaint among testers, is the slow performance of bloom on older machines, so we have added a brand new Kernel Blur method. Its results are very similar to the original Gaussian Blur method however significantly faster! In addition we’ve added some new falloff setting which allow a subtle gradient fade effect between surfaces which should be bloomified and surfaces that should not. The end result is a much nicer and realistic surface glow when powerful light is reflected off it.
- Fixed bug where attempting to change a material texture of a model that has just been placed caused a crash.
- Fixed bug where changing a texture in a material to another texture already in the material and then switching back to the original texture wouldn't update on the second time around (this was a weird one to say the least)
- Fixed bug where shadows from a light source moving along a path did not update correctly
- Fixed bug where the camera would stop working after changing a Filter during Object Placement unless another placement setting was changed
- Fixed bug where the hierarchy icons for Waypoints were incorrect
- Fixed bug where Groups were being loaded incorrectly and sometimes caused a crash
- Fixed bug where settings for Texture Quality wasn't being loaded correctly on Engine restart
- Fixed bug where settings for Grid Scale wasn't being loaded correctly on Engine restart
- Fixed bug where settings for rendering waypoints in the viewport wasn't being loaded correctly on Engine restart
- Fixed bug where using the picking tool for a waypoint would sometimes cause a crash
- Fixed bug where the Align to Ground tool did not work unless Grid movement was enabled
- Fixed bug where texture filtering wasn't being applied correctly, resulting in incorrect mipmap interpolation
- Fixed bug where the projection Matrix was being calculated four times per frame instead of just once
- Fixed bug where the view Matrix was being calculated eight times per frame instead of just once
- Fixed bug where an object moved using the Drag tool would not save changes if no other setting on that object was changed
- Fixed bug where hiding waypoint objects within the scene also caused Emitters to be hidden
- Fixed bug where removing the last instance of a 3D model would cause a crash
- Fixed bug where a false warning would output when selecting a 3D model in a project without any Animation Sets
- Fixed bug where a false warning would output when selecting a 3D model in a project without any Animation Sequences
- Fixed bug which sometimes caused random crashes when performing a transformation on a waypoint
- Fixed bug where generated thumbnails for terrain textures were not being resized resulting in large file sizes and wasting memory
- Fixed bug where placing an object in the scene while having terrain selected caused the placement to fail and the UI to disappear sometimes causing a crash
- Fixed bug where SSAO was being incorrectly rendered on terrain objects due to a mis-calculation in the Clipping planes
- Fixed bug where animated models were not interacting with light sources creating incorrect rendering results
- Fixed bug where reloading a scene after adding duplicate models would cause a crash
- Fixed bug where SSAO and shadows were not being calculated on duplicated models until after you selected them
Now that we enter our final chapter of this update series, it's time to put the new features on hold and fix up a lot of things which have been put off for too long. Improvements to terrain, shadows, animated models and alpha blending are on their way, along with the final stage of Waypoint integration, Environmental Audio Effects, and the long anticipated Undo system!