Hurling Simulation Engine

I have started on a new project to do in my spare time. Its based around two things I really enjoy, Hurling and sports simulation games. I have started writing an engine to simulate hurling matches and give out scores, stats and match reports. I started by looking at results over the last two years for matches to try get various stats such as goals per game and points per game. I then broke it into steps, first getting the right number of scores, then scores per team, then goals and points per team. Right now I am simulating results quite similar to real results.

The program takes in teamsheets from textfiles with the players listed in position. Each player has 4 ratings, goalie, defence, pass and attack, on a 1 to 20 scale. These determine how good each is in each position. Player abilities affect the overall team performance and the likelihood of each scoring. I am currently trying to alter the probabilities further so that the overall attacking skill affects the scores of a team as does the defence.

I also can read commentary in from textfiles and with some manipulation can output the action just performed. All these are put together and outputted to another file.

Sample Teamsheet
GK,GKA1,7,2,1,1
FB,FBA1,1,8,3,2
FB,FBA2,1,9,1,2
FB,FBA3,1,7,1,2
HB,HBA1,1,8,3,2
HB,HBA2,1,8,4,2
HB,HBA3,1,7,5,2
MF,MFA1,1,5,8,3
MF,MFA2,1,4,9,5
HF,HFA1,1,2,7,7
HF,HFA2,1,3,5,8
HF,HFA3,1,2,6,8
FF,FFA1,1,1,1,9
FF,FFA2,1,1,3,7
FF,FFA3,1,2,3,9

Sample Match Report

MIN) 0 The ball is sent over the bar by HFA1.
0-1 TO 0-0
MIN) 2 MFA1 picks up the sliotar and hits it over the bar.
0-2 TO 0-0
MIN) 7 WIDE
MIN) 9 The ball is sent over the bar by FFB2.
0-2 TO 0-1
MIN) 12 The ball is sent over the bar by MFB1.
0-2 TO 0-2
MIN) 13 FFB2 picks up the sliotar and hits it over the bar.
0-2 TO 0-3
MIN) 14 FFB3 catches the ball, turns and scores a goal.
0-2 TO 1-3
MIN) 17 MFA2 picks up the sliotar and hits it over the bar.
0-3 TO 1-3

 

Advertisements
Tagged , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: