Php game formula

Help on attack formulas for php game

Page 1 of 1

11 Replies - 1980 Views - Last Post: 20 January 2010 - 11:18 PM Rate Topic: -----

#1 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,299
  • Joined: 22-October 08

Php game formula

Post icon  Posted 20 January 2010 - 03:26 AM

Hi all, as some know i am creating a php text game, i am in a point of trouble, i am creating the attack system, but i dont know the correct formulas. Here are some variables
$will = 1200;
$level = 1;
$strength = 100;

they are some variables. Now i need to cram them into a formula to equal a small number eg 2 , 5 but every level you gain your strength goes up as does will.
Is This A Good Question/Topic? 0
  • +

Replies To: Php game formula

#2 Auzzie  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 43
  • View blog
  • Posts: 573
  • Joined: 20-January 09

Re: Php game formula

Posted 20 January 2010 - 03:36 AM

What formulas have you tried already?
Was This Post Helpful? 0
  • +
  • -

#3 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,299
  • Joined: 22-October 08

Re: Php game formula

Posted 20 January 2010 - 04:11 AM

1) will/strength*level
2)$rand = rand(1,6);
strength*$rand/level/will
thats about all i could think of lol but, its hard lol
Was This Post Helpful? 0
  • +
  • -

#4 Auzzie  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 43
  • View blog
  • Posts: 573
  • Joined: 20-January 09

Re: Php game formula

Posted 20 January 2010 - 04:15 AM

Okay and what is Will?? If it is something special that can seriously affect the formula then it helps to know
Was This Post Helpful? 0
  • +
  • -

#5 Crehl  Icon User is offline

  • New D.I.C Head

Reputation: 6
  • View blog
  • Posts: 49
  • Joined: 25-January 09

Re: Php game formula

Posted 20 January 2010 - 04:41 AM

I'd be interested to know why you want to do this, as it sounds like all you want is to create a hash of those 3 variables, unless I've misunderstood your original intentions.
Was This Post Helpful? 0
  • +
  • -

#6 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,299
  • Joined: 22-October 08

Re: Php game formula

Posted 20 January 2010 - 04:47 AM

Soz here are all the variables
$will = 1200;
$strength = 100;
$agility = 50;
$guard = 50;
$level = 1;
$rand = rand(1200,4500);
$formula = $will/$strength*$rand/$guard/$agility*$level
thats sorta the formula, but every time a person levels up the $will goes up by 200 $level goes up by 1 and $strength,$agility,$guard goes up anything you train it
Was This Post Helpful? 0
  • +
  • -

#7 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,299
  • Joined: 22-October 08

Re: Php game formula

Posted 20 January 2010 - 04:52 AM

Well as i said its an attack system for a php text based game
Was This Post Helpful? 0
  • +
  • -

#8 Auzzie  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 43
  • View blog
  • Posts: 573
  • Joined: 20-January 09

Re: Php game formula

Posted 20 January 2010 - 05:12 AM

One big problem i can see with your formula at the moment is the lack of brackets ( and ) which would help a lot.
Don't forget when making an attack script you need to calculate the opponents defence too.

So for the brackets maybe try using this:
$formula = (($strength * $will) / ($rand / ($level * $rand)) - $defenceFormula;
Was This Post Helpful? 0
  • +
  • -

#9 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,299
  • Joined: 22-October 08

Re: Php game formula

Posted 20 January 2010 - 05:33 AM

Ok ive changed that formula around to what i want thanks but how do a calculate a defence formula
Was This Post Helpful? 0
  • +
  • -

#10 Auzzie  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 43
  • View blog
  • Posts: 573
  • Joined: 20-January 09

Re: Php game formula

Posted 20 January 2010 - 10:48 AM

that would depend on your defensive stats.... then the formula would be almost the same
Was This Post Helpful? 0
  • +
  • -

#11 nanowire  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 107
  • Joined: 05-January 10

Re: Php game formula

Posted 20 January 2010 - 11:30 AM

This should be in the game forum, not here. Please, save me the trouble of making me report to move this or move this.

This post has been edited by nanowire: 20 January 2010 - 11:31 AM

Was This Post Helpful? 0
  • +
  • -

#12 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,299
  • Joined: 22-October 08

Re: Php game formula

Posted 20 January 2010 - 11:18 PM

Sorry, my fault, but it is a php game and the coding is php and it is php formulas so technically i did post it in the right place lol next time ill remember

Sorry, my fault, but it is a php game and the coding is php and it is php formulas so technically i did post it in the right place lol next time ill remember
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1