mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2026-06-01 05:00:40 +00:00
Update GameDev_v1.yaml
refined prompts, removed QA counter
This commit is contained in:
parent
2e65ba7c66
commit
e96ed42602
@ -1,9 +1,8 @@
|
|||||||
graph:
|
graph:
|
||||||
id: pygame_game_factory_streamlined
|
id: pygame_game_factory_streamlined
|
||||||
description: "Streamlined two-phase workflow to generate cool, playable Pygame games with visual polish."
|
description: Streamlined two-phase workflow to generate cool, playable Pygame games with visual polish.
|
||||||
log_level: INFO
|
log_level: INFO
|
||||||
is_majority_voting: false
|
is_majority_voting: false
|
||||||
|
|
||||||
nodes:
|
nodes:
|
||||||
- id: Game Designer
|
- id: Game Designer
|
||||||
type: agent
|
type: agent
|
||||||
@ -66,7 +65,6 @@ graph:
|
|||||||
# Constraints
|
# Constraints
|
||||||
- DO NOT suggest loading external assets (images, fonts, sounds).
|
- DO NOT suggest loading external assets (images, fonts, sounds).
|
||||||
- Keep the scope small enough for a 200-line single-file implementation.
|
- Keep the scope small enough for a 200-line single-file implementation.
|
||||||
|
|
||||||
- id: Planner
|
- id: Planner
|
||||||
type: agent
|
type: agent
|
||||||
context_window: 0
|
context_window: 0
|
||||||
@ -129,10 +127,9 @@ graph:
|
|||||||
4. Animation & Juice: Add smooth movements, size pulsing, rotation.
|
4. Animation & Juice: Add smooth movements, size pulsing, rotation.
|
||||||
5. Visual Feedback: Flash effects on collisions, spawn animations.
|
5. Visual Feedback: Flash effects on collisions, spawn animations.
|
||||||
6. UI Polish: Centered text, drop shadows, background gradients.
|
6. UI Polish: Centered text, drop shadows, background gradients.
|
||||||
|
|
||||||
- id: Core_Developer
|
- id: Core_Developer
|
||||||
type: agent
|
type: agent
|
||||||
context_window: 5
|
context_window: 6
|
||||||
config:
|
config:
|
||||||
provider: openai
|
provider: openai
|
||||||
name: gpt-4o
|
name: gpt-4o
|
||||||
@ -182,11 +179,25 @@ graph:
|
|||||||
- NO visual effects (particles, shake, etc.) in Phase 1
|
- NO visual effects (particles, shake, etc.) in Phase 1
|
||||||
|
|
||||||
PROCESS:
|
PROCESS:
|
||||||
1. Write complete, runnable code
|
1. Write the complete, runnable game code based on the plan
|
||||||
2. Call `save_file` with path="game.py" and full code as content
|
|
||||||
|
2. Call `save_file` with TWO REQUIRED ARGUMENTS:
|
||||||
|
save_file(
|
||||||
|
path="game.py",
|
||||||
|
content="<COMPLETE PYTHON CODE AS STRING>"
|
||||||
|
)
|
||||||
|
|
||||||
|
CRITICAL: The 'content' parameter MUST contain the full game code.
|
||||||
|
DO NOT call save_file with empty arguments.
|
||||||
|
|
||||||
3. Output exactly: "Phase 1 complete. Code saved to game.py."
|
3. Output exactly: "Phase 1 complete. Code saved to game.py."
|
||||||
|
|
||||||
DO NOT output code in your message. DO NOT add explanations.
|
IMPORTANT OUTPUT RULES:
|
||||||
|
- You MUST generate the complete Python code internally
|
||||||
|
- Pass this code as a STRING to save_file's 'content' parameter in the tool call
|
||||||
|
- DO NOT paste the code in your chat message text (to save tokens and avoid duplication)
|
||||||
|
- The code should ONLY appear inside the tool call's 'content' argument, NOT in your message
|
||||||
|
- DO NOT add explanations after calling save_file
|
||||||
tooling:
|
tooling:
|
||||||
- type: function
|
- type: function
|
||||||
config:
|
config:
|
||||||
@ -195,10 +206,9 @@ graph:
|
|||||||
- name: install_python_packages
|
- name: install_python_packages
|
||||||
- name: save_file
|
- name: save_file
|
||||||
- name: describe_available_files
|
- name: describe_available_files
|
||||||
|
|
||||||
- id: Polish_Developer
|
- id: Polish_Developer
|
||||||
type: agent
|
type: agent
|
||||||
context_window: 3
|
context_window: 6
|
||||||
config:
|
config:
|
||||||
provider: openai
|
provider: openai
|
||||||
name: gpt-4o
|
name: gpt-4o
|
||||||
@ -314,14 +324,39 @@ graph:
|
|||||||
4. pygame.QUIT handled properly
|
4. pygame.QUIT handled properly
|
||||||
|
|
||||||
PROCESS:
|
PROCESS:
|
||||||
1. Call `read_text_file_snippet` to read game.py (use limit=25000, check truncation)
|
1. Call `read_text_file_snippet(path="game.py", offset=0, limit=25000)` to read the code
|
||||||
2. Apply ALL visual design principles above
|
- If truncated=true in response, call again with offset=25000 to get the rest
|
||||||
3. Preserve ALL game logic - DO NOT break gameplay
|
- Store the COMPLETE code string in memory
|
||||||
4. Verify all 4 mandatory requirements are present
|
|
||||||
5. Call `save_file` with path="game.py" and complete enhanced code
|
|
||||||
6. Output exactly: "Phase 2 complete. Code saved to game.py."
|
|
||||||
|
|
||||||
DO NOT output code in your message. DO NOT add descriptions.
|
2. In your reasoning, plan the visual enhancements:
|
||||||
|
- Identify which color palette to use based on game theme
|
||||||
|
- Decide which particle effects to add (subtle, not overwhelming)
|
||||||
|
- Plan animation improvements (smooth, not bouncy)
|
||||||
|
|
||||||
|
3. Construct the complete enhanced code as a single Python string:
|
||||||
|
- Apply the color palette throughout
|
||||||
|
- Add particle system code
|
||||||
|
- Add screen shake and animation code
|
||||||
|
- Preserve ALL game logic (do not break functionality)
|
||||||
|
|
||||||
|
4. Call `save_file` with TWO REQUIRED ARGUMENTS:
|
||||||
|
save_file(
|
||||||
|
path="game.py",
|
||||||
|
content="<THE COMPLETE PYTHON CODE AS A STRING>"
|
||||||
|
)
|
||||||
|
|
||||||
|
CRITICAL: The 'content' parameter MUST be the full Python code string.
|
||||||
|
DO NOT call save_file with empty arguments.
|
||||||
|
DO NOT call save_file multiple times.
|
||||||
|
|
||||||
|
5. After successful save, output exactly: "Phase 2 complete. Code saved to game.py."
|
||||||
|
|
||||||
|
IMPORTANT OUTPUT RULES:
|
||||||
|
- You MUST generate the complete enhanced Python code internally
|
||||||
|
- Pass this code as a STRING to save_file's 'content' parameter in the tool call
|
||||||
|
- DO NOT paste the code in your chat message text (to save tokens and avoid duplication)
|
||||||
|
- The code should ONLY appear inside the tool call's 'content' argument, NOT in your message
|
||||||
|
- DO NOT add explanations after calling save_file
|
||||||
tooling:
|
tooling:
|
||||||
- type: function
|
- type: function
|
||||||
config:
|
config:
|
||||||
@ -330,7 +365,6 @@ graph:
|
|||||||
- name: read_text_file_snippet
|
- name: read_text_file_snippet
|
||||||
- name: save_file
|
- name: save_file
|
||||||
- name: describe_available_files
|
- name: describe_available_files
|
||||||
|
|
||||||
- id: Game_Launcher
|
- id: Game_Launcher
|
||||||
type: agent
|
type: agent
|
||||||
context_window: 0
|
context_window: 0
|
||||||
@ -370,16 +404,14 @@ graph:
|
|||||||
auto_load: true
|
auto_load: true
|
||||||
tools:
|
tools:
|
||||||
- name: read_text_file_snippet
|
- name: read_text_file_snippet
|
||||||
|
|
||||||
- id: Final_Game_Executor
|
- id: Final_Game_Executor
|
||||||
type: python
|
type: python
|
||||||
config:
|
config:
|
||||||
timeout_seconds: 120
|
timeout_seconds: 120
|
||||||
encoding: utf-8
|
encoding: utf-8
|
||||||
|
|
||||||
- id: Bug_Fixer
|
- id: Bug_Fixer
|
||||||
type: agent
|
type: agent
|
||||||
context_window: 5
|
context_window: 6
|
||||||
config:
|
config:
|
||||||
provider: openai
|
provider: openai
|
||||||
name: gpt-4o
|
name: gpt-4o
|
||||||
@ -397,16 +429,33 @@ graph:
|
|||||||
|
|
||||||
PROCESS:
|
PROCESS:
|
||||||
1. Read the error traceback from input (identifies line number and error type)
|
1. Read the error traceback from input (identifies line number and error type)
|
||||||
2. Read the COMPLETE game.py (make multiple read calls if needed)
|
|
||||||
|
2. Read the COMPLETE game.py file:
|
||||||
|
- Call `read_text_file_snippet(path="game.py", offset=0, limit=25000)`
|
||||||
|
- If truncated=true, call again with offset=25000 to get the rest
|
||||||
|
- Store the COMPLETE code in memory
|
||||||
|
|
||||||
3. Verify file completeness:
|
3. Verify file completeness:
|
||||||
- Check that code doesn't end mid-line or mid-function
|
- Check that code doesn't end mid-line or mid-function
|
||||||
- Verify main() function exists
|
- Verify main() function exists
|
||||||
- Verify if __name__ == "__main__" block exists
|
- Verify if __name__ == "__main__" block exists
|
||||||
- If incomplete, read more until complete
|
- If incomplete, read more until complete
|
||||||
4. Identify the EXACT line(s) causing the error
|
|
||||||
5. Fix ONLY those specific line(s) using minimal changes
|
4. Identify the EXACT line(s) causing the error and fix them:
|
||||||
6. Save the COMPLETE fixed code (ALL original lines + the fix)
|
- Make ONLY minimal changes to fix the specific error
|
||||||
7. Output: "Bug fixed: [one-line description]. Code saved to game.py."
|
- Keep all other code EXACTLY as is
|
||||||
|
|
||||||
|
5. Call `save_file` with TWO REQUIRED ARGUMENTS:
|
||||||
|
save_file(
|
||||||
|
path="game.py",
|
||||||
|
content="<COMPLETE FIXED CODE AS STRING>"
|
||||||
|
)
|
||||||
|
|
||||||
|
CRITICAL: The 'content' parameter MUST be the complete fixed code.
|
||||||
|
DO NOT call save_file with empty arguments.
|
||||||
|
DO NOT save incomplete code.
|
||||||
|
|
||||||
|
6. Output: "Bug fixed: [one-line description]. Code saved to game.py."
|
||||||
|
|
||||||
COMMON FIXES (minimal changes only):
|
COMMON FIXES (minimal changes only):
|
||||||
- IndentationError: Fix spacing on the error line only
|
- IndentationError: Fix spacing on the error line only
|
||||||
@ -421,7 +470,12 @@ graph:
|
|||||||
- DO NOT simplify or optimize code
|
- DO NOT simplify or optimize code
|
||||||
- DO NOT save if file is incomplete (< 10000 bytes is suspicious)
|
- DO NOT save if file is incomplete (< 10000 bytes is suspicious)
|
||||||
|
|
||||||
OUTPUT: Only a brief fix description, NO code blocks in your message.
|
IMPORTANT OUTPUT RULES:
|
||||||
|
- You MUST generate the complete fixed Python code internally
|
||||||
|
- Pass this code as a STRING to save_file's 'content' parameter in the tool call
|
||||||
|
- DO NOT paste the code in your chat message text (to save tokens and avoid duplication)
|
||||||
|
- The code should ONLY appear inside the tool call's 'content' argument, NOT in your message
|
||||||
|
- Only output a brief fix description in your message, NO code blocks
|
||||||
tooling:
|
tooling:
|
||||||
- type: function
|
- type: function
|
||||||
config:
|
config:
|
||||||
@ -429,10 +483,9 @@ graph:
|
|||||||
tools:
|
tools:
|
||||||
- name: read_text_file_snippet
|
- name: read_text_file_snippet
|
||||||
- name: save_file
|
- name: save_file
|
||||||
|
|
||||||
- id: QA_Agent
|
- id: QA_Agent
|
||||||
type: agent
|
type: agent
|
||||||
context_window: 5
|
context_window: 6
|
||||||
config:
|
config:
|
||||||
provider: openai
|
provider: openai
|
||||||
name: gpt-4o
|
name: gpt-4o
|
||||||
@ -504,10 +557,9 @@ graph:
|
|||||||
auto_load: true
|
auto_load: true
|
||||||
tools:
|
tools:
|
||||||
- name: read_text_file_snippet
|
- name: read_text_file_snippet
|
||||||
|
|
||||||
- id: Polish_Refinement
|
- id: Polish_Refinement
|
||||||
type: agent
|
type: agent
|
||||||
context_window: 5
|
context_window: 6
|
||||||
config:
|
config:
|
||||||
provider: openai
|
provider: openai
|
||||||
name: gpt-4o
|
name: gpt-4o
|
||||||
@ -519,15 +571,35 @@ graph:
|
|||||||
|
|
||||||
PROCESS:
|
PROCESS:
|
||||||
1. Read QA feedback (lists specific issues)
|
1. Read QA feedback (lists specific issues)
|
||||||
2. Read COMPLETE game.py (use limit=25000, check truncation)
|
|
||||||
|
2. Read the COMPLETE game.py file:
|
||||||
|
- Call `read_text_file_snippet(path="game.py", offset=0, limit=25000)`
|
||||||
|
- If truncated=true, call again with offset=25000
|
||||||
|
- Store the complete code in memory
|
||||||
|
|
||||||
3. Fix ONLY the identified issues:
|
3. Fix ONLY the identified issues:
|
||||||
- If color issue: adjust palette
|
- If color issue: adjust palette
|
||||||
- If animation issue: add/improve effects
|
- If animation issue: add/improve effects
|
||||||
- If UI issue: redesign layout/text
|
- If UI issue: redesign layout/text
|
||||||
- If functional issue: add missing feature
|
- If functional issue: add missing feature
|
||||||
4. Verify ALL other code remains unchanged
|
- Verify ALL other code remains unchanged
|
||||||
5. Save complete fixed code
|
|
||||||
6. Output: "Refinement complete. Issues addressed: [list]. Code saved."
|
4. Call `save_file` with TWO REQUIRED ARGUMENTS:
|
||||||
|
save_file(
|
||||||
|
path="game.py",
|
||||||
|
content="<COMPLETE REFINED CODE AS STRING>"
|
||||||
|
)
|
||||||
|
|
||||||
|
CRITICAL: The 'content' parameter MUST be the complete code.
|
||||||
|
DO NOT call save_file with empty arguments.
|
||||||
|
|
||||||
|
5. Output: "Refinement complete. Issues addressed: [list]. Code saved."
|
||||||
|
|
||||||
|
IMPORTANT OUTPUT RULES:
|
||||||
|
- You MUST generate the complete refined Python code internally
|
||||||
|
- Pass this code as a STRING to save_file's 'content' parameter in the tool call
|
||||||
|
- DO NOT paste the code in your chat message text (to save tokens and avoid duplication)
|
||||||
|
- The code should ONLY appear inside the tool call's 'content' argument, NOT in your message
|
||||||
|
|
||||||
CONSTRAINTS:
|
CONSTRAINTS:
|
||||||
- Make MINIMAL changes (only fix what QA mentioned)
|
- Make MINIMAL changes (only fix what QA mentioned)
|
||||||
@ -541,52 +613,32 @@ graph:
|
|||||||
tools:
|
tools:
|
||||||
- name: read_text_file_snippet
|
- name: read_text_file_snippet
|
||||||
- name: save_file
|
- name: save_file
|
||||||
|
|
||||||
- id: QA_Loop_Counter
|
|
||||||
type: loop_counter
|
|
||||||
config:
|
|
||||||
max_iterations: 3
|
|
||||||
reset_on_emit: false
|
|
||||||
message: "Maximum QA refinement attempts (3) reached. Proceeding with current version."
|
|
||||||
|
|
||||||
- id: Bug_Fix_Counter
|
|
||||||
type: loop_counter
|
|
||||||
config:
|
|
||||||
max_iterations: 3
|
|
||||||
reset_on_emit: false
|
|
||||||
message: "Maximum bug fix attempts (3) reached. Game has critical bugs that could not be fixed automatically."
|
|
||||||
|
|
||||||
edges:
|
edges:
|
||||||
- from: Game Designer
|
- from: Game Designer
|
||||||
to: Planner
|
to: Planner
|
||||||
trigger: true
|
trigger: true
|
||||||
carry_data: true
|
carry_data: true
|
||||||
|
|
||||||
- from: Planner
|
- from: Planner
|
||||||
to: Core_Developer
|
to: Core_Developer
|
||||||
trigger: true
|
trigger: true
|
||||||
carry_data: true
|
carry_data: true
|
||||||
keep_message: true
|
keep_message: true
|
||||||
|
|
||||||
- from: Core_Developer
|
- from: Core_Developer
|
||||||
to: Polish_Developer
|
to: Polish_Developer
|
||||||
trigger: true
|
trigger: true
|
||||||
carry_data: true
|
carry_data: true
|
||||||
|
|
||||||
- from: Polish_Developer
|
- from: Polish_Developer
|
||||||
to: QA_Agent
|
to: QA_Agent
|
||||||
trigger: true
|
trigger: true
|
||||||
carry_data: true
|
carry_data: true
|
||||||
|
|
||||||
- from: QA_Agent
|
- from: QA_Agent
|
||||||
to: QA_Loop_Counter
|
to: Polish_Refinement
|
||||||
condition:
|
condition:
|
||||||
type: keyword
|
type: keyword
|
||||||
config:
|
config:
|
||||||
any:
|
any:
|
||||||
- NEEDS_REFINEMENT
|
- NEEDS_REFINEMENT
|
||||||
carry_data: true
|
carry_data: true
|
||||||
|
|
||||||
- from: QA_Agent
|
- from: QA_Agent
|
||||||
to: Game_Launcher
|
to: Game_Launcher
|
||||||
condition:
|
condition:
|
||||||
@ -595,47 +647,26 @@ graph:
|
|||||||
any:
|
any:
|
||||||
- APPROVE
|
- APPROVE
|
||||||
carry_data: false
|
carry_data: false
|
||||||
|
|
||||||
- from: QA_Loop_Counter
|
|
||||||
to: Polish_Refinement
|
|
||||||
condition: loop_pass
|
|
||||||
carry_data: true
|
|
||||||
|
|
||||||
- from: Polish_Refinement
|
- from: Polish_Refinement
|
||||||
to: QA_Agent
|
to: Game_Launcher
|
||||||
trigger: true
|
trigger: true
|
||||||
carry_data: false
|
carry_data: false
|
||||||
|
|
||||||
- from: QA_Loop_Counter
|
|
||||||
to: Game_Launcher
|
|
||||||
condition: loop_fail
|
|
||||||
carry_data: false
|
|
||||||
|
|
||||||
- from: Game_Launcher
|
- from: Game_Launcher
|
||||||
to: Final_Game_Executor
|
to: Final_Game_Executor
|
||||||
trigger: true
|
trigger: true
|
||||||
carry_data: true
|
carry_data: true
|
||||||
|
|
||||||
- from: Final_Game_Executor
|
- from: Final_Game_Executor
|
||||||
to: Bug_Fix_Counter
|
to: Bug_Fixer
|
||||||
condition: code_fail
|
condition: code_fail
|
||||||
carry_data: true
|
carry_data: true
|
||||||
|
|
||||||
- from: Bug_Fix_Counter
|
|
||||||
to: Bug_Fixer
|
|
||||||
condition: loop_pass
|
|
||||||
carry_data: true
|
|
||||||
|
|
||||||
- from: Bug_Fixer
|
- from: Bug_Fixer
|
||||||
to: Game_Launcher
|
to: Game_Launcher
|
||||||
trigger: true
|
trigger: true
|
||||||
carry_data: false
|
carry_data: false
|
||||||
|
initial_instruction: Describe a game idea you want to see come to life (e.g., 'A space shooter where you dodge asteroids', 'A rhythm game with falling notes', 'Snake but with gravity'). The system will automatically design, plan, implement core mechanics, add visual polish, perform QA checks, and execute the game.
|
||||||
initial_instruction: "Describe a game idea you want to see come to life (e.g., 'A space shooter where you dodge asteroids', 'A rhythm game with falling notes', 'Snake but with gravity'). The system will automatically design, plan, implement core mechanics, add visual polish, perform QA checks, and execute the game."
|
|
||||||
start:
|
start:
|
||||||
- Game Designer
|
- Game Designer
|
||||||
end:
|
end:
|
||||||
- Final_Game_Executor
|
- Final_Game_Executor
|
||||||
|
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
vars: {}
|
vars: {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user