Remove this Banner Ad

Sim Sim update planning

🥰 Love BigFooty? Join now for free.

Some documentation for those who can follow

Downloading the required modules, setting up the screen window and defining initial variables

Whereby start.png is:
start.png

and gamescreen.png is

gamescreen.png

Python:
import random
import pygame
pygame.init()

ScreenHeight = 400
ScreenWidth = 640

win = pygame.display.set_mode((ScreenWidth, ScreenHeight))

pygame.display.set_caption("PyQooty")

start_bg = pygame.image.load('start.png')
game_bg = pygame.image.load('gamescreen.png')

myfont_main = pygame.font.SysFont("Verdana", 20)
myfont_game = pygame.font.SysFont("Verdana", 28)

clock = pygame.time.Clock()

Bluey_Green = (0, 200, 200)
Light_Green = (100, 255, 100)
Green = (0, 255, 0)
White = (255, 255, 255)

This is used to define the start menu that comes up when the program is opened
Python:
def main_menu():
    win.blit(start_bg, (0,0))
    mouse
    #print(mouse)
    #coordinates1 = (90, 275, 110, 25)
    #coordinates2 = (90, 300, 140, 25)
    #coordinates3 = (90, 325, 110, 25)
    #coordinates4 = (90, 350, 130, 25)

    if 90 + 110 > mouse[0] > 90 and 275 + 25 > mouse[1] > 275:
        menu_text1 = myfont_main.render('Play Footy', 1, Light_Green)
        if click[0] == 1:
            global main
            global playing_match
            main = False
            playing_match = True
            pygame.time.delay(200)
    else:
        menu_text1 = myfont_main.render('Play Footy', 1, Bluey_Green)
    if 90 + 140 > mouse[0] > 90 and 300 + 25 > mouse[1] > 300:
        menu_text2 = myfont_main.render('Setup League', 1, Light_Green)
    else:
        menu_text2 = myfont_main.render('Setup League', 1, Bluey_Green)
    if 90 + 110 > mouse[0] > 90 and 325 + 25 > mouse[1] > 325:
        menu_text3 = myfont_main.render('Stats Type', 1, Light_Green)
    else:
        menu_text3 = myfont_main.render('Stats Type', 1, Bluey_Green)
    if 90 + 130 > mouse[0] > 90 and 350 + 25 > mouse[1] > 350:
        menu_text4 = myfont_main.render('View Results', 1, Light_Green)
    else:   
        menu_text4 = myfont_main.render('View Results', 1, Bluey_Green)

    win.blit(menu_text1, (90, 275))
    win.blit(menu_text2, (90, 300))
    win.blit(menu_text3, (90, 325))
    win.blit(menu_text4, (90, 350))
    pygame.display.update()

The resultant window is
1570253310479.png

when the cursor hovers over the bluish menu text the text will change to a lighter shade. Only the 'Play Footy' option does anything at this point in time.
 
This block of code comes directly after the stuff in the previous post. It defines a class which is going to bundle all the variables and functions related to the actual running of a game.

Under class sim_game(object) lists all the initial variables, what their values are at the start of a game.

GamePlay() is a series of IF statements that at the moment allow the functionality of the timer ticking over for 25 minutes of game time for 4 quarters and stops after that point is reached. Some additional IF statements will be added in regards to scoreboard and ball positioning later on.

match_sim_running() is a basically a loop that will populate the window with the variables involved in the game timer and update (this is what will make the timer tick over on-screen). It's currently an infinite loop as I haven't put in any code to get out of it as of yet other than clicking the exit window cross.

Python:
class sim_game(object):
    game_minutes = 0
    game_seconds = 0
    QTR = 1
    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
    
    # def __init__(self, game_minutes, game_seconds, QTR, speed, homeTeam, homeTeamShort, home_goals, home_behinds, home_score, awayTeam, awayTeamShort, away_goals, away_behinds, away_score):
        # self.game_minutes = game_minutes
        # self.game_seconds = game_seconds
        # self.QTR = QTR
        # self.speed = speed
        # self.homeTeam = homeTeam
        # self.homeTeamShort = homeTeamShort
        # self.home_goals = home_goals
        # self.home_behinds = home_behinds
        # self.home_score = home_score
        # self.awayTeam = awayTeam
        # self.awayTeamShort = awayTeamShort
        # self.away_goals = away_goals
        # self.away_behinds = away_behinds
        # self.away_score = away_score

    def GamePlay():
        if sim_game.QTR <= 4 and sim_game.game_minutes <= 25:
            sim_game.game_seconds += sim_game.speed
            
            #bunch of if statements regarding randomised events of the contest
            #to roll through here
            
            pygame.time.delay(100)
        if sim_game.game_seconds >= 60:
            sim_game.game_minutes += 1
            sim_game.game_seconds -= 60
        if sim_game.game_minutes == 25:
            sim_game.QTR += 1
            sim_game.game_minutes = 0
            sim_game.game_seconds = 0
    
    def match_sim_running():
        sim_running = True
        while sim_running:
            win.blit(game_bg, (0,0))
            QTR_display = myfont_game.render(str(sim_game.QTR), 1, Green)
            win.blit(QTR_display, (100, 15))
            if sim_game.game_seconds < 10:
                GameTime_display = myfont_game.render(str(sim_game.game_minutes) + ":0" + str(sim_game.game_seconds), 1, Green)
            else:
                GameTime_display = myfont_game.render(str(sim_game.game_minutes) + ":" + str(sim_game.game_seconds), 1, Green)
            win.blit(GameTime_display, (240, 15))
            
            homeTeam_display = myfont_game.render(sim_game.homeTeamShort, 1, White)
            win.blit(homeTeam_display, (110, 70))
            awayTeam_display = myfont_game.render(sim_game.awayTeamShort, 1, White)
            win.blit(awayTeam_display, (110, 220))
            
            sim_game.GamePlay()
            sim_running = False
            
            pygame.display.update()
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()

When invoked the result is something like this with the time constantly ticking over by increments of 4 seconds until the minute mark reaches 25, then the quarter number will increase until the 25 minute mark of the 4th quarter when it stops:
1570254008179.png

The main loop that runs the code and invokes the functions defined above (the code that makes stuff actually happen) i.e. take you to the startup screen when you open the program, transfer you to the game screen when you click on 'Play Footy' and makes the timer tick over.
Python:
run = True
main = True
playing_match = False
while run:
    pygame.event.get()
    
    clock.tick(12)
    
    mouse = pygame.mouse.get_pos()
    click = pygame.mouse.get_pressed()
    
    if main:
        main_menu()
    
    if playing_match:
        sim_game
        sim_game.match_sim_running()
    
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False
pygame.quit()
 
Huzzah! Was able to run a game where the scoreboard ticks over alongside the time, and stops once the 4th quarter ends.


Main piece of code added was GamePlayBallPos(), this function added under the "sim_game" class which contains a series of IF statements regarding who is in possession of the ball, the movement of the ball, randomised during every loop.
Python:
def GamePlayTime():
        if sim_game.QTR <= 4 and sim_game.game_minutes <= 25:
            global match_status
            match_status = "In Progress"
            sim_game.game_seconds += sim_game.speed
            pygame.time.delay(100)
        else:
            match_status = "Finished"
        if sim_game.game_seconds >= 60:
            sim_game.game_minutes += 1
            sim_game.game_seconds -= 60
        if sim_game.game_minutes >= 25:
            sim_game.QTR += 1
            sim_game.game_minutes = 0
            sim_game.game_seconds = 0
            sim_game.play_posLine = 0
            sim_game.play_posCol = 0
    
    def GamePlayBallPos():   
        possessionRoll = random.randint(0,1)
        if possessionRoll == 0:
            possession = "Home"
        elif possessionRoll == 1:
            possession = "Away"
        
        if possession == "Home":
            movementRoll = random.randint(0,1)
            if movementRoll == 0:
                sim_game.play_posLine += 0
            elif movementRoll == 1:
                sim_game.play_posLine += 1
        elif possession == "Away":
            movementRoll = random.randint(0,1)
            if movementRoll == 0:
                sim_game.play_posLine -= 0
            elif movementRoll == 1:
                sim_game.play_posLine -= 1
        
        if sim_game.play_posLine == 3:
            shotRollHome = random.randint(0,1)
            if shotRollHome == 0:
                sim_game.home_behinds += 1
                sim_game.play_posLine = 2
            elif shotRollHome == 1:
                sim_game.home_goals += 1
                sim_game.play_posLine = 0
                sim_game.play_posCol = 0
        if sim_game.play_posLine == -3:
            shotRollAway = random.randint(0,1)
            if shotRollAway == 0:
                sim_game.away_behinds += 1
                sim_game.play_posLine = -2
            elif shotRollAway == 1:
                sim_game.away_goals += 1
                sim_game.play_posLine = 0
                sim_game.play_posCol = 0

        sim_game.home_score = sim_game.home_goals * 6 + sim_game.home_behinds
        sim_game.away_score = sim_game.away_goals * 6 + sim_game.away_behinds

1570281784394.png

Full code as of right now: https://www.dropbox.com/s/r0o0rmtgb60oj16/5_DEC.txt?dl=0
 

Log in to remove this Banner Ad

And some more found. Possibly this is the same thing, but converted into a choose your own adventure style of presentation:
View attachment 759030View attachment 759031View attachment 759032View attachment 759033View attachment 759034View attachment 759035
Think my inclination is just to for every loop

Rand - who wins possession of the ball
Rand - location of next contest
Check if location is at either end of the field in which case register a score.

If goal return the ball to centre, if behind oppo gets ball at the B line

All the other stuff can just draw from a list of random labels and count how many times they get invoked
 
Think my inclination is just to for every loop

Rand - who wins possession of the ball
Rand - location of next contest
Check if location is at either end of the field in which case register a score.

If goal return the ball to centre, if behind oppo gets ball at the B line

All the other stuff can just draw from a list of random labels and count how many times they get invoked
This is pretty much what the Qooty code does.
 
I'm not going to pretend to understand coding but I do understand the value of work you've put in Kennedy Parker. It looks fantastic.

Is there room to potentially include boundary interactions in this newer version? ie. Mobbs' rank 0 or 6 was a score, is it possible to run a file [sic terminology] 0 or 4 with the boundary action resulting in a throw in if the ball touches the ground or hand and a randomly generated outcome of a free kick or throw in if the ball is kicked over?
 
I'm not going to pretend to understand coding but I do understand the value of work you've put in Kennedy Parker. It looks fantastic.

Is there room to potentially include boundary interactions in this newer version? ie. Mobbs' rank 0 or 6 was a score, is it possible to run a file [sic terminology] 0 or 4 with the boundary action resulting in a throw in if the ball touches the ground or hand and a randomly generated outcome of a free kick or throw in if the ball is kicked over?
Yes it is possible, immediate priority would be to simply replicate the functionalities of the existing sim though
 
Looking good, Kennedy Parker

Can you keep me informed on test runs, etc? If it goes well, I will look at introducing it next season or S30
 
Was a bit of an effort but defined this function which means we can now visualise the play.
Python:
def map_play():
        Pos_Coordinates = (sim_game.play_posCol, sim_game.play_posLine)

        if Pos_Coordinates == (-1,2) and possession == "Away":
            away_rBP_display = pygame.draw.rect(win, Soft_Red, (400, 55, 40, 15), 0)
        else:
            away_rBP_display = pygame.draw.rect(win, Red, (400, 55, 40, 15), 0)
        if Pos_Coordinates == (0, 2) and possession == "Away":
            away_FB_display = pygame.draw.rect(win, Soft_Red, (470, 55, 40, 15), 0)
        else:
            away_FB_display = pygame.draw.rect(win, Red, (470, 55, 40, 15), 0)
        if Pos_Coordinates == (1, 2) and possession == "Away":
            away_lBP_display = pygame.draw.rect(win, Soft_Red, (540, 55, 40, 15), 0)
        else:
            away_lBP_display = pygame.draw.rect(win, Red, (540, 55, 40, 15), 0)
        if Pos_Coordinates == (-1, 2) and possession == "Home":
            home_lFP_display = pygame.draw.rect(win, Soft_Blue, (400, 70, 40, 15), 0)
        else:
            home_lFP_display = pygame.draw.rect(win, Blue, (400, 70, 40, 15), 0)
        if Pos_Coordinates == (0, 2) and possession == "Home":
            home_FF_display = pygame.draw.rect(win, Soft_Blue, (470, 70, 40, 15), 0)
        else:
            home_FF_display = pygame.draw.rect(win, Blue, (470, 70, 40, 15), 0)
        if Pos_Coordinates == (1, 2) and possession == "Home":
            home_rFP_display = pygame.draw.rect(win, Soft_Blue, (540, 70, 40, 15), 0)
        else:
            home_rFP_display = pygame.draw.rect(win, Blue, (540, 70, 40, 15), 0)

        if Pos_Coordinates == (-1, 1) and possession == "Away":
            away_rHBF_display = pygame.draw.rect(win, Soft_Red, (400, 100, 40, 15), 0)
        else:
            away_rHBF_display = pygame.draw.rect(win, Red, (400, 100, 40, 15), 0)
        if Pos_Coordinates == (0, 1) and possession == "Away":
            away_CHB_display = pygame.draw.rect(win, Soft_Red, (470, 100, 40, 15), 0)
        else:
            away_CHB_display = pygame.draw.rect(win, Red, (470, 100, 40, 15), 0)
        if Pos_Coordinates == (1, 1) and possession == "Away":
            away_lHBF_display = pygame.draw.rect(win, Soft_Red, (540, 100, 40, 15), 0)
        else:
            away_lHBF_display = pygame.draw.rect(win, Red, (540, 100, 40, 15), 0)
        if Pos_Coordinates == (-1, 1) and possession == "Home":
            home_lHFF_display = pygame.draw.rect(win, Soft_Blue, (400, 115, 40, 15), 0)
        else:
            home_lHFF_display = pygame.draw.rect(win, Blue, (400, 115, 40, 15), 0)
        if Pos_Coordinates == (0, 1) and possession == "Home":
            home_CHF_display = pygame.draw.rect(win, Soft_Blue, (470, 115, 40, 15), 0)
        else:
            home_CHF_display = pygame.draw.rect(win, Blue, (470, 115, 40, 15), 0)
        if Pos_Coordinates == (1, 1) and possession == "Home":
            home_rHFF_display = pygame.draw.rect(win, Soft_Blue, (540, 115, 40, 15), 0)
        else:
            home_rHFF_display = pygame.draw.rect(win, Blue, (540, 115, 40, 15), 0)

        if Pos_Coordinates == (-1, 0) and possession == "Away":
            away_rW_display = pygame.draw.rect(win, Soft_Red, (400, 170, 40, 15), 0)
        else:
            away_rW_display = pygame.draw.rect(win, Red, (400, 170, 40, 15), 0)
        if Pos_Coordinates == (0, 0) and possession == "Away":
            away_C_display = pygame.draw.rect(win, Soft_Red, (470, 170, 40, 15), 0)
        else:
            away_C_display = pygame.draw.rect(win, Red, (470, 170, 40, 15), 0)
        if Pos_Coordinates == (1, 0) and possession == "Away":
            away_lW_display = pygame.draw.rect(win, Soft_Red, (540, 170, 40, 15), 0)
        else:
            away_lW_display = pygame.draw.rect(win, Red, (540, 170, 40, 15), 0)
        if Pos_Coordinates == (-1, 0) and possession == "Home":
            home_lW_display = pygame.draw.rect(win, Soft_Blue, (400, 185, 40, 15), 0)
        else:
            home_lW_display = pygame.draw.rect(win, Blue, (400, 185, 40, 15), 0)
        if Pos_Coordinates == (0, 0) and possession == "Home":
            home_C_display = pygame.draw.rect(win, Soft_Blue, (470, 185, 40, 15), 0)
        else:
            home_C_display = pygame.draw.rect(win, Blue, (470, 185, 40, 15), 0)
        if Pos_Coordinates == (1, 0) and possession == "Home":
            home_rW_display = pygame.draw.rect(win, Soft_Blue, (540, 185, 40, 15), 0)
        else:
            home_rW_display = pygame.draw.rect(win, Blue, (540, 185, 40, 15), 0)

        if Pos_Coordinates == (-1, -1) and possession == "Away":
            away_rHFF_display = pygame.draw.rect(win, Soft_Red, (400, 240, 40, 15), 0)
        else:
            away_rHFF_display = pygame.draw.rect(win, Red, (400, 240, 40, 15), 0)
        if Pos_Coordinates == (0, -1) and possession == "Away":
            away_CHF_display = pygame.draw.rect(win, Soft_Red, (470, 240, 40, 15), 0)
        else:
            away_CHF_display = pygame.draw.rect(win, Red, (470, 240, 40, 15), 0)
        if Pos_Coordinates == (1, -1) and possession == "Away":
            away_lHFF_display = pygame.draw.rect(win, Soft_Red, (540, 240, 40, 15), 0)
        else:
            away_lHFF_display = pygame.draw.rect(win, Red, (540, 240, 40, 15), 0)
        if Pos_Coordinates == (-1, -1) and possession == "Home":
            home_lHBF_display = pygame.draw.rect(win, Soft_Blue, (400, 255, 40, 15), 0)
        else:
            home_lHBF_display = pygame.draw.rect(win, Blue, (400, 255, 40, 15), 0)
        if Pos_Coordinates == (0, -1) and possession == "Home":
            home_CHB_display = pygame.draw.rect(win, Soft_Blue, (470, 255, 40, 15), 0)
        else:
            home_CHB_display = pygame.draw.rect(win, Blue, (470, 255, 40, 15), 0)
        if Pos_Coordinates == (1, -1) and possession == "Home":
            home_rHBF_display = pygame.draw.rect(win, Soft_Blue, (540, 255, 40, 15), 0)
        else:
            home_rHBF_display = pygame.draw.rect(win, Blue, (540, 255, 40, 15), 0)

        if Pos_Coordinates == (-1, -2) and possession == "Away":
            away_rFP_display = pygame.draw.rect(win, Soft_Red, (400, 285, 40, 15), 0)
        else:
            away_rFP_display = pygame.draw.rect(win, Red, (400, 285, 40, 15), 0)
        if Pos_Coordinates == (0, -2) and possession == "Away":
            away_FF_display = pygame.draw.rect(win, Soft_Red, (470, 285, 40, 15), 0)
        else:
            away_FF_display = pygame.draw.rect(win, Red, (470, 285, 40, 15), 0)
        if Pos_Coordinates == (1, -2) and possession == "Away":
            away_lFP_display = pygame.draw.rect(win, Soft_Red, (540, 285, 40, 15), 0)
        else:
            away_lFP_display = pygame.draw.rect(win, Red, (540, 285, 40, 15), 0)
        if Pos_Coordinates == (-1, -2) and possession == "Home":
            home_lBP_display = pygame.draw.rect(win, Soft_Blue, (400, 300, 40, 15), 0)
        else:
            home_lBP_display = pygame.draw.rect(win, Blue, (400, 300, 40, 15), 0)
        if Pos_Coordinates == (0, -2) and possession == "Home":
            home_FB_display = pygame.draw.rect(win, Soft_Blue, (470, 300, 40, 15), 0)
        else:
            home_FB_display = pygame.draw.rect(win, Blue, (470, 300, 40, 15), 0)
        if Pos_Coordinates == (1, -2) and possession == "Home":
            home_rBP_display = pygame.draw.rect(win, Soft_Blue, (540, 300, 40, 15), 0)
        else:
            home_rBP_display = pygame.draw.rect(win, Blue, (540, 300, 40, 15), 0)
            
            away_rBP_display
            away_FB_display
            away_lBP_display
            home_lFP_display
            home_FF_display
            home_rFP_display
            away_rHBF_display
            away_CHB_display
            away_lHBF_display
            home_lHFF_display
            home_CHF_display
            home_rHFF_display
            away_rW_display
            away_C_display
            away_lW_display
            home_lW_display
            home_C_display
            home_rW_display
            away_rHFF_display
            away_CHF_display
            away_lHFF_display
            home_lHBF_display
            home_CHB_display
            home_rHBF_display
            away_rFP_display
            away_FF_display
            away_lFP_display
            home_lBP_display
            home_FB_display
            home_rBP_display

Full code as now: https://www.dropbox.com/s/v7a99tqet7khdfs/8_DEC.txt?dl=0
 
Looking good, Kennedy Parker

Can you keep me informed on test runs, etc? If it goes well, I will look at introducing it next season or S30
Next season would be no chance given I still need to create modifiable inputs, and multiple new menu pages + options. 30 might be the optimistic time frame.
 

Remove this Banner Ad

Next season would be no chance given I still need to create modifiable inputs, and multiple new menu pages + options. 30 might be the optimistic time frame.
As long as it happens before Mobbs gets old and saggy
Mobbs said:
I would love to see someone new and sassy create a new program that superseded Qooty, and would support them entirely. If I was any more compliant I'd be doing naked starjumps in a fast food store.
 
Mobbs

I've just added in some basic variations in ball movement i.e. distinctions between long kicks, short kicks, handballs
Curious what was your probability distribution. I found in order to make the game run at a semi-realistic pace I needed to make each transaction a 55% chance of the player "Holding up play" meaning they stay in the same part of the ground with no advancement of the ball.
 
Mobbs

I've just added in some basic variations in ball movement i.e. distinctions between long kicks, short kicks, handballs
Curious what was your probability distribution. I found in order to make the game run at a semi-realistic pace I needed to make each transaction a 55% chance of the player "Holding up play" meaning they stay in the same part of the ground with no advancement of the ball.
It'll take me some work to look at the code and try to understand what I did.
 

🥰 Love BigFooty? Join now for free.

There was no "holding up play". He either kicked it, handpassed it, or lost possession (through various means but all via the same random dice roll).

This seems to be a reasonably close interpretation of the flow from the point of having possession, on to having disposed of it in some way. It's a bunch of extracts, there's heaps of updatng of stats etc code removed from the following:

DoesHeLoseBall:
IF RND(1) >= .87 THEN ' NOT MUCH CHANCE OF LOSING BALL
(anything from being dipossessed to kicking it out on the full)

DoesHeHaveABounce:
IF RND(1) < .85 THEN StoppedBouncing% = 1: GOTO DoesHeHandball ' CHANCE OF BOUNCING '
bounces happen (advance one rank for every 2nd bounce)

DoesHeHandball:
IF V = 5 AND RND(1) > .25 THEN GOTO DoesHeHaveShotAtGoal ' LESS CHANCE IN FRONT OF GOAL
IF V = 5 AND H = 2 AND NOT FP AND RND(1) > .15 THEN GOTO DoesHeHaveShotAtGoal ' EVEN LESS CHANCE IF FULL FORWARD
IF RND(1) < .5 THEN GOTO DoesHeHaveShotAtGoal ' 5 HANDPASSES PER 5 KICKS
handballs happen

DoesHeHaveShotAtGoal:
IF V = 5 OR (V = 4 AND RND(1) > .75) OR (V = 3 AND RND(1) > .92) THEN
shots on goal happen

' # WHO DOES HE KICK THE BALL TO #
IsItCrossGround:
IF RND(1) > .32 THEN KickedForward% = 1 ELSE KickedForward% = 0 ' increase line 68% of time, 32% is cross-ground kick
then a random target position is chosen

The flow was :
1. The guy gets the ball.
2. The guy has the ball.
3. The guy either uses or loses the ball.
4. goto 1
 
There was no "holding up play". He either kicked it, handpassed it, or lost possession (through various means but all via the same random dice roll).

This seems to be a reasonably close interpretation of the flow from the point of having possession, on to having disposed of it in some way. It's a bunch of extracts, there's heaps of updatng of stats etc code removed from the following:

DoesHeLoseBall:
IF RND(1) >= .87 THEN ' NOT MUCH CHANCE OF LOSING BALL
(anything from being dipossessed to kicking it out on the full)

DoesHeHaveABounce:
IF RND(1) < .85 THEN StoppedBouncing% = 1: GOTO DoesHeHandball ' CHANCE OF BOUNCING '
bounces happen (advance one rank for every 2nd bounce)

DoesHeHandball:
IF V = 5 AND RND(1) > .25 THEN GOTO DoesHeHaveShotAtGoal ' LESS CHANCE IN FRONT OF GOAL
IF V = 5 AND H = 2 AND NOT FP AND RND(1) > .15 THEN GOTO DoesHeHaveShotAtGoal ' EVEN LESS CHANCE IF FULL FORWARD
IF RND(1) < .5 THEN GOTO DoesHeHaveShotAtGoal ' 5 HANDPASSES PER 5 KICKS
handballs happen

DoesHeHaveShotAtGoal:
IF V = 5 OR (V = 4 AND RND(1) > .75) OR (V = 3 AND RND(1) > .92) THEN
shots on goal happen

' # WHO DOES HE KICK THE BALL TO #
IsItCrossGround:
IF RND(1) > .32 THEN KickedForward% = 1 ELSE KickedForward% = 0 ' increase line 68% of time, 32% is cross-ground kick
then a random target position is chosen

The flow was :
1. The guy gets the ball.
2. The guy has the ball.
3. The guy either uses or loses the ball.
4. goto 1
Speed of the game might be because there's no flow in my current coding every single transaction is randomised at the moment.
 
Speed of the game might be because there's no flow in my current coding every single transaction is randomised at the moment.
I actually inserted time delays based on the actual clock, between transactions.
You can't just tweak a FOR ... NEXT time delay because the game is supposed to be portable and different computers will run the process at different speeds.
 
I actually inserted time delays based on the actual clock, between transactions.
You can't just tweak a FOR ... NEXT time delay because the game is supposed to be portable and different computers will run the process at different speeds.
The actual clock should have nothing to do with the amount of transactions because the game 'time' is not based upon a timer at all, it's just a count. Each loop the counter will add the 'speed' value onto the 'time' and concurrently produce one transaction of play. Every time the program passes through the loop it produces another line of play.
 
The actual clock should have nothing to do with the amount of transactions because the game 'time' is not based upon a timer at all, it's just a count. Each loop the counter will add the 'speed' value onto the 'time' and concurrently produce one transaction of play. Every time the program passes through the loop it produces another line of play.
That's correct for my approach too, but there are two different concepts of time. That's why I had both a Speed and a Game Pace option.
- One is how fast the game runs in-game (eg how many transactions occur) (in Qooty, weather is another factor affecting this)
- The other is how fast the display runs through these transactions, for the visual experience. Just a coding delay between each, to make it watchable (similar to running your video at 2x or 0.5x speed).
 

Remove this Banner Ad

Remove this Banner Ad

🥰 Love BigFooty? Join now for free.

Back
Top Bottom