Spaces:
Running
on
Zero
Running
on
Zero
kwabs22
commited on
Commit
·
bc92805
1
Parent(s):
2c9eb60
Fixing Edit while play
Browse files- app.py +17 -8
- relatively_constant_variables.py +5 -0
app.py
CHANGED
@@ -242,12 +242,10 @@ def generate_story_and_timeline(no_story_timeline_points=10, no_ui_timeline_poin
|
|
242 |
# Pick 10 random UI items
|
243 |
random_ui_items = pick_random_items(player_engagement_items, no_ui_timeline_points)
|
244 |
random_story_items = pick_random_items(story_events, no_story_timeline_points)
|
245 |
-
print("simulplay debug - good to here")
|
246 |
|
247 |
# Generate UI and story timelines
|
248 |
ui_timeline = generate_timeline(random_ui_items, "UI")
|
249 |
story_timeline = generate_timeline(random_story_items, "Story")
|
250 |
-
print("simulplay debug - good to here 2")
|
251 |
|
252 |
# Initialize merged timeline with UI and story timelines
|
253 |
merged_timeline = ui_timeline + story_timeline
|
@@ -270,7 +268,6 @@ def generate_story_and_timeline(no_story_timeline_points=10, no_ui_timeline_poin
|
|
270 |
|
271 |
# Create the story
|
272 |
story = create_story(merged_timeline)
|
273 |
-
print("simulplay debug - good to here 3")
|
274 |
|
275 |
# Format the timeline for display
|
276 |
formatted_timeline = "\n".join([f"{entry[0]}: {entry[1]} - {entry[2]}" for entry in merged_timeline])
|
@@ -283,6 +280,8 @@ def generate_story_and_timeline(no_story_timeline_points=10, no_ui_timeline_poin
|
|
283 |
|
284 |
suggestions, selected_list_names = timeline_get_random_suggestions(num_lists, items_per_list, include_existing_games, include_multiplayer)
|
285 |
|
|
|
|
|
286 |
return formatted_timeline, story, json.dumps(game_structure_with_media, indent=2), suggestions, selected_list_names #no_media_formatted_timeline, json.dumps(game_structure_without_media, indent=2) #, game_structure_with_media
|
287 |
|
288 |
media_file_types = ["image", "video", "audio"]
|
@@ -1184,22 +1183,32 @@ Creating more diverse paths through the game""")
|
|
1184 |
gr.Markdown("Click the button to generate a random timeline and story based on UI elements and story events. <br>Ask an LLM to use this to write a story around")
|
1185 |
with gr.Row():
|
1186 |
ewpgame_structure_output_text_with_media = gr.Code(language="json")
|
1187 |
-
ewpgame_structure_output_text = gr.Code(language="json")
|
1188 |
with gr.Row():
|
1189 |
ewptimeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
|
1190 |
-
ewptimeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
|
|
|
|
|
|
|
1191 |
ewpstory_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
|
1192 |
with gr.Row():
|
|
|
1193 |
ewpgenerate_no_ui_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of ui timeline points")
|
1194 |
-
ewpgenerate_no_media_timeline_points = gr.Slider(minimum=1, value=5, step=1, maximum=30, label="Choose the amount of media timeline points")
|
1195 |
-
ewpgenerate_with_media_check = gr.Checkbox(label="Generate with media", value=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
1196 |
ewpgenerate_button = gr.Button("Generate Story and Timeline")
|
1197 |
|
1198 |
@gr.render(inputs=ewpwacustom_config) #ewpgame_structure_output_text_with_media
|
1199 |
def update(ewpwacustom_config):
|
1200 |
return show_elements_json_input(ewpwacustom_config)
|
1201 |
|
1202 |
-
ewpgenerate_button.click(generate_story_and_timeline, inputs=[ewpgenerate_no_ui_timeline_points,
|
1203 |
|
1204 |
with gr.Tab("Asset Generation Considerations"):
|
1205 |
with gr.Row():
|
|
|
242 |
# Pick 10 random UI items
|
243 |
random_ui_items = pick_random_items(player_engagement_items, no_ui_timeline_points)
|
244 |
random_story_items = pick_random_items(story_events, no_story_timeline_points)
|
|
|
245 |
|
246 |
# Generate UI and story timelines
|
247 |
ui_timeline = generate_timeline(random_ui_items, "UI")
|
248 |
story_timeline = generate_timeline(random_story_items, "Story")
|
|
|
249 |
|
250 |
# Initialize merged timeline with UI and story timelines
|
251 |
merged_timeline = ui_timeline + story_timeline
|
|
|
268 |
|
269 |
# Create the story
|
270 |
story = create_story(merged_timeline)
|
|
|
271 |
|
272 |
# Format the timeline for display
|
273 |
formatted_timeline = "\n".join([f"{entry[0]}: {entry[1]} - {entry[2]}" for entry in merged_timeline])
|
|
|
280 |
|
281 |
suggestions, selected_list_names = timeline_get_random_suggestions(num_lists, items_per_list, include_existing_games, include_multiplayer)
|
282 |
|
283 |
+
print("simulplay debug - good to here 4")
|
284 |
+
|
285 |
return formatted_timeline, story, json.dumps(game_structure_with_media, indent=2), suggestions, selected_list_names #no_media_formatted_timeline, json.dumps(game_structure_without_media, indent=2) #, game_structure_with_media
|
286 |
|
287 |
media_file_types = ["image", "video", "audio"]
|
|
|
1183 |
gr.Markdown("Click the button to generate a random timeline and story based on UI elements and story events. <br>Ask an LLM to use this to write a story around")
|
1184 |
with gr.Row():
|
1185 |
ewpgame_structure_output_text_with_media = gr.Code(language="json")
|
1186 |
+
#ewpgame_structure_output_text = gr.Code(language="json")
|
1187 |
with gr.Row():
|
1188 |
ewptimeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
|
1189 |
+
#ewptimeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
|
1190 |
+
with gr.Column():
|
1191 |
+
ewptimeline_output_text = gr.Textbox(label="Random Suggestions", lines=10)
|
1192 |
+
ewptimeline_selected_lists_text = gr.Textbox(label="Selected Idea Lists for Inspiration", lines=2)
|
1193 |
ewpstory_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
|
1194 |
with gr.Row():
|
1195 |
+
ewpgenerate_no_story_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of story timeline points")
|
1196 |
ewpgenerate_no_ui_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of ui timeline points")
|
1197 |
+
#ewpgenerate_no_media_timeline_points = gr.Slider(minimum=1, value=5, step=1, maximum=30, label="Choose the amount of media timeline points")
|
1198 |
+
#ewpgenerate_with_media_check = gr.Checkbox(label="Generate with media", value=True)
|
1199 |
+
with gr.Row():
|
1200 |
+
ewptimeline_num_lists_slider = gr.Slider(minimum=1, maximum=len(all_idea_lists), step=1, label="Number of Lists to Consider", value=3)
|
1201 |
+
ewptimeline_items_per_list_slider = gr.Slider(minimum=1, maximum=10, step=1, label="Items per List", value=3)
|
1202 |
+
ewptimeline_include_existing_games = gr.Checkbox(label="Include Existing Game Inspirations", value=True)
|
1203 |
+
ewptimeline_include_multiplayer = gr.Checkbox(label="Include Multiplayer Features", value=True)
|
1204 |
+
|
1205 |
ewpgenerate_button = gr.Button("Generate Story and Timeline")
|
1206 |
|
1207 |
@gr.render(inputs=ewpwacustom_config) #ewpgame_structure_output_text_with_media
|
1208 |
def update(ewpwacustom_config):
|
1209 |
return show_elements_json_input(ewpwacustom_config)
|
1210 |
|
1211 |
+
ewpgenerate_button.click(generate_story_and_timeline, inputs=[ewpgenerate_no_story_timeline_points, ewpgenerate_no_ui_timeline_points, ewptimeline_num_lists_slider, ewptimeline_items_per_list_slider, ewptimeline_include_existing_games, ewptimeline_include_multiplayer], outputs=[ewptimeline_output_with_assets, ewpstory_output, ewpgame_structure_output_text_with_media, ewptimeline_output_text, ewptimeline_selected_lists_text]) #ewptimeline_output_with_assets, ewptimeline_output, ewpstory_output, ewpwacustom_config, ewpgame_structure_output_text]) #ewpgame_structure_output_text_with_media, ewpgame_structure_output_text])
|
1212 |
|
1213 |
with gr.Tab("Asset Generation Considerations"):
|
1214 |
with gr.Row():
|
relatively_constant_variables.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
""" Variables moved to make reading a bit easier
|
2 |
ctrl+f - #-------------------------#-------------------------#-------------------------#-------------------------
|
|
|
3 |
FAQ and RAG data and prompt engineering
|
4 |
Default Config - JS config
|
5 |
Autostructure suggestor?
|
@@ -11,6 +12,10 @@ Test if HTML can load in HTML gradio component
|
|
11 |
|
12 |
"""
|
13 |
|
|
|
|
|
|
|
|
|
14 |
#Supposed to be part of FAQ buttons
|
15 |
Frontendpromptengforguide = """Suggest descriptions for media to fill the empty media fields -
|
16 |
|
|
|
1 |
""" Variables moved to make reading a bit easier
|
2 |
ctrl+f - #-------------------------#-------------------------#-------------------------#-------------------------
|
3 |
+
Game Ideas for LLM prompts
|
4 |
FAQ and RAG data and prompt engineering
|
5 |
Default Config - JS config
|
6 |
Autostructure suggestor?
|
|
|
12 |
|
13 |
"""
|
14 |
|
15 |
+
GameIdeasForPromptstodiscusswithSOTALLM = ["Programming Interview", "Coaching an NPC into the main character", "High pressure environment eg. Chefs Kitchen, Pitstop", "Moral Injury"]
|
16 |
+
|
17 |
+
#-------------------------------------------------------------------------------------------------------------------------
|
18 |
+
|
19 |
#Supposed to be part of FAQ buttons
|
20 |
Frontendpromptengforguide = """Suggest descriptions for media to fill the empty media fields -
|
21 |
|