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



Leave a Reply.

    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