RuneScape 2 Development > Snippets

[PI/wL] NPC Spawns from json [v1.3]

<<< (2/10) >>>

sk8rdude461:

--- Quote from: wildskiller on July 10, 2014, 11:37:33 AM ---
--- Quote from: Driman Rune on July 08, 2014, 05:22:57 PM ---I don't like JSON, but thanks!

--- End quote ---
It's just like using XML but it's cleaner. JSON is easily parsed, understandable, and clean. I do believe Google and Yahoo use JSON for their web services and possibly other things.

--- End quote ---
JSON also loads incredibly fast (esp. for how large some files can get). I've got 20k item definitions loading from a json file and it takes 1 maybe 2 seconds.

Dan0194:
The loading for xml kind of sucks but I find it way more flexible than json.

sk8rdude461:

--- Quote from: Dan0194 on July 12, 2014, 08:09:05 AM ---The loading for xml kind of sucks but I find it way more flexible than json.

--- End quote ---
I've always wanted to play with XML loading. I like JSON because it's fast and it has readability (compared to reading a cfg file with 1 item name and 15 seemingly random digits after it). I just haven't found anything in my RSPS that I'd want to convert over to it (and I haven't played with xml reading in java).

Dan0194:

--- Quote from: sk8rdude461 on July 12, 2014, 03:56:26 PM ---
--- Quote from: Dan0194 on July 12, 2014, 08:09:05 AM ---The loading for xml kind of sucks but I find it way more flexible than json.

--- End quote ---
I've always wanted to play with XML loading. I like JSON because it's fast and it has readability (compared to reading a cfg file with 1 item name and 15 seemingly random digits after it). I just haven't found anything in my RSPS that I'd want to convert over to it (and I haven't played with xml reading in java).

--- End quote ---

I say there both pretty the same when it comes to readability. The speed though for json is really the only reason why I would switch over from using xml most of the time.

Michael P:
Ugh you should really load NPC definitions in it's own file rather then setting it for each spawn.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version
Powered by SMFPacks SEO Pro Mod |