dworkin / dgd

Dworkin's Game Driver, an object-oriented database management system originally used to run MUDs.
https://www.dworkin.nl/dgd/
GNU Affero General Public License v3.0
103 stars 31 forks source link

[Suggestion] YAML and json support built-in? #75

Closed rubyFeedback closed 2 years ago

rubyFeedback commented 2 years ago

Hey there Felix,

This is a semi-question or semi-suggestion.

I was working on my own MUD code base in ruby (ok ok performance ... I get it, but I am more interesting in the functionality, e. g. a roleplay-centric MUD based on "scenes" more and less about classical rooms).

One thing I was contemplating was to describe the game world simply via yaml files, and allow players to modify the content as-is.

That did, however had, also got me thinking about old legacy LPC code stored in many MUDs and vice versa.

Would it be possible for DGD itself to be able to generate json and yaml output as-is, from an existing LPC object/room?

That could even be used in a hybrid system, say, old LPC is kept like that but players could contribute new areas via a yaml file simply (at the least initially; code could be generalized into components that are then attached to this lateron; and the text players used could be automatically reformatted to yaml or json and vice versa).

Not sure how much work this may involve, and how many people may benefit from this, so this is just a loose suggestion. Please feel free to ignore it - it was kind of a semi-idea mosly.

nandesu commented 2 years ago

I'm not Felix; However I was inspired to ask:

Any specific reason you have no desire to use SQL? This seems to be a perfect use case for a relational DB. My initial thought is that it would be easier to integrate a DB link to sqlite, then create a custom yaml/JSON parser.

Just curious.

dworkin commented 2 years ago

It would be as easy to translate LPC rooms to json or yaml as it would be to translate ruby code to json or yaml. That is to say, it can be done in the context of a particular MUD, and if DGD has to do it, then DGD has to be rewritten for that particular MUD.

It would naturally be a lot easier to do the translation in LPC.