Archive for December, 2006
Whee! Pouya wanted to try setting up a subdomain on his DreamHosters account, so I ended up getting rhubarb.lepouya.com. Sweet. 1GB of storage, 100GB bandwidth with PHP5 and MySQL. Basically, everything I need to host my current project.
Now, what I really need is a name. I can’t bloody come up with _ANYTHING_, so any and all suggestions are welcome. Its currently playable; the most updated version is up on rhubarb.
Anyway, I’m going up to New York tommorrow, and not coming back until Thursday. Plenty of time to play on my DS and tinker with PvP gameplay mechanics in my notebook; there’s only a couple more bare-bones things I need to implement on my checklist before I can get into the naughty extra bits.
I have to say, I fucking love this wonderful mud-ball. It may be coded like shit in a shit language/script, but its fun to work on most of the time. And that’s what game programming’s about, right? :3
Oh, don’t forget to leave a name suggestion :DNo comments
So I implemented item usage in (and out of) battles yesterday. There’s a potion in the tavern (bottom floor of the inn) sitting on the small table in the front of the room which you can use to gain about 15HP from. You can use it from the inventory menu, or with the ‘use item’ command in battles.
Today I wrote up the code for experience tables, gaining experience from battles, levelling up, etc. I think the hardest part was figuring out the overly complex system for stat gains. lolol complications.
Basically, when you level up you’re given access to the stat allocation page. You can difer the allocation indefinitely – if you level up multiple times without allocating stats it’ll recognize that and let you allocate multiple times etc etc.
You choose 3 of the 6 stats to increase; you can choose any stat any number of times, it doesn’t care (though its not really advantageous to do so due to a couple ceils, but I haven’t really looked into that).
Basically, you’re guarenteed that 7 stat points will be allocated between the 3 categories you select. The ternary stat will always get less than or equal to the secondary, which always is less than or equal to the primary.
$statinc3 = rand( 1, 2 );
$statinc2 = rand( $statinc3, 4 - $statinc3 );
$statinc1 = 7 - $statinc2 - $statinc3;
Makes a nice distribution, I think.
Anyway, there are 3 main secondary stats: maximum HP, maximum MP and dexterity. Each of the 6 core stats is combined with multipliers then summed to get the raw secondary stat gain, which is then scaled by a somewhat random factor. Each primary stat has weights that make logical sense with the different weapon classes, so a dagger-user ends up with the most dexterity, and the magic-user gets the highest max MP. That was a nightmare working out…
Anyway, that leaves us with luck, which is… randomly gained :3
$rawluk = rand(0,1)*rand(0,1) + rand(0,1)*rand(0,1) + rand(0,1)*rand(0,1);
And so on. This presents us with a nice little screen (using the stat choices from the above screen) like this -
I’m going to finish up the weapon/armor code tommorrow, which involves the stats and such to determine overall power/defense/evasion/accuracy and such. Basically, the transformation between the numbers and the actual gameplay mechanic. Its all starting to come together…No comments