Procrastination

The first idea of the game was to make a clicker stat-builder, e.g. you click on a button and gain experience which results in leveling up and getting higher stats. After one "release" (as in a somewhat working program) I changed the idea to be an automatically running builder where the player choosing between different attack options.


Hard work often pays off after time, but laziness always pays off now.

Irresponsibility

My new project is a single player strategy RPG where you control up to 15 characters at the same time and battle monsters on, to start with, gridded map.

No single raindrop believes it is to blame for the flood.

Monday, February 2, 2009

A new game

So far I haven't done anything except experimenting with some ways to control the battle and functions for calculating attacks.

I made two experiment projects to test whether it is best to do calculations within a specific class or to have an overlooking class that fetch information, which is the only thing the other classes keep track of. Example for an attack the unit class could have the attacked opponent as parameter and return the resulting damage, or the overlooking class can just fetch all neccessary information from both the attacking and defending unit.

The drawback of the overlooking class is that all units will have the same calculation, which sometimes might not be what we want.

I also tried to make up a suitable function for calculating defence. Before I always let the defence be an absolute valute (simplified: attack - defence = damage, and if damage <= 0 it's a miss) but I found the idea of having a defence recalulated to a valute between 0-1 (0-100%) and multiply it with the attack for a damage as well as using defence (or some other variable) to calculate a probability for a miss.

Right now my function looks something like this:
def = defence, lvl = level, diff = level difference, ratio = defence ratio (0-100%)

ratio = 1 - ((def/lvl*0,6)-(def^2/level^2*0,0004))/(10+diff+(def/lvl*0,6)-(def^2/level^2*0,0004))

or as it looks in code:

double partA = defence * 6 / level / 10;
double partB = defence * defence * 4 / level / level / 10000;
double defRatio = 1000 * (1 - ((partA - partB) / ((10 + levelDiff) + (partA - partB))));

this gives something like 100% damage when defence is 1, 50% at around defence 16-17 and around 25% at defence 50. This will multiply with level so a level 10 will need 160-170 defence for 50%.

No comments: