Jump to content
  • Advertisement
Brad Utterstrom

please help me get my game started

Recommended Posts

I'm just starting to learn programming myself. I'm currently designing a game (hockey fight simulator) and plan to either program it myself, or have someone else get started and then I take over at some point (probably gradually making changes as I learn). I plan to use javascript. At this point I'm looking for anyone interested in helping, from just looking over what I've got so far and helping me 'clean it up' so it's ready to be coded, to getting the coding started.

I'm just going to post what I have so far of the fight engine so people can take a look. I feel like it could be created as a working program from this, but I also think this needs some work...cleaning up the language so it's more consistent. And even though I think the math works out, I feel like my formulas are inconsistent as well...like I should use the same general method in different areas whereas right now I'm using several different methods. Maybe I'm wrong and it's just fine. Anyway, please take a look and let me know any thoughts:


This is a working version of the sim, though I've taken out several features I want to add in later in an advanced version (such as tying up/grips, toe to toe exchanges, dirty fighting, etc)

Fighter ratings:
offense: 1-10
defense: 1-10
overall rating: Ox2.5,Dx2.5,Px4,Cx3,Bx1,Sx1 (rating up to 100)

takedowns: 0-2
bleeder: y/n (a bleeder has -5 to his overall rating above)

We break the fight down into 5 second increments called 'half rounds', a full round equaling 10 seconds. Each half round a fighter can throw up to a punch per second, and we also need to check each half round for fight ending scenarios such as fighters slipping, linesmen intervention, and takedowns.

First, at the beginning of each half round, check to see if a fighter will attempt a takedown. If he
does, this replaces attacks for that half round (ie, he spends the entire 5
seconds trying to tug and pull his opponent down). The reason we check this 'first' is because a guy like Mick Vukota would often go for the takedown very first thing, he might not even throw a punch. So we'll check for a takedown before we even check for punches, and then again to start each new half round.

Takedown rating=% chance
*note: add 5% if a fighter is losing decisively (behind by 10 fight points or more).

When a takedown IS attempted, it is a balance check for the opposing fighter.
BAL rating
1    80% chance of success
2    65%
3    50%
4    35%
5    20%

(the reason it's just a straight balance check for the fighter being taken down is because the balance of the fighter attempting the takedown doesn't necessarily correlate to how effectively he can take a guy down. Again using Vukuta as an example since he's the takedown king, he doesn't have a high balance himself as he's not known for having long fights. A guy like Domi or McSorely who DOES have great balance is not known for taking guys down.)

every second, before modifiers, there is a 30% chance each fighter attempts a punch. Add 5% for each offense point of the aggressor (i.e. + 5xOff), subtract 5% for each defense point of the defender.

The base chance of the punch landing is 30%. Again, add 5% for each offense point of the aggressor, subtract 5% for each defense point of the defender.

If the punch lands, we need to determine if it is a light punch (no damage), or power punch (either hard punch or haymaker)
Our modifier is (power)^2 of the attacking fighter (1-25)-(2x def of the defending player). So the modifier is between -19 and +23. The base chance of a hard punch before the modifier is 25%. So even a weak puncher against a great defensive fighter has a 6% chance of a hard punch, and a 5 power puncher against a very weak defensive fighter will land hard punches almost half the time.

To determine if a hard punch that has landed is upgraded to a haymaker, we run the same check again but with the modifier halved (so the chances of a haymaker is 15.5%-36.5%. (Is there a way to determine hard punch or haymaker all within the first roll, rather than needing a 2nd roll? Feels like there should be.)

Whenever a hard punch or haymaker lands, we must determine if it causes a cut,
any type of knockdown, or both. There are 3 types of knockdown: KO/TKO/KD.

KO is a clean knockout, fighter can't get up on his own or gets up wobbly. No doubt
about it.

a knockdown (KD) or technical knockout(TKO) are virtually the same, with one slight difference...when a knockdown occurs, there is a slight chance the fighter gets back up and continues fighting. If he does, it's a knockdown. If he doesn't and the fight ends as a result of that punch, it's a TKO.

TKO is a clean knockdown and the fight is over, but the fighter is able to get up on his own and is relatively unshaken. KD is a flash knockdown, a player takes a punch and goes down, but it's clear he wasn't hurt, and it's unclear whether the
punch landed cleanly and dropped him or it just knocked him off balance
momentarily. He gets back to his feet quickly.

On a hard punch, chance of a knockdown is 20% at baseline. Modifier is (power^2)/2 of the puncher - (chin^2)/2 of the punchee. So the modifier will be +12% for a 5 power against a 1 chin, and -12% for a 1 power vs 5 chin. So percentage chance of knockdown on a hard punch ranges from 8% to 32%.

If a knockdown occurs, check to see if the fighter gets back up quickly. There is a 20% chance the fighter pops back up quickly and continues fighting before the linesmen can break it up. If so, the fight continues. If not, it's a TKO. On a TKO, the fight is over and the winner of the fight is the one who caused the TKO, regardless of fight points.

On a haymaker, the process is the same, only the base chance is 40%, so the range for a knockdown is 28%-52%. Check to see if the fighter gets back up quickly, same as before 20%.

To see if there is a KO, if a knockdown occurs on a haymaker that's landed, we need to make another check. This time, the base chance is only 15%, we use the same modifier as before (power^2)/2 of the puncher - (chin^2)/2 of the punchee. So the range of a knockout should be 3% to 27% (15 + or - 12) depending on the ratings of the fighters. (This means that even a weak puncher has a very slight chance of knocking out a 5 chin if he lands a haymaker)

Once again, if there is a knockdown but the fighter does not get up quickly and it's not a knockout either, then it's scored as a TKO.

(note, I'd like to work in some way for varying degrees of cuts, perhaps by running a second check on a successful cut similar to how we checked for a knockout. But for now let's keep it simple..though multiple 'cuts' to the same fighter in the same fight are possible, and I tend to think of that as a cut worsening)

Chance of a cut= 3x the attacking fighter's power on a hard punch (so a 5 power puncher causes a cut on a hard punch 15% of the time). For a haymaker, double it (6x power.) For a bleeder, multiply the chance of blood by 1.5.

*note...it is possible for 1 punch to cause a KD/TKO/KO AND cut at the same time. These checks are not mutually exclusive.


After every half round (5 seconds), check to see if the fighters slip to the ice: Base chance is 27%-(fighter A balance * fighter B balance)
So 2 fighters who are 5 balance would have a 2% chance of slipping, 2 fighters who are a 1 would have a 26% chance.

When a fighter slips, he may get back up. The % chance of that happening is the
combined balance of the 2 fighters, x3.

after every half round, check to see if linesmen intervene:
*if neither fighter landed a punch in the previous 5 seconds, 50% chance
*if one fighter is winning the fight decisively, 50% chance
*if the half round was fought 'toe to toe' linesmen will not intervene.
*if fight is past the 30 second mark (12 half rounds), 5% chance.

note: when linesmen move in, there is a 1/1000 chance that they catch a stray punch for their efforts!


A fighter begins to tire after his stamina rating has been surpassed in FULL rounds. IE, a fighter with stamina 4 begins to tire after 8 half rounds (4 full rounds, 40 seconds.)

When a fighter's stamina rating has been surpassed, the following ratings suffer:
offense: decreased by 1, continues to decrease by 1 every half round (minimum 1)
power: decreased by 1, continues to decrease by 1 every FULL round (minimum 1)
defense: decreased by 1, " every FULL round (minimum 1)
balance: decreased by 1, " every FULL round (minimum 1)
takedowns: increased by 1. So a fighter with a 0 for takedowns now is considered a 1. Tired fighters are looking for a way out.

Ok so the fight is over, either a fighter slipped, got knocked down (or TKO'd/KO'd), or the linesmen broke up the fight, or a fighter was taken down (I think that covers all the ways to end a fight.) Now how to determine a winner? If there was KO or TKO, it's an automatic win for the puncher. Otherwise, we calculate the following FIGHT POINTS.

Each fighter gets the following points:
weak punch=    1
hard punch=    3
haymaker=    5
cut caused=    5
knockdown=    5
TKO=        10
KO=        25

It's possible (though unlikely) for their to be multiple cuts or knockdowns by the same fighter during a fight, so remember to count 5 points for EACH cut or knockdown.

If a fight is even or within 2 fight points, it's considered a DRAW
If a fighter wins the fight by 3-9 fight points, it's a NARROW WIN
If they win by over 10 points it's a DECISIVE WIN

final note: obviously all of the formulas in here can and probably will need to be adjusted. We'll have to playtest and see if fights seem to be going too long, or if there's too many or too few punches landed, too much blood or too many knockdowns/KOs. But this gives us a starting point.


Share this post

Link to post
Share on other sites



Honestly, I find it hard to imagine how (or if) this system works from just reading 3-4 pages about it. I think you should write a small demo. Then one can discuss how to approach/fix certain aspects that are not working so well.



Share this post

Link to post
Share on other sites

I appreciate the response. I didn't expect anyone to read through the whole thing unless they were really curious about it. And I'm sure you are right, I bet it's got a couple holes. (Like what happens if both guys land a simultaneous punch and they both go down? I didn't specifically address that, but it could happen.) Anyway, that's why I'm posting it here, to try to get some help with it.

I'm no programmer but I am trying to learn. That's why it's written in layman's terms instead of code at this point. So yes, my goal is to get a demo made up and then fine tune it from there. I'm certain the formulas will need some tweaking after playtesting, but this is a start.

Share this post

Link to post
Share on other sites

So, you posted an outline of the game's design. What question do you have - is it about the writing, or is it about the math:

7 hours ago, Brad Utterstrom said:

even though I think the math works out, I feel like my formulas are inconsistent as well...like I should use the same general method in different areas whereas right now I'm using several different methods. Maybe I'm wrong and it's just fine.

The only good answer is: build it. If you can't code, make a paper prototype. Test the math by playing it. You can't know what precise math of everything on paper will be fun to play.  ...I'm not sure, but maybe this thread ought to be moved to the Game Design forum. 

2 hours ago, Brad Utterstrom said:

yes, my goal is to get a demo made up and then fine tune it from there. I'm certain the formulas will need some tweaking after playtesting, but this is a start.


Share this post

Link to post
Share on other sites

I actually enjoy simulation games and have programmed them in the past. Have you considered just using something simple like HTML/CSS/Javascript to do this? If you wanted to go online it would be an easy step moving into PHP and working with a database with SQL

If you're actually looking at going full blown 3D it's very doable. These games are essentially spreadsheets playing out different scenarios, tracking stats, playing out possible events, ect... then you project the results visually either through text, 2D graphics, 3D graphics, or a mix.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!