generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Attack and Defense Formula

Previous Thread :: Next Thread 
DaveHereYouTube is not online. DaveHereYouTube
Joined: 13 May 2016
Total Posts: 213
03 Aug 2016 08:07 AM
I'm getting to the point in my game that I'll start making a formula for attacking other players. Problem is a basic formula wont work and I'm looking for suggestions on how I should do this.

Basic Formula
player 1
Attack = 1000
Defense = 1000

player 2
Attack = 950
Defense = 950

If player 2 attacks player 1
950 - 1000 = -50 (no damage)

If player 1 attacks player 2
1000 - 950 = 50 (Half of their life)

In the future players could have attack and defense in the millions. I don't want them to kill players with 1000 less attack/defense in 1 hit. Any suggestions?
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
03 Aug 2016 08:11 AM
if Attack/2 > Defense then

Idk, just don't let people with super high attacks attack super low defense.


Report Abuse
Eslerp is not online. Eslerp
Joined: 07 May 2016
Total Posts: 205
03 Aug 2016 08:14 AM
Maybe you could have some randomness in it. For an example, they missed, or they did low/med/high/full damage.
Report Abuse
DaveHereYouTube is not online. DaveHereYouTube
Joined: 13 May 2016
Total Posts: 213
03 Aug 2016 02:32 PM
Thanks for the suggestions. They will definitely help me try to figure out a system. Does anyone have any more suggestions?
Report Abuse
MisunderstoodOwl is not online. MisunderstoodOwl
Joined: 04 Oct 2014
Total Posts: 181
03 Aug 2016 02:36 PM
Connect players to servers based on their attack/defense stats. Highly skilled players only fight highly skilled players.
Report Abuse
Toonshield is not online. Toonshield
Joined: 04 Mar 2015
Total Posts: 518
03 Aug 2016 02:38 PM
I mean what's the point of having a million attack if you can't even 1 hit a noob? Lame.
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 02:38 PM
Basic Formula
player 1
Attack1 = 1000
Defense1 = 1000

player 2
Attack2 = 600
Defense2 = 600

If player 2 attacks player 1
if Defense 1 > Attack 2 then
damage = math.sqrt(Attack2/2) (~16 damage to higher defense player instead of 0)
else
damage = math.sqrt(Attack2) (~24 damage)


sqrt really helps with big numbers

you might want to divide after sqrt, that way its a bigger difference for not having enough attack power

but this would still encourage ppl not to attack low ppl because low ppl would still do some damage to them
Report Abuse
DaveHereYouTube is not online. DaveHereYouTube
Joined: 13 May 2016
Total Posts: 213
03 Aug 2016 09:50 PM
That's awesome Wowgnomes! Thanks for suggesting it.
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 09:55 PM
Glad i could help dave, best of luck!
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
03 Aug 2016 10:21 PM
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=193511484
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image