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

ECS: Run-Time Component Store Initialisation and Entity Parsing

13/8/2015

0 Comments

 
Okay so last night I finally started on changing the Component store to get rid of all the statics and instead have the vector of "Component Proxies" populated at run-time. This all went really well and I managed to get it up and running pretty quickly. This then left me with the rest of my evening to progress further with other improvements. 

Entity Class Naming Change

One thing I changed is that I have renamed the "Entity" class in my new ECS system to "EntityECS" and I will then derive this from a base Entity Interface class. This is so that in the future I could possibly implement a different EntityManager and that could maybe do the classic deep hierarchy approach to entities. I have already changed the EntityManager to "EntityManagerECS" and the JBEngine class has a IEntityManager Interface which you can set so this future improvement shouldn't be too difficult. 

Further on from this I've gone on to attempt to conquer the Entity Parsing for the new ECS

Entity Parsing from XML

I use a library for dealing with the underlying complexities of parsing XML in from a file. The layer I have built on top of this allows me to perform some handling code at the start and end of xml tags. Within each tag the library collects all the values and stores them in an attribute list that has a "name" and a "value". i.e. name="PosX" value="0.00" 
Here is the basic process I have implemented for creating entities.

  1. When I get an <Entity> start tag I create a new entity.
  2. When I hit a new component within this <Entity> tag I then use the component store which creates that component by it's name and adds it to the passed in Entity. 
  3. The component store also returns a "BaseComponent" which I then use the overridden "Load" function to pass in all the values from the attributes list. Which sets the component up exactly as it was stored in the xml.

I was going to try and have the Load function deal with the xml but instead I thought it would just be easier to just use a stringstream and this could then just use the ">>" and "<<" operators for both the Load and Save Functions.

I will have to be careful that the Load and Save functions always remain in sync otherwise there could be a lot of data corruption going on. 

I really like this approach as it means that the class deals with it's own initialisation and nothing else needs to know about it.

So what's next?

Okay next I will be getting on with ensuring that all the load and save functions work for the components I already have. I will also be doing some refactoring as there are a lot of commented out functions and redundant code left over from when I used the old Entity System as a starting point.

Once I have done this I will then think about exactly what components I need to implement, and also to implement all this "Component Store" and Entity Parsing functionality for my ECS Systems.

Thanks :)
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