- Dec 15, 2018
- 304
- 309
So if you're curious what this is about... I've been mulling the idea of a frontend database, as something to use in a game design. Since full-stack stuff is what I'm familiar with, I was thinking it could be cool to leverage a database. Either one database for a whole game, or one database per save file.
Basically, one could imagine the game as a web app using some javascript framework. You could go to the site, or just download the relevant assets. But it wouldn't be making API calls to a backend (because who wants their ero-game making calls to some server... not me). All good: can do this client-side.
If having one db across multiple saves, then you'd just need to religiously include a saveId column. So an actor table could be like:
Appropriate use of libraries could then read and write to the "db", which is basically a different kind of save file. Besides this being a setup I'm familiar with, I was thinking there's an advantage that you can have large save files, with many actors, stats, & action history, but only a small amount of data needs to be in memory at any point in time, and it's quick to fetch whatever you need.
That opens some interesting doors. It would be easy to save data from all ero-sessions, and later an NPC can say, "It's funny how you never want a BJ. Always straight to the point, lol." Or mid-session, they might recognize a pattern and comment on it (a dev can code versions of that without machine-learning). Edit: this is of course currently possible for most games, but would scale horribly due to large save files, unless it's limited to a few characters.
Any thoughts?
BTW, I assume this will be a short-lived topic, so I made the title with "and other random experiments". I have a few other things I've been pondering, and might throw them onto this thread once the current item seems exhausted.
Basically, one could imagine the game as a web app using some javascript framework. You could go to the site, or just download the relevant assets. But it wouldn't be making API calls to a backend (because who wants their ero-game making calls to some server... not me). All good: can do this client-side.
If having one db across multiple saves, then you'd just need to religiously include a saveId column. So an actor table could be like:
{ "saveId": "00000001", "id": 1, "personaId": 1, "firstName": "Foo", "lastName": "Bar", "horns": null, "ears": "HUMAN", "stats": { "int": -1 } }
Appropriate use of libraries could then read and write to the "db", which is basically a different kind of save file. Besides this being a setup I'm familiar with, I was thinking there's an advantage that you can have large save files, with many actors, stats, & action history, but only a small amount of data needs to be in memory at any point in time, and it's quick to fetch whatever you need.
That opens some interesting doors. It would be easy to save data from all ero-sessions, and later an NPC can say, "It's funny how you never want a BJ. Always straight to the point, lol." Or mid-session, they might recognize a pattern and comment on it (a dev can code versions of that without machine-learning). Edit: this is of course currently possible for most games, but would scale horribly due to large save files, unless it's limited to a few characters.
Any thoughts?
BTW, I assume this will be a short-lived topic, so I made the title with "and other random experiments". I have a few other things I've been pondering, and might throw them onto this thread once the current item seems exhausted.
Last edited: