Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Flatbuffers for Unity

Discussion in 'Scripting' started by Brathnann, May 24, 2017.

  1. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,143
    Recently while trying to implement a feature to load, search, and save huge amounts of data, I came across this.

    http://exiin.com/blog/flatbuffers-for-unity-sample-code/

    I thought I'd just share it here as I did see a few post about Flatbuffers but it seems most don't understand how to use it within Unity. I will say it's not easy to setup and probably not for a beginner (though they go through it pretty decently in the steps)

    The size and speed were huge for us (it's a book app, so lots of data). Hopefully this is useful for some out there. They mention using it for saving and loading game data.
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Looks interesting. Reading the white paper they were specifically built with modern architecture, mobile performance and games in mind. Which is a step up from most other serialisation systems.
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,143
    That's cool to know. I haven't had a chance to dig in that deeply in it. Just a few of the different pages and then we did a test implementation that was very successful. Always looking to find out more about some of the different techs we use.
     
  4. wunder9l

    wunder9l

    Joined:
    Aug 17, 2019
    Posts:
    1
    I have created a plugin for Unity Editor that supports .fbs: creation .fbs files and its translation to c#-code as right button action. You can find this plugin here: https://github.com/Wunder9l/UnityFbs
    Additional documentation is available on https://gamedev-wunder9l.blogspot.com/search/label/flatbuffers

    I have tried to add this plugin to Unity AssetStore (as free asset) but unfortunately have not managed to meet all the requirements. If there is interest to it I will make another attempt later
     
    igsunity092 likes this.
  5. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,143
    Hey, that's cool. I'll have to take a look at what you created. I did things differently, but if this makes it easier to work with flatbuffers, that's great.
     
  6. shejianshangdezhongguo

    shejianshangdezhongguo

    Joined:
    Feb 18, 2019
    Posts:
    9
    Hello,I want to know how to repeatedly write different data in Update.How do I read stored data.Example not found.All my attempts were wrong.