Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Battle Algorithm (https://forums.graalonline.com/forums/showthread.php?t=70494)

Chompy 11-30-2006 05:36 PM

Battle Algorithm
 
Well, I am making a battle system, but I am not necessary good at algorithms,
I'm trying to find an algorithm to control the damage, the only algorithm I made, which I thought was good, was this. Well, I hate math, but I know its useful :)

PHP Code:

speed 0.42;
weight 5;
damage 3;
(
speed 0.05) + weight damage + (speed 4)
/* its suppose to be weaker if the speed is low, since you don't got power,
also its suppose to control if the weight is lower-> lower damage
(higher speed and weight = higher damage)
but I wanted to make it, if the speed is too high,
its suppose to make it lower, if its too slow,
well I am not good at algorithms
*/ 

Also, if you would like to help me with my battle system, someone could post algorithms, ideas, suggestions on a good algorithm etc..?

Btw, I am interested to get someone to help me make good algorithms (or learn me how to make better ones), if anyone is interested in teaching me, pm me or leave a post here :)

Andy0687 11-30-2006 09:04 PM

Quote:

Originally Posted by Chompy (Post 1248772)
Well, I am making a battle system, but I am not necessary good at algorithms,
I'm trying to find an algorithm to control the damage, the only algorithm I made, which I thought was good, was this. Well, I hate math, but I know its useful :)

PHP Code:

speed 0.42;
weight 5;
damage 3;
(
speed 0.05) + weight damage + (speed 4)
/* its suppose to be weaker if the speed is low, since you don't got power,
also its suppose to control if the weight is lower-> lower damage
(higher speed and weight = higher damage)
but I wanted to make it, if the speed is too high,
its suppose to make it lower, if its too slow,
well I am not good at algorithms
*/ 

Also, if you would like to help me with my battle system, someone could post algorithms, ideas, suggestions on a good algorithm etc..?

Btw, I am interested to get someone to help me make good algorithms (or learn me how to make better ones), if anyone is interested in teaching me, pm me or leave a post here :)


Is this an active system like Maloria or Zodiac?

Yen 11-30-2006 09:59 PM

Just do what I did: pull some formulas out of your ass and let people play with them. If they don't work, try changing some things around to reflect what you want changed.

Zodiac's started off with a formula for damage and damage reduction, but I've changed it so much that the actual damage/reduction goes through three or four formulas before it reaches the final result.

KuJi 11-30-2006 10:01 PM

temp.dmg = somecalculationdmg + int(random(0, 10));

coolio =D

_Z3phyr_ 11-30-2006 10:53 PM

of course! an algorithim!


....wait what's an algorithym?

Chompy 11-30-2006 11:38 PM

Quote:

Originally Posted by Andy0687 (Post 1248807)
Is this an active system like Maloria or Zodiac?

What you mean? :)

Quote:

Originally Posted by Yen (Post 1248828)
Just do what I did: pull some formulas out of your ass and let people play with them. If they don't work, try changing some things around to reflect what you want changed.

Zodiac's started off with a formula for damage and damage reduction, but I've changed it so much that the actual damage/reduction goes through three or four formulas before it reaches the final result.

I'll try that :)

many formulas there :O the most easiest damage calculation I have made is:

PHP Code:

int((power 3) *  8



Well, for the battle system I am making, I am trying to make the damage depending
on speed, weight and normal damage, also I am planning to having buffs,
resistance etc.. (Mudlib :) ) I've been wondering, like where should I store player's buffs,
armor addition etc.. like in a clientr. string? anyone have suggestions? ideas?
I was wondering if I should use clientr. strings, so players can't reconnect to lost bad buffs etc..
or a database, I dunno, any ideas?

coreys 12-01-2006 01:23 AM

Yeah, that's what I do Yen. xP

Eventually you do come across a pretty good one.

Chompy 12-01-2006 01:32 AM

Quote:

Originally Posted by coreys (Post 1248935)
Yeah, that's what I do Yen. xP

Eventually you do come across a pretty good one.

Hmm, I gotta try that :p

smirt362 12-01-2006 02:18 AM

Quote:

Originally Posted by Yen (Post 1248828)
Just do what I did: pull some formulas out of your ass and let people play with them. If they don't work, try changing some things around to reflect what you want changed.

Zodiac's started off with a formula for damage and damage reduction, but I've changed it so much that the actual damage/reduction goes through three or four formulas before it reaches the final result.

Pfft...it was my formula from Maloria when you worked there. Tee hee...JOKE TIME

jake13jake 12-01-2006 02:42 AM

Quote:

Originally Posted by Yen (Post 1248828)
Just do what I did: pull some formulas out of your ass and let people play with them. If they don't work, try changing some things around to reflect what you want changed.

Zodiac's started off with a formula for damage and damage reduction, but I've changed it so much that the actual damage/reduction goes through three or four formulas before it reaches the final result.

Wow, that's pretty inefficient.

Idrox0 12-03-2006 07:49 AM

I like this one.

NPC Code:
Attack = Power + Random(int(Power/8));
M = int(Strength * Level / 128) + 2;
Defense = OpponentsDefenseFactor;
Damage = (Attack - Defense) * M;



Such is the 'Swords' damage formula of Final Fantasy V. You could also use this one (which would only really be accurate for blunt weapons):

NPC Code:
Damage = int(WeaponWeight^2 / Strength);



Quote:

Originally Posted by jake13jake (Post 1248972)
Wow, that's pretty inefficient.

I second that.

Yen 12-04-2006 12:14 AM

Well, it's an action RPG.. You have to take things like the area things hit in, how fast they hit, comparison to other things, ect. into consideration.

You can put down formulas that look good on paper, but it's unlikely they'll be that great in-game.

Andy0687 12-04-2006 06:50 PM

Quote:

Originally Posted by Idrox0 (Post 1249531)
I second that.

As inneficient as it is may read to you guys its probably the best bet.

Come up with something, and time test it, and revise, until it works. No one makes anything perfect the first time they try, it can always be improved or changed later. Eventually it will work well and youll go from there, if you had any doubt about that, i do notice Zodiac is actually on the classic list, so its got to work somehow.

Chompy 12-04-2006 08:48 PM

I think I found a good algorithm :D

HTML Code:

Damage = int(WeaponWeight^.75 + ((Strength * Power) /2));

jake13jake 12-06-2006 12:58 AM

Quote:

Originally Posted by Yen (Post 1249816)
Well, it's an action RPG.. You have to take things like the area things hit in, how fast they hit, comparison to other things, ect. into consideration.

You can put down formulas that look good on paper, but it's unlikely they'll be that great in-game.

You could make something good, or you could use an already proven algorithm if you've really researched your topic. If you're experimenting you'll end up making something better over time, but you'd need to take into account the ups and downs of it.


All times are GMT +2. The time now is 04:48 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.