added readme and requirements.txt
This commit is contained in:
parent
e4214365d7
commit
d3a7f0af21
3 changed files with 197 additions and 132 deletions
|
|
@ -1,3 +1,64 @@
|
|||
## AI Game Dev Team
|
||||
# AI Game Development Agent Advisory 🎮
|
||||
|
||||
This is a simple example of how to use Autogen's RoundRobinGroupChat to create an AI game development team.
|
||||
The AI Game Development Team is a collaborative game design system powered by Autogen's AI Agent framework. This app generates comprehensive game concepts through the coordination of multiple specialized AI agents, each focusing on different aspects of game development based on user inputs such as game type, target audience, art style, and technical requirements. This is built on Autogen's GroupChat methods and AssistantAgent features, run through initiate_chat() method.
|
||||
|
||||
## Features
|
||||
|
||||
- **Multi-Agent Collaboration System**
|
||||
- 🎭 **Story Agent**: Specializes in narrative design and world-building, including character development, plot arcs, dialogue writing, and lore creation
|
||||
- 🎮 **Gameplay Agent**: Focuses on game mechanics and systems design, including player progression, combat systems, resource management, and balancing
|
||||
- 🎨 **Visuals Agent**: Handles art direction and audio design, covering UI/UX, character/environment art style, sound effects, and music composition
|
||||
- ⚙️ **Tech Agent**: Provides technical architecture and implementation guidance, including engine selection, optimization strategies, networking requirements, and development roadmap
|
||||
- 🎯 **Task Agent**: Coordinates between all specialized agents and ensures cohesive integration of different game aspects
|
||||
|
||||
- **Comprehensive Game Design Outputs**:
|
||||
- Detailed narrative and world-building elements
|
||||
- Core gameplay mechanics and systems
|
||||
- Visual and audio direction
|
||||
- Technical specifications and requirements
|
||||
- Development timeline and budget considerations
|
||||
|
||||
- **Customizable Input Parameters**:
|
||||
- Game type and target audience
|
||||
- Art style and visual preferences
|
||||
- Platform requirements
|
||||
- Development constraints (time, budget)
|
||||
- Core mechanics and gameplay features
|
||||
|
||||
- **Interactive Results**: Results are presented in expandable sections for easy navigation and reference
|
||||
|
||||
## How to Run
|
||||
|
||||
Follow these steps to set up and run the application:
|
||||
|
||||
1. **Clone the Repository**:
|
||||
```bash
|
||||
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
|
||||
cd ai_agent_tutorials/ai_game_dev_team
|
||||
```
|
||||
|
||||
2. **Install Dependencies**:
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
3. **Set Up OpenAI API Key**:
|
||||
- Obtain an OpenAI API key from [OpenAI's platform](https://platform.openai.com)
|
||||
- You'll input this key in the app's sidebar when running
|
||||
|
||||
4. **Run the Streamlit App**:
|
||||
```bash
|
||||
streamlit run ai_game_dev_team/ai_game_dev_agents.py
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
1. Enter your OpenAI API key in the sidebar
|
||||
2. Fill in the game details:
|
||||
- Background vibe and setting
|
||||
- Game type and target audience
|
||||
- Visual style preferences
|
||||
- Technical requirements
|
||||
- Development constraints
|
||||
3. Click "Generate Game Concept" to receive comprehensive design documentation from all agents
|
||||
4. Review the outputs in the expandable sections for each aspect of game design
|
||||
|
|
|
|||
|
|
@ -86,137 +86,141 @@ if st.button("Generate Game Concept"):
|
|||
if not api_key:
|
||||
st.error("Please enter your OpenAI API key.")
|
||||
else:
|
||||
# Prepare the task based on user inputs
|
||||
task = f"""
|
||||
Create a game concept with the following details:
|
||||
- Background Vibe: {background_vibe}
|
||||
- Game Type: {game_type}
|
||||
- Game Goal: {game_goal}
|
||||
- Target Audience: {target_audience}
|
||||
- Player Perspective: {player_perspective}
|
||||
- Multiplayer Support: {multiplayer}
|
||||
- Art Style: {art_style}
|
||||
- Target Platforms: {', '.join(platform)}
|
||||
- Development Time: {development_time} months
|
||||
- Budget: ${cost:,}
|
||||
- Core Mechanics: {', '.join(core_mechanics)}
|
||||
- Mood/Atmosphere: {', '.join(mood)}
|
||||
- Inspiration: {inspiration}
|
||||
- Unique Features: {unique_features}
|
||||
- Detail Level: {depth}
|
||||
"""
|
||||
|
||||
# Configure OpenAI model client with the API key
|
||||
llm_config = {
|
||||
"timeout": 600,
|
||||
"cache_seed": 44, # change the seed for different trials
|
||||
"config_list": [
|
||||
{
|
||||
"model": "gpt-4o-mini",
|
||||
"api_key": api_key,
|
||||
}
|
||||
],
|
||||
"temperature": 0,
|
||||
}
|
||||
|
||||
# Define a task-provider agent
|
||||
task_agent = autogen.AssistantAgent(
|
||||
name="task_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="You are a task provider. Your only job is to provide the task details to the other agents.",
|
||||
)
|
||||
|
||||
# Define agents with detailed system prompts
|
||||
story_agent = autogen.AssistantAgent(
|
||||
name="story_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="""
|
||||
You are an experienced game story designer specializing in narrative design and world-building. Your task is to:
|
||||
1. Create a compelling narrative that aligns with the specified game type and target audience.
|
||||
2. Design memorable characters with clear motivations and character arcs.
|
||||
3. Develop the game's world, including its history, culture, and key locations.
|
||||
4. Plan story progression and major plot points.
|
||||
5. Integrate the narrative with the specified mood/atmosphere.
|
||||
6. Consider how the story supports the core gameplay mechanics.
|
||||
Provide your response in a detailed, well-structured report format. Do not use XML tags.
|
||||
with st.spinner('🤖 AI Agents are collaborating on your game concept...'):
|
||||
# Prepare the task based on user inputs
|
||||
task = f"""
|
||||
Create a game concept with the following details:
|
||||
- Background Vibe: {background_vibe}
|
||||
- Game Type: {game_type}
|
||||
- Game Goal: {game_goal}
|
||||
- Target Audience: {target_audience}
|
||||
- Player Perspective: {player_perspective}
|
||||
- Multiplayer Support: {multiplayer}
|
||||
- Art Style: {art_style}
|
||||
- Target Platforms: {', '.join(platform)}
|
||||
- Development Time: {development_time} months
|
||||
- Budget: ${cost:,}
|
||||
- Core Mechanics: {', '.join(core_mechanics)}
|
||||
- Mood/Atmosphere: {', '.join(mood)}
|
||||
- Inspiration: {inspiration}
|
||||
- Unique Features: {unique_features}
|
||||
- Detail Level: {depth}
|
||||
"""
|
||||
)
|
||||
|
||||
gameplay_agent = autogen.AssistantAgent(
|
||||
name="gameplay_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="""
|
||||
You are a senior game mechanics designer with expertise in player engagement and systems design. Your task is to:
|
||||
1. Design core gameplay loops that match the specified game type and mechanics.
|
||||
2. Create progression systems (character development, skills, abilities).
|
||||
3. Define player interactions and control schemes for the chosen perspective.
|
||||
4. Balance gameplay elements for the target audience.
|
||||
5. Design multiplayer interactions if applicable.
|
||||
6. Specify game modes and difficulty settings.
|
||||
7. Consider the budget and development time constraints.
|
||||
Provide your response in a detailed, well-structured report format. Do not use XML tags.
|
||||
"""
|
||||
)
|
||||
|
||||
visuals_agent = autogen.AssistantAgent(
|
||||
name="visuals_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="""
|
||||
You are a creative art director with expertise in game visual and audio design. Your task is to:
|
||||
1. Define the visual style guide matching the specified art style.
|
||||
2. Design character and environment aesthetics.
|
||||
3. Plan visual effects and animations.
|
||||
4. Create the audio direction including music style, sound effects, and ambient sound.
|
||||
5. Consider technical constraints of chosen platforms.
|
||||
6. Align visual elements with the game's mood/atmosphere.
|
||||
7. Work within the specified budget constraints.
|
||||
Provide your response in a detailed, well-structured report format. Do not use XML tags.
|
||||
"""
|
||||
)
|
||||
|
||||
tech_agent = autogen.AssistantAgent(
|
||||
name="tech_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="""
|
||||
You are a technical director with extensive game development experience. Your task is to:
|
||||
1. Recommend appropriate game engine and development tools.
|
||||
2. Define technical requirements for all target platforms.
|
||||
3. Plan the development pipeline and asset workflow.
|
||||
4. Identify potential technical challenges and solutions.
|
||||
5. Estimate resource requirements within the budget.
|
||||
6. Consider scalability and performance optimization.
|
||||
7. Plan for multiplayer infrastructure if applicable.
|
||||
Provide your response in a detailed, well-structured report format. Do not use XML tags.
|
||||
"""
|
||||
)
|
||||
|
||||
# Function to run agents sequentially
|
||||
def run_agents_sequentially(task):
|
||||
# Task agent provides the task to each agent one by one
|
||||
task_agent.initiate_chat(story_agent, message=task, max_turns=1)
|
||||
story_response = story_agent.last_message()["content"]
|
||||
|
||||
task_agent.initiate_chat(gameplay_agent, message=task, max_turns=1)
|
||||
gameplay_response = gameplay_agent.last_message()["content"]
|
||||
|
||||
task_agent.initiate_chat(visuals_agent, message=task, max_turns=1)
|
||||
visuals_response = visuals_agent.last_message()["content"]
|
||||
|
||||
task_agent.initiate_chat(tech_agent, message=task, max_turns=1)
|
||||
tech_response = tech_agent.last_message()["content"]
|
||||
|
||||
return {
|
||||
"story": story_response,
|
||||
"gameplay": gameplay_response,
|
||||
"visuals": visuals_response,
|
||||
"tech": tech_response,
|
||||
# Configure OpenAI model client with the API key
|
||||
llm_config = {
|
||||
"timeout": 600,
|
||||
"cache_seed": 44, # change the seed for different trials
|
||||
"config_list": [
|
||||
{
|
||||
"model": "gpt-4o-mini",
|
||||
"api_key": api_key,
|
||||
}
|
||||
],
|
||||
"temperature": 0,
|
||||
}
|
||||
|
||||
# Run the agents sequentially and capture their responses
|
||||
individual_responses = run_agents_sequentially(task)
|
||||
# Define a task-provider agent
|
||||
task_agent = autogen.AssistantAgent(
|
||||
name="task_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="You are a task provider. Your only job is to provide the task details to the other agents.",
|
||||
)
|
||||
|
||||
# Update session state with the individual responses
|
||||
st.session_state.output = individual_responses
|
||||
# Define agents with detailed system prompts
|
||||
story_agent = autogen.AssistantAgent(
|
||||
name="story_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="""
|
||||
You are an experienced game story designer specializing in narrative design and world-building. Your task is to:
|
||||
1. Create a compelling narrative that aligns with the specified game type and target audience.
|
||||
2. Design memorable characters with clear motivations and character arcs.
|
||||
3. Develop the game's world, including its history, culture, and key locations.
|
||||
4. Plan story progression and major plot points.
|
||||
5. Integrate the narrative with the specified mood/atmosphere.
|
||||
6. Consider how the story supports the core gameplay mechanics.
|
||||
Provide your response in a detailed, well-structured report format. Do not use XML tags.
|
||||
"""
|
||||
)
|
||||
|
||||
gameplay_agent = autogen.AssistantAgent(
|
||||
name="gameplay_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="""
|
||||
You are a senior game mechanics designer with expertise in player engagement and systems design. Your task is to:
|
||||
1. Design core gameplay loops that match the specified game type and mechanics.
|
||||
2. Create progression systems (character development, skills, abilities).
|
||||
3. Define player interactions and control schemes for the chosen perspective.
|
||||
4. Balance gameplay elements for the target audience.
|
||||
5. Design multiplayer interactions if applicable.
|
||||
6. Specify game modes and difficulty settings.
|
||||
7. Consider the budget and development time constraints.
|
||||
Provide your response in a detailed, well-structured report format. Do not use XML tags.
|
||||
"""
|
||||
)
|
||||
|
||||
visuals_agent = autogen.AssistantAgent(
|
||||
name="visuals_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="""
|
||||
You are a creative art director with expertise in game visual and audio design. Your task is to:
|
||||
1. Define the visual style guide matching the specified art style.
|
||||
2. Design character and environment aesthetics.
|
||||
3. Plan visual effects and animations.
|
||||
4. Create the audio direction including music style, sound effects, and ambient sound.
|
||||
5. Consider technical constraints of chosen platforms.
|
||||
6. Align visual elements with the game's mood/atmosphere.
|
||||
7. Work within the specified budget constraints.
|
||||
Provide your response in a detailed, well-structured report format. Do not use XML tags.
|
||||
"""
|
||||
)
|
||||
|
||||
tech_agent = autogen.AssistantAgent(
|
||||
name="tech_agent",
|
||||
llm_config=llm_config,
|
||||
system_message="""
|
||||
You are a technical director with extensive game development experience. Your task is to:
|
||||
1. Recommend appropriate game engine and development tools.
|
||||
2. Define technical requirements for all target platforms.
|
||||
3. Plan the development pipeline and asset workflow.
|
||||
4. Identify potential technical challenges and solutions.
|
||||
5. Estimate resource requirements within the budget.
|
||||
6. Consider scalability and performance optimization.
|
||||
7. Plan for multiplayer infrastructure if applicable.
|
||||
Provide your response in a detailed, well-structured report format. Do not use XML tags.
|
||||
"""
|
||||
)
|
||||
|
||||
# Function to run agents sequentially
|
||||
def run_agents_sequentially(task):
|
||||
# Task agent provides the task to each agent one by one
|
||||
task_agent.initiate_chat(story_agent, message=task, max_turns=1)
|
||||
story_response = story_agent.last_message()["content"]
|
||||
|
||||
task_agent.initiate_chat(gameplay_agent, message=task, max_turns=1)
|
||||
gameplay_response = gameplay_agent.last_message()["content"]
|
||||
|
||||
task_agent.initiate_chat(visuals_agent, message=task, max_turns=1)
|
||||
visuals_response = visuals_agent.last_message()["content"]
|
||||
|
||||
task_agent.initiate_chat(tech_agent, message=task, max_turns=1)
|
||||
tech_response = tech_agent.last_message()["content"]
|
||||
|
||||
return {
|
||||
"story": story_response,
|
||||
"gameplay": gameplay_response,
|
||||
"visuals": visuals_response,
|
||||
"tech": tech_response,
|
||||
}
|
||||
|
||||
# Run the agents sequentially and capture their responses
|
||||
individual_responses = run_agents_sequentially(task)
|
||||
|
||||
# Update session state with the individual responses
|
||||
st.session_state.output = individual_responses
|
||||
|
||||
# Display success message after completion
|
||||
st.success('✨ Game concept generated successfully!')
|
||||
|
||||
# Display the individual outputs in expanders
|
||||
with st.expander("Story Design"):
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
pyautogen>=0.2.0
|
||||
beautifulsoup4==4.12.2
|
||||
lxml==4.9.3
|
||||
streamlit>=1.30.0
|
||||
pyautogen>=0.7.0
|
||||
autogen==0.6.1
|
||||
streamlit==1.41.1
|
||||
openai
|
||||
Loading…
Reference in a new issue