Friday, March 28, 2014

2 Week Coding Project - Day 13 : Main GUI Cleanup and Bugfixes

Today I decided it was time to clean up some code. Considering the main GUI code has reached over 4,500 lines (3,500 after the cleanup) I figured it was time to consolidate a lot of the repetitive lines into methods instead; allowing a single line to replace 10 or more in some cases; all of which had been duplicated for all 15 characters. It was a mess. That's what happens when you learn as you go, and it all functioned fine anyways; I'd just rather learn to be efficient while I learn to code.

I also took the time to do all of the bug fixing for the main GUI, not that there was a lot since I do so much testing while I work. I found a few things that needed to be altered because they created impossible loops in the game, mainly restricted to the Quest system. I had overshot a little bit with the amount of methods I ran to calculate questing and gaining experience; so I took another look and fixed everything I could find. I'm sure if any of you try the prototype you'll find a billion things I didn't, but that's to be expected.

I made sure that experience was being calculated correctly by the system, and that it was also being converted into levels when it was supposed to be. This was simple, although it became an issue after I striped all of the extra "characterExperience" variables. I simply made a function on experience gain that if the character experience is above 25, then it is converted into a level. I can add to this later to make higher levels take longer based on a level multiplier (it will essentially take the base xp required and multiply it by the level to create a new required amount); but since this is just a prototype with 1 enemy, I saw that as overkill. At 25xp per level it takes a 6 minutes and 15 seconds to level up a character. Meaning you can have max characters in a little over an hour.

Tomorrow is going to be a busy day; I need to tie all the information from the main GUI into the character objects, since I have changed so much in the last week they all have to be fully rewritten. Luckily, they all have values stored in the PlayerPrefs which will make it so I no longer have to pull those values from another script, everything important will be stored where it can be accessed from anywhere. I should be able to get it all done tomorrow. The only thing I'm worried about not getting done is the character attack rotations, but it shouldn't be too rough. They only really need a basic attack that they repeat, and then a special attack that the player can cast. So that's a total of 32 attacks that need to be created, even though they will all just use placeholder assets anyways.

Tomorrow will be my final day of working on it before I release it as a prototype #1. This doesn't mean that I'll necessarily just drop it immediately or anything. I'll probably keep working until the system is fleshed out the way I want it to, and feedback will decide how much effort gets put into it after that. I have a few more 2-week projects I want to work on, and it would be a shame to spend much extra time on something that isn't liked when I could be working on improving my skills and possibly coming up with something people will like more. In the end, this was a test I gave myself to see how much I could accomplish with a game type I really know nothing about creating; and that's how all the 2-week projects will be.

No comments:

Post a Comment