Open shawokou123 opened 7 months ago
You don't need to rename the variable : you should keep the variable name "KEN_WHITE"
However, you need to change the variable value, which is a color used to track the character.
Can you share a screenshot ? Do you know what color is Gouki's costume ?
I replace the second character with Gouki and define it as white Gouki_WHITE = [255, 255, 255]. If the two characters do not switch positions, the game proceeds normally, but once the two characters switch positions, the two characters cannot approach each other. play1 KEN_RED = [248, 0, 0], play 2 Gouki_WHITE = [255, 255, 255].
Please point out my programming error.
robot.py:
import os import random import re import time from collections import defaultdict from typing import Dict, List, Literal, Optional
import numpy as np from gymnasium import spaces from loguru import logger from phospho.lab import get_provider_and_model, get_sync_client from rich import print
from .config import ( INDEX_TO_MOVE, META_INSTRUCTIONS, META_INSTRUCTIONS_WITH_LOWER, MOVES, NB_FRAME_WAIT, X_SIZE, Y_SIZE, ) from .observer import detect_position_from_color
class Robot: observations: List[Optional[dict]] = None # memory next_steps: List[int] # action plan actions: dict # actions of the agents during a step of the game
actions of the agents during the previous step of the game
{power_prompt} {last_action_prompt} Your current score is {reward}. {score_prompt} To increase your score, move toward the opponent and attack the opponent. To prevent your score from decreasing, don't get hit by the opponent. """
Your character is {self.character}. Your goal is to defeat the opponent. While constantly approaching and striking your opponent, you should also pay attention to your defense. If the opponent attacks you with moves like Fireball, you should retreat to defend, then seize the opportunity to close in and launch a deadly attack on your opponent. {self.context_prompt()} The moves you can use are: {move_list}
Reply with a bullet point list of moves. The format should be:
- <name of the move>
separated by a new line. Example if the opponent is close:Example if the opponent is far:
Move closer"""