A proceduraly generated story game

Started by Ryex, September 17, 2014, 11:38:08 pm

Previous topic - Next topic

Ryex

September 17, 2014, 11:38:08 pm Last Edit: October 11, 2014, 11:42:24 pm by Ryex
I've taken inspiration from a lot of different genres of games, read a lot on game design, watch every episode of extra credits. and I think I might finally have an idea worth pursuing.

The general Idea is to create a game that can be played over and over again because it's never the same twice. I'm starting from a base of mechanics because ensuring your mechanics are engaging, consistent, and build on each other is critical to game design.

A Procedurally Generated World: Right down to the story
Like minecraft and a few other similar games the world for this game should be procedurally generated from a seed. but just the makeup of the terrain etc. is not the limit of this generation. the game will also randomly select places that meet certain criteria, ie. next to a water source, select types of terrain and climate present and generate villages, towns, and cities of matching cultures. the game then tries to create paths between those places cities linking them to some number of nearby towns with roads. if those roads must path through obstacles it generates passages. ie mountain ranges it will generate a cave system or a mine etc to link them. ther of course will be rules in place to ensure every town isn't trying to link to every other town. and the number of roads in and out of a settlement must match it's size ect.

Of course the game will also generate locations of interest: Dungeons, temples, ancient ruins etc.

putting all this together I think will generate a world not only of variety but of character.

But again the generation does not stop there, now we start adding story. The game selects a goal, slay the big bad, find macguffin x, save the princess, rescue your sibling / friend. perhaps the player has some sort of input or choice here, to select what type of game play they are looking for.
The game will take that goal and extrapolate. what kind of story elements does a quest for this goal entail? it picks them and starts adding them together selecting major transition points to fin is the story arc that goes with the selected goal. it then adds in the smaller details like the mini quests that lead to the main goal. the game then should add in side quest to go with any location that is not yet associated with the main story, these side quest are miniaturised versions of a main story that use a DIFFERENT goal from the main one, to create diversity in the game.

Basic Mechanics of Play
On entering the world the player should be placed near the location that will let them start the main story line and given some indication of where they should head. be it as simple as rearranging the world around them so there is only one direction to go or some sort of vague message like "you sense a disturbance in the force over there" or any other viable means.

The game should limit exploration of the world past uncompleted story locations.

The game will probably be run like minecraft as an instanced server. this means that also like minecraft multiplayer game play is considered a strong part of the game to goal being to work together to complete the goal. though it would be pretty freaking awesome if becoming an antagonist for the group was a viable option, perhaps this can be added later but it's not atm a core mechanic.

The game should be playable for anywhere from 1 -10 players with whatever combat system is used allowing for other players to make significant contributions without getting in the way for this reason I feel a FPS type combat is not an option, wanderlust provides a good example perhaps, I also have a nifty idea for a simultaneously processed turn based combat system that I could see working.
Either way, game play should encourage participation from everyone in a combat situation but also allow a single player to progress on their own. The game should probably include some sort of scaling system that increases enemy power the more people are in game like Borderlands. HOWEVER I feel big number scaling would NOT be conducive to the game play. battle should be fought more on skill (like legend of Zelda games) than on power curves.


All this is of course preliminary and nothing is set in stone. What do you guys think of the premise of the game? does a game that can generate a new story every time interest you?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

winkio

Haha, awesome, I'm planning a lot of procedural stuff for Vault too!  Although none of what I'm doing is story based, there is no reason it can't be done.  However, there are a ton of different ways you could end up doing the procedural code, and you would end up with a completely different game depending on which way you chose.

One question I'm interested in is how much are you planning to pre-generate vs. generating on the fly.  For example, you could generate the entire story all at the same time, and then have the character play through it (100% pre-generated).  On the other hand, you could generate the entire game one part as a time as it is being played (100% on the fly), which allows you to take the player's actions into account.

I've also had a similar idea for a game as an MMO before, but it's probably buried in the chat section somewhere.  Regardless, it's a great concept, and definitely something worth pursuing :D

Ryex

Your question is a very good one and honestly I'm not sure. I'd very much like to be able to generate on the fly and take actions into account but this gets exponentially more complicated story wise. My initial thoughts were to do 100% pre-gen work but I think that might result in a game far more stale than I'm looking for.

I think ill end up doing some combination of both. Generate the world and cities, places of interest. And generate a course fir the story (major event order etc.)  and generate the rest on the fly.

I have this Idea for a "story language" so the generation of the story could be controlled by a script of sorts and I think the idea lends itself to the hybrid approach.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

KK20

September 19, 2014, 01:39:16 am #3 Last Edit: September 19, 2014, 02:01:34 am by KK20
So like a tabletop game where the dungeon master is an ever-intelligent and creative computer. But more visually appealing and gameplay and stafph.

I'd be down for that, both in creating and playing it. Of course, if nothing like this exists yet, clearly the reason is it's absurdly difficult.

EDIT: Forgot to mention, the testing phase is going to be BRUTAL.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

legacyblade

I've been wanting to do this sort of thing since I was a wee lad!

The main problem is coming up with a way to procedurally generate the story. It's easy to imagine generating a story from the big picture standpoint (have different plot archtypes, then select randomly from a list of objects and living NPCs to fill the various roles). But it'd be hard to make said stories INTERESTING. Let alone get them from being repetitive after 20 hours or so. Plus, as they say, the devil is in the details. Almost every popular story can be boiled down to a very small set of plot archtypes. And yes, they do have different nouns inserted into the framework. But it's not the story structure, but the little scenes, that make it. And the characters. So having a good NPC personality engine would be key, as well as a very nuanced "small scene" generator.

Then you'd have to try and factor player choice into your story engine.

If you can ever make this idea work well, you'd have made the perfect game. So I wish you luck on your endevour. Though I'd start on something that only requires a very simple procedurally generated story. Like a procedurally generated dating sim where you take control of your kid, and he dates procedurally generated girls. Dating a girl in a sim usually happens in a vacuum, so it'd be easier, and would give you some good experience with randomly generating stories.

Kiwa

I hope I won't come across as rude or a trouble maker, but I'm gonna lay out some of my non professional thoughts.

I'm not a skilled programmer either by any stretch of the imagination.
making a complete randomly generated map by seeds sounds great. but you'll need to tame it a bit or else you may have these massive needle type mountains peeking in the center of a forest or something like that.

And looking from real experience. things aren't random. mountains are formed from plate shifts, rivers carve their own way due to land and what not trying to reach an ocean, foliage tends to grow where it can find a source of water or humidity. things are completely calculated by nature. which will be extremely hard to make with a random generator.

and if you seed "stock" made images/models it can be kind of repetitive and still miss shaped. perhaps 2 towns may over lap or collide  causing graphic bugs.

I'm not saying the ideas bad or impossible. I've thought about it extensively and that's why i have these conclusions.


As for a random story, I think it can only be done on a flat choose your own adventure...go to page 30 kind of thing.
because making gaps between the story links can be rough.
one minute the sheriff is arresting some baddies ...the next story link the baddies are free again..you can connect that to make the sheriff is corrupt but at some point you'll need to address that but it will perhaps clash with another chain link.
what if your finding that the sheriff is corrupt then suddenly your mothers past life becomes the focus of the story. where are the limitations to the variations? when do you come back to the sheriff? whats he done in the time you were gone?

I made a simple puppy love dating game in RM2K3 or that had similar issues and it was just development from only 3 choices for partners.

the girl who i took on a date to the mall was a "story" event individual to her variables. another girl was there as a "random" event individual to the mall map.
Both events wanted to run at the same time. i know that's a flaw in my choices and RM2K3 but its a perfect example of why random can be bad.

I've made a lot of junk games. some for fun, some cuz I thought I was fucking awesome. I'm trying to take the one I really love seriously. The one I've Posted named 'Uo'.

What I've learned from making shit games and making my "Loved" one is that everything needs to be calculated. Everything needs to flow.
even now, my game Uo with extensive history on the land and each kingdom and each key NPC character AND one dimensional story...it still feels rushed, disconnected, and not well calculated.


In my unprofessional opinion, If your going to make a Dynamic world. you need to create the non dynamic world first. which is hard enough.
Characters who will like each other or hate each other mixed with changing stories between them mixed with changing worlds mixed with changing reasons for entering dungeons mixed with why monsters attack ...mixed with mixed with mixed with. it will run you down and destroy you.


Anyway I hope I got some cogs turning and brought a different perspective.
I think the idea behind it is a wonderful idea but the practice is as if being the most perfect organized mess.

Blizzard

September 19, 2014, 06:28:14 am #6 Last Edit: September 19, 2014, 06:44:32 am by Blizzard
Procedurally generated usually means that it's generated from a formula and a certain set of rules (not just randomly). Rules like this would prevent a needle mountain in the middle of a forest.
If story arcs can be boiled down to segments and possible events that can happen during the story together with locations, then it should be possible to define a strict set of rules that allows for a tree of possibilities. Now, the main problem here would be dialogue. Even if for every "event" there were certain dialogue sets, they would probably feel disjointed and unnatural.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Soulshaker3

The concept is great, like kk20 said it would be seriously difficult to make it happen but rewarding when it was done, i also agree that the test phase would be a pain in the ass considering that a story is most likely different from the other and some bugs might appear in parts of the story that doesn't happen on other story with the same part. Just thinkihng this would be way to difficult for a bunch of guys to pull off maybe a developer with hundred of employees could work this out easier since numbers in some part matter, but it's totally worth a shot, go for it.
Hellow?

Blizzard

Nah, No Man's Sky also has just 10 developers and they pulled off procedurally generated planets. 4-5 people sitting down and working out the details would be enough.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Kiwa

I understand what he means by "proceduraly" and I'm all for it. But he mentioned a random factor.

Quote
the game will also randomly select places that meet certain criteria, ie. next to a water source, select types of terrain and climate present and generate villages, towns, and cities of matching cultures. the game then tries to create path between those places cities linking then to some number of nearby towns with roads.


I'm not saying he cant do it. I have nothing but respect for the coders I've seen here.
When I was talking about the story problem is where I see randomness is most needed and most structure needed.

My example about the sheriff I felt was good, but perhaps it wasn't lol.
You need an element of randomness for it to always be unique. but how far can you swing off course without it being too far?

Guild Wars 2 promised the same thing. they said every time you play thru the game. it will be a different experience. I've made 4 characters in that game. intentionally chose different selections and different reactions. and tho not every character is maxed...its been similar in many ways with the same "dynamic" events happening over and over again.

To make so many different paths would be difficult.
To make multi ending multi path games with a few different endings would be difficult.
but a completely unique world + completely unique story + a unique feeling everywhere would be extremely difficult to pull off while connecting each story arc fluidly.
I don't think its impossible but improbable.
There is a certain level of comfort to everyone having a similar experience as well that we have to be mindful of i think.

Pioneers like ryex are necessary. I hope that something can come of it.

Blizzard

Of course there is randomness involved. But there is a difference between pure randomness and calculated randomness.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

September 19, 2014, 02:01:29 pm #11 Last Edit: September 19, 2014, 08:05:00 pm by Ryex
^^what blizz said. The goal isn't too throw mud at the wall and see what sticks. The goal is to craft a meticulous machine that can create a story.

The system will require a lot of detail generators. A character generator to craft NPCs apearence. A dialog generator that takes recent events into account. Some sort of scene generator that adapts to terrain and player actions.  I never assumed this would be easy.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Soulshaker3

Any of us did but like I said before it sounds like an awesome idea, something that i would like to be involved but too difficult for me, I'm scratching my head every day creating an RPG so I don't think this is for me . ^^
Hellow?

legacyblade

I really hope you can manage to make this, Ryex. If you want to take this massive project on, go for it.

And I've been studying creative writing since I was a wee lad. I used to be an english major (I switched to computer science because you can make more money with it). So if you want any help with the story generation, feel free to hit me up :) I'm not good enough at code to implement any of it, but I can give you plenty of advice on story and scene structure.

Ryex

September 19, 2014, 08:45:20 pm #14 Last Edit: September 20, 2014, 01:29:53 am by Ryex
@ KK20 I missed your comment earlier (posting from phones can do that). and ya, your right, the testing phase WILL be brutal I'll have to build myself tools as I go to make it easier.

On the topic of procedural generation of the world, this is actually far simpler than one might think. so long as you DO think about it. just slapping elements in where ever based on a random draw is going to cause chaos but  imagine this process


  • Start with an ocean
  • Add landmass using a Cellular Automata algorithm kinda like this.
  • split the map into biome sections and fill them in with appropriate land mass types, adjacent biomes should not clash (tropical forest next to tundra etc.)
  • Split map into plates and place mountain ranges on top of the lines, randomize a bit to make them spider out make the ranges thicker in some parts ect.
  • use a similar cellular automata algorithm to drop forests and other appropriate vegetation
  • on either side of the ranges start small streams and direct them toward the coast, make them tend toward each other and when they join make the river bigger from there on. delta the river as it reaches the coast
  • find locations on the map that hold properties that would make them ideal for settlements placement. select some % of them and place settlements
  • connect the settlements with each other with roads, each settlement should connect to at least one other location. multiple connection are made if there are enough nearby locations but using a limited amount of total distance of roads. the more connection a settlement already has the more road it has available to make more, if a settlement does not have enough road to make another connection it stops.
  • re-size settlements to the number of connection they have. those with a large number become cities, lower number become towns. those with only 1 or 2 should be smaller villages. the closer a settlement is to a city the larger it can be.
  • place roads between the settlements setting places to generate obstacle passages (cave, mine, bridge etc.) like points where it crosses a mountain range or river. Roads like rivers will tend to merge as they get closer together.
  • start generating the building in settlements starting with the basics like a shop and inn. adding more as the population allows, the size of the settlement determines population limit.
  • add dungeons, temple, ruins, etc. in out of the way places. if normally inaccessible set a point to generate a obstacle passage but do not generate road.


Wala, a proceduraly constructed but unique world that makes sense. obviously I'm over simplifying as all the algorithms in question would need to be thoroughly tested and fine tuned to get desired result but all the basic steps are there. further detail can be generated on the fly

The story is going to be much harder. Honestly I'm not sure I understand story structure enough to truly know what parts can feasibly be split out and generated. This is where help form people like legacyblade will be critical.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

WhiteRose

September 20, 2014, 12:48:56 am #15 Last Edit: September 20, 2014, 12:53:34 am by WhiteRose
As legacyblade mentioned, one of the key points will be the characters. If you want the story to be engaging, having well-written characters is vitally important. Longevity of the characters is also going to be significant - people are going to get more connected to their characters over time, so perhaps having an option to make a "sequel" with characters appearing from a previous version of the game would be a good idea.
Once people are connected to the characters, you're going to have a lot of cards in your hard, but you'll need to make sure they're played properly. For example, the generator could decide to kill off a certain character. This would need to be handled very well in order to have an emotional impact and not just have the player get angry and / or lose interest in the story because one of their characters died. For subsequent deaths seen in either that playthrough or another, if there were any, they would need to be clearly unique enough that it isn't obvious that the death scene is based on the same root. That would take all of the emotion out of it and once again become frustrating. Though I used death scenes as an example, this would also apply to any sort of character-based event scene, whether it be inter-party banter or the climax of the story. (As a passing suggestion, deaths should be used very sparingly so that they are not expected in order to have maximum impact. Somewhere between 0 and 1 per playthrough would probably be more than enough. That way, it would be really jarring for the player to encounter one, even if they've been through the game several times. Now, near-death scenes could be a little more frequent, in order to keep the player mentally on their toes and not knowing when something truly tragic might happen. Sorry, I'm rambling now, but hopefully the thought makes sense.)
To reiterate, character personality traits and so on are key. If you can manage to create characters that are unique every run but manage to be the quality of characters seen in story-based franchises like Chrono Trigger, Mother, Final Fantasy, Mass Effect, and so on, then this engine would really be a work of art, and something I'd even purchase if it were to be on sale.

You have a really great idea on your hands. :)

Ryex

oh thats a good point.

I get the feeling that a great deal of the story engine is going to have to pull from dating sim examples. By that I mean that there will have to be a character archetype generator for main characters and a great deal of effort will have to go into writing dialog for banter between archetypes in both protagonist on protagonist and protagonist on antagonist settings. and this dialog will have to pull in story events...

holy crap, If I can take this as far as I'm thinking it will be beautiful... I'm going to need SO much help with story writing and dialog. The database of story and dialog for this game will be freaking gigantic!

but if I do this right I can write a generator that can use the same code for generating story on all detail levels and the code base will be relatively easy to maintain.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

legacyblade

I spent awhile thinking about good ways to generate interesting characters, and I came up with a system that might work. I'm thinking that in addition to personality archtype, they should have different personality traits in each category to draw from. To keep the characters memorable though, the amount in each category would need to be controlled (as well as the total number allowed). I haven't really nailed down what categories I think you should use, but I have some general thoughts.

In addition to the NPCs having them, the main character should have a set of personality traits to pick in each category. This way, you can draw on elements from their past and personality.

I think you need at least a section for political/religious views. With each trait in this category, there should be a Boolean for if they actually follow their belief. For example, a character who believes that all sex is wrong, but has sex themselves, would get very angry at anyone who has sex. You should also have a boolean for these traits as to whether the character actually believes their belief, or if it's something they have convinced themselves that the believe. These two things would be used in gauging the reaction a character would have to various situations. (and would probably be easy to code. You have it generate a different value for each emotion based on the flags in different sections, and their contained Booleans. Whichever emotion was strongest would be what determines which reactions the character pulls from it's archytpe's dialog bank)

There also needs to be a past triumphs section, as well as a past indiscretions/dark secrets section. Every character has a past, and if the player gets to know the characters, the events in their past need to be mentioned by the NPC. Each of these should have a shame and pride value (some people are ashamed of their accomplishments, and proud of things others would consider horrible).

Past that, the ideas I have are just floaty bits in the back of my head. But I think with a lot of thought, it could be condensed to the point where you could make interesting characters without needing a novel's length of dialog for each possible personality trait for each archtype. That would leave whoever's writing the dialog free to really put a lot of effort into each of the dramatic points, or the banter.

I really hope you move forward with this. I'd really like to be a part of it XD

@WhiteRose, Oooooh, that's a good idea. I like the idea of sequels. I just kinda figured the player wouldn't age and the story wouldn't span long enough for sequels to be necessary. I think after a major story ark has been concluded, the system should have some sort of algorithm in place to decide how much time should pass till the next arc of the story, and which characters survived and are still around. The amount of bonding the player did with them should play a big role in whoever makes the cut for the sequel.

Ryex

So I've spent some time thinking and I have a few more ideas on how to do this. (A curse and blessing of my existence is that I literally can not stop thinking, in order to fall asleep I have to overwhelm my brain by thinking too much as trying to stop simply doesn't work. every moment my brain finds to idle It ends up returning to and iterating on previous ideas. when I say I've spent some time thinking I mean I spent a good twenty hours on this since I last posted).

1) The universe will have to be internally consistent.

by that I mean that no matter how many iterations of the game you play through the world must have the same rules down to the last detail. the situations can change but the fundamentals should not. worlds should always be generated form the same fixed set of mechanics. this is important not only for consistency but for player experience. If I encounter a enemy in one world that has some power. if I ever encounter that power again in another world or otherwise it should have the same effect, same general strength and belong to the same type of enemy

2) The story should start generation before the world.

Worlds do not exist in isolation, a story can be similar and exist in many different worlds. Trying to generate a story to fit in a given world seems ass backwards to me. As such the story should start generation before the world. The engine should determine what kinds of places / cultures / things will be involved and THEN start generating a world with given characteristics. that way we don't generate a snowy world but end up with a story best told in a desert.

3) The engine will be tasked with making linear but not binary choices, it's simple to choose between two things, even with the two things aren't obviously comparable. one can simply assign some arbitrary quality to be measured and chouse. But in a non binary system where there are three, five, ten, or hundreds of choices for the same item of concern how does the engine decide?

My idea is to function kinda like a search engine. engine assign tags to items in it's database that are of some relation to it's contents, these tags are often called meta data. data about the data. well if every choice the engine has to make has meta data then a simple search can be performed  "these elements are already in my story (Dark, spooky, swords, princesses), which of these options best relates? or which option has the most tags in common?" if you in a game with a dark spooky atmosphere the game had bet not generate the "heart shaped spear of love and tolerance" as a drop without dam good reason. the "evil spear of hate and power" would fit right in however.

4) The game should make use of player metrics.

This is a topic that relatively new to the gaming industry, but here is how I see doing it. every action the player makes can be brought down to a statistic, and some action can be given arbitrary tagged qualities, eg. saving the village on fire would have a "helpful" quality, doing it WITHOUT taking and of the villages stuff would be heroic, doing it while stealing everything in sight would have other connotations. these qualities and statistic could then be incorporated when it comes time to choose content for the newly generated portions of the game. Patterns in player actions form how they go about solving question to which types of moves they use in battle could all be taken into account to cater to the player's play style. If it's better to supply more of the same or try to force the player out of their comfort zone is up for debate.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

winkio

I'm interested on how you will set up the search metadata.  Entering it all by hand is one way, but it ends up getting difficult/tedious/impossible as more and more things are added to the database.  You might want to think of a way to write an extrapolation algorithm that will infer more detailed information and connections based on a basic or incomplete starting database.

Ryex

Winkio, I want to thank you. You've been quite adept at asking exactly the right questions to get me thinking on the specifics of how the intricacies of this could work.

I though about your question on database construction for a fair bit but I only really came up with one solution.

my current plan for the game is for the vast majority of it's logic and game play to be handled by the server. the client for the game would be a thin client with only enough logic to render the data sent by the server. The server would take care of processing all user input for effect.

The database used for content would indeed be a massive undertaking if one were to enter all meta data by hand. While my examples so far have used english words as properties I'm not sure if this is the route I will go. If it IS is would be entirely unreasonable to expect every object added to the database to list the complete set of all properties it may have.

I believe the solution to my problem is a sort of tooled generation of the database. The database initially would consist of a structured set of files in a directory tree that described the bare minimum amount of information to describe them along with two to five words to describe the item. A tool would then collect and compile the items into a database. Use inference rules (would could also be defined as database items) to fill in additional properties of each item. For example an item might have a "Holly" property, the item could also be said to be "cleansing", "good", "pure", "sacred" etc. and the opposite of "evil", "corrupt" etc. if such rules were added to the database that described one property using sets of other properties then set theory could be applied to expand the three or so properties entered by hand into a complete set. care would need to be taken to avoid referential loop recursion and the properties would need to be defined in such a way that base cases could be found to etc. not a simple task to be sure. Additionally properties might be defined on an object with a level of separation from the original. eg the hand entered properties would have 0 levels of separation and properties found by expanding the originals would have 1 level of separation, properties found by expanding again would have 2 etc. Searches could be conducted limiting items returned by separation level. perhaps the engine would search for options using 1 level of separation first then expanding to 2, 3 etc to find the most relevant.

One all potential items have had their full set of properties indexes would need to be constructed to aid search speed, another task for the database generation tool. as the database does not need to be modified after the game has been distributed this would be a build time task.


Please continue to ask question and perhaps challenge me on my implementation ideas, just the task of thinking about this project is fun atm.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

This sounds a lot like most point-and-click RPGs do it (e.g. the Diablo series). They usually have certain attributes and then construct a name for the item by putting together properties. e.g. Holy Smashing Giant Sword of Burning Vigilant Agility. In that case you probably just want to decide first whether the item will have a certain attribute (e.g. holy element) and then decide the magnitude and for each magnitude you can use a different word. e.g. Cleansing < Virtuous < Pure < Sacred < Holy < Angelic < Godly
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

well.. yes and no. The idea is similar except it's being applied to every detail of the game right down to the pallets. and there isn't any hierarchical properties. "Holy" is composed of or related to those other properties
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Ryex

May 24, 2015, 11:56:09 pm #23 Last Edit: May 25, 2015, 03:13:58 am by Ryex
So, I haven't stopped thinking about this idea.


Lately my thought have been toward the technical parts of the problem. namely the base tech that will allow me to accomplish my goals.

One thing was immediately apparent. I need a simi specialized database. and while I done a fair bit of research nothing existing has presented me with even a majority of the tools I need.

My requirements are as follows:

  • FAST look up of a VERY large set of assets by ID. once the game world is created it will ecentialy be a large tree structure of material IDs that describe all the objects, the Game will have to not only look up the IDs but quickly find all properties
  • handle a absurd number of asset to tag associations. if there are N number of assets there will probably be at least N/10 different tags. and each object could have as many as 10 different tags that describe it. in other-words on the order of N^2 associations between assets and tags
  • Each asset could have a different structure,  a 3D modal, a texture, some generic item. ect. all have different properties and data that need to be stored
  • Storage efficiency, assets should support compression, ideally entire blocks of the database should support compression as the more data you have to work with the more repeated sections of bits there will be the more efficient the compression can be. TL;DR blocks will compress at a better ratio than individual objects.
  • Additions to the database do NOT need to be fast. while it would be nice while building the database from directories of assets, the database will be static while the game run, so performance on additions is unnecessary.
  • Library based local access. Like SQLite this database should be accessible directly form the game process not some server process with socket communication.
  • Thread safe, the Database should be able to be accessed from more than one thread at a time. as the database doesn't need to be appended to during run time this isn't exactly hard, more a matter of ensuring that the access library doesn't end up sharing a access buffer between threads or destructively modify a shared cache while another thread is reading.
  • Support for a very large data-set on the order of gigabytes

    My plans for dealing with this was to employ a simplistic key:value disk storage b-tree library and build around it
    using two separate databases, one for mapping ID's to an asset data structure. another database for making tags to a set of ID's with that tag. should allow for quick lockups with out the horror of maintaining indexes. Well actually the b-tree database of tags to ID's technically IS an index. it may be necessary to profile and maintain a third database as a cache of ID's with a common set of tags (Look, all theses assets have all three of the tags "spooky", "demon", and "plant").

    the currently watched Key:Value library that seems to fit my needs is LevelDB.



    Also, I had a thought while writing this post that I think may finally let me resolve the dialog issue.
    A programming language that I will here by dub ScreenPlay

    it would look something like this, WARNING ONLY A CONCEPT, SYNTAX CAN DEFINITELY CHANGE

    Eloquent.Angry(describe SUBJECT is ADJECTIVE):
       "That SUBJECT is demonstrably <ADJECTIVE>(Eloquent)!"


    That is a declaration of a sentence that describes some SUBJECT as ADJECTIVE, using angry and eloquent language where the engine can choose to substitute the passed ADJECTIVE for a synonym that is Eloquent.

    obviously this idea needs a great deal of refinement. but  then whoever was writing dialog for some type of event could write it like this
    {CHARACTER1}describe CHARACTER2 as (select PROPERTY from CHARACTER2 where PROPERTY is NEGATIVE) 

    meaning CHARACTER1 would describe CHARACTER2 useing one of CHARACTER2's negative properties.
    by the exact dialog would depend of CHARACTER1's speaking pattern and Emotional state.

    so lets say CHARACTER1 is an Eloquent speaker and is currently angry, and CHARACTER2 is named bob and has a sloppy appearance. the dialog generated might be

    "That Bob is demonstrably slovenly!"

    of course to have the intended effect the would need to be a great deal of sentence declarations. The nice thing though is that if the language is created correctly it lends it self to supporting translations quite well.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

If you use SQLlite and a local database, it will be thread-safe as far as I know. Quick access for all tags, etc. can be done via indices in SQL databases.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

the problem with SQLite is that it's a relational database, storing arbatray data structres would neither be easy nor performant. A relational database just isn't a good choice for this problem.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Soulshaker3

May 25, 2015, 10:09:25 am #26 Last Edit: May 25, 2015, 10:15:03 am by soulshaker3
I had a tought but quickly realised it wouldn't work. I was thinking of you using LINQ + Lists. The downside is that it would take up space in disk and in RAM and if you had loads of information it would take ages to load. So not a good idea

This was the way I designed my database for my XNA project, but it had just 5mb of info, so it just load up really fast, but in order to load GB's it would take a lot of time and as I said it was loaded to the RAM and I don't think all pcs have 32 GB of ram avaliable.
Hellow?