I don't remember when i last slept this well.. At least 9 hours! (This blog remembers it though... most likely)
Yesterday i enjoyed playing through a lot of contrast, enough played as a designer to learn from it, but i want to finish it for the story :I Apart from storyline and plot "tricks" theres little in that game i can use although i might use the parallel universe thing they've got going on (i.e. make my own) i had thought of the Dragons in amodos that way. That their evli had laid waste to their own world parallel to amodos in a separate dimension, and then after killing off each other for a long time (since there was nothing else left to destroy nor eat) one of the few surviving dragons discovered a way into Amodos (out of their dimension) and he taught the remaining (strongest survivors...) dragons to enter that world.
This way i can make most of the dragons evil, without actually forcing them to be evil (so anomalies like Parthurnax could exist) that is, they were forced into cannibalism and inner conflicts after destroying everything else. They learned too late how important it was to limit their destruction so they wouldn't run out of things to destroy.
Interesting enough right? it'll do.
As beings from another dimension, they're not bound to the same laws as creatures in Amodos, which is why they are simply the strongest creatures in the universe (and Zinth is furious about how they disrupted the balance and actively tries to fight them, they're his or "it's" only real enemy. Whereas the other gods don't seem to care much about them.)
I realized something today, why i think usually game or movie number 2 fails compared to the first. It's probably because the authors try to create "more of" and "less of" something from the first movie/game instead of just continuing the story. For example Lord of the Rings had it's script written many years before the movies were made (in the form of novels) and everything in the movies followed the original books word by word, the books were all about continuing the story rather than balancing violence or romance or discovery/exploration or something like that, it was all about finishing the quest, whereas say.. Highschool DxD which i watched recently, which had a lot of pointless fanservice in the first season, turned it up even more in the next season. It went "more shounen" and "more ecchi" instead of "more story" and therefore it had more pointless/filler/episodic episodes in it than the first season.
Another example is most action and shooter games where the next game always tries to be more violent than the first, and to excuse the added violence the story often must change to accommodate for that which will very possibly damage the atmosphere and the overall flow of the story.
It's something i must avoid... and i didn't seem to be headed towards that either, for example my game nr. 2 will be a completely different story with a slightly different atmosphere than my first game, although linked it's not intended as a continuation of the story.
Then the 3rd game with the undead protagonist is going to take a jump back a bit and be a bit less dark than the first, but not (anywhere near) as light as the second.
Oh yeah and today i read some manga (or what's out of it) named Hakaijuu, i learned something valuable from it and i now know why i had to turn away from making only bad endings to Yrja's Torment like i had originally intended so fast. It's because i loved my protagonist... If i create characters that i actually hate, without making it obvious that i really hate them, i can kill them off at any time i want when no one is expecting it. Another trick i figured out is that people will least expect a character to die when that character is still important to the story, for example Kamina from Guren Lagann (as much as i hated him... and was pleased to see him die, but i was still surprised!)
Killing off side characters that i like, although painful is possible, but killing of lead characters, important ones that the story actually focuses on a lot is hard... I can get just as attached to the characters as the readers if not more.
I haven't finished Amnesia: A Machine for Pigs yet. But the plan was to leave Yrja's Torment in an atmosphere not dissimilar from what you can hear from Amnesia's ending song. I.e. make the player feel like shit. A sad but at the same time beautiful ending.
Thinking back again...
It really could be for the best to turn back to that. One thing is for certain though, i need to refine and massively increase the drama in the ending i currently have planned (which could slightly change once i've actually written the story up till that point).
Anyways, i need to get back to work :)
6 hours of slacking today... i guess classes are really intimidating aren't they? but this ends now! i'll fire up Devildriver and proceed! i must do this! And i shall do it now! (Even if i want to be playing Contrast and finishing up Seikon no Qwaser...) oh yeah about emilie autumns book (The Asylum...) the reason i haven't finished reading it yet is that i was enjoying it so much that 50 pages in i decided to order a physical copy, it'll be in my hands a day or two from now :)
10 minutes later...
I'm onto something! Yes!!
I see it all so clear now. Classes are perfect for this!
here's some example code of what i'm talking about for the crafting skill.
So i can basically just make 9 classes (1 for each major skill)
I could make 1 class named "skills" but... at least right now that doesn't seem like a good idea. I don't need to do that right now.
Another good thing is that now everytime i ask it to display or check the skills level it re-calculates it. (Perfect!)
Now lets see... i think this is the best way to do it. For now at least. I mean i should be able to create a class called player, then assign the values from that class to the player class and ... bah... what am i even trying to explain. Well it's obvious anyways.
What does this mean though? that i got classes down and used them for the skills?
It means that apart from implementing the experience system, the route towards finishing this leveling system prototype is 100% clear, i've learned to use all the tools i need to finish it.
This also means that my programming skills just got a level up. I now have the basic skills needed to use all the tools at my disposal, the rest of it all is just figuring out how best to use them. In my past experiences i've been pretty good at that and in fact i enjoy doing that.
Now before i finish up writing down all the skills(or classes for them) how do i intend to implement the leveling system?
...?
Hmm... well the plan was that everytime the player uses a skill he gets experience points towards leveling that skill up, then once he has X amount of experience he gets Y level instead...
HmMmMmmm...
Lets see the code if i remember was
...
I found the code, but the python code and the Java code aren't giving me the same results, and i based everything off the java code so i have to make the python code match up to it. It's taking a while Dx
Finally!
I got it!
for lvl in range(1, 100):
exp += int(lvl + 300 * 2 * lvl / 3)
output = lvl + 1, exp / 4
print ("Level %d = %d" % output)
raw_input()
Haha! it worked! what a fucking pain in the ass... Python is weird when it comes to math (i removed all the (s and the )s... and the formula all of a sudden worked...)
Ok.. now that i've got the formula for generating the experience required for leveling up, how will i actually apply that? uhm.. hmm...
What if i turn it into a while loop instead of a for loop?
No i need it to be able to run infinitely... Hmm... Now this is getting hard :/ i need to find a way to stop the for loop from generating another level until the player's exp is enough to level up... Why do i need to do that? Well because i cannot create dynamic variables for every single level (that'd just be fucking stupid...)
break is the command i was looking for!
i added this line
if exp < experience:
break
to the end of the file and now it'll just stop if the player's exp isn't high enough... but wait things are never so simple are they? if i do that it means i'll have to start over again every time i run the for loop so i need to have a way to register where it stopped and start there again D:
Allright, this is what i needed...
minlevel = 1
maxlevel = 100
level = 0
points = 0
exp = 0
for lvl in range(minlevel, (maxlevel + 1)):
points += int(lvl + 300 * 2 * lvl / 3)
output = lvl + 1, points / 4
print ("Level %d = %d" % output)
level = lvl
if exp < (points / 4):
break
points = 0
I've got a level value which tells me the current level, i've got an exp value which tells me the current exp i've got, i've got minimum and maximum levels functioning exactly like i want them to. and the points value is reset on every run so everytime i run it again it generates the whole list again (not as good as picking up where it left off, but when we're talking about a value of 1-100 it generates it fast enough so that it won't matter... a matter of milliseconds, it'd stay that way even if i go to 1000 too. Going above 1000 and i'd have to optimize this for better speed though, i think i could do that by turning it into a while loop because if i use a while loop i can make it start at the last level... hmm..)
Hehe since i saw a chance to optimize how could i possibly let go?!
minlevel = 1
maxlevel = 100
level = 1
points = 0
exp = 0
while level in range(minlevel, (maxlevel + 1)):
points += int(level + 300 * 2 * level / 3)
output = level + 1, points / 4
print ("Level %d = %d" % output)
level += 1
if exp < (points / 4):
level -= 1
break
This is just as precise as what i had before, and it doesn't require me to reset "points" everytime it's run. The only drawback of using this is that it doesn't support reducing my level/experience, if i do that with this code it'll break. If i want to reset my level to a lower value i have to reset points and level before i run it again...
That's a small tradeoff in return for the increased speed :) and with this it'll be no problem if i set the max level to over 1 million, whereas doing that would temporarily freeze up the program if i used the older code. Excellent!
Now that i have that... i'm back to needing to find a way to implement it, but it's become a whole lot easier to do that now that i have exp & level variables.
Oh thats right like i said earlier i could implement it as a sub-class for each skill class, but... That's kind of ugly, still.... I don't think there's another way, and with this (slightly improved) code i think it's a feasible solution.
Well i was working very well, and i indeed am super close to having a satisfactory prototype code for this whole thing, but i got interrupted by the mailman. My book was delivered! and with it i got some top notch white tea mixed from mostly rare as fuck herbs + american peppermint. I figured my life would be pretty sad if i didn't at least once in my life taste some high quality tea... right?
Anyways then i got back to it, one thing i'm wondering now is if Python's float -> int conversion floors or approximates :/ easiest way to find out is to well... check...
It floors! magnificent! (The only thing i would ever want to approximate rather than floor would be... honestly... i'm not sure. But possibly stats.)
Well.. i realized after figuring this out that at the time i was interrupted i already had a functional code... :O
Now i just need to write that on a bigger scale... And question if this is really the most convenient way to do this? hmm.... There's not exactly anyone i can ask... I do know though that this is a fairly complicated way to do it, but what i was aiming for in this first prototype (above all) is "accurate" rather than "fast/optimized" or "simple/readable" code.
Writing it on a bigger scale without making any mistakes is hard =_= i generally need to test everything as i write it to be sure. And it's a lot of skills (shame on me)
One thing i have decided though, is that when i'm done with this and satisfied, i'll donate it to Ren'Py cookbook... nobody should have to go through all this trouble just to set up a fucking leveling system Dx
I'll have to continue tomorrow though. Today was productive even if half of it was spent slacking! I hope for a better tomorrow ^_^
No comments:
Post a Comment