sainkan commited on
Commit
ea8e80f
·
verified ·
1 Parent(s): 92ba273

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -33
app.py CHANGED
@@ -32,34 +32,36 @@ def generate_text(prompt, model_name="claude-3-opus-20240229"):
32
  def main():
33
  st.set_page_config(page_title="StoryForge", layout="wide")
34
  st.title("StoryForge")
 
 
 
 
 
 
35
 
36
  # Sidebar for user input
37
  with st.sidebar:
38
- st.header("Controls")
39
  image_description = st.text_area(
40
- "Set the foundation for the game world by providing a detailed and imaginative description of the overall theme, setting, and gameplay elements.",
 
41
  height=100
42
  )
43
  protagonist_description = st.text_area(
44
- "Introduce the main character of the game. Describe their appearance, personality, strengths, and weaknesses. What makes them unique and interesting?",
 
45
  height=100
46
  )
47
  antagonist_description = st.text_area(
48
- "Describe the primary antagonist or enemy in the game. What are their motivations, abilities, and characteristics? How do they pose a challenge to the protagonist?",
 
49
  height=100
50
  )
51
- generate_text_btn = st.button("Generate Game Design")
52
 
53
  col1, col2 = st.columns(2)
54
 
55
  with col1:
56
- st.markdown(
57
- "*StoryForge* is a cutting-edge AI app designed to empower *game developers* and creators. "
58
- "With StoryForge, you can effortlessly craft captivating game design documents. "
59
- "From crafting immersive storylines and intricate plots to defining compelling protagonists and antagonists, "
60
- "StoryForge unlocks your creative potential and streamlines the game design process."
61
- )
62
-
63
  st.subheader("Game Environment")
64
  if generate_text_btn and image_description:
65
  with st.spinner("Generating game environment description..."):
@@ -68,16 +70,16 @@ def main():
68
  )
69
  st.markdown(generated_environment)
70
 
71
- st.subheader("Antagonist")
72
- if generate_text_btn and antagonist_description:
73
- with st.spinner("Generating antagonist description..."):
74
- generated_antagonist = generate_text(
75
- f"Generate a detailed description of a game antagonist based on this description: {antagonist_description}"
76
  )
77
- st.markdown(generated_antagonist)
78
 
79
  with col2:
80
- st.subheader("Story")
81
  if generate_text_btn and image_description:
82
  with st.spinner("Generating game story..."):
83
  generated_story = generate_text(
@@ -85,21 +87,13 @@ def main():
85
  )
86
  st.markdown(generated_story)
87
 
88
- st.subheader("Protagonist")
89
- if generate_text_btn and protagonist_description:
90
- with st.spinner("Generating protagonist description..."):
91
- generated_protagonist = generate_text(
92
- f"Generate a detailed description of a game protagonist based on this description: {protagonist_description}"
93
- )
94
- st.markdown(generated_protagonist)
95
-
96
- st.subheader("Game Plot")
97
- if generate_text_btn and image_description:
98
- with st.spinner("Generating game plot..."):
99
- generated_plot = generate_text(
100
- f"Generate a short game plot with a hook, gameplay relation, sticky mechanics, and setting based on this description: {image_description}"
101
  )
102
- st.markdown(generated_plot)
103
 
104
  # Run Main Function
105
  if __name__ == "__main__":
 
32
  def main():
33
  st.set_page_config(page_title="StoryForge", layout="wide")
34
  st.title("StoryForge")
35
+ st.markdown(
36
+ """
37
+ **StoryForge** helps game developers generate comprehensive Game Design Documents.
38
+ Input details about your game environment, protagonist, and antagonist to create a structured design document.
39
+ """
40
+ )
41
 
42
  # Sidebar for user input
43
  with st.sidebar:
44
+ st.header("Game Details")
45
  image_description = st.text_area(
46
+ "Game Environment",
47
+ placeholder="Describe the setting of your game",
48
  height=100
49
  )
50
  protagonist_description = st.text_area(
51
+ "Protagonist",
52
+ placeholder="Describe the main character",
53
  height=100
54
  )
55
  antagonist_description = st.text_area(
56
+ "Antagonist",
57
+ placeholder="Describe the main villain or opposing force",
58
  height=100
59
  )
60
+ generate_text_btn = st.button("Generate Document")
61
 
62
  col1, col2 = st.columns(2)
63
 
64
  with col1:
 
 
 
 
 
 
 
65
  st.subheader("Game Environment")
66
  if generate_text_btn and image_description:
67
  with st.spinner("Generating game environment description..."):
 
70
  )
71
  st.markdown(generated_environment)
72
 
73
+ st.subheader("Protagonist")
74
+ if generate_text_btn and protagonist_description:
75
+ with st.spinner("Generating protagonist description..."):
76
+ generated_protagonist = generate_text(
77
+ f"Generate a detailed description of a game protagonist based on this description: {protagonist_description}"
78
  )
79
+ st.markdown(generated_protagonist)
80
 
81
  with col2:
82
+ st.subheader("Game Story")
83
  if generate_text_btn and image_description:
84
  with st.spinner("Generating game story..."):
85
  generated_story = generate_text(
 
87
  )
88
  st.markdown(generated_story)
89
 
90
+ st.subheader("Antagonist")
91
+ if generate_text_btn and antagonist_description:
92
+ with st.spinner("Generating antagonist description..."):
93
+ generated_antagonist = generate_text(
94
+ f"Generate a detailed description of a game antagonist based on this description: {antagonist_description}"
 
 
 
 
 
 
 
 
95
  )
96
+ st.markdown(generated_antagonist)
97
 
98
  # Run Main Function
99
  if __name__ == "__main__":