Remove this Banner Ad

Sim Sim update planning

🥰 Love BigFooty? Join now for free.

Rich (BB code):
            ROY   GCR
Hitouts   : 10   17
Kicks     : 118  143
Marks     : 59   55
Handballs : 108  134
Tackles   : 24   35
Frees For : 11   18
Frees Ag. : 18   11
Smothers  : 0    1
Ironouts  : 3    11
Inside50  : 14   17
Goals     : 11   17
Behinds   : 4    11


Home HO: 27
Home K: 107
Home HB: 39
Home M: 4
Home T: 27
Home FF: 36
Home FA: 24
Away HO: 26
Away K: 133
Away HB: 63
Away M: 12
Away T: 31
Away FF: 24
Away FA: 36


Bottom is python test output (limited version) in comparison to total stats output from a game from the current sim. Naturally Total Hitouts across the board increase due to the introduction of boundary throw-ins, marks need to increase ten-fold, handballs need to double in volume

If you need me to look at something let me know and I'll see what I can do.

Rucks DT is going to go through the roof.
 
I'll read this again on PC tonight. Looking grouse.

Followers chance of taking possession probably about : an eighteenth (positions) multiplied by 3 (followers) divided by your feeling about a standing ratio.

Have more turnovers to negate high scores. In perfect world have a retained-possession count (at team level) and ramp up turnover chance as the count grows, to negate ping pong. I didn't do this, I wasn't clever enough.

I suggest if you still want to call it Qooty, add a flair term. When I migrated Qooty from QBasic to QB64 (10.0) I called it "Qooty Fwoar" [emoji16]

On DUB-LX2 using BigFooty.com mobile app
 
If you need me to look at something let me know and I'll see what I can do.

Rucks DT is going to go through the roof.
Sure, feel free to run the code and play around in a word processor



I'll probably offset Rucks by making it less likely for them to get possessions
 
I'll read this again on PC tonight. Looking grouse.

Followers chance of taking possession probably about : an eighteenth (positions) multiplied by 3 (followers) divided by your feeling about a standing ratio.

Have more turnovers to negate high scores. In perfect world have a retained-possession count (at team level) and ramp up turnover chance as the count grows, to negate ping pong. I didn't do this, I wasn't clever enough.

I suggest if you still want to call it Qooty, add a flair term. When I migrated Qooty from QBasic to QB64 (10.0) I called it "Qooty Fwoar" [emoji16]

On DUB-LX2 using BigFooty.com mobile app
How would you prevent the ruck rover having the ball at FB and then marking his own kick at C?

QootyPy is probably my flair term of choice atm
 

Log in to remove this Banner Ad

Have you checked the marking stats for ruck-rovers lately? [emoji16]
Imo best thing to do is keep a record of the last player to have possession, then make sure re-use is refuted.

On DUB-LX2 using BigFooty.com mobile app
 
Have you checked the marking stats for ruck-rovers lately? [emoji16]
Imo best thing to do is keep a record of the last player to have possession, then make sure re-use is refuted.

On DUB-LX2 using BigFooty.com mobile app

if ruck_marking_attempt == TRUE:
falcon_ko
 
After adjusting various probabilities and making a few changes I've managed to get these stats in a game where the Home Team 11.15.81 defeated the Away Team 10.19.79

Home HO: 25
Home K: 106
Home HB: 81
Home M: 40
Home T: 71
Home FF: 23
Home FA: 11
Away HO: 34
Away K: 108
Away HB: 75
Away M: 53
Away T: 54
Away FF: 11
Away FA: 23

Which begin to resemble some more reasonable figures. Main changes were to count any effective kick as a mark because all players in the SFA are extremely skilled and will never drop an uncontested kick to advantage, slightly reduce the timer speed to increase the number of transactions, increase the overall likelihood of turnovers, put in place a congestion limiter so after let's say 3 tackles in a row the sim will default to a player finding space.
 
After adjusting various probabilities and making a few changes I've managed to get these stats in a game where the Home Team 11.15.81 defeated the Away Team 10.19.79

Home HO: 25
Home K: 106
Home HB: 81
Home M: 40
Home T: 71
Home FF: 23
Home FA: 11
Away HO: 34
Away K: 108
Away HB: 75
Away M: 53
Away T: 54
Away FF: 11
Away FA: 23

Which begin to resemble some more reasonable figures. Main changes were to count any effective kick as a mark because all players in the SFA are extremely skilled and will never drop an uncontested kick to advantage, slightly reduce the timer speed to increase the number of transactions, increase the overall likelihood of turnovers, put in place a congestion limiter so after let's say 3 tackles in a row the sim will default to a player finding space.
What are the throw-in numbers like?
Thanks for your work Clod!
 
What are the throw-in numbers like?
Thanks for your work Clod!
They vary. Dependent on how much of the game gets played along the boundary line, the ball moves laterally etc
 
I tweaked the timer to incorporate a bit of unpredictability to the length of the quarter. Right now everyone knows every quarter should end just before 25 minutes. I made it so quarters can end anywhere between 25 minutes and 35 minutes (although extremely improbable) the chance of the quarter ending progressively gets more after every minute post 25. Which should add a bit more drama in close games when people aren't exactly sure when the game will end.

Python:
class sim_game(object):
    game_minutes = 0
    game_seconds = 0
    QTR = 1
    stoppage_time = 5
    speed = 4
    homeTeam = "Home Sample"
    homeTeamShort = "HOM"
    home_goals = 0
    home_behinds = 0
    home_score = 0
    awayTeam = "Away Sample"
    awayTeamShort = "AWY"
    away_goals = 0
    away_behinds = 0
    away_score = 0
    play_posLine = 0
    play_posCol = 0
    congestionLimiter = 0
   
    possession = "None"
    transType = "Contest"
    ActionType = "Ball Up"

    left_throwIn = False
    right_throwIn = False
    play_restart = True

    def GamePlayTime():
        QTR_endTime = 20 + sim_game.stoppage_time
        if sim_game.QTR <= 4 and sim_game.game_minutes <= QTR_endTime:
            global match_status
            match_status = "In Progress"
            sim_game.game_seconds += sim_game.speed
            pygame.time.delay(100)
        else:
            match_status = "Finished"
           
            global playing_match
            global main
            teamStatistics.arrangeTeamStats()
            teamStatistics.write_team_stats()
            playing_match = False
            main = True
        if sim_game.game_seconds >= 60:
            sim_game.game_minutes += 1
            sim_game.game_seconds -= 60
            sim_game.stoppage_time = random.randint(5,15)
        if sim_game.game_minutes >= QTR_endTime:
            sim_game.game_minutes = 0
            sim_game.game_seconds = 0
            sim_game.play_posLine = 0
            sim_game.play_posCol = 0
            sim_game.QTR += 1
            sim_game.transType = "Contest"
            sim_game.play_restart = True

In terms of total game stats, I don't think I can exactly replicate the total number of disposals going around. Just a trade-off of introducing boundary throwins so some lines of play will go instead to that and games are likely to be less free-flowing, more congested in the initial version of this sim. Reduced the number of tackles occurring in the game so its a similar amount to marks.
 
I tweaked the timer to incorporate a bit of unpredictability to the length of the quarter. Right now everyone knows every quarter should end just before 25 minutes. I made it so quarters can end anywhere between 25 minutes and 35 minutes (although extremely improbable) the chance of the quarter ending progressively gets more after every minute post 25. Which should add a bit more drama in close games when people aren't exactly sure when the game will end.
That's brilliant.
 

Remove this Banner Ad

Not sure how I'm suppose to individually identify all the players, but general direction I think is to define a new class and assign each player a dictionary that will collect stats as the ball passes through the field positions.

No idea if I've done it right because I've never done much object oriented programming.

Python:
class player(object):
    RUCK_POScol = 0
    RUCK_POSline = 0
    RR_POScol = 0
    RR_POSline = 0
    R_POScol = 0
    RR_POSline = 0
    
    def __init__(self, name, team, position):
        self._name = name
        self._team = team
        self._position = position
        self._stats = {
            "Hitouts": 0,
            "Kicks": 0,
            "Handballs": 0,
            "Marks": 0,
            "Tackles": 0,
            "Frees For": 0,
            "Fress Against": 0,
            "Goals": 0,
            "Behinds": 0
        }

    def DefinePositions():
        rFPh = (1, 2, "Home")
        FFh = (0, 2, "Home")
        lFPh = (-1, 2, "Home")
        rHFFh = (1, 1, "Home")
        CHFh = (0, 1, "Home")
        lHFFh = (-1, 1, "Home")
        rWh = (1, 0, "Home")
        Ch = (0, 0, "Home")
        lWh = (-1, 0, "Home")
        rHBFh = (1, -1, "Home")
        CHBh = (0, -1, "Home")
        lHBFh = (-1, -1, "Home")
        rBPh = (1, -2, "Home")
        FBh = (0, -2, "Home")
        lBPh = (-1, -2, "Home")
        RUCKh = (player.RUCK_POScol, player.RUCK_POSline, "Home")
        RRh = (player.RR_POScol, player.RR_POSline, "Home")
        Rh = (player.R_POScol, player.R_POSline, "Home")
        INT1h = (-4, -4, "Home")
        INT2h = (-5, -5, "Home")
        
        lBPa = (1, 2, "Away")
        FBa = (0, 2, "Away")
        rBPa = (-1, 2, "Away")
        lHBFa = (1, 1, "Away")
        CHBa = (0, 1, "Away")
        rHBFa = (-1, 1, "Away")
        lWa = (1, 0, "Away")
        Ca = (0, 0, "Away")
        rWa = (-1, 0, "Away")
        lHFFa = (1, -1, "Away")
        CHFa = (0, -1, "Away")
        rHFFa = (-1, -1, "Away")
        lFPa = (1, -2, "Away")
        FFa = (0, -2, "Away")
        rFPa = (-1, -2, "Away")
        RUCKa = (player.RUCK_POScol, player.RUCK_POSline, "Away")
        RRa = (player.RR_POScol, player.RR_POSline, "Away")
        Ra = (player.R_POScol, player.R_POSline, "Away")
        INT1a = (4, 4, "Away")
        INT2a = (5, 5, "Away")
 
Had a think about what a player entry screen would look like.
Not entirely sure but the general approach I'm thinking would be to allow the user to add players into a 'master list' of sorts in the sim and then select/group these players into different 'team' lists that get added into the program.

Code so far that makes up the screen, later on the print(playerNameText) function will be replaced by the name being appended to some kind of list and stored in a file so that info is retained.
Python:
def PlayerCreationScreen():
    win.blit(general_bg, (0,0))
    mouse
    global active
    global playerNameText
    pygame.draw.rect(win, (0,0,0), (45,100,260,40),0)
    PS_titleText = myfont_playerselectTitle.render('Add Players', 1, Green)
    PS_EntryLabel = myfont_main.render('Enter Player Name Here: ', 1, Green)
    win.blit(PS_titleText, (20, 20))
    win.blit(PS_EntryLabel, (50,105))
    if active:
        colour = White
    else:
        colour = Light_Grey
    player_inputBox = pygame.draw.rect(win, colour, (305, 100, 220, 40), 0)
    playerEntered = False
    if not playerEntered:
        for event in pygame.event.get():
            if event.type == pygame.MOUSEBUTTONDOWN:
                #user clicks on input box
                if player_inputBox.collidepoint(event.pos):
                    #toggle the active variable
                    active = True
                else:
                    active = False
                if not active:
                    player_inputBox = pygame.draw.rect(win, Light_Grey, (305, 100, 220, 40), 0)
                else:
                    player_inputBox = pygame.draw.rect(win, White, (305, 100, 220, 40), 0)
            if event.type == pygame.KEYDOWN:
                if active:
                    if event.key == pygame.K_RETURN:
                        print(playerNameText)
                        playerNameText = ""
                    elif event.key == pygame.K_BACKSPACE:
                        playerNameText = playerNameText[:-1]
                    else:
                        playerNameText += event.unicode
            txt_surface = myfont_main.render(playerNameText, True, Blue)
            win.blit(txt_surface, (310, 105))
                    
            pygame.display.update()
            if event.type == pygame.QUIT:
                pygame.quit()

Video of it currently in works...
View attachment PyQooty 2019-11-18 14-53-18_Trim.mp4
 
the general approach I'm thinking would be to allow the user to add players into a 'master list' of sorts in the sim and then select/group these players into different 'team' lists that get added into the program
Yes please.
 
Subscribing as I love reading about this sort of stuff (even though my knowledge of coding stops at crystal reports).

Doubt it's something that can be done easily/at all but I think something that would be fantastic to keep more posters invested would be to allow players in a set position to be able to gain possession in other positions.

For instance, I think it would be really cool is a half back flanker could pop up and kick a goal from time to time and it would make the back-line positions much more interesting.

Could this be done by having an extra step that calculates chance of receiving possession at a particular spot on the ground set out like follows if a kick is to centre half forward;


LW (4%) C (5%) RW (4%)
LHF (10%) CHF [x,y] (40%) RHF (10%)
LFP (4%) FF (5%) RFP (4%)

R (4%) Rov (10%) RR(10%)

Might also allow for the players through the centre line to be treated as extra onballers as well?
 
More chipping away on the front end part, with some kind of notification box , addition of SAVE and Main Menu buttons to the player addition screen.

View attachment PyQooty 2019-11-19 18-01-27_Trim.mp4

The result...

1574147081006.png

Eventually, this file will be read into the Team Selection menu and users assign the player names to a team.
 

🥰 Love BigFooty? Join now for free.

for optimisation, PlayerCreationScreen which was previously defined as a function now turned into its own class

Python:
class PlayerCreationScreen(object):
    active = False
    playerNameText = ""
    PS_recentAct = False
    latestPlayer = ""
    PlayerMasterListQueue = []
    InQueue = 0
    newlyAdded = 0
    ChangesSavedNotice = False
    
    def openPCScreen():
        win.blit(general_bg, (0,0))
        mouse
        pygame.draw.rect(win, (0,0,0), (45,100,260,40),0)
        pygame.draw.rect(win, (100, 100, 100), (45, 180, 500, 150), 0)
        
        PS_titleText = myfont_playerselectTitle.render('Add Players', 1, Green)
        PS_EntryLabel = myfont_main.render('Enter Player Name Here: ', 1, Green)
        PS_NoticeLabel = myfont_main.render('Latest Activity: ', 1, Green)
        win.blit(PS_titleText, (20, 20))
        win.blit(PS_EntryLabel, (50,105))
        win.blit(PS_NoticeLabel, (50, 185))
        
        if PlayerCreationScreen.PS_recentAct:
            PS_Notice1 = myfont_main.render(PlayerCreationScreen.latestPlayer + ' was added as a Free Agent', 1, White)
            PS_Notice2 = myfont_main.render(str(PlayerCreationScreen.InQueue) + ' players are in the Free Agent Queue', 1, White)
            PS_Notice3 = myfont_main.render('Click the SAVE button to confirm the additions', 1, White)
            win.blit(PS_Notice1, (50, 210))
            win.blit(PS_Notice2, (50, 250))
            win.blit(PS_Notice3, (50, 290))
        
        if PlayerCreationScreen.ChangesSavedNotice:
            PS_Notice1 = myfont_main.render('Additions saved to MasterList.txt', 1, White)
            PS_Notice2 = myfont_main.render(str(PlayerCreationScreen.newlyAdded) + ' new players were added', 1, White)
            PS_Notice3 = myfont_main.render('Free Agents Queue Reset', 1, White)
            win.blit(PS_Notice1, (50, 210))
            win.blit(PS_Notice2, (50, 250))
            win.blit(PS_Notice3, (50, 290))

        if PlayerCreationScreen.active:
            colour = White
        else:
            colour = Light_Grey
        player_inputBox = pygame.draw.rect(win, colour, (305, 100, 240, 40), 0)
        
        #save changes button
        if 50 + 80 > mouse[0] > 50 and 350 + 40 > mouse[1] > 350:
            PS_SaveButton = pygame.draw.rect(win, Soft_Red, (50, 350, 80, 40), 0)
            if click[0] == 1:
                OpenMasterList = open('MasterList.txt', 'a')
                for i in PlayerCreationScreen.PlayerMasterListQueue:
                    new_player = str(i) + '\n'
                    OpenMasterList.write(new_player)
                    pygame.time.delay(120)
                OpenMasterList.close()
                PlayerCreationScreen.ChangesSavedNotice = True
                PlayerCreationScreen.PS_recentAct = False
                
                PlayerCreationScreen.newlyAdded = PlayerCreationScreen.InQueue
                PlayerCreationScreen.InQueue = 0
                PlayerCreationScreen.PlayerMasterListQueue = []
        else:
            PS_SaveButton = pygame.draw.rect(win, Red, (50, 350, 80, 40), 0)
        PS_SaveLabel = myfont_main.render('SAVE', 1, White)
        win.blit(PS_SaveLabel, (58, 358))
        
        #main menu button
        if 320 + 210 > mouse[0] > 320 and 350 + 40 > mouse[1] > 350:
            PS_MainMenuButton = pygame.draw.rect(win, Soft_Red, (320, 350, 210, 40), 0)
            if click[0] == 1:
                global main
                global AddingPlayers
                main = True
                AddingPlayers = False
                
                PlayerCreationScreen.active = False
                PlayerCreationScreen.playerNameText = ""
                PlayerCreationScreen.PS_recentAct = False
                PlayerCreationScreen.latestPlayer = ""
                PlayerCreationScreen.PlayerMasterListQueue = []
                PlayerCreationScreen.InQueue = 0
                newlyAdded = 0
                PlayerCreationScreen.ChangesSavedNotice = False
                
                pygame.time.delay(200)
        else:
            PS_MainMenuButton = pygame.draw.rect(win, Red, (320, 350, 210, 40), 0)
        PS_MainMenuLabel = myfont_main.render('Back To Main Menu', 1, White)
        win.blit(PS_MainMenuLabel, (328, 358))
        
        playerEntered = False
        if not playerEntered:
            for event in pygame.event.get():
                if event.type == pygame.MOUSEBUTTONDOWN:
                    #user clicks on input box
                    if player_inputBox.collidepoint(event.pos):
                        #toggle the active variable
                        PlayerCreationScreen.active = True
                    else:
                        PlayerCreationScreen.active = False
                    if not PlayerCreationScreen.active:
                        player_inputBox = pygame.draw.rect(win, Light_Grey, (305, 100, 240, 40), 0)
                    else:
                        player_inputBox = pygame.draw.rect(win, White, (305, 100, 240, 40), 0)
                if event.type == pygame.KEYDOWN:
                    #process typing
                    if PlayerCreationScreen.active:
                        if event.key == pygame.K_RETURN:
                            PlayerCreationScreen.PlayerMasterListQueue.append(PlayerCreationScreen.playerNameText)
                            PlayerCreationScreen.InQueue += 1
                            #print(PlayerCreationScreen.PlayerMasterListQueue)
                            PlayerCreationScreen.PS_recentAct = True
                            PlayerCreationScreen.ChangesSavedNotice = False
                            PlayerCreationScreen.latestPlayer = str(PlayerCreationScreen.playerNameText)
                            PlayerCreationScreen.playerNameText = ""
                        elif event.key == pygame.K_BACKSPACE:
                            PlayerCreationScreen.playerNameText = PlayerCreationScreen.playerNameText[:-1]
                        else:
                            PlayerCreationScreen.playerNameText += event.unicode
                txt_surface = myfont_main.render(PlayerCreationScreen.playerNameText, True, Blue)
                win.blit(txt_surface, (310, 105))
                        
                pygame.display.update()
                if event.type == pygame.QUIT:
                    pygame.quit()
 
Features Implemented So Far:
- Main Menu; navigation to Sim Game screen and Add Player screen
- Sim Game
- Game Timer Stopping after 4 QTRs​
- Scoreboard updates (realistic scoring pace)​
- On-field graphics that respond to play location​
- Commentary that updates with play​
- Onfield actions including; goals, behinds, tackle, mark, kicks - long,short,torpedo,sideways, handballs - forward and sideways, run and bounce, hitouts after goals and throwins, throw-ins responding to ball being kicked out of play, free kicks, turnovers after OOBOTF, turnovers after behinds​
- Team stats tallying​
- Adding players
- responsive input box​
- activity notice that tells user who's been added and instructions​
- SAVE button to confirm changes and append new player names to a master list​
- Main Menu button for navigation back to Main Menu​
 
Unsure about "Sweet FA presents"
Don't you want it to be more portable than that? Your product will attract new leagues from different platforms by the trillions!
 
Unsure about "Sweet FA presents"
Don't you want it to be more portable than that? Your product will attract new leagues from different platforms by the trillions!
It's just a graphic so I can easily change it. If it eventually does get used for the official SFA season it would be cool to have a customised graphic for the start screen.

BTW do you want some crediting back to you as the creator of the original Qooty?
 
I’m assuming that by creating Free Agent players, you may have a menu to transfer players from club to club. And therefore, the sim could track the players that go from club to club and keep a collective of their stats.
I think eventually python is capable of just directly exporting the stats to a csv file

In terms of team creation, my idea would be to populate team lists allowing for the selection of players who have a free agent status
 

Remove this Banner Ad

Remove this Banner Ad

🥰 Love BigFooty? Join now for free.

Back
Top Bottom