Day 10 was spent creating the base foundations for the Profession systems; and all of the crafting systems were finished without a problem. The next step, and one that I have put some serious hours into today is developing a system that allows characters to perform gathering tasks (which will also be the foundation for the quest system). I currently have the system working in-theory, but it is far from the completed system I wanted in place; so I'm going to devote another day to working on it. If it proves to be too much for the next few days, I'll simply revert it to the system I'm using now and move along to other problems; this is simply a 2-Week Prototype project after all.
The crafting systems that currently work are Alchemy, Armorsmith, and Weaponsmith; all of which have a Basic and an Advanced version of their crafting item. I can add as many as I want, but it all goes back to that 2-week project thing: how much does a game with 1 boss fight need? I opted to display the ability of collected inventory to crafted inventory based on character data values, and used that to the best of my abilities. In creating crafting, I also had to create an inventory; which runs in its own script; one that can be accessed from inside and outside of battle.
I first check to see which "characterProfession" integer the "characterSelected" has, and then based on it's return value, I display a specific menu; much like I did for changing Classes, Roles, and Professions. This time, it also checks the character level to see what objects can be crafted. In the future, all of the professions will have their own levels to them, or switching professions will cause you to start over from a base professional level of 1. This would prevent players from using a single character to do all professions; I might implement this tomorrow if time is available.
If the character level meets or exceeds a requirement for a specific crafted object, then the button appears. It also displays statistics about the item such as the crafting materials required, how many of said material you currently have, and how many of the crafted item you already have in your inventory. Basic information, I felt was fairly necessary to a crafting window. If you have the necessary items, it will allow you to craft the object, and all of the basic information updates to reflect the changes.
As for the gathering professions, those are posing a problem. I know how it could be done easily, but it would require thousands of lines of code based on duplicated methods for each of the 15 characters. This will probably be the route that I will have to take. The currently implemented alternative is to simply toggle a bool as true when any character is currently using a gathering method (gather herbs, gather ore); and allow that method to "InvokeRepeating" until it is cancelled. Gathering is time-based with a "roll for success" algorithm to see if the gathering was successful. It simply runs the script every 5 seconds to see if you gathered a plant, and then starts over; if it's successful your inventory count goes up.
The next easiest way to extend this would be to simply add a modifier to the roll, allowing the system to gain a bonus to their roll (or decrease the gathering time, with a higher initial time up from 5 seconds) based on the amount of characters you have gathering that specific object at any one time. This would mean, for example, that each character could add themselves to the Gather Herbs pool, allowing more herbs to be gathered overall in the same amount of time. So, instead of my current script of:
void GatherHerbs()
{
var herbgatherRoll = Random.Range(0,11);
if(herbgatherRoll >= 7)
{
itemBasicHerb ++;
}
}
It would look something like this:
int charactersgatheringHerbs = amt; //where 'amt' is the number of characters you have gathering
void GatherHerbs()
{
var herbgatherRoll = Random.Range(0,11);
var totalherbgatherRoll = herbgatherRoll + charactersgatheringHerbs;
if(totalherbgatherRoll >= 8)
{
itemBasicHerb ++;
}
}
This would allow you to add 8 characters to the gathering pool and always get an herb. I'm going to lean towards this way, simply because it's relatively efficient and still allows the player to benefit from having multiple characters gathering from the same resource. It will also allow me to convert the gathering bonus over to a gathering time reduction later when there are more than 2 types of herbs to gather. Remembering that changing your character profession will immediately remove that character from the pool, and the bonus.
No comments:
Post a Comment