It starts with a little Class
This past week was getting the most bare bones of the program down. At a glance, this consisted mostly of the following:
- Creating a class for in game dictionaries and unchanging variables.
- Creating a character class and initializing basic character fields.
- Creating a few helper functions for re-initializing character stats if the character's type or affinities change.
Now for the more in-depth details regarding the above:
I decided to create a class for in-game dictionaries and lists instead of leaving them as floating global variables. As I've not coded anything of this size before, I'm not sure if there are any risks to this. This layout does provide me with the benefit of initializing the dictionaries to the current_game as a default set. I could easily work in a mod system for DM's where they can add to the creature (playable character or foe) dictionary, or personality/harmony dictionaries (which provide bonuses to characters based on what kind of lifestyle and harmony the character is most in tune with. It allows for the game to be a bit more modular, and allow for further customization for DM driven scenarios (changeling invasions, zombie ponies, or additions of species types that are introduced later in the show). I plan to flesh the dictionaries out a lot more on my own; but this leaves a door for others to add their creativity to customize their game as well.
I'm currently working on a gender dictionary as well. The intention here is to lay down some early framework for a function that can update the pronouns in flavor text (or replace a marker with the accurate pronoun) for a pony depending on their gender/sex. It would be easiest to stick with pronouns based on the characters sex (or identifying gender, if you will), but I'm toying with the idea of having gender and sex as separate variables. This would really please only a very small crowd that wish to identify as a gender different than their physical sex. While difficult from a developer's perspective, I'm also not sure how valuable it is to the target audience, as I imagine many trans individuals would choose the sex they identify as/transition towards. For now I've decided to put in an "undeclared" option, to try and offer an option outside of the binary. Another thought was to rephrase the question of sex to be focused on gender identity instead: "What gender does your character identify as?". This works with the Male, Female, and Undeclared options well.
This is where most of the work so far has gone into. So far I've initialized a number of basic variables for the character upon creation. Each character will get stat bonuses depending on the following:
- Species (Pony, griffin, etc)
- Species type (earth pony vs pegasus vs unicorn vs Alicorn, young vs adult dragon, etc)
- Personality type (hardworking, social, bookworm, etc)
- Harmony type (whichever of the 6 harmonies the character is most in tune with)
- Pony Level
- Inventory/equipment
Additional variables currently process the character's information- a generic description field, the Pony's gender, start position (on game map- to be implemented much later), possibly strength/weakness, and whatever other information ends up becoming relevant.
I may end up adding in a "hardcore" difficulty setting for the game here; where in the normal game if the character is defeated they are captured, and pose a chance to escape. In hardcore mode, the character would perish. This idea was well suited for the game as I had envisioned it in an RP, so I will have to consider whether or not it is appropriate in a single player version of the game.
Last, I've incorporated a few helper functions that loop through the dictionaries (mentioned) above, and apply stat bonuses to characters based on current values in the Character class (also mentioned above). I spent a good deal of time developing my for loop skills so that I didn't have redundant code for each variable or dictionary that I needed to run through- and so far I've managed to get it to work well. Even when a DM adds custom material to the dictionaries in the game class, the helper functions should automatically run through the additional content and process it. Having never done this before- I was pretty happy with figuring it out to this degree.
All in all, its only about 127 lines of code right now, but I've streamlined the code by about that many lines already; so I feel its off to a good start. There are so many things to code that its a little unclear of where to start next once the Character class is situated (for now). I think I may tackle HP or some form of tracking character fatigue next. Beyond that, I'm interested in building a framework of a system for locations and events. I think I'll save combat for a bit later- but I will want to get an early working concept of how that will work out as well. Further areas of development such as a party system and player controls will have to come after the next steps.
For now, its time to head to bed!