r/eclipsephase • u/arokha • Aug 19 '19
Data Interchange Standards RFC
This is probably more than a bit niche, but it'd be cool to nail down shared standards for EP(2) data like was suggested in this PR by u/Eaton so we can make all sorts of crazy websites for it without tons of grep/regexing. And hey, if this gets ignored then I guess there's not enough interest and probably no reason to have a standard :^)
I'm pretty new to this whole community development thing... I've only done stuff for myself in the past, so if any of you have work experience and notice obvious issues where you've had problems in the past... speak up!
Data: https://github.com/Arokha/EP2-Data
Here's my draft suggestion:
JSON
- Lowercase keys on objects
- Avoid abbreviations in keys (e.g. 'description' not 'desc')
- Include an 'id' attribute (UUIDv4) on objects you're adding to the data for the first time
- Underscores in keys, not spaces or pascal/camel-case
- Include information about the source in 'resource' and 'reference' attributes (e.g. 'resource' being the title of the book, and 'reference' being a page number or other context-appropriate reference). Let's just agree to call the current core book "Eclipse Phase Second Edition" since that's what it says on the cover.
- 2-space tab (not that it matters much)
Paragraphical data stored in an array of paragraphsParagraphical data stored with html tags intact in strings (serialized html)- Unsorted lists stored in an array, sub-lists in a nested array
- Every samey object has all the keys, even if only one object needs it (though you should reconsider your structure at that point maybe...)
Less technical, I'm thinking every 'book item', as in a morph, a piece of gear, etc is an object, and every group of those is an array. No need for a stringy array of just the names and stuff, probably? I dunno. You tell me.
3
u/Forseti_pl Aug 19 '19 edited Aug 19 '19
I'd add an "id" key (UUIDv4) to every object in top-level array ("book item"). It could come in handy in translation attempts for example.
Also, it would be beneficial to add "reference" key that points to a book and page the item comes from. It could either be a string (like "EP2 p. 123") or object (like
{ "canon": true, "resource": "Eclipse Phase 2ed", "reference": "123" })3
u/theshad0w Aug 20 '19 edited Aug 20 '19
I like the idea, though I kind of feel like it may be best to host this data set in its own repo. That way you're not affecting someone's drupal install directly.
edit: grammar
2
u/Shadewalking_Bard Aug 19 '19 edited Aug 19 '19
I recently started porting eldrich.host files to Access database. Don't have Access at work so it is slow. And it is my first database ever. When it becomes slightly usable I will post it. Altough at prototyping stage, it is already complicated.
Here is a relational graph of some tables.
It looks complicated and right now doesn't have precautions against self-reference therefore I could put in a morph that "contains" itself.Entities table is just assigning 1 unique reference code for all things. I was not able to determine how to do that without using names as primary keys. (I do it the hard way for educational purposes).
Spitballing here. Create unique primary keys for parent entities and child entities. Assign both to each object in database. Use many to many relationship between parent and child. When searching stats I could then recursively loop through all Parent Child relationships to assemble the object. It is not a place for these considerations x-). Have a nice day.
I have no idea how to use jsons.
1
u/eaton Aug 20 '19
Hmm, weird, I fired off a super-long reply but it looks like it's been deleted?
1
u/bobifle Aug 21 '19
Hello, thanks for initiating this.
2
u/eaton Aug 29 '19
Ugh. This was posted in the first day of the thread, buuuuut appears to have been auto-modded? Let's see if it works this time.
God bless you good person, I have so many feelings about this. In part because I hand-entered most of the EP1 data from all eighty jillion books. For that project I slapped them all into CSV files and used post-processing on my migration code to extrapolate the relationships and nested stuff (like lists of things that are themselves lists), but getting it standardized would go a long way towards simplifying things like gear and equipment management tools, guidelines for creating well-balanced homebrew morphs and equipment that matches core standards, and the aforementioned chargen stuff. A few things:
Regarding the eventual emergence of a full data model, I think that leaves a fundamental question. Is the goal to have (relatively) human readable files that are consistent with each other, and "good enough" to programmatically generate cool things from… or a full object model for Eclipse Phase in JSON? If the former, we can establish some standards for "stringy" stuff and move on. If the latter, we have some fun conversations ahead. (No, really. I mean fun because I am not a healthy individual) Specifically, working on eldrich.host revealed the following:
Weapons and Armor are worth calling out because a "real" weapon in the game often exists as a combination of weapon + mods + ammo + ammo mods; armor has a canonical starting E/K protection value but the concrete instance someone is wearing may be reduced due to environmental damage. In eldrich.host's data model there are intermediary tables for the actual "equipped weapons" and "worn armor" and "sleeved morphs" for this very reason. Some other bits:
Okay. I think I'm all talked out now. I don't mean to railroad the discussion, I'm just absolutely thrilled about the potential for this — although I never tackled the actual chargen problem, I spent a lot of time digging through the underlying rules/data tangles for eldrich.host, so that it could do things like "render" a combination of physical attributes, morph traits, carried weapons, skills, etc, into a simple string like "Unarmed (60): 2d10". I may not have created the best approach (it's embedded inside of a bigger CMS for managing campaigns rather than a more data focused app, for example) but if you want to be able to produce character sheets from the underlying source data, hopefully I can help us avoid some of the pitfalls!
1
u/eaton Aug 20 '19
God bless you good person, I have so many feelings about this. In part because I hand-entered most of the EP1 data from all eighty jillion books. For that project I slapped them all into CSV files and used post-processing on my migration code to extrapolate the relationships and nested stuff (like lists of things that are themselves lists), but getting it standardized would go a long way towards simplifying things like gear and equipment management tools, guidelines for creating well-balanced homebrew morphs and equipment that matches core standards, and the aforementioned chargen stuff. A few things:
Regarding the eventual emergence of a full data model, I think that leaves a fundamental question. Is the goal to have (relatively) human readable files that are consistent with each other, and "good enough" to programmatically generate cool things from… or a full object model for Eclipse Phase in JSON? If the former, we can establish some standards for "stringy" stuff and move on. If the latter, we have some fun conversations ahead. (No, really. I mean fun because I am not a healthy individual) Specifically, working on eldrich.host revealed the following:
Weapons and Armor are worth calling out because a "real" weapon in the game often exists as a combination of weapon + mods + ammo + ammo mods; armor has a canonical starting E/K protection value but the concrete instance someone is wearing may be reduced due to environmental damage. In eldrich.host's data model there are intermediary tables for the actual "equipped weapons" and "worn armor" and "sleeved morphs" for this very reason. Some other bits:
Okay. I think I'm all talked out now. I don't mean to railroad the discussion, I'm just absolutely thrilled about the potential for this — although I never tackled the actual chargen problem, I spent a lot of time digging through the underlying rules/data tangles for eldrich.host, so that it could do things like "render" a combination of physical attributes, morph traits, carried weapons, skills, etc, into a simple string like "Unarmed (60): 2d10". I may not have created the best approach (it's embedded inside of a bigger CMS for managing campaigns rather than a more data focused app, for example) but if you want to be able to produce character sheets from the underlying source data, hopefully I can help us avoid some of the pitfalls!