PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Nov 24, 2017 5:24 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: football simulator
PostPosted: Sun Aug 17, 2003 5:04 pm 
Offline
Forum Contributor

Joined: Wed Feb 26, 2003 11:29 am
Posts: 119
Location: Bristol,UK
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?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 20, 2003 5:57 am 
Offline
Forum Contributor

Joined: Fri Jun 21, 2002 9:38 am
Posts: 120
Location: Memphis, TN
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 20, 2003 10:15 am 
Offline
DevNet Resident
User avatar

Joined: Fri Aug 16, 2002 8:57 am
Posts: 1834
Location: Watertown, MA
(Note, the original poster is in the UK so "football"="soccer" to us American types. Therefore tackle=steal normally.)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 11, 2003 1:03 pm 
Offline
Forum Commoner
User avatar

Joined: Tue Oct 01, 2002 5:28 am
Posts: 89
Location: Gothenburg Sweden
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 11, 2003 1:25 pm 
Offline
DevNet Resident
User avatar

Joined: Fri Aug 08, 2003 6:53 pm
Posts: 2101
Location: Sweden
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...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 12, 2003 2:19 am 
Offline
Forum Contributor

Joined: Wed Feb 26, 2003 11:29 am
Posts: 119
Location: Bristol,UK
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group