diff --git a/ai_agent_tutorials/ai_game_dev_team/main.py b/ai_agent_tutorials/ai_game_dev_team/main.py index 2493a26..21c5aad 100644 --- a/ai_agent_tutorials/ai_game_dev_team/main.py +++ b/ai_agent_tutorials/ai_game_dev_team/main.py @@ -4,6 +4,7 @@ from autogen import AssistantAgent from autogen.agentchat.groupchat import RoundRobinGroupChat from autogen.agentchat.conditions import TextMentionTermination from autogen.oai.client import OpenAIWrapper +from bs4 import BeautifulSoup # Initialize session state if 'output' not in st.session_state: @@ -91,8 +92,36 @@ if st.button("Generate Game Concept"): "story_agent", model_client=model_client, system_message=""" - You are a game story designer. Your task is to create a compelling narrative for the game. - Include details about the world, characters, and plot. Make the story immersive and engaging. + 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 + + Structure your response using these XML tags: + + + [Describe the game world, its history, and setting] + + + + [Character name] + [Character role] + [Character motivation] + [Character development arc] + + + + [Opening act] + [Main story development] + [Story climax] + [Story resolution] + + [List of pivotal story moments] + [How story elements connect with gameplay] + """ ) @@ -100,8 +129,34 @@ if st.button("Generate Game Concept"): "gameplay_agent", model_client=model_client, system_message=""" - You are a game mechanics designer. Your task is to define the core gameplay mechanics, features, and systems. - Include details about combat, exploration, progression, and unique features. + 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 + + Structure your response using these XML tags: + + + [Main gameplay loop] + [Supporting gameplay loops] + + + [Control scheme details] + [List of player actions] + + + [Skills, abilities, stats] + [Items, features, content] + [Key milestones and rewards] + + [List and description of game modes] + [Multiplayer mechanics if applicable] + [Game balance considerations] + """ ) @@ -109,8 +164,41 @@ if st.button("Generate Game Concept"): "visuals_agent", model_client=model_client, system_message=""" - You are a visual and audio designer. Your task is to define the art style, environment design, and audio elements. - Include details about the color palette, character design, and sound effects. + 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 + + Structure your response using these XML tags: + + + [Color scheme details] + [Overall visual direction] + [Visual references] + + + [Main character visual details] + [NPC design guidelines] + + + [World design principles] + [Notable location designs] + + + [VFX guidelines] + [Animation guidelines] + + + [Platform-specific considerations] + """ ) @@ -118,8 +206,43 @@ if st.button("Generate Game Concept"): "tech_agent", model_client=model_client, system_message=""" - You are a technical expert. Your task is to recommend the technology stack, tools, and implementation plan. - Include details about the game engine, programming languages, and tools for asset creation. + 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 + + Structure your response using these XML tags: + + + [Game engine choice and rationale] + [Development tools list] + [Programming languages] + + + [Asset creation and management] + [Build and deployment process] + [Version control strategy] + + + [Platform-specific requirements] + [Performance targets] + [Network requirements if applicable] + + + [Team composition and roles] + [Hardware requirements] + [Server infrastructure if needed] + + + [Development phases] + [Key technical milestones] + [Technical risks and mitigation] + + """ ) @@ -143,10 +266,14 @@ if st.button("Generate Game Concept"): result = loop.run_until_complete(run_agents(task)) # Parse the result and update session state - st.session_state.output['story'] = result.split("Story:")[1].split("Gameplay:")[0].strip() - st.session_state.output['gameplay'] = result.split("Gameplay:")[1].split("Visuals:")[0].strip() - st.session_state.output['visuals'] = result.split("Visuals:")[1].split("Tech:")[0].strip() - st.session_state.output['tech'] = result.split("Tech:")[1].strip() + # Create BeautifulSoup object from the result + soup = BeautifulSoup(result, 'xml') + + # Extract sections + st.session_state.output['story'] = str(soup.find('story')) + st.session_state.output['gameplay'] = str(soup.find('gameplay')) + st.session_state.output['visuals'] = str(soup.find('visuals')) + st.session_state.output['tech'] = str(soup.find('technical')) # Display the outputs in containers with st.container(): diff --git a/ai_agent_tutorials/ai_game_dev_team/requirements.txt b/ai_agent_tutorials/ai_game_dev_team/requirements.txt index cbd32cd..24ec0b5 100644 --- a/ai_agent_tutorials/ai_game_dev_team/requirements.txt +++ b/ai_agent_tutorials/ai_game_dev_team/requirements.txt @@ -1 +1,3 @@ -agentarium==0.3.0 \ No newline at end of file +agentarium==0.3.0 +beautifulsoup4==4.12.2 +lxml==4.9.3 \ No newline at end of file