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

OpenGL Vulkan and What to expect this year...

16/2/2016

0 Comments

 
So Vulkan was released today! What better reason to do a blog post, when it's been so highly anticipated for so long. I can't wait to get stuck into the API and Reference documents and start trying to throw some tech demo's together. 

I have just got hold of the SDK and had a little play around with the Demo's, I've not managed to get much done but the whole thing does look much more "DirectXy" which will likely have it's good and bad points. for example the horrendously long class/struct names. I've already seen "VkPipelineInputAssemblyStateCreateInfo" as a name and I'm sure there will be plenty longer. It will obviously have it's benefits in terms of performance but I'm not sure we will really experience that for a while. Anyway here is a quick video of me after messing with the textures a little with the cube demo:
As you can see it all looks a little messed up. The cube is spinning incredibly slow as well as I don't think it uses delta time for the rotation, so the recording application almost halted the rotation. What can you expect from a half hour mess around?

So what will I be doing this year?

It's been a while since my 2015 post-mortem and I really wanted to point out some of the things I will be concentrating on this year. I have just fully moved in to my new flat with Meg in Blackpool so that is the reason I haven't done any real work or blogged for a while. 

So this year my main focus is going to be on:
  • Getting my Space Invaders game finished off, and I mean fully polished!
  • Developing my skills in Blender.
  • Slowly making parts of the JBEngine OpenSource.
  • Trying to contribute much more to the OpenSource Community.
  • Getting stuck in to Vulkan, hopefully integrating it with the JBEngine at some point.
  • Making the JBEngine Cross Platform.
So far I've not done so well on these goals other than the last two. You can't really call a 30 minute play with the demo's "Getting stuck in" though. I have been working on getting the Maths and Sound libraries of the JBEngine to compile for linux. I started using CMake last Saturday and I really feel like I was getting somewhere. I am going to set myself a target of getting those two libraries working for Linux, and OSX in the next week or so which shouldn't be too difficult. 

Anyway that's pretty much it, oh and I did do some work with blender over the past month so here is some dev art to laugh at:
Picture
It's supposed to be a Starfish, in case you were wondering. 

​Cheers :)
0 Comments

JBEngine: Space Invaders AI Movement Speed and a few bug fixes

5/12/2015

0 Comments

 
Okay so first thing I got to work doing recently is implementing the AI Movement Speed. These utilise the Speed Component that the Enemy and the Player already has but in the AI Movement System the code now uses a timer to increase the speed of the enemies. Initially the speed ups only occur after a few seconds but the timer gets smaller so the speed increases become more frequent. 

The next thing I worked on was a few bug fixes. The player was being deleted when going to the next level. If you clicked "Esc" when waiting for the next level or when you were respawning it would crash the game out. These were easy enough fixes but the last one was a biggee and was actually still there in this video: 
So as you can see the game is coming along nicely, I changed the skybox stars texture to a much nicer one that you can see here. 

The big bug that I managed to catch out was an optimisation problem. My FPS had dropped to ~40 all the time. At first I thought It was something to do with the Entity Component System as it seemed to show up most when profiling, this then caused me to make some changes to use more efficient containers. It turned out it was actually the awesomium texture updates. I was updating the scores and lives every update. This causes a re-draw of the whole html page which is very slow! 

I managed to catch it and my FPS is way back up again now so all is well. 

Oh as an added note I downloaded blender tonight so I will be getting to work on the defence posts soon. 

Cheers :)
0 Comments

Space Invaders: Enemy Movement 

27/8/2015

0 Comments

 
I've slacked off on development over the past week or so whilst I was playing H1Z1 and trying out my new GFX Card. 

I have managed to get the enemy movement working. It is very simple for the Space Invaders game and I did have the opportunity here to try and make it really generic but I decided against it to try and just complete exactly what needs doing for this game. Otherwise I end up getting bogged down with the design. 

Anyway here is a little sneak peek:
At the moment the drop down and change in direction is triggered by a timer but in the final version and once I have the physics implemented it will be based on collision messages from the wall. 

I am really pleased with progress. The next part might be a little complex as I haven't touched any of the physics code for a long time. 

I also might install blender and have a go at creating some models to get my self a little better before creating the final pieces for this game. 

Thanks :)
0 Comments

ECS Parsing and beginning of Space Invaders

19/8/2015

0 Comments

 
So last time I wanted to focus on getting the Systems working via import/export. I have managed to do this now although It doesn't work in the same way as the components. 

Systems can only be ran once by the engine and entities apply to be acted upon by them. Even though the code allows you to do "entity->AddSystem<RenderSystem>()" what it is actually doing is just adding the list of entities that will be processed by the render system. 

After doing all this and basically getting the ECS in a state where I could start adding the components that were in the level editor I decided to stop. Instead of adding all the old components I am going to steer clear of the level editor for a while and instead focus on a small game. One that wouldn't even need a level editor.

Enter Space Invaders...

Space Invaders

So I've decided to remake the classic arcade game but in 3D. The functionality will be very similar to what the original was (unless I decide I prefer something else). You will still be able to play it in the same view style as well i.e. Top Down. Alternatively you will be able to play it in a first person mode as well.

Anyway that's the basic idea here is what I have so far:
It's really not that impressive and creating functionality it a little bit tedious at the moment as I'm having to create loads of classes for the components and systems. Once I have written these I will be able to reuse them for games in the future I hope.

All is going well... Oh on another note I bought a new nVidia Geforce 970 gtx and have just installed it so I may get distracted by shiny new games. 

Cheers :)
0 Comments

Level Editor: Input Refactoring & Awesomium Integration

11/9/2014

0 Comments

 
Over this past week or so I have been getting used to using the Awesomium Library. I hit a performance issue fairly early on but that was soon resolved and the webpages now render very efficiently. I was pretty amazed to see how well it actually works and I definitely think this is the way that the majority of my User Interfaces will be done from now on, including HUD's. The input to the awesomium library is done as input injections, such as MouseMove, MouseButtonDown. This got me thinking a lot about how my input actually worked and I decided to refactor it a little.

Input Refactoring

As a general rule there are two approaches to handling input: Polling and Callbacks. So far in my engine I have been using polling. Whenever an object needed to check for some input it would read something like: 

if( input->GetButton( JB_ENTER_KEY ) == JB_PRESS )

This approach worked and for a long time it was sufficient, but to provide Awesomium with the information it needed I would have to call this every frame for every possible button and that was not realistic. 

I have now implemented a callback based approach which allows different objects to listen for the key presses and mouse movements it is interested in.

For example at the moment I have an "Input Context" that listens for all the keys and mouse movements and the callbacks report to Awesomium about it. 

Another Input context is used for the Level Editor movement and only listens for the WASD buttons and allows the camera to move about when it's callbacks are called.

This approach makes this much simpler and I'm hoping I won't ever have to touch the inner workings of the input again. One thing that could change is adding some input mapping so that different keys could be used for the input i.e. use Up, Down, Left and Right instead of WASD for movement. 

Awesomium Integration

The integration between the JavaScript and the C++ side is seamless and didn't take too long to get up and running. Currently I have callbacks from the JavaScript into C++ but I haven't fully tested opposite approach quite yet, although it seems fairly simple. 

Anyway here is a quick demo of a User Interface I setup for the Level Editor, it doesn't actually show off any of the callbacks in this video but I will soon be showing a fully integrated version:
Okay so this all seems to work well and I'm thinking there has go to be a catch at some point but let's hope I'm wrong. It's really surprised me how little information there is on other people using Awesomium in native applications. I believe this is much better than using any other User Interface Library, even if the performance isn't quite as good as a C++ Library would be. 

I think the largest advantage is the ability to create User interfaces on any computer, currently the engine doesn't work for Mac OSX but I sat there the other day on my MacBook and bashed out this user interface. This also means that when it comes to releasing a game you already allow the users to mod the user interface in which ever way they want. All they would need to do is call the appropriate methods on the JavaScript Object for the engine. 

That is it from me today, I'm hoping to get much more work done over the next week or so to finally get this level editor user interface polished off, and also refactor the design for this Awesomium work.
0 Comments

JBEngine: Awesomium User Interface and Artwork progress

1/9/2014

0 Comments

 
This past couple of weeks I've been playing around with 3ds max a little more and working on creating animations. Using these animations I realised that my engine can't handle FBX files very well, and in fact the example Model Viewer I got couldn't either. This meant going back to the drawing board and figuring out why FBX animations weren't working. I soon narrowed it down that the use of FBX and the 
biped objects in 3DS Max were making it really difficult to import into certain pieces of software. Due to this I am not resorting back to using Collada as my main import type as it is the most standardised and it will work for animations as long as I don't use the biped. 

This has caused a lot of frustrating as now I am having to create all my bones and animations by hand, in the long run I think It might be slightly easier as the biped can't really do everything I need it to.

Awesomium

I found a piece of middleware called Coherent UI which allows the use of HTML webpages to display GUI's in games and other native applications. This seemed really powerful and from the look of their website appeared to do everything I wanted it to do. The only issue is that their licenses were a bit limited for what I needed it for. I realised afterwards how useful this middleware would be to me as I would then not need to create all the GUI elements for the engine and would increase productivity rapidly, so I went on the lookout for a similar library which i could use. This is when I stumbled upon Awesomium. It also allows application to take a webpage and render it to a texture, more than this you can interact fully with it using JavaScript for callbacks to C++ functions. 

I have been playing with Awesomium over the past week and have managed to get something up and running, rendering the google homepage and allowing some interaction with it. There is still plenty more to be done and it does seem that there is a large performace issue with it at the moment. I believe this is due to the texture being overwritten almost every frame and then uploaded to the graphic card again, although I am yet to profile it. 

If i can manage to get these performance issues out the way I will proceed further with it and hopefully be able to throw together a new UI for the game and also the level editor. This will give so much flexibility and also the ability for users to mod the game. they can simply create their own UI by overwriting the current webpage with whatever they would like to display. 

Plenty to be looking forward to and I will hopefully have a demo usage of the awesomium up soon. 

Thanks 
:)
0 Comments

JBEngine: Level Editor Export, Artwork and Library updates

18/8/2014

0 Comments

 
Okay so I really haven't managed to get much done in terms of coding but I have learnt quite a bit that will hopefully be very useful.

Okay so I started off by creating the Export part of the Level Editor which means I now have a full pipeline for level production, I can create assets, place them in the scene and then save them to an XML file. This XML file can then be either imported into the Level Editor again for further work or can be used in the game. 

Artwork

I have been getting used to using 3DS Max and I have become much more efficient with it, learning to model and texture objects. I have also learnt to use the biped tools to create simple walk and jump animations. 

This is when I ran into some troubles as when I exported my model to collada I couldn't get the animations to export properly. I initially thoguht this was an issue with my engine but as I tested the animation in two other assimp featured model viewers I decided it was an issue with the file format. 

To combat this I decided to try and export the model as an .FBX which worked with the modelling programs. .FBX is only supported in the newer version of the assimp library that I didn't have at the time so it was time to update the library.

Updating the Assimp Library

Okay so I set off downloading the newest version of the assimp library. The first time I compiled assimp it came with a setup visual studio solution so I simply had to compile the program and it would create all the files for me. 

Since then they have decided to go for a CMake alternative as it is the most cross platform approach and I'm guessing take the least work on their part. 

I had never used CMake before and was a bit worried about using it as it all seemed overly confusing. After reading up a bit on the internet about Make Files and how to use CMake I finally managed to get the assimp library to compile. 

It was actually not as difficult as it first seemed and I will will more than likely use it many times again with other libraries that I need to update. 

As a final note I still haven't got the character to display properly as there is an issue with how the bones are setup in the engine. I know this file format does work as it has worked with the model viewer so I will just need to do a little more debugging to figure out what is going on. 

I really need to get something demoable very shortly as this is making me lose motivation some what. Once I have my character model in and walking round I will feel much better. 

Cheers :)
0 Comments

JBEngine: Level Editor Initial Development

19/7/2014

0 Comments

 
Okay It's been a while since my last post and I have been slowly working my way through creating some of the initial GUI Elements for my Level Editor, and eventually the game. 

I have just added a checkbox class and an Editbox class that will allow the user to enter data. As a starting point these really are the only two extra elements I need. The editboxes are needed to allow the user to edit things like, Entity Name, position, scale and rotation and obviously the checkboxes are great for turning things on and off. 

Anyway enough of my ramblings, here is a short demo of some of the functionality of the Level Editor:
So the video is pretty minimal at the moment but even now this is going to make life much easier than editing values in an XML file to add objects to the scene. 

Next steps are:
  • Allow the user to specify an object to place in the scene
  • adjust rotation and scale as well ( fairly low hanging fruit )
  • start work on the XML exporter
  • Add extra GUI Elements( Dropdown list and Listbox with scroll bar )

I definitely need to get started on the XML exporter, although it shouldn't be too difficult it will be a time consuming thing to get right. I already have a specific format of how the file should look, due to having to write the importer so I want to get that nailed as soon as.

The other bits and pieces are just general improvements to the Level Editor which will be implemented over time. I really want to keep this level editor as minimal as possible so I'm having to assess each of the functionality I want to add and think about whether I really need it.

Happy with Development at the moment,
just need to keep motivation high!

0 Comments

JBEngine: Housekeeping 

29/6/2014

0 Comments

 
Recently I have been looking at the overall design of my game/engine and decided it needed a bit more housekeeping to ensure that there is a good level of abstraction so I can replace or rip parts out if I ever need to. A while back I managed to create two seperate libraries for Sound and Networking, meaning that those two could be used within any other project fairly easily.

This time round I'm having a look at seperating out all the rendering code into it's own library which is a little bit more difficult as it is a much larger portion of the codebase.  Whilst doing this I realised that the rendering code and also parts of the engine code both rely on some of the maths classes that I've created so I decided to seperate that out as well and have both libraries depend on the Maths Library. 

After some thought I cracked on with doing the housekeeping and started by splitting the GUI parts of the rendering from the normal scene rendering as the GUI part will eventually be going into it's own library. For now the GUI parts are staying as part of the Engine as I didn't want to try and do too much at once. This new Renderer Library is now complete along with the Maths Library. 

In total I now have these libraries as part of my visual studio solution:
  • JBEngine
  • Networking
  • Sound
  • Renderer
  • Maths

The next part I need to do is to take out any application specific code that I have put in the JBEngine project. This will allow me to compile the JBEngine as a library and use it as part of a new project which will either be the game or the level editor or any other application I want to use it for.

All is going well just need to crack on with these few bits and I will feel loads better about the whole design of the engine...
Keep Coding :) 
0 Comments

JBEngine: Demo Functionality and Physics

21/5/2014

0 Comments

 
I have just been working on a couple of bugs with my networking that have been annoying me, particularly the camera and player model becoming out of sync and also the spells were being fired in the wrong direction. I have now fixed both of these issues and I can now seamlessly fly around my demo level shooting spells, which is a relief.

Next week me and a colleague are going to demo some of the functionality that has been added to our projects. We have been doing this every so often as I think this keeps motivation quite high and can spark some interesting discussions about implementations. For this demo I want to be able to have two clients connected to a game, flying around damaging each other with spells. This does seem quite achievable but It means I will need to put some extra work into the physics integration in my engine.  

Physics so far...

Currently the physics implementation is fairly minimal, allowing for collisions to be resolved and callbacks to be triggered for the two entities involved. I want to go much further than this and allow the new bounds functionality to be used for the physics shapes. I also want to allow the change of certain properties like restitution and friction for each physics object.

Currently the physics code is not being sent across the network which is also something that will need to be resolved. each client will still need to do some sort of collision resolution to keep the game looking smooth, but the server will once again need to have the overall say so this will be a challenge. 

I'm excited to get this demo up and running :) 
0 Comments

JBEngine: Bounding Box Rendering

15/5/2014

0 Comments

 
Just an update, I've recently added Bounding Box Rendering to my project. I have added an extra few classes including, Bounds and the Bounding Box class. The bounds holds the AABB (axis aligned bounding box ) and also spherical bounds. The Bounding Box Class stores a Cube that corresponds to the bounds of any loaded mesh. 

Currently the Bounding Box Class doesn't give axis aligned bounding box, instead it takes the meshes original AABB and transforms that with the world matrix of the mesh instance to create a bounding box that surrounds the mesh instance. For me to support AABB for each mesh instance I would need to recreate the AABB each frame which at the moment I don't really need. This is just as a visualisation technique for what will be my level editor and also to create simple representations of a mesh for the physics. 

In the future I will want to provide AABB's as it will be useful especially for things such as quad trees, but that is quite a while off yet. 

Things are moving forward, need to do some housekeeping of my rendering code and also crack on with GUI advancements and also Network debugging.

Cheers :)
0 Comments

JBEngine: Picking, GUI Development and Level Editor

8/5/2014

0 Comments

 

Debugging Networking

After a while battling with implementing networking code I realised how difficult it actually is. Bugs are much harder to track and this really has slowed me down quite considerably. I asked on the gamedev forums about other peoples techniques for debugging networking code and some of the answers were pretty good such as:
  • Packet Logging Per Executable
  • Unit Tests for all packet classes
  • Outputting logs to the screen

Most of the tips were to implement a more sophisticated logging system, currently mine just outputs all the server and client information into one log which isn't helpful at all as a few clients can be writing to the file at the same time and causing issues. 

So creating independant logs for each client and the server is my first priority along with outputting more information e.g. Timestamps / Full Packet Information. 

I will also be creating a more thorough logger that allows you to set priorities for the logging, this will be ideal for when I output logging information to screen as I can just visualise high priority data like specific errors. This leads me onto the next part as currently my GUI is not complete enough to allow for an onscreen debug log.

Picking and GUI Development

After realising I was going to need to do some more work with the GUI to make it more complete and allow for debug logging, this got me thinking about another important tool that I should be working towards which is a Level Editor. 

I am going to use my own GUI code to create all the elements for the Level Editor but there is still one thing that is crucially missing which is the ability to do Picking. It also gave me a break from doing debugging the Networking code. 

I have now implemented a basic picking algorithm using colour based picking. It is really quite simplistic in it's nature and only took about an hour or so to throw together. All that needs to be done is create a unique colour for each Entity that you want to do picking for and output that colour in the fragment shader.

The second part of picking is to actually pick a pixel and read back it's colour, which can be decoded to give you the unique ID for the Entity. 

Now that I have got the Picking working I need to address the rest of the GUI as currently there are definitely parts of it that don't work particularly well such as the Font Rendering. The sizing of text needs to be looked at as currently there is a lot of guess work needed to get text looking correct. 

Okay so there is a lot to be done but I'm sure I can get through it, hopefully I will have something fairly impressive to show soon. I am going to focus on getting the GUI correct and start work on the Level Editor as a test to see how well the GUI does work.

Thanks :)
0 Comments

JBEngine: Networking Continued and Misc

5/5/2014

0 Comments

 
It has been what seems like an age since my last post, and I have been holding off because I wanted to get something a little more substantial before I posted an update. 

I have been working mostly on the Networking but also sorting out some issues that I was having with my matrices due to the library I am using ( which I ended up writing some of the functions myself ). This means that now my FPS Camera is fully working which is a massive relief.

Networking and Libraries

Now that I have got that out the way let's talk about some of the Networking I have been doing. As a starter I suppose it is best to mention that I created all this networking code as a separate library that is used by my Engine. This took a little bit of refactoring and some tinkering with the Visual Studio Project options but was a great learning curve as it has made me think of the other parts of my code that could be their own projects. particularly:
  • Sound ( Now Done )
  • Physics
  • Rendering
  • Input
  • JBEngine

The first three libraries will be a great start and will be the easiest to create, these will then be part of the JBEngine project which will be the product as a whole. 

Doing this means that If i want to create a development tool such as a level editor I can just link the Rendering, Physics and Input libraries and build the application code on top of that and there won't be any extra bulk that I don't need. 

Networking Game Advancements

I have been adding a lot of code for various "packet" classes and sorting out exactly how a client and server communicates with one another.

The basics of it is that I create a specific packet object such as a Camera Movement Packet and this class alone deals with both stuffing its data into and out of the packet class of the Network Library.

This has made it fairly flexible and easy to implement passing new data between the client and server. 

Anyway without any further ado, here is where the project is currently at: 
There are still some major issues that I need to sort out, specifically the camera getting out of sync with the player model. This is due to some latency issues and I should have it sorted fairly soon. 

Overall I think It is still going very well, although I think I need to up productivity massively.

Cheers :)
0 Comments

JBEngine: Networking with RakNet

8/2/2014

0 Comments

 
As any game I'm hoping to make is going to involve some sort of multi-player functionality I decided I needed to look into how this should be implemented very early on. It seems that whether a game is Multi-player heavily influences the structure of the game code. 

After doing some searching around I found a popular Networking Library called RakNet. The library seems very well documented which is a massive plus and has lots of added features for things like VOIP. 

Okay So I managed to get a simple console application demo up and running quickly. It just allowed the server and client to communicate a simple chat message. 

I then wrapped this functionality into some classes so that I would then be able to integrate it easily into the JBEngine. These classes are provided here and can be used as a starting point for anyone else that is starting to implement networking.

There is a working visual studio 2010 demo here. This allows for a two instances of the program to be ran, one as the server and the other as the client. Once the client has connected to the server the client can then send messages to the server which are displayed in the console.

So I then went on to implement this in the Engine which really didn't take much work at all, I simply send a packet to the other computer and they then apply that packet in the game code. Here is a demo using the movement of a player in a game:
It isn't a great demonstration but It was just the first thing I managed to get up and running. It is also a very simple way of communicating and not how the final implementation will be. In the video every time a movement key is pressed a MoveMessage is sent to the other computer and it moves by that set value. This is essentially a peer to peer model at the moment where as I will be implementing a Server-Client Model in the final product.

Next Few steps are to think about the format of the packets i.e. send a MoveMessage that just triggers the movement and a StopMovement Message, that way there isn't a continuous number of packets being sent to the server to move by a small amount.

Another thing I will need to think about is the difference in packets being sent to or from the server. The ones to the server will more than likely be very minimal and mostly based around input, where as the server will be sending back much more data. The server will need to send every so often a packet to inform the client of the current game state. This is so that the client can correct itself if it has become out of sync because technically the game is only being ran on the server, the client just simulates a possibility until it gets the final word from the server.

Plenty more to think about and implement, but this stuff is pretty exciting.

Keep Coding :)

0 Comments

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

Simple Blended Animation and GUI Improvements

24/12/2013

0 Comments

 
I have now managed to get a very simple implementation of blending two animations together. I created a snowman in 3DS Max and applied two animations to it, a slide forward (since snowmen can't walk) and a jump. This didn't take long at all to get a simple version working but it is lacking a lot in design which is my next major step. 

Unfortunately my artistic skills are pretty poor and I have been trying with no avail for a while to create a simple character with walk and run animations. This would allow me to properly test the blending, introducing fade in/out values and blend points. 

As the art has been taking me so long and I needed a break I decided to tackle some low hanging fruit( Double Buffering ). This was already partially implemented but could really do with some wrapping up in preparation for the next task after animation( GUI/Fonts ). I have now created a double buffer object that has two framebuffers and that object deals with switching between the two buffers and allows you to get at the Texture associated with them. Once the double buffering has finished rendering it is finally rendered to the default buffer to present to the screen.

Using this I have laid the foundations of some core GUI classes, the first being a GUI Layover, which is basically just a full screen texture like a HUD. User Interface design is such a large part of a game that I will be approaching this with a lot of care to try and create a flexible design that will easily allow me to create, draw and interact with the GUI components. Anyway I have been babbling on for too long here is the video: 

The video has two layovers active, the writing and the boxes on the top and bottom and also a blue gradient from the sides. This gradient effect is similar to how some games visualise damage being taken but is normally a red gradient. 

Next few things are getting my artistic finger out and produce a model I can actually test some of this blending with properly. Could also potentially add sound into the engine as that is low hanging fruit as well.

Much more to come, hoping to get some done over the holidays in between the alcohol and merriment but it is unlikely.

Merry Christmas :)
0 Comments

Loading Multiple Animations

18/12/2013

4 Comments

 
Since finishing the first working version of the animation I started testing out different file types and cleaning up a lot of my code. Since then I have been attempting to implement multiple animations and animation blending.

First off I have created an "AnimationTrack" class which hold all the keyframe data for one animation regarding one bone. That is slightly confusing to say, basically the bones no longer hold the keyframes for an animation, instead they have a number of tracks which hold the keyframe data for each specific animation. This way multiple animations can be realted to one bone hierarchy. 

Second of all I needed some way of importing multiple types of animation, which wasn't so easy. Assimp supports multiple animations and with the right files it is fairly straightforward. The problem is that I am using 3DS Max and ideally collada files for all my models and the combination of the two has been a pain. Apparently 3DS Maxx doesn't allow you to easily export multiple animations in one collada file(Why?? I have no idea!!). This meant I would either have to use a different file type such as ".x" or find some way to get around this issue. After some searching I found that there are ways in which people have had to get round this before, specifically for importing into the Unity Engine.

The way in which unity deals with this is to have all animations represented on a single timeline in 3DS Max and then using the Start and End KeyFrames breaks the animations up when loading. Personally I don't like this as it means you can't just load a file and it will all work perfectly. 

The approach I thought of was to have seperate collada files all with the same bind pose model but with different animations inside. This way when the file is loaded it will check to see if the model already exists and if it does just check to see if there is a new animation and just load that. That way all you ever have to do is load as many or as little files as you need, i.e. the animations you will need and you aren't altering one file all the time to change one animation. This approach has caused more trouble than I thought, mostly due to 3DS Max once again. Max was naming all the animations the same when being exported and also often didn't supply a name for the RootNode of the scene, which was what I was using to check the model was the same.

Ideally I would want my approach to work but I decided I had spent too much time on it and instead implemented the "All in one timeline" approach. I have now got this working and although I do have to provide extra input it works fairly well. There is more than likely going to be extra input for things like bone masking and specifying blend points so It doesn't seem too bad, also it seems to be the standard way that artists do it so that is always a benefit.

I have got the animations loaded in this manner now, although there isn't much to show. I should shortly have a demo of multiway blended animations.

Keep Coding :)
4 Comments

Skeletal Animation Completed!

20/11/2013

0 Comments

 
Here it is, I have finally finished Skeletal Animation. It has been a long time coming but I have polished it off at last.There were a couple of things that tripped me up and I managed to spot them by simplifying everything down and using a basic 3D model of a cylinder with just three bones, bending in one direction. This is some advice I would give to anybody that is trying to implement this. I think one of the main reasons I didn't do this to start with is purely because of the amount of time it would have taken me(I attempted it a few times in Blender). I had to bite the bullet eventually but I created it in 3DS Max and had it created within about 10 minutes. Just goes to show you the difference between an intuitive and non intuitive UI design. If anybody wants a copy of this model it is here:

Here is the Collada Version and the 3DSMax Version

The two bugs I found were both to do with assimp in some way. Firstly there was a flag I had set for the importer "aiProcess_FindInvalidData" which was causing any Keys from ym keyframes to only appear once if they were the same through the entire animation. After changing this the animation was almost perfect but a few of the bones were still off quite a bit.

This comes to the second issue I had which was from the assimp documentation telling me that the transformations for the Key Frame should be applied as: Scale * Rotation * Translation, when in actual fact I had to change it to Translation * Rotation * Scale. 

Anyway enough of my ramblings, here is the finished product that shows the model finally animating correctly:

This project has taken me quite a long time and I think that if I had just simplified it all much earlier on then this would have been done much sooner. Whilst doing this I noticed that debugging the matrix data for the animation was actually rather complex. This was due to the fact that keyframes aren't stored as Matrices so the only thing you can really check is the positions. I am hoping to put together a simple application at some point that will allow the user to load a model with animations and then be able to check the data assocciated with any bone at any point in time. This will hopefully make other peoples debugging much simpler as they will have a correct version of the running animation with the key frame data exposed for them to compare against their own version.

Okay so this isn't quite the end yet, there is still plenty more to do. Next few things on my list are:

  • Tidy up all the animation code
  • Do some testing on various file formats to ensure they work
  • Add support for blending multiple animations
  • Do some performance testing and see how I can make the animation more efficient
  • Look into ways to incorporate the animation with player input

Once all these things are done I can look into either creating a squash player or outsourcing to an artist and get them to create the player and all its animations, which is a much better option. 

Cheers :)
0 Comments

Animation: Parent Hierarchy Working

13/11/2013

0 Comments

 
As a quick test on the transformation hierarchy and the vertex weights I decided to leave out the key frame data and apply a simple transformation myself to just one bone. 

This can be seen below: 
As you can see the arm rotates smoothly in a circle which proves that the Bone Hierarchy transformations are correct(at least for the bind pose). This points out that the issue is solely with how the key frame data is being loaded or that an extra transformation step needs to be done in order for the key frame data to be used. 

I'm definitely nearly there with this now, can't wait till its cracked.

Keep Coding :)
0 Comments

Animation: Almost there now..

12/11/2013

0 Comments

 
I've had another breakthrough with the animation and it now animates in a similar way to how it is supposed to look. There was some issues with the timing that caused the animation to jitter between only a few keyframes. Since getting this sorted and playing with a few of the transformations I have now got it pretty close, take a look: 

As you can see it is still quite a bit off, I definitely believe that this is now just an issue with the transformations and will hopefully get this figured out pretty soon. 

Just do what makes you happy :)
0 Comments

Animation Aggrevation

8/11/2013

0 Comments

 
Still struggling with this animation problem, which is starting to set me back quite a lot. After trying every which order of transformation and looking online at a few different implementations I still can't figure out what is going wrong. 

My next step is to take it back to loading of the animation and see if I can see any problems with the matrices as they are being loaded. Luckily the model I'm using is stored in a human readable format so I can compare the data for the key frames easily.

The only other problem that I could see it being is an issue with the quaternions for the keyframes not being correct. This again can be tested by doing some debugging at the animation load time. 

Hopefully I will get there soon.

Keep Coding :)
0 Comments
<<Previous

    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