GPWiki.org
GPWiki.org
It is currently Wed Jun 19, 2013 7:36 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Sport management game
PostPosted: Tue Aug 07, 2012 1:49 pm 
Rookie

Joined: Tue Aug 07, 2012 12:27 pm
Posts: 4
hi all,

I want to create a simple (really simple) football (not american) managment game. I am not expert programmer, but also not beginner.

The game should be really simple, player has one team witch is managed by him, he progresses through weeks (1 week = 1 turn) and if there is match in this week, it will be played in some text mode.
During the match the time goes on and in some minute the attack action occurs. Every action if it occurs will fire a comentary, statistics update (corner counts, shots on goal, fouls..) and other necessery updates (in future maybe player atribute development update, players mood adjustment etc.)

I have started creating match engine for simulating one match of two teams. The teams are for now really simple, they have overal strength (number) and are compared according to this strenght. I startet to think in way, that every event in game will be defined as action. So I got this concept:


    Attack - the beginning of every event that will be continued by these actions:
  1. Out - the ball went out of the pitch (no ball position, no pitch dimensions comparings, just an event)
  2. Foul - this action should be followed by one of...
    1. Penalty - must be followed by:
      1. Shot
    2. Free kick - must be followed by one of:
      1. Attack - this means no shot on goal, but pass to player and the 0.Attack starts from beginning
      2. Shot
      ...and one of actions:
    3. Injury
    4. Card from referee
  3. Lost possession - from this can occure again
    1. Attack - as counter attack of the defending team
  4. Shot - is followed by:
    1. Blocked shot - can result in
      1. Corner
    2. Missed shot
    3. Cought by keeper
    4. Goal
  5. Corner - results in one of:
    1. Shot
    2. Lost possession
    3. Hand
    4. Foul
  6. Offside
  7. Hand


The bold and underlined actions are definitions, that means that any Shot action that is not bold and underlined can continue as 4. Shot
from this, the sequences of actions can look like:
1. Attack -> Foul + Injury -> Free kick -> Attack -> Shot -> Blocked shot + Corner -> Shot -> Goal
2. Attack -> Shot -> Cought by keeper
3. Attack -> Offside

of course the commentary for user will be nicer, but thats not important now.

Every Action should know (really? can it be done better? some table of actions I read somewhere but can not imagine how to implement and use..) by what action it should be followed and what are the chances of occuring this or that chance according to team strength (the chances will claculate an OddAnalyzer module from team imputs).

Now I want to ask what you think of my concept? I am not sure how to code this, I started with event driven simulation in my mind, than changed to State Management and now I am not sure if I am going the right way.

Thanks for any ideas.. sorry for my EN and for not being smart :)


Top
 Profile  
 
PostPosted: Tue Aug 07, 2012 3:38 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1567
Location: burrowed
Hey zavael and welcome to the forums.

Simulating a football game (or any sports game in that manner) is quite tricky, but since you're not visualizing it you can get away with a lot of trickery.

I'd assume you have some basic input parameters for a match simulation. Meaning the teams players, formation, player strengths and weaknesses if you go for a full on simulation. Meaning you start the match, follow the ball played from player to player, simulate every single action that was taken, check where players are positioned at key moments like passing the ball, or doing a shot to see if someone else might even have the chance to intercept it, and if he then succeeds to do so, and so on.

Since all this is invisible to the actual player of your game you don't quite need to go that far (although it might be an interesting practice) so you can dumb it down to very few parameters that result in different actions.

If your teams overall strength is higher than the opposing teams, raise the odds of something good happening, and lower the odds of misplay. Disregard the individual play of the team, and simply do checks at random times (modified by the odds of your teams strength). Did someone attempt a shot? Follow the chart you did. A state machine would be a good way to start working on that.

From that on you can start to introduce more deciding factors like the opposing teams defensive lineup and formation for calculating the chances if a shot hits the goal or if it's blocked, and how it is blocked (corner, long shot, pass to any other players). There you can start to implement individual behavior like who blocked the shot (determined by team formation for instance) is he good at controlling the ball, can he turn it into a counter offensive etc.

There is really a lot you can account for, but you should ask yourself what is necessary to really simulate if all the player will be informed with is "goal", "foul", "corner", and whatever else.

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Tue Aug 07, 2012 5:49 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 283
Location: Here (where else?)
Quote:
I want to create a simple (really simple) football (not american) managment game. I am not expert programmer, but also not beginner.

The game should be really simple, player has one team witch is managed by him, he progresses through weeks (1 week = 1 turn) and if there is match in this week, it will be played in some text mode.
Let me focus on a different part :)

If the above is your goal (no pun intended), I'd say first write the management part, and at first reduce the 'game' to drawing two random numbers that represent the end result.

Doing a truly detailed simulation may be fun to program (it probably is), but from a player point of view, there is nothing he can do during this time, so it may add little to the 'management' aspect of your game.

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
PostPosted: Tue Aug 07, 2012 7:38 pm 
Rookie

Joined: Tue Aug 07, 2012 12:27 pm
Posts: 4
many thanks to both of you

weezl wrote:
Hey zavael and welcome to the forums.

Simulating a football game (or any sports game in that manner) is quite tricky, but since you're not visualizing it you can get away with a lot of trickery....

yes, thats what I wanted - to simplify the proces... I wanted to avoid watching the positions of ball and players, everything I wanted to calculate from the odds.. for example - if a blocked shot occurs I simply decide which player did that (in 50% it was cetral defender, 20% it was central or defensive midfielder, in 20% it was side defender and in 10% it could be anyone else). In this way I wanted to decide everything. I know it will be hard to decide the percentages corectly, but whit a try-repair method I could get some nice results and the manager will not notice if it is really simulating or not.

Of course the input data will be sofisticated than just the overall for two teams... i want to describe 3 skills for players - mental, technical and physical, all of them from 20 to 50. from this, the overall for player will be summary of the three attributes (for golakeeper the physical will be probably halved) then from the tactic that was chosen by manager there will be 4 streghts for team:
    forward
    midfield
    defence
    goalkeeping

at the attack chance occurence, i will generate the odds for every action that comes possible to follow and than decide from random generator if the chance was succesfull.. for example the OUT will have 10% to occur, Foul 5% (plus modified by overall mental skill of team), Lost possession (calculated from midfield streghts) etc...

as to correct myself, not allways there will be a comentary for manager. He will have three options how to watch the game:
    just the final result as the manager was not at the game himself
    just watch the time run and see only result changes, injuries or card changes (example)
    and the third will be with commentary instead the picture in the middle of screen (its just for imagine, not my ui design)

but the commentary will be in way that the time will proceed minute after minute and in 5th minute of the game there will be first commentary on screen, after it finishes there can be again 10 min without comment and so on.. in this way I will handle if both equal teams are playing defensively = few comments will be from the boring game, and vice versa

Alberth wrote:
Let me focus on a different part :)

If the above is your goal (no pun intended), I'd say first write the management part, and at first reduce the 'game' to drawing two random numbers that represent the end result.

yes that was my first approach, but than i realized that while I will be making the management part, the testers (community around other manager) can test in console the behaviour of my engine and give me feedback, so I can adjust the odds for actions or see if they are happy with this count of actions or not... :)

it will be just the first version of engine, I would like to use MVC pattern to easily replece the engine with new version

I am a bit affraid of the graphics of ui (my idea is WPF but not definitely decided) and database as how to handle this amount of data and keep it fast and lightweight


Top
 Profile  
 
PostPosted: Tue Aug 07, 2012 8:23 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 283
Location: Here (where else?)
Zavael wrote:
yes that was my first approach, but than i realized that while I will be making the management part, the testers (community around other manager) can test in console the behaviour of my engine and give me feedback, so I can adjust the odds for actions or see if they are happy with this count of actions or not... :)
Ok, sounds like a good plan, I was mostly worried that you were focusing on a small part of the game and forgetting about the broader problem, which you may later find too being complicated to implement.

Zavael wrote:
it will be just the first version of engine, I would like to use MVC pattern to easily replece the engine with new version
Euhm, ok. I am not that much of a thinker in patterns, but if it works for you, by all means, go ahead. (The concept is sound at least.)

Zavael wrote:
I am a bit affraid of the graphics of ui (my idea is WPF but not definitely decided) and database as how to handle this amount of data and keep it fast and lightweight
I don't use Windows technology, so I don't know about the quality of it.
As for speed, one of the goals of a data base is to handle massive amounts of data at a fast pace. If a data base cannot do it, what can?

Try to worry less about things that may never happen, and/or accept that sometimes you make a wrong decision, and you have to modify/redo some part.
Working on concrete actual problems instead of preparing for every possible problem made my coding a lot simpler :)

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
PostPosted: Wed Aug 08, 2012 6:22 am 
Rookie

Joined: Tue Aug 07, 2012 12:27 pm
Posts: 4
Alberth wrote:
Try to worry less about things that may never happen, and/or accept that sometimes you make a wrong decision, and you have to modify/redo some part.
Working on concrete actual problems instead of preparing for every possible problem made my coding a lot simpler :)

oh... i think its the best advice i could get :) i think you are right, I always try to design/code for the first time as best as it is possible, not as best as I can right now.. i have to change that


Top
 Profile  
 
PostPosted: Fri Aug 10, 2012 1:21 pm 
Rookie

Joined: Tue Aug 07, 2012 12:27 pm
Posts: 4
dont any of you by accident know of any resource containing info about some principles of sport management/coach simulation type of game? any book or blog where would be the concepts or something similar? I found tons of 3D game articles, collision detection technics but only a few (or none) about some economy in game, trading AI, market simulation etc..
thanks


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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

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