コード例 #1
0
def predict_CarSim(L0, V0, dt, ept, g, cf=CAR_FRICTION):

    st = CarState(Vector3(*L0), Vector3(*V0))

    pt = []
    for i in range(int(dt / ept)):
        st = PhyLib.carStep(st, ept, g, cf)  # calling the step function
        pt.append([a3(st.Location), a3(st.Velocity)])

    # if dt%ept>0:
    st = PhyLib.carStep(st, dt % ept, g, cf)
    pt.append([a3(st.Location), a3(st.Velocity)])

    return pt
コード例 #2
0
ファイル: Bots.py プロジェクト: robbai/RLBotPack
def bot_composite(s):

    GeneralInfo(s)

    safe_haven = set_dist(
        s.bL, s.ogoal,
        min(dist3d(s.bL, s.ogoal) - 200,
            dist3d(s.pV) + 1200, 2000))
    safe_haven[2] = 0

    # obehind = dist3d(s.oL, s.ogoal) < dist3d(s.bL, s.ogoal)
    behind = dist3d(s.pL, s.ogoal) > dist3d(s.bL, s.ogoal)
    infront = s.bL[1] * s.color > s.pL[1] * s.color + 99

    # blockable = min(abs(s.oglinex), abs(s.obglinex)) < 999 and s.bV[1] * s.color < 0 and infront

    if s.kickoff:
        bot_default(s)
    else:
        if s.bL[2] > 500 and s.pL[2] > 60 and dist3d(
                s.bL, s.goal) < 4500 and s.poG and not infront:
            go_to(s, (safe_haven + s.bL) * a3([1, 1, 0]))
        elif dist3d(s.ogoal, s.bL) < 3000 or (s.bV[1] * s.color < 0
                                              and s.pV[1] * s.color < 0
                                              and s.bd < 999):
            bot_fastbot(s)
        else:
            if not behind and dist3d(s.oL, s.bL) > 2000:
                bot_shooter(s)
            else:
                bot_default(s)
コード例 #3
0
def predict_CarLoc(L0, V0, dt, ept, g, cf=CAR_FRICTION):

    st = CarState(Vector3(*L0), Vector3(*V0))

    for i in range(int(dt / ept)):
        st = PhyLib.carStep(st, ept, g, cf)  # calling the step function

    # if dt%ept>0:
    st = PhyLib.carStep(st, dt % ept, g, cf)

    return a3(st.Location)
コード例 #4
0
def state_ca3(st):  # nested numpy array
    return [a3(st.Location), a3(st.Velocity)]
コード例 #5
0
def state_ba3(st):  # nested numpy array
    return [a3(st.Location), a3(st.Velocity), a3(st.AngularVelocity)]