Author Topic: [D&D CharOp Software] Making a character generator (that supports constraints)  (Read 37750 times)

Offline veekie

  • Spinner of Fortunes
  • Epic Member
  • ****
  • Posts: 5423
  • Chaos Dice
    • View Profile
Well, if the database is integrated there shouldn't be much problem. An external database now would be overkill yeah.

What's the difference?

One of the things I'd like to see is that the database can be used by other programs.  I imagine a lot of people have done and will do programs that do this or that, and I'd love to be able to give them a leg up by having a lot of the data entry done for them already in an easy-to-use format -- as long as it doesn't distract from what we're trying to accomplish.  I actually went looking for such datafiles not long ago, but couldn't find any that would be useful (Crystal Keep came close and may work out, but I haven't seen their files yet)

Separate installation versus a library that manages the database as part of your code. I know of db4o for Java, and it works reasonably well, but it does work rather differently from the regular SQL based stuff.
Everything is edible. Just that there are things only edible once per lifetime.
It's a god-eat-god world.

Procrastination is the thief of time; Year after year it steals, till all are fled,
And to the mercies of a moment leaves; The vast concerns of an eternal scene.

Offline kitep

  • DnD Handbook Writer
  • ****
  • Posts: 1948
  • Lookout World!
    • View Profile
If I understand it correctly, integrated sound good.  I was going to post that a point for comma delimited or XML file would be that the user wouldn't have to install a database program, but integrated seems a way around that.


Offline nijineko

  • DnD Handbook Writer
  • ****
  • Posts: 2413
  • two strange quarks short of a graviton....
    • View Profile
    • TwinSeraphim
crystalballlite uses a table system. not sure how close to a database it really is though. considering the sheer amount of potential data which could be added to meet prereqs: races, feats, classes, prestiges, items, spells, powers, racial sub levels, templates... times all the official sources, times all the third party stuff people will insist on adding.... i think we should plan like we are going to try to fit all of 3.x into the program.

of course, we are only going to include what is legal to do so.

but people will add their own custom stuff, so, we should take that into consideration from the onset.

Offline nijineko

  • DnD Handbook Writer
  • ****
  • Posts: 2413
  • two strange quarks short of a graviton....
    • View Profile
    • TwinSeraphim
i believe one next step is to identify the metadata we will be working with in creating a stub builder-someday-automated character sheet. the main goal of identifying the metadata is to break down the various aspects of the game-system-of-choice, in this case the 3.x SRD, into the numeric values and concepts necessary for programming.

please feel free to correct and add to my thoughts and suggestions.

for purposes of design, i shall refer to each aspect of a character sheet as an "asset".

assets consist of:

Assets of a Character
  • race (sub-races, type, subtype, special ability)
  • template (inherited and acquired)
  • class (prestige, racial sub levels, special ability)
  • alt class feature
  • feat
  • skill (skill tricks)
  • stat (stat mods)
  • equipment (weapons, armor, items)
  • money
  • languages
  • spell
  • power
  • optional rules
  • derived characteristics


now to examine metadata in some small detail.

taking the asset of "feat" as an example, a casual perusal yields the following "obvious metadata":

MetaData for Feats
  • feat name
  • feat type
  • short desc
  • prereq
  • benefit
  • normal
  • special

here we run into our first problem. some feats have more than one prereq. i believe the best way to handle this is to put the data into database tables. rather than use prereq for the metadata type, i suggest that we use prereq0 through prereq 9. if there are any feats with more than 10 prereqs, then instead we would have to use prereq00 through prereq11, or whatever. Also, the prereq will reference the name of another assest on the sheet, and its' value.

come to think of it, in the case of feats with more than one type, we can do the same thing with type as well.

now we run into our second problem. this is not all the metadata actually contained in any given feat. there is a set of "non-obvious metadata" which also needs to be extracted, specifically from the benefit and special sections. given in the descriptions of the benefits and special section are special rules which describe how the feat works, and what it does.

for example, weapon focus adds plus one to the attack value of the character if they use a particular weapon. this metadata can be referred to as "affects0(name)" and "affects0(value)". in the case of weapon focus, it would be "affects0(weaponName:toHit)" and "affects0(1)" again, if there is a feat that affects more than ten things, then the naming scheme would have to be changed to use double digits.

additionally, the source of the feat should be contained within the metadata, perhaps with page number for convenience, especially since many feats have more than one version published across different sources. errata will necessitate the need to decide whether to automatically include all errata, or to list the errata changes as a separate feat. This becomes potentially relevant to changes between 3.0 and 3.5, which may also need a metadata tag.



so the final metadata for a feat would look something like this:

MetaData for Feats
  • feat name
  • feat type
  • short desc
  • prereq0(name)
  • prereq0(value)
  • prereq1(name)
  • prereq1(value)
  • prereq2(name)
  • prereq2(value)
  • benefit
  • normal
  • special
  • affects0(name:partname)
  • affects0(value)
  • affects1(name:partname)
  • affects1(value)
  • sourceName
  • sourcePage
  • editionVersion

the exact number of prereqs and 'affects' metadata would be different for each feat. for purposes of testing this idea programatically, we would only need the featName, featType (both for sorting checks), the prereq metadata and the affects metadata.



thoughts, comments, questions?




ps: I can set up a site for hosting dev work, and other helpful additions.

Offline kitep

  • DnD Handbook Writer
  • ****
  • Posts: 1948
  • Lookout World!
    • View Profile
I believe data files can keep lists of unknown length.  So we won't need prereq0 - prereq9, we can simply have prereqList

Assets of a Character
  • race (sub-races, type, subtype, special ability)
  • template (inherited and acquired)
  • class (prestige, racial sub levels, special ability)
  • alt class feature
  • feat
  • skill (skill tricks)
  • stat (stat mods)
  • equipment (weapons, armor, items)
  • money
  • languages
  • spell
  • power
  • optional rules
  • derived characteristics
  • alignment     <-- added
  • deity (there are PRC prereqs of following certain dieties)     <-- added
  • size (though this may be covered under race)     <-- added
  • age     <-- added

Added some assets to the end of the list
I assume derived characteristics include things like BAB, base saves, caster level, manifester level, etc?


MetaData for Feats
  • keyword     <-- added
  • feat name
  • feat type
  • short desc
  • prereqList(name)     <-- changed to List
  • prereqList(value)     <-- changed to List
  • benefit
  • normal
  • special
  • affectsList(name:partname)     <-- changed to List
  • affectsList(value)     <-- changed to List
  • sourceName
  • sourcePage
  • sourceWebSite              <-- added
  • editionVersion


We'll need a way to tell if the prereqs are an "and" or an "or",  eg Elven Spell Lore (PHB2-72) has the prereqs
Int 17 or Elf, Knowledge(arcana) 12 ranks

Offline Dictum Mortuum

  • Sr. Member
  • ***
  • Posts: 467
    • View Profile
We should also discuss how are we going to represent classes. As a whole or level-by-level?
Dictum Mortuum's Handbooks: My personal character optimization blog.

Offline veekie

  • Spinner of Fortunes
  • Epic Member
  • ****
  • Posts: 5423
  • Chaos Dice
    • View Profile
Depends on how you intend to handle substitution levels and ACFs, but I suspect level by level would be easier to manage, and flexible with regards to classes that 'break rules' like Warhulk.
Everything is edible. Just that there are things only edible once per lifetime.
It's a god-eat-god world.

Procrastination is the thief of time; Year after year it steals, till all are fled,
And to the mercies of a moment leaves; The vast concerns of an eternal scene.

Offline Dictum Mortuum

  • Sr. Member
  • ***
  • Posts: 467
    • View Profile
Depends on how you intend to handle substitution levels and ACFs, but I suspect level by level would be easier to manage, and flexible with regards to classes that 'break rules' like Warhulk.

especially with substitution levels - some even change skill points/level, class skills, hit die, etc.
Dictum Mortuum's Handbooks: My personal character optimization blog.

Offline nijineko

  • DnD Handbook Writer
  • ****
  • Posts: 2413
  • two strange quarks short of a graviton....
    • View Profile
    • TwinSeraphim
i wasn't sure how to categorize the miscellaneous data points on the character sheet such as alignment and whatnot. size and age are both functions of race. alignment and deity, however, are basically separate. i guess they could be handled as an independent asset. thanks.

i think each base class and prestige class could be a table. racial sub levels would be a check against the race asset and the class asset and the level asset to determine if a racial sub level was a valid option at any given point. probably a separate table for each set of racial sub levels.

i was thinking that due to the similar names of multiple versions of feats, that we might need a primary key - is that what you meant by keyword?

what is the purpose of putting the prereqs in a separate list? are we talking a single master list, or a separate list for each feat, etc..? each feat (and prestige, and some items) will have a unique list of prereqs. is it easier to include the prereqs as characteristics of the feat asset, or to put them into a list? how would it be referenced programatically? we need to be able to get at the names and values so that we can error check the build stubs and selection options.

same questions with affects(x). we are eventually going to need to be able to reference the "affects(value)" in order to calculate derived values displayed on character sheets. it will also be needed to accurately calculate the build stubs as each asset is added, that opens up or closes down various options.

so i'm not disagreeing, i'm just not quite seeing the value. but, then again, i'm a beginner in actual coding, i'm stronger in the design and theory areas.

Offline kitep

  • DnD Handbook Writer
  • ****
  • Posts: 1948
  • Lookout World!
    • View Profile
i was thinking that due to the similar names of multiple versions of feats, that we might need a primary key - is that what you meant by keyword?

I was thinking that "Name" would be human readable and may allow for duplicates, while "Keyword" would be unique.  Eg, "Rage" could be a name of a class feature and a spell, but the keywords "ClassFeatureRage" and "SpellRage" would refer to different things.

Quote
what is the purpose of putting the prereqs in a separate list? are we talking a single master list, or a separate list for each feat, etc..?

Sorry, I don't think I was clear on that.  The list isn't separate, it's just an array that can grow and shrink as needed.  You don't need to worry the array has 1 or 10 or 100 things in it.

Offline nijineko

  • DnD Handbook Writer
  • ****
  • Posts: 2413
  • two strange quarks short of a graviton....
    • View Profile
    • TwinSeraphim
i see. so that would be two arrays? one for names and one for values? and first value in the name array is associated automatically with the first value of the second array?


Offline kitep

  • DnD Handbook Writer
  • ****
  • Posts: 1948
  • Lookout World!
    • View Profile
i see. so that would be two arrays? one for names and one for values? and first value in the name array is associated automatically with the first value of the second array?

That would work.

But more likely, you would create a new datatype for the database that holds both those variables.   Then you just make 1 array of the new datatype.



Offline veekie

  • Spinner of Fortunes
  • Epic Member
  • ****
  • Posts: 5423
  • Chaos Dice
    • View Profile
Well if its in Java you just need to make an abstract 'data type' describing the methods and variables necessary to identify the particular chunk you're holding, and then implement it into whatever types you like. Then just store all of them in a linked list of the abstract type. That should provide enough information to identify the particular type a given object should be, so you can recast it on use.
Everything is edible. Just that there are things only edible once per lifetime.
It's a god-eat-god world.

Procrastination is the thief of time; Year after year it steals, till all are fled,
And to the mercies of a moment leaves; The vast concerns of an eternal scene.

Offline Dictum Mortuum

  • Sr. Member
  • ***
  • Posts: 467
    • View Profile
Many languages have custom data types that we could use, not only java. I'd say that it would be a lot more intuitive if we had a

Code: [Select]
affectsList(name:partname, value)     
notation
Dictum Mortuum's Handbooks: My personal character optimization blog.

Offline veekie

  • Spinner of Fortunes
  • Epic Member
  • ****
  • Posts: 5423
  • Chaos Dice
    • View Profile
It depends mostly on your primary language really. Whatever you're most comfortable working with.
Everything is edible. Just that there are things only edible once per lifetime.
It's a god-eat-god world.

Procrastination is the thief of time; Year after year it steals, till all are fled,
And to the mercies of a moment leaves; The vast concerns of an eternal scene.

Offline Dictum Mortuum

  • Sr. Member
  • ***
  • Posts: 467
    • View Profile
It depends mostly on your primary language really. Whatever you're most comfortable working with.

Indeed. It's just a simple lookup.
Dictum Mortuum's Handbooks: My personal character optimization blog.

Offline kitep

  • DnD Handbook Writer
  • ****
  • Posts: 1948
  • Lookout World!
    • View Profile
Oh. Well Hrmmm....

Okay, Well, here's what I've put together:

The Big List of Spells.pdf

Do note, I have yet to finish the final appendix, so none of the files have creature stats. The stats for monster/critters you will have to find elsewhere.

I was looking through the list to pick my sorcerer spells and came across Ghostly Tail.  You have it listed under sorcerer spells, but don't include the description like you do for every other spell.  I'm still loving the list, BTW.  So much simpler than paging through book after book.


Offline Psithief

  • Lurker
  • *
  • Posts: 35
  • Can I haz your PP?
    • View Profile
You know guys we could go web-based and offer an option to upload a custom database. Now that I think of it though, we get into other problems, like how bug that database will be or whatever.

Yeah, I support this idea, provided HTML5 is used and it's restricted to browsers that implement the File API (anything that's not Internet Explorer). [Supported browsers]
With the File API you can open local files and the browser javascript can read them, so that huge custom CharOp database would only be loaded into your local memory.
Any actual builds wouldn't need all that information just to be shared with the public. (if you wanted to do that.)

Applications are unfun when working on a rapidly changing system such as this. Distribution is a nightmare and such. With a web application you always have the latest version.

Offline Captnq

  • DnD Handbook Writer
  • ****
  • Posts: 1602
  • Haters gonna hate. Dragons gonna drag.
    • View Profile
    • Ask the Captain
I was looking through the list to pick my sorcerer spells and came across Ghostly Tail.  You have it listed under sorcerer spells, but don't include the description like you do for every other spell.  I'm still loving the list, BTW.  So much simpler than paging through book after book.

Thank you for your comments. I have updated the file. I forward you to this post for more details.
If you have questions about 3.5 D&D, you might want to look at the:
Encyclopedia Vinculum Draconis

Currently: Podcasting

Offline NunoM

  • Legendary Member
  • ****
  • Posts: 1253
    • View Profile
Hello, all... I've been (fast) reading through this thread and i think i can help with a few things...
Database engines for use:
  According to the main purpose of this ("search by given parameters") it appears an SQL database would be a good start. That said, IMO:
- MySQL: it you're aiming for browser access - not a bad idea if you ask me...)
- SQLite: for either browser or Java or whatever access, my personal favorite in this case
- XML: workable, but... meh...

Also, i have experience with DB creation and management professionally. From what i gathered, it's easier to start simple and identify the basic building blocks from which to start working on this... and yes, the Entity Relationship Model is a must! Programming becomes so much easier with a picture to look at...
After 10mins of analysis (too tired for more now, sorry), i can see this DB will have to grow (duh!!) but most of all, it will have to be versatile enough to allow redundant combinations.
Example: a feat can be a class ability gained at a given level, but can also be a requirement for a PrC. Yes, you could just create a new table and input the same data in another record, but there's no need to input the same data twice if it will work the exact same way (there are always exceptions, of course).

Another programming principle to use: DRY (Don't Repeat Yourself)! If you repeat code or data inserted, you're only adding levels of complexity to the management of your work (ex.: if you have bugs in your code, or errors in data inserted, you'll have to search everywhere for the pieces of code/data that relates to that issue to correct it. Keep it in a single place and you only do the corrections once).

Examples of "building block" tables (preliminary and they will grow - please don't mind the names):

- SAVTHROW_TYPE: we already "have" this ("Good", "Medium", "Weak")
  Fields: SavThrowTypeId, SavThrowTypeName
 - SAVTHROW_PROG: layout of the saving throw progressions

- CLASS: table for classes and prestige classes
   Fields: ClassId, ClassName, ClassType (0/Nil= normal, 1= Prestige class), Fort_SavThrowTypeId, Ref_SavThrowTypeId, Will_SavThrowTypeId
- CLASS_LEVEL: table for levels of classes
   Fields: ClassId, LevelOrd

EDIT: not sure if CLASS_LEVEL table is needed! The info could be inferred by records in other tables and a view created to represent it later...
« Last Edit: August 17, 2012, 10:38:46 PM by NunoM »