From: Mart Lubbers Date: Sun, 21 Jun 2015 18:16:25 +0000 (+0200) Subject: crap, nothing works anymore. strange ballgaining bugs X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=11c4f7b1fc35fc5b305a6ad7ab01a239ccb34a01;p=fp1415-soccerfun.git crap, nothing works anymore. strange ballgaining bugs --- diff --git a/src/Team_MartLubbers.icl b/src/Team_MartLubbers.icl index d7319bc..9a18f19 100644 --- a/src/Team_MartLubbers.icl +++ b/src/Team_MartLubbers.icl @@ -84,6 +84,7 @@ mind field (x=:{referee,football,others,me}, mm=:{home,origpos}) | me.playerID.playerNr == 1 | i_have_ball = kick closest_free_teammate (x, mm) | ball_in_reach maxCatchReach = (CatchBall, mm) + | ball_in_reach maxKickReach = kick closest_free_teammate (x, mm) | ball_their_half = halt (x, mm) | ball_within_16 | we_have_ball = stayInGoal (x, mm) @@ -100,7 +101,9 @@ mind field (x=:{referee,football,others,me}, mm=:{home,origpos}) | otherwise = stayInGoal (x, mm) // Defense | me.playerID.playerNr > 7 - | ball_their_half = fix {origpos & px=origpos.px + (scale 0.5 ballPos.pxy.px)} prec (x, mm) + | ball_their_half + | i_have_ball = kick closest_free_teammate (x, mm) + | otherwise = fix {origpos & px=origpos.px + (scale 0.5 ballPos.pxy.px)} prec (x, mm) | otherwise // TODO I have the ball | i_have_ball = moveForward i (x, mm) @@ -121,19 +124,22 @@ mind field (x=:{referee,football,others,me}, mm=:{home,origpos}) obtainBall :: Int -> FootballerAI m obtainBall i | ball_in_reach maxTackleReach && length has_ball > 0 - | i<15 = \(_,mm).(Tackle (hd has_ball).playerID (ms 10.0), mm) - | i < 50 = kick closest_free_teammate + | i < 15 = \(_,mm).(Tackle (hd has_ball).playerID (ms 10.0), mm) | otherwise = \(_,mm).(GainBall, mm) + | ball_in_reach maxGainReach = \(_,mm).(GainBall, mm) | isClosest us me ballPos.pxy = fix ballPos.pxy prec - | otherwise = fix closest_free_player prec + | otherwise = fix (attract prec closest_free_player ballPos.pxy) prec moveForward :: Int -> FootballerAI m - moveForward i = fix their_goal prec//TODO + moveForward i = kick closest_free_teammate stayInGoal = fix (attract goal_area_depth our_goal ballPos.pxy) prec - closest_free_player = their_goal // TODO - closest_free_teammate = their_goal // TODO - + closest_free_player = (closest them me.pos).pos // TODO + closest_free_teammate + | length players_closer_to_goal > 0 = (closest players_closer_to_goal me.pos).pos + | otherwise = their_goal + + players_closer_to_goal = filter (\x.not (closerToHome home x.pos.px me.pos.px)) us player_within_16 p = inPenaltyArea field home p.pos ball_within_16 = inPenaltyArea field home ballPos.pxy diff --git a/src/competition.txt b/src/competition.txt new file mode 100644 index 0000000..c5ff97c --- /dev/null +++ b/src/competition.txt @@ -0,0 +1,52 @@ +99 +,Æsir_W,MiniEffiesW,G'frincham0-W,G'frincham2-W,G'frincham4-W,G'frincham6-W,G'frincham8-W,G'frincham10-W +x Æsir_W vs Æsir_E +0 6 Æsir_W vs MiniEffiesE +0 1 Æsir_W vs G'frincham0-E +0 3 Æsir_W vs G'frincham2-E +0 2 Æsir_W vs G'frincham4-E +0 6 Æsir_W vs G'frincham6-E +0 4 Æsir_W vs G'frincham8-E +0 9 Æsir_W vs G'frincham10-E +12 0 MiniEffiesW vs Æsir_E +x MiniEffiesW vs MiniEffiesE +3 0 MiniEffiesW vs G'frincham0-E +3 5 MiniEffiesW vs G'frincham2-E +0 8 MiniEffiesW vs G'frincham4-E +0 8 MiniEffiesW vs G'frincham6-E +1 10 MiniEffiesW vs G'frincham8-E +0 9 MiniEffiesW vs G'frincham10-E +0 0 G'frincham0-W vs Æsir_E +0 2 G'frincham0-W vs MiniEffiesE +x G'frincham0-W vs G'frincham0-E +0 1 G'frincham0-W vs G'frincham2-E +0 3 G'frincham0-W vs G'frincham4-E +0 3 G'frincham0-W vs G'frincham6-E +0 8 G'frincham0-W vs G'frincham8-E +0 13 G'frincham0-W vs G'frincham10-E +4 0 G'frincham2-W vs Æsir_E +6 1 G'frincham2-W vs MiniEffiesE +0 0 G'frincham2-W vs G'frincham0-E +x G'frincham2-W vs G'frincham2-E +0 3 G'frincham2-W vs G'frincham4-E +0 3 G'frincham2-W vs G'frincham6-E +0 8 G'frincham2-W vs G'frincham8-E +0 8 G'frincham2-W vs G'frincham10-E +8 0 G'frincham4-W vs Æsir_E +5 0 G'frincham4-W vs MiniEffiesE +2 0 G'frincham4-W vs G'frincham0-E +2 0 G'frincham4-W vs G'frincham2-E +x G'frincham4-W vs G'frincham4-E +0 3 G'frincham4-W vs G'frincham6-E +0 3 G'frincham4-W vs G'frincham8-E +0 7 G'frincham4-W vs G'frincham10-E +7 0 G'frincham6-W vs Æsir_E +8 0 G'frincham6-W vs MiniEffiesE +4 0 G'frincham6-W vs G'frincham0-E +4 0 G'frincham6-W vs G'frincham2-E +1 0 G'frincham6-W vs G'frincham4-E +x G'frincham6-W vs G'frincham6-E +0 4 G'frincham6-W vs G'frincham8-E +0 3 G'frincham6-W vs G'frincham10-E +7 0 G'frincham8-W vs Æsir_E +x G'frincham8-W vs MiniEffiesE