• Size and scope of a project that I am working on
    4 replies, posted
Hello FP, I wish to create this book in PHP: [url]http://www.scribd.com/doc/26519770/Central-Casting-Heroes-of-Legend-by-Paul-Jaquays[/url] Every page has a random dice roll to determine events that happen to your character starting from conception, all the way to adulthood and beyond. Initially going into this project, it looked quite easy, and so far it can roll all the way up to your birth events. However, when tackling on the birth events [url]http://i.imgur.com/f3Dko.jpg[/url], this can lead to pretty much anywhere in the book. I will talk about 'cases' as each individual dice roll requires more than just text, but functions, variables, constants, arrays, and everything else you can think of all in a single dice roll. Each case can have something happen to your character, whether it be rolling an extremely wealthy noble, and then something happens to you in your adolescence and now you are dirt poor and lost your current possessions to joining the military and having a background that looks like Lorem Ipsum spam. Let's ask a question: [url]http://i.imgur.com/8FWx6.jpg[/url] Here we have the Blessings table, which can be rolled on from birth events, to adulthood events, so it's quite common to see this in someone's background. The cases marked in red are the ones that have threw me in a loop and I wouldn't even know where to start with roll 18. The blue one circled (or squared if you prefer), is complete, however, I would like the additional blessings to be unique instead of the same. For example, rolling two good luck talismans overwrites the previous one and doesn't make sense. I currently use a switch/case system in each table and have a function called array_random that parses an array and challenges each result in a temp. array to determine if the results match, if they do, roll another one. This works and produces genuinely unique rolls. Making the blessings table into one big array so I can do that is complex, when the actual dice rolls are ranges which arrays can't do (I think), and am stuck with a case-based system that don't produce unique rolls (don't know how to structure it) so, FP, I ask of your great advice into a project that I am currently enjoying coding and would love to hear on how to proceed into it.
I would love to help you with this but I'm not sure I understand the question. You're basically storing some stats in a character object based on some rolls rolled by the player? And it just goes from one page to the next, and on page one you're rolling for one attribute and on the next page you're rolling for something else? And you want to maybe keep track of these with descriptions as your character develops? [b]Edit:[/b] The problem with the blessings thing is that you have a one-value column for something that can have multiple values. Are you sure that you're supposed to be storing these attributes like this? Since you're not going to sort players by blessings or whatever I would just stick such attributes (that I wouldn't consider base attributes but rather add-ons?) in a JSON array or something to that effect. Could you post your database structure? Preferably as a CREATE statement.
[QUOTE=holocene;38206236]I would love to help you with this but I'm not sure I understand the question. You're basically storing some stats in a character object based on some rolls rolled by the player? And it just goes from one page to the next, and on page one you're rolling for one attribute and on the next page you're rolling for something else? And you want to maybe keep track of these with descriptions as your character develops?[/QUOTE] Yes. :) [QUOTE=holocene;38206236]The problem with the blessings thing is that you have a one-value column for something that can have multiple values. Are you sure that you're supposed to be storing these attributes like this? Since you're not going to sort players by blessings or whatever I would just stick such attributes (that I wouldn't consider base attributes but rather add-ons?) in a JSON array or something to that effect. Could you post your database structure? Preferably as a CREATE statement.[/QUOTE] I'm not completely sure, as before your comment it wasn't using a database at all, in retrospect that it probably does. I took the liberty and quickly switched to PDO, and have a working example setup. [CODE]$query = "INSERT INTO `character` (race) VALUES (:race)"; try { $core = Core::getInstance(); $STH = $core->dbh->prepare($query); $STH->bindParam(':race', $this->raceToString[$race], PDO::PARAM_STR, 20); $STH->execute(); } catch(PDOException $e) { preprint($e->getMessage()); }[/CODE] brainstorming that database structure [b]Edit:[/b] i am now lost
[url]http://i.imgur.com/Fdkgs.jpg[/url] - progress! added my steam profile if anyone wants to contact me and see where im at with this, i would be ecstatic
with the Military came new challenges... [url]http://i.imgur.com/PrxWy.png[/url] it's looking great :) [b]EDIT[/b] noticed a couple of bugs/inconsistencies, fixed. also, the military section is an extension of the parent class... around 1193 lines of code at the moment. $this->military->enlist();
Sorry, you need to Log In to post a reply to this thread.