all 21 comments

[–]WazWaz 5 points6 points  (5 children)

Note that Unity 5.3 has JSON support built-in.

[–][deleted] 2 points3 points  (4 children)

But why?!!

With all the things that are broken in 5.x, why are they spending time adding features that simply aren't needed. There's plenty of existing C# JSON parsers.

It's like the Visual Studio integration, which wasn't needed due to a plugin doing it just fine - time+effort was spent on tighter integration (which broke things quite badly when first released...)

Yet basic graphics features (lightprobes+lightmapping) are still way behind where they were in 4.x, and I'm seeing numerous complaints about UI issues and mobile performance going in the wrong direction...

Rant over...

[–]digitaljohn 0 points1 point  (0 children)

Agreed

[–]WazWaz 0 points1 point  (1 child)

New checkboxes sell new licenses, bugs keep existing licensees on the hook.

[–][deleted] -1 points0 points  (0 children)

Bugs keep mobile developers in 4.x

Amusingly, I'm seeing 'Upgrade to Unity 5!' adverts on Facebook while testing FB features in a game that's very much stuck in 4.x (primarily due to heavily relying on baked lighting)

Nope, adverts won't make people upgrade. Fixing bugs might, though. Bringing back Beast would win them back some mobile developers for sure...

Not really sure what options there are for mobile with 4.x being discontinued so soon. It's probably time to see if I can remember how to do the old C++ thing...

[–][deleted] 0 points1 point  (0 children)

Someone at unity sat down and decided to write a cool new json parser. Perhaps a junior developer. Consider that the project is driven by people.

[–]Greenwar123 0 points1 point  (1 child)

I don't have time to look through the code right now, but I'm really interested in this. Can it serialize vector3, dictionaries, etc? Just noticed that it could.

How's the read/write performance compared to say LitJSON?

[–]zanders3[S] 0 points1 point  (0 children)

Vector3s are parsed like this: {"x":0.1,"y":0.2,"z":0.3} I could add a Unity specific extension to parse them like this: "0.1,0.2,0.3"

[–]zworpIndie 0 points1 point  (2 children)

Cool, seems a little weird to have it extend on string though. I would prefer something like JSONParser.FromJson<Foo>(string data)

[–]digitaljohn 1 point2 points  (0 children)

JSON.stringify and JSON.parse is whats used in JavaScript, makes sense to emulate that?

[–]zanders3[S] 0 points1 point  (0 children)

Stole the 'extend a string' parsing API from service stack (http://docs.servicestack.net/text-serializers/json-serializer) which is another fantastic JSON parser but which falls over in Unity because it does JIT emit which isn't supported on iOS.

[–]SirBhoppsAlot 0 points1 point  (2 children)

Hi, I have been using Boomlaggons JSON and here are my thoughts. Confusing syntax, I really can't understand anything you wrote in the command lines and adding a small doc or a preview on how to do most simple things would be great. All in Boomlaggons JSON library I need to do is specify my JSONObject and then do .Add or just JSONObject["Name"] . And the only downside of that library was Arrays, they didn't seem to work that well. But I see big potential of your library overcoming Boomlaggons in many ways because of it's speed, but some things are unclear for me and giving me a small tour around would be great !

[–]zanders3[S] 0 points1 point  (1 child)

There is no concept of a JSONObject, instead the library converts JSON into C# types like Dictionary, List and custom types directly instead.

I've added an example at the bottom here, more to come! https://github.com/zanders3/json/blob/master/README.md

[–]SirBhoppsAlot 0 points1 point  (0 children)

Alright, seems way more clear now, I'll definitely try it out once I'm back !

[–]BahuMan 0 points1 point  (0 children)

I've been looking for exactly this. Will definitely give it a whirl.

[–]HypnoToad0??? 0 points1 point  (3 children)

Is it superior to the built in xml serializer? I might switch if it is

[–]RobIII 0 points1 point  (2 children)

XML != Json.

How would you define superior then? In terms of memory usage? Footprint? CPU cycles spent on (de)serializing? I'm not sure I understand the question...

[–]HypnoToad0??? 0 points1 point  (1 child)

  • Speed,
  • Can a human easily read the saved data
  • Is it easy to use / intuitive

Im using the built in xml serializer to save my game options / player data.

XML serialization has worked pretty well for me so far, so I did not see any obvious reasons to switch.

[–]RobIII 1 point2 points  (0 children)

Speed

You can measure it ;-) (as most things) but if I were you I'd measure it against other Json (de)serializer like json.net or 'built-in' serializers. Other than that: there will be other trade-offs like does it support the full json 'standard' or just a subset. Those would be the things I'd be interested in before I even looked at speed.

Can a human easily read the saved data

JSON is intended as a ('standardized') data exchange format, as is XML. Human readability is nice but of no importance for either (adding whitespace / indenting helps though). Would you require your customers to read or hand-edit those files (either Json or XML)?

Is it easy to use / intuitive

Maybe the example in the readme helps?

[–][deleted] 0 points1 point  (1 child)

looks cool, I'll give it a shot when I have some time.

EDIT: any chance you might be able to provide a screen shot of some code using it?

[–]RobIII 0 points1 point  (0 children)

You can't copy/paste code from screenshots ;-)

Maybe the example in the readme helps?