football simulator

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
toms100
Forum Contributor
Posts: 119
Joined: Wed Feb 26, 2003 10:29 am
Location: Bristol,UK

football simulator

Post by toms100 »

this is more a theory question.
ive been thinking about making a football management game, and ive had a few thoughts about the hardest (and most important) part of design: the match simulator.
now i would have players on each team with stats in different areas, but the question is this:
do i do a one off run through calculation based on the stats and random numbers to generate a score, or, create a virtual pitch where the players run around (based on ai and random numbers) and when players reach each other certain things happen (such as a players tries to tackle another and the stats decide who wins the tackle and it goes on from there), but i think that would be very hard to create a set of circumstances which the ai must react to...

anyone care to share any ideas?
will
Forum Contributor
Posts: 120
Joined: Fri Jun 21, 2002 9:38 am
Location: Memphis, TN

Post by will »

i would think to create a large matrix that represents the playing field. a regulation field is 160' wide and 300' long (plus 30' for each end zone). figure a person takes up a 2' x 2' area when standing, so you would have a 80x180 matrix. track the position (X and Y coordinate) of each player at all times, as well as the coordinates of the ball. when two players occupy the same block, the one with the greater strength (maybe factor in fatigue and inuries) will tackle/block/knock down the other player. When the receiver occupies the same block as the ball, figure some algorithm that will determine if he catches it based on skill and whatever else, as well as a little bit of randomness.

well, that's where i would begin anyway.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

(Note, the original poster is in the UK so "football"="soccer" to us American types. Therefore tackle=steal normally.)
User avatar
cybaf
Forum Commoner
Posts: 89
Joined: Tue Oct 01, 2002 5:28 am
Location: Gothenburg Sweden

Post by cybaf »

go check out http://www.managerzone.com and see if you can talk to someone at their staff about how to set it up... but in general the setup shouldn't be much different than from the Am. Football example above.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

toms100 wrote:...but i think that would be very hard to create a set of circumstances which the ai must react to...
Depending on realism (I asume you are into 100% as real) it would be very hard.

Lineup (amount on defence/offence), individual stats, team stats, home/away... yikes. ;)
Extremely (!) interesting topic tho. My question is, how fast would php/sql parse the code and get some sort of result on an average server-sertup? It sounds like intence work...
toms100
Forum Contributor
Posts: 119
Joined: Wed Feb 26, 2003 10:29 am
Location: Bristol,UK

Post by toms100 »

it is rather intense:(
ive come to the conclusion that perhaps c++ for an engine would be better... but we'll see:)
thanks for all the usefull tips, appreciated
Post Reply