Jordan Bonser
  • Home
  • CV
  • University Work
    • Second Year Work >
      • Top-Down Shooter
    • Third Year Work >
      • Terrain Analysis Project >
        • Terrain Analysis Tool
        • Game Demonstration
      • Post Processing
      • Android Application - Sports Centre
  • Projects
    • Unity Development >
      • Lerpz Tutorial
      • Dare to be Digital Entry - "Lit"
      • Unity Game
    • Geometry Instancing
    • Road to Eldorado
    • Level Editor
    • OpenGL Work
    • JBEngine
  • Blog
  • Tutorials
    • Flask Session Timeout

Development Blog

XML Parsing: Asset Loading

28/1/2014

0 Comments

 
The past few days I have been finishing up some of the extra functionality for the GUI and fixing a few bugs. After doing this I decided it was time to make my engine a lot more data driven and decided to allow for the parsing of XML to load the assets such as Meshes, Animation Data, Sounds and Textures. 

This luckily didn't take much work as I had already created generic classes for parsing XML in a previous project( Another Win for reusable code! ). 

So now Instead of having a couple hundred lines of code for importing the assets for the engine I now have two lines:


ParseAssets parser( mEngine );
parser.ParseFile( "Assets.xml" );

With a tidy XML document that looks a little like this:
Picture
There are still plenty of adjustments to make and I'm hoping that even more of the engine can be loaded using XML, such as:
  • All Game Entities with positioning
  • GUI Layouts
  • Engine Settings i.e. Resolution/Shader Detail/Shadows Toggle

One massive advantage to this way of loading is the most obvious in that the code is a lot less cluttered but it also means that you don't need to recompile when you only want to tweak game specific values; further than that it means that you can load radically different levels/assets that you may need for testing without having to change any source code. 

Cheers :)
0 Comments

JBEngine: GUI Progression

24/1/2014

0 Comments

 
I have been working solely on the GUI aspect of my work for a while and have now come up with what is hopefully close to a final implementation. I've had to deal with issues to do with working in different spaces. i.e. converting from Mouse Co-ordinates and manipulating texture co-ordinates to finally get the final image in clip space co-ordinates. It has been tough and taken a few iterations to get it all right. 

I finally have a semi-finished example showing the use of GUI Buttons, Layovers and Text:

One of the more difficult decisions I made was deciding how to do the events for the GUI elements such as OnClickEvent. After doing some searching around I settled on using a C++ 11 feature the std::function. The important aspect of this feature is that it allows you to store a reference to a member function. Here is an example of how it is used: 
 //Create a function object for member function for this instance 
function<void()> myOnClickFnc = bind( &MyClass::FunctionName, this );
//Then Set the OnClickFunction for my GuiElement
button->SetOnClickEvent( myOnClickFnc );
The main advantage of this is that it is now fairly easy for any class to set their own member functions to work as the event function for an element and it is much safer than using normal function pointers. The std::function does still work for normal functions and also static class functions, the only difference is that you wouldn't need to use the "bind()" function. so it would simply be:
 //Create a function object for static class function
function<void()> myOnClickFnc = &MyStaticClass::FunctionName;
or:
 //Create a function object for function 
function<void()> myOnClickFnc = &functionName;
//Then Set the OnClickFunction for my GuiElement
button->SetOnClickEvent( myOnClickFnc );
I have read online that this new feature can be quite slow although at the moment I haven't noticed any performance issues and as a general rule a GUI isn't as performance critical as other parts of a game.

This project is really coming along and I am now looking to tidy up some bits and really design how the "Engine" will be exposed to the user.

Keep coding :)
0 Comments

Font Rendering (Minimal) Implementation

14/1/2014

0 Comments

 
I have started working on the font rendering functionality and it all seems to be going well. I currently have it rendering a simple "Hello World" sample. This is very much hard coded at this moment in time as I haven't added the font loading functionality properly, it is simply using UV co-ordinates from the font texture that I have loaded.

Here is the basic method I have used to show each letter on screen: 

I use a quad with vertices from 0,0 to 1,1 with matching texture co-ordinates. This way I only have one quad for every font and every letter. Simply by altering some uniforms in the shader I can adjust exactly which letter is drawn where and what size.

This is a big performance boost as I've seen examples that either:

1) require you to have a different texture for each letter. 

2) require you to change the texture co-ordinates in the vertex buffer data.

Anyway here is what the text currently looks like:
Picture
As you can see there are still some issues, the blending for example needs sorting, as the surrounding area of the letter should be transparent. 

There is also a lot of refactoring that needs to be done to make this as flexible as possible. I should just be able to supply a string and that be rendered to the screen wherever I want and which ever size I want.

When I have got this finished off I will post the full process that I have used to calculate the texture co-ordinates and the screen placement.

It's getting there :)
0 Comments

Animation Blending Design

12/1/2014

0 Comments

 
I have finally implemented the design for the Animation blending, along with bone masking and animation fading. It has taken a while to get it all straight in my head, I also fixed some small bugs with the current animation loading/playing. 

This new design has an "Animation Blend Group" associated with ever Mesh Instance. Animation Instances are added to the Animation Blend Group and each cycle the Blend Group goes through all of its Animation Instances and calculates the Final Pose from this. 

To achieve the bone masking there are now some extra optional data that you can supple to the loading of a model. This allows you to apply bone weight to a specific bone in a specific animation. 

The animation fading can also be specified on load but in the future I would like to be able to change this so that you can change the fade in and out values per animation instance. 

Okay so I've talked about it, now here is the outcome: 

There are still a few alterations that could be made to the bone weights and the fading in/out values to make the blending more realistic. I think this has been a good starting point as this model is not one that I can alter, forcing me to make the code as flexible as I can to alter the animation data. 

The next step really is to create my own models that I can use for the game, although I am still lacking in the 3D modelling department and it may take me a while. 

As an added note I will soon be working on Font Rendering to progress the development of the GUI for my engine. This will then give me a chance to create a small executable for testing out different bone weights and fade in/out values. 

Progressing well, 
Keep coding :)
0 Comments

And then there was sound... FMOD Ex

6/1/2014

0 Comments

 
I wanted to take a break from implementing the design for weight blended animations and so I thought I would take this opportunity to implement sound into the JBEngine. 

I had written some classes for the FMOD libraries for a previous project so luckily this was fairly "low hanging fruit". It was literally a case of copying the classes across and then including the libraries and away we go. I did add some debug logging to make sure that any problems would be supported. Anyway here is a quick demo of the sound implemented for the racquet swing in the squash game:

This is only a very simple demo to show a real game example of how the sounds are going to be used. This video does highlight some issues with the shadow mapping that wasn't there before so that will need looking at. 

I need to refactor some of the sound code to ensure it follows the same coding standards as the rest of the project and some testing to ensure no bugs have crept in.

All in all this little task went well and takes the project into the realms of an Audio/Visual Project. I do need to now get back to working on the design for animation blending otherwise it will never get done.

Cheers :)
0 Comments

    Archives

    May 2020
    April 2020
    January 2020
    November 2019
    October 2019
    September 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    August 2018
    July 2018
    June 2018
    March 2018
    January 2018
    June 2017
    February 2017
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    February 2016
    January 2016
    December 2015
    November 2015
    September 2015
    August 2015
    July 2015
    June 2015
    March 2015
    January 2015
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014
    May 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    February 2013
    January 2013
    December 2012
    October 2012
    September 2012
    August 2012
    July 2012
    June 2012
    May 2012

    Categories

    All
    2D
    3rd Year Project
    Agile
    Android
    Angular
    Animation
    API
    Apple
    Apps
    Arden
    Async
    Awesomium
    C#
    CI/CD
    Clean Code
    CMake
    Cocos2d-x
    Colour Match
    Compilers
    Cross Compiling
    Cross-Compiling
    Databases
    Design
    Development Tools
    Docker
    Electronics
    Examples
    Flask
    Flask-Login
    Fmod
    Game Development
    Godot
    GUI
    Hackathon
    Hacktoberfest
    Hardware
    Home Life
    IBM
    Inspired Gaming
    Instancing
    Ios
    Javascript
    Jbengine
    Kata
    Level Editor
    Linux
    Microsoft
    Mobile Development
    Monogame
    Moodster
    Motivation
    Networking
    Objective C
    Opengl
    Open Source
    Organisation
    Physics
    Physx
    Pi
    Planning
    Post Mortem
    PyGame
    Python
    Quart
    Quasar
    RakNet
    React
    Road To Eldoarado
    Scripting
    Scrum Master
    Sessions
    Session Timeout
    Social
    Sound
    Space Invaders
    Squash Game
    Squash Game
    Streaming
    TDD
    Team Leading
    Test
    Test Driven Development
    Travis
    Unity
    Unity Development
    VSCode
    Vulkan
    Web Applications
    Worklife
    WSL
    XML
    XNA / C#

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • Home
  • CV
  • University Work
    • Second Year Work >
      • Top-Down Shooter
    • Third Year Work >
      • Terrain Analysis Project >
        • Terrain Analysis Tool
        • Game Demonstration
      • Post Processing
      • Android Application - Sports Centre
  • Projects
    • Unity Development >
      • Lerpz Tutorial
      • Dare to be Digital Entry - "Lit"
      • Unity Game
    • Geometry Instancing
    • Road to Eldorado
    • Level Editor
    • OpenGL Work
    • JBEngine
  • Blog
  • Tutorials
    • Flask Session Timeout