Codifying the Basics (Part 2)

 OK...so I never really explained much about the coding part in the last post. 

I know that Ren'Py can handle arrays. If you don't know what an array is, it's basically a list of information components identified as a coherent cluster. A program can withdraw specific elements of data from the array... so it might have 5 elements of data, and you can print out the second one, you can rearrange them by shuffling the data elements, or add another one to the end and turn it into 6 elements of information. There's all sorts of ways that you can modify an array. I'll run the arrays a bit like a relational database that can be modified on the fly, but will always start with a static framework and data.

(If anyone out there is reading this and knows about databases, python scripting, or Ren'Py specifically, and if they have any better ways to address these ideas, please let me know.) 

The first and most obvious array would be called "deck" (or something similar) and have 78 elements of data in it, one for each of the tarot cards. This array would need to able to be shuffled, then we draw the first five cards out of it and place them in the spread. The simplest way to do this would be to make the array a list of numbers 01 through 78. The cards don't really need the abilities linked to them here, because that will be massively complicated and make the array unwieldy. So the easiest fix that I can think of is to create 78 new arrays, 1 for each tarot card. These new arrays would be named for the position in the main array ("Card01", "Card02", "Card03"..."Card78"), and the pieces of data in them would start with the name of the card (eg. the first element of data in array "Card05" would be "Five of Wands", followed by "Physical" since it's the attribute that woud be boosted if this card were drawn, the next three elments would be "Brawl", "Intimidation", and "Melee" since these are the abilities that seem to match the correspondences of the card (according to the research I've done and the needs of the game), The program will only activate these parts of the array once they are in the tarot spread.  

(Why don't we want to just draw random cards from the "Deck" array? Simply because we don't want the same card randomly drawn twice and therefore appearing at multiple points of the tarot spread.)   

The next easy array would be called "core" (or somthing similar) and have the four attributes and the agency rating in it, each attribute would start at one, and most characters in the world (especially NPCs) don't have agency so it would start at zero... so for the data perspective it will just look like ("1", "1", "1", "1", "0"). Each time a relevant card is added to one of the 4 parts of the spread that boost a starting character (Past, Present, Potential or Reason), it boost the relevant attribute or agency. In the example of card "5" (the "Five of Wands") it would add +1 to the first element of data, which is associated with the physical attribute and would change the array to ("2", "1", "1", "1", "0").

I ran into messiness last time I developed this idea when I tried to sort out the abilities. Instead of calling elements within an array, I had previously defined each ability as a separate variable. If "Brawl" equalled zero, the character didn't have it. If Brawl equalled "1" the character did have it. I still think this will work, because if I run with a single "abilities" array, then I'd probably list all of the abilities in alphabetical order, then if need to add a new ability later in the game development process, I'll need to renumber everything alphabetically after that point in the array and hopefully not suffer some kind of mismatch in data where another part of the program addressing the array hasn't been correctly numbered. Now we'll be looking at single ability variables with a variety of numbers associaed with them. "0" still indicates that the character doesn't have access to this ability. "1" indicates that the character can potentially learn it (it's pencilled on their character sheet). "2" indicates that the character has learned the ability. I'm still tossing up whether to include a "3" level which would indicate complete mastery of the ability (which would provide double the usual benefit when activated in play). Any time a card appears at one of the boosting points of the spread, we look at the three abilities embedded in the card's array, and we boost each of those abilities by +1. Since we can't go above 2 in our character abilities, there's a chance that a card will have a part of it's benefit negated...so here's where we might throw in a pool of "freebie points" and the pool is increased if an ability is unable to be raised.  

The elemental affinity for the character would be defined in a way similarto the cards. A number of affinity/essence arrays might be numbered "Essence01" to "Essence24", with each array indicating ("Essence Name", "Element", then the seven abilities associated with the essence, and finally the name of the magical benefit that character gets from following this essence type).

A part of the game has been to identify an incident in the character's past that led them on the path to magical awareness, or at least an event that awakened them to the need for change in the world. We did this by pulling a random element from the "Reason" and "Past" cards. So, depending on where a card landed, the first part of a sentence would be made from one card, and the second part of the sentence would be from the second card... for example "When I was young I failed to..." "...save a friend who died from an overdose". We don't know what that critical moment was, but it's something that shapes the character and gives them motivation in the world. I worked with 72 sentence fragments (36 starters, and 36 finishers). Of these, there were 14 common sentence beginnings and endings (one for each of the ranks of the minor arcana, with four chances of appearing, once per suit), and 22 uncommon sentence beginnings and endings (which have a less likely chance of appearing because they're only linked to a single card). Rather than making a brand new array for these, it makes sense to add these elements of data into the existing card arrays at the end.

A similar procedure combined the character's "Potential" and "Future" cards to give them a destiny that would need to be addressed during the course of play. So we're now looking at adding four sentence fragments as data elements into each card array. It still works.    

A couple of open variables need to be added to the mix, because we need to be able to add a range of either predefined or user-defined data into them. These variables would be things like the character's "Name", the way they are marginalised in society (because this is a ket element in the game), an assortment of allies, equipment and other advantages they might have at their disposal.

There are a number of worldbuilding elements that pose some difficulty here... the first of which are the books. Magical books will also need to be an array, each with a name and up to five magical words that can be learned from it. Each book will also need a minimum attribute level and up to three abilities that need to be possessed before the magic can be unlocked. Not all of data slots the magical words will be filled up for each book, some books may only have one or two words associated with them. Similarly, not all of the books will have all of the "unlock requirements" filled up...some books are easier to learn from than others. There needs to be a way for a GM/Narrator to quickly share the books that will be relevant in their intended game sessions. So I'll need to research an import/export option.

The second worldbuilding element is the assortment of magical societies. For this I'm sticking to the factions mentioned when the game was first developed back in 2019, but I'd like the ability for groups to be able to customise some of the societies that are present in their stories. Perhaps a GM/Narrator will have the option of picking one to three global societies, and adding one or two of their own (I always find that a story works better when there are two or three factions for the player characters to play off against).  

If I was to separate out the program into two parts, one might be the GM/Narrator's version (dedicated to worldbuilding and archiving a campaign), while the second would be the player's version. Just thoughts I'm considering at the moment. 

There are a few key elements needed for developing familiars in the game...but I'll save those for the next post.



Comments

Popular posts from this blog

A Guide to Geomorphs (Part 7)

A Guide to Geomorphs (Part 1)