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

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

JBEngine: Parse Entities and Changes to Entity ID's

6/2/2014

0 Comments

 
Since last post I have been working on the parsing of entity instances from XML just like how it does for the Assets. This did bring up some interesting questions about entity communication and caused a fair few changes. Currently in XML there are a pair of <Entity> tags inside which there are a number of <Component> or <DataComponent> Tags. These in essence define what the entity is which is really generic and great for re-usability.

The problem is that a lot of entities need to send messages to specific other entities for example a lot of entities may want to know the players ID to send messages specifically for that entity. Previously the Entity ID's were just unsigned int values that were generated when an Entity was created, which made it impossible to know which entity was the player unless the order stayed the same. 

To overcome this I have now changed the Entity ID system to be a little more flexible, initially an Entity has an EntityType and an EntityName. An example of this could be "GUI" and "StatsBar", this along with the original unique ID now combine to make a unique ID such as "GUIStatsBar34". I know what you're thinking: "But that doesn't overcome the not knowing the player ID problem". Okay so to overcome this, you can either provide Entity Type and Entity Name or specify the Unique ID yourself. So for the player the UniqueID is "MainPlayerID". 

This overcomes the issue of knowing a specific entities ID and also gives some better debugging information. Previously an Entity would have an ID of 37 and I would have to guess what it was from the Components and Data Components that it had. Now I can just look at the ID and it should give me some hint as to the object I am dealing with.

Okay so not much to show this time but there has been quite a bit of work behind the scenes. Next few things on the cards are to get the networking aspect of the engine setup before going much further, especially as this may involve some changes to the messaging system and general game architecture. 

Happy Coding :)
0 Comments

JBCC: First Development Tool

3/2/2014

0 Comments

 
Today I made my first development tool to go alongside the engine. To be honest it was more something to make my life a little easier. As the JBEngine uses an Entity Component System I found that I was having to create a lot of classes for these components which to start off with all have the same signature. This meant I was copying and pasting a component and changing the class names A LOT!

So now I have the JBEngine Component Creator (JBCC). It is just a simple WinForms application to generate a component class with a specified name and a priority value that is assigned to each class.
Picture
Okay so it is pretty basic but I thought it was worth noting, seen as it will probably be the first of many development tools that will be created alongside the JBEngine. 

I have also started work on the Entity XML Parsing so I should hopefully have this done shortly.

Happy Coding :)
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