kwabs22 commited on
Commit
743b06e
1 Parent(s): b602b14

Config based info to help users

Browse files
Files changed (1) hide show
  1. app.py +555 -14
app.py CHANGED
@@ -330,7 +330,8 @@ all_states = {
330
  "transitions": {'explore village': 'village_rumor', 'gather supplies': 'village_supplies', 'rest': 'village_start'},
331
  "consequences": {
332
  'gather supplies': lambda player: player.add_item('basic supplies')
333
- }
 
334
  },
335
  'rumor': {
336
  "description": "You hear more details about the treasure hidden in the ancient ruins nearby.",
@@ -338,36 +339,42 @@ all_states = {
338
  "transitions": {'decide to go': 'village_supplies', 'ignore': 'village_start'},
339
  "consequences": {
340
  'decide to go': lambda player: player.update_knowledge('treasure location')
341
- }
 
342
  },
343
  'supplies': {
344
  "description": "You gather supplies for your journey.",
345
  "choices": ['head to forest', 'stay in village'],
346
- "transitions": {'head to forest': 'forest_forest', 'stay in village': 'village_start'}
 
347
  },
348
  },
349
  'forest': {
350
  'forest': {
351
  "description": "You enter the dense forest, heading towards the ruins.",
352
  "choices": ['travel further', 'return to village'],
353
- "transitions": {'travel further': 'ruins_ruins', 'return to village': 'village_start'}
 
354
  },
355
  },
356
  'ruins': {
357
  'ruins': {
358
  "description": "You reach the ancient ruins. The entrance is dark and eerie.",
359
  "choices": ['enter ruins', 'return to forest'],
360
- "transitions": {'enter ruins': 'ruins_explore', 'return to forest': 'forest_forest'}
 
361
  },
362
  'explore': {
363
  "description": "You explore the ruins, encountering traps and puzzles.",
364
  "choices": ['solve puzzle', 'avoid traps'],
365
- "transitions": {'solve puzzle': 'ruins_hiddenPassage', 'avoid traps': 'ruins_ruins'}
 
366
  },
367
  'hiddenPassage': {
368
  "description": "You solve a challenging puzzle and unlock a hidden passage.",
369
  "choices": ['enter passage', 'go back'],
370
- "transitions": {'enter passage': 'ruins_treasureRoom', 'go back': 'ruins_explore'}
 
371
  },
372
  'treasureRoom': {
373
  "description": "You enter the treasure room and find the treasure chest.",
@@ -375,26 +382,30 @@ all_states = {
375
  "transitions": {'take treasure': 'ruins_celebrate', 'leave': 'ruins_ruins'},
376
  "consequences": {
377
  'take treasure': lambda player: player.add_item('treasure')
378
- }
 
379
  },
380
  'celebrate': {
381
  "description": "You celebrate your discovery and decide to bring the treasure back to the village.",
382
  "choices": ['return to village'],
383
- "transitions": {'return to village': 'village_return'}
 
384
  },
385
  },
386
  'village_return': {
387
  'village_return': {
388
  "description": "You return to the village with the treasure and share it with the villagers.",
389
  "choices": ['end adventure'],
390
- "transitions": {'end adventure': 'end_end'}
 
391
  },
392
  },
393
  'end': {
394
  'end': {
395
  "description": "Your adventure ends here. The villagers are grateful and everyone's lives improve.",
396
  "choices": [],
397
- "transitions": {}
 
398
  },
399
  }
400
  }
@@ -553,7 +564,6 @@ def display_website(link):
553
  gr.Info("If 404 then the space/page has probably been disabled - normally due to a better alternative")
554
  return html
555
 
556
-
557
  initgameinfo = start_game()
558
 
559
  #-----------------------------------------------------------------------------------------------------------------------------------
@@ -638,7 +648,7 @@ with gr.Blocks() as demo:
638
  with gr.Accordion("Temporary Asset Management Assist - click to open", open=False):
639
  gr.HTML("Make Files and Text ideas for the field and paste <br>When Space is restarted it will clear - zip export and import will be added later")
640
  with gr.Accordion("Upload Files for config"):
641
- gr.Markdown("# Media Saver and Explorer (refresh file list to be resolved - for now upload all files and reload the space - they persist as long as the space creator doesnt reset the space - will add manual clear options later)")
642
  with gr.Tab("Upload Files"):
643
  file_input = gr.File(label="Choose File to Upload")
644
  save_output = gr.Textbox(label="Upload Status")
@@ -694,6 +704,534 @@ with gr.Blocks() as demo:
694
  imagegenspace = gr.HTML("Chat Space Chosen will load here")
695
  imagegenspacebtn.click(display_website, inputs=linktoimagegen, outputs=imagegenspace)
696
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
697
  with gr.Tab("Test and Edit Config"):
698
  gr.HTML("The main issue is frequent changes add more chances for bugs in how ")
699
  with gr.Tab("Full Manual - Test Example State Machine"):
@@ -884,13 +1422,16 @@ with gr.Blocks() as demo:
884
  with gr.Tab("Export Options"):
885
  gr.HTML("Placeholder - My Custom JS, Playcanvas, Unreal Engine")
886
 
 
 
 
887
  with gr.Tab("Asset Generation Considerations"):
888
  gr.HTML("With some ideas from gemini-1.5-flash-api-0514 and reka-flash-preview-20240611 <br><br>Licenses for the spaces still to be evaluated")
889
 
890
  with gr.Tab("Save files"):
891
  gr.HTML("For Dynamic events overnight or when player is not active what can LLMS edit? <br><br>eg. Waiting for a letter from a random npc can be decided by the llm <br>eg. Improved Stats on certain days (eg. bitrthday) <br>Privacy <br>User Directed DLC eg. Rockstar Editor with local llm guide")
892
  gr.HTML("Some ideas - In game websites eg. GTA esp stock markets, news; ")
893
- gr.HTML("Placeholder for huggingface spaces that can assist - https://huggingface.co/nvidia/Nemotron-4-340B-Instruct (Purpose is supposed to be synthetic data generation) ")
894
  gr.HTML("Placeholder for models small enough to run on cpu here in this space that can assist (9b and under) <br>initial floor for testing can be https://huggingface.co/spaces/Qwen/Qwen2-0.5B-Instruct, https://huggingface.co/spaces/Qwen/Qwen2-1.5b-instruct-demo, https://huggingface.co/spaces/stabilityai/stablelm-2-1_6b-zephyr, https://huggingface.co/spaces/IndexTeam/Index-1.9B, https://huggingface.co/microsoft/Phi-3-mini-4k-instruct")
895
 
896
  with gr.Tab("Images"):
 
330
  "transitions": {'explore village': 'village_rumor', 'gather supplies': 'village_supplies', 'rest': 'village_start'},
331
  "consequences": {
332
  'gather supplies': lambda player: player.add_item('basic supplies')
333
+ },
334
+ "media": []
335
  },
336
  'rumor': {
337
  "description": "You hear more details about the treasure hidden in the ancient ruins nearby.",
 
339
  "transitions": {'decide to go': 'village_supplies', 'ignore': 'village_start'},
340
  "consequences": {
341
  'decide to go': lambda player: player.update_knowledge('treasure location')
342
+ },
343
+ "media": []
344
  },
345
  'supplies': {
346
  "description": "You gather supplies for your journey.",
347
  "choices": ['head to forest', 'stay in village'],
348
+ "transitions": {'head to forest': 'forest_forest', 'stay in village': 'village_start'},
349
+ "media": []
350
  },
351
  },
352
  'forest': {
353
  'forest': {
354
  "description": "You enter the dense forest, heading towards the ruins.",
355
  "choices": ['travel further', 'return to village'],
356
+ "transitions": {'travel further': 'ruins_ruins', 'return to village': 'village_start'},
357
+ "media": []
358
  },
359
  },
360
  'ruins': {
361
  'ruins': {
362
  "description": "You reach the ancient ruins. The entrance is dark and eerie.",
363
  "choices": ['enter ruins', 'return to forest'],
364
+ "transitions": {'enter ruins': 'ruins_explore', 'return to forest': 'forest_forest'},
365
+ "media": []
366
  },
367
  'explore': {
368
  "description": "You explore the ruins, encountering traps and puzzles.",
369
  "choices": ['solve puzzle', 'avoid traps'],
370
+ "transitions": {'solve puzzle': 'ruins_hiddenPassage', 'avoid traps': 'ruins_ruins'},
371
+ "media": []
372
  },
373
  'hiddenPassage': {
374
  "description": "You solve a challenging puzzle and unlock a hidden passage.",
375
  "choices": ['enter passage', 'go back'],
376
+ "transitions": {'enter passage': 'ruins_treasureRoom', 'go back': 'ruins_explore'},
377
+ "media": []
378
  },
379
  'treasureRoom': {
380
  "description": "You enter the treasure room and find the treasure chest.",
 
382
  "transitions": {'take treasure': 'ruins_celebrate', 'leave': 'ruins_ruins'},
383
  "consequences": {
384
  'take treasure': lambda player: player.add_item('treasure')
385
+ },
386
+ "media": []
387
  },
388
  'celebrate': {
389
  "description": "You celebrate your discovery and decide to bring the treasure back to the village.",
390
  "choices": ['return to village'],
391
+ "transitions": {'return to village': 'village_return'},
392
+ "media": []
393
  },
394
  },
395
  'village_return': {
396
  'village_return': {
397
  "description": "You return to the village with the treasure and share it with the villagers.",
398
  "choices": ['end adventure'],
399
+ "transitions": {'end adventure': 'end_end'},
400
+ "media": []
401
  },
402
  },
403
  'end': {
404
  'end': {
405
  "description": "Your adventure ends here. The villagers are grateful and everyone's lives improve.",
406
  "choices": [],
407
+ "transitions": {},
408
+ "media": []
409
  },
410
  }
411
  }
 
564
  gr.Info("If 404 then the space/page has probably been disabled - normally due to a better alternative")
565
  return html
566
 
 
567
  initgameinfo = start_game()
568
 
569
  #-----------------------------------------------------------------------------------------------------------------------------------
 
648
  with gr.Accordion("Temporary Asset Management Assist - click to open", open=False):
649
  gr.HTML("Make Files and Text ideas for the field and paste <br>When Space is restarted it will clear - zip export and import will be added later")
650
  with gr.Accordion("Upload Files for config"):
651
+ gr.Markdown("# Media Saver and Explorer (refresh file list to be resolved - for now upload all files and reload the space - they persist as long as the space creator doesnt reset/update the space - will add manual clear options later)")
652
  with gr.Tab("Upload Files"):
653
  file_input = gr.File(label="Choose File to Upload")
654
  save_output = gr.Textbox(label="Upload Status")
 
704
  imagegenspace = gr.HTML("Chat Space Chosen will load here")
705
  imagegenspacebtn.click(display_website, inputs=linktoimagegen, outputs=imagegenspace)
706
 
707
+ with gr.Accordion("Config Crafting Progerssion - click to open", open=False):
708
+ gr.HTML("Example of how to advance a game config with LLM - end goal is to have automatic worflow that takes these considerations into account <br> Things missing from the game engine - Economics and Basic Politics (NPC affiliation)")
709
+ originalconfigatbeinningofthisspace = """{
710
+ 'village': {
711
+ 'start': {
712
+ "description": "You wake up in a small village. You hear a rumor about a lost treasure.",
713
+ "choices": ['explore village', 'gather supplies', 'rest'],
714
+ "transitions": {'explore village': 'village_rumor', 'gather supplies': 'village_supplies', 'rest': 'village_start'},
715
+ "consequences": {
716
+ 'gather supplies': lambda player: player.add_item('basic supplies')
717
+ },
718
+ "media": []
719
+ },
720
+ 'rumor': {
721
+ "description": "You hear more details about the treasure hidden in the ancient ruins nearby.",
722
+ "choices": ['decide to go', 'ignore'],
723
+ "transitions": {'decide to go': 'village_supplies', 'ignore': 'village_start'},
724
+ "consequences": {
725
+ 'decide to go': lambda player: player.update_knowledge('treasure location')
726
+ },
727
+ "media": []
728
+ },
729
+ 'supplies': {
730
+ "description": "You gather supplies for your journey.",
731
+ "choices": ['head to forest', 'stay in village'],
732
+ "transitions": {'head to forest': 'forest_forest', 'stay in village': 'village_start'},
733
+ "media": []
734
+ },
735
+ },
736
+ 'forest': {
737
+ 'forest': {
738
+ "description": "You enter the dense forest, heading towards the ruins.",
739
+ "choices": ['travel further', 'return to village'],
740
+ "transitions": {'travel further': 'ruins_ruins', 'return to village': 'village_start'},
741
+ "media": []
742
+ },
743
+ },
744
+ 'ruins': {
745
+ 'ruins': {
746
+ "description": "You reach the ancient ruins. The entrance is dark and eerie.",
747
+ "choices": ['enter ruins', 'return to forest'],
748
+ "transitions": {'enter ruins': 'ruins_explore', 'return to forest': 'forest_forest'},
749
+ "media": []
750
+ },
751
+ 'explore': {
752
+ "description": "You explore the ruins, encountering traps and puzzles.",
753
+ "choices": ['solve puzzle', 'avoid traps'],
754
+ "transitions": {'solve puzzle': 'ruins_hiddenPassage', 'avoid traps': 'ruins_ruins'},
755
+ "media": []
756
+ },
757
+ 'hiddenPassage': {
758
+ "description": "You solve a challenging puzzle and unlock a hidden passage.",
759
+ "choices": ['enter passage', 'go back'],
760
+ "transitions": {'enter passage': 'ruins_treasureRoom', 'go back': 'ruins_explore'},
761
+ "media": []
762
+ },
763
+ 'treasureRoom': {
764
+ "description": "You enter the treasure room and find the treasure chest.",
765
+ "choices": ['take treasure', 'leave'],
766
+ "transitions": {'take treasure': 'ruins_celebrate', 'leave': 'ruins_ruins'},
767
+ "consequences": {
768
+ 'take treasure': lambda player: player.add_item('treasure')
769
+ },
770
+ "media": []
771
+ },
772
+ 'celebrate': {
773
+ "description": "You celebrate your discovery and decide to bring the treasure back to the village.",
774
+ "choices": ['return to village'],
775
+ "transitions": {'return to village': 'village_return'},
776
+ "media": []
777
+ },
778
+ },
779
+ 'village_return': {
780
+ 'village_return': {
781
+ "description": "You return to the village with the treasure and share it with the villagers.",
782
+ "choices": ['end adventure'],
783
+ "transitions": {'end adventure': 'end_end'},
784
+ "media": []
785
+ },
786
+ },
787
+ 'end': {
788
+ 'end': {
789
+ "description": "Your adventure ends here. The villagers are grateful and everyone's lives improve.",
790
+ "choices": [],
791
+ "transitions": {},
792
+ "media": []
793
+ },
794
+ }
795
+ }
796
+ """
797
+ #Analyzing Game Configuration Metrics - was the thread name of where the
798
+ claude3_5_06072024configtips = """Example Config Development Tab - Claude 3.5 Sonnet as the LLM Assitant
799
+
800
+ This config is for a basic text based game engine I made with help many llms including you. Thanks to all the help it loads which presented another problem, I dont have any structural metrics to assess the quality of the config. What JSON things can we look at to see if it may be too bland for a person testing the game
801
+
802
+
803
+
804
+
805
+ Text-Based Game Configuration Analysis
806
+ 1. State Variety
807
+
808
+ Total number of states: 13
809
+ Number of unique locations: 5 (village, forest, ruins, village_return, end)
810
+
811
+ 2. Choice Diversity
812
+
813
+ Average choices per state: 1.92
814
+ States with no choices: 1 (end state)
815
+ States with most choices: 3 (village_start with 3 choices)
816
+ Unique choices across all states: 17
817
+
818
+ 3. Transition Complexity
819
+
820
+ Total number of transitions: 25
821
+ Average transitions per state: 1.92
822
+ States with most transitions: 3 (village_start with 3 transitions)
823
+
824
+ 4. Consequence Implementation
825
+
826
+ States with consequences: 3
827
+ Total number of consequences: 3
828
+ Types of consequences: Adding items, Updating knowledge
829
+
830
+ 5. Description Length
831
+
832
+ Average description length: 13.15 words
833
+ Longest description: 24 words (village_return)
834
+ Shortest description: 4 words (village_supplies)
835
+
836
+ 6. Cyclic Paths
837
+
838
+ Presence of loops: Yes (e.g., village_start -> village_supplies -> village_start)
839
+
840
+ 7. Dead Ends
841
+
842
+ Number of dead ends: 1 (end state)
843
+
844
+ 8. Media Integration
845
+
846
+ States with media: 0
847
+ Total media elements: 0
848
+
849
+ 9. Narrative Progression
850
+
851
+ Clear beginning (village_start) and end (end) states
852
+ Multiple paths to reach the end
853
+
854
+ 10. Player Agency
855
+
856
+ Choices affect game progression
857
+ Some choices have consequences (3 instances)
858
+
859
+ 11. Game Length
860
+
861
+ Minimum steps to complete: 6 (village_start -> village_supplies -> forest_forest -> ruins_ruins -> ruins_explore -> ruins_hiddenPassage -> ruins_treasureRoom -> ruins_celebrate -> village_return -> end)
862
+ Maximum steps (including loops): Potentially infinite due to cycles
863
+
864
+ 12. Replayability
865
+
866
+ Multiple paths through the game
867
+ Some variability in outcomes based on choices
868
+
869
+ #=============================================
870
+
871
+ To assess the quality and potential blandness of your game configuration, we can analyze several structural metrics within the JSON. Here are some aspects we can examine:
872
+ Text-Based Game Configuration AnalysisClick to open document
873
+ Based on this analysis, here are some observations about the potential blandness of the game:
874
+
875
+ Limited state variety: With only 13 states across 5 locations, the game might feel short and lacking in diversity. Consider adding more locations or states within existing locations.
876
+ Low average choices: An average of 1.92 choices per state might make the game feel linear. Increasing the number of choices in more states could improve player engagement.
877
+ Limited consequences: Only 3 states have consequences, which might make player choices feel less impactful. Adding more consequences could increase the sense of agency.
878
+ Short descriptions: The average description length of 13.15 words might not provide enough detail to immerse players. Consider expanding descriptions to create a richer narrative.
879
+ Lack of media: No states currently use media elements, which could make the game feel less engaging. Adding images, sound effects, or other media could enhance the player experience.
880
+ Limited narrative branching: While there are some loops and choices, the overall structure is relatively linear. Adding more branching paths could increase replayability and player interest.
881
+
882
+ To make the game less bland, consider:
883
+
884
+ Adding more states and locations
885
+ Increasing the number of choices in each state
886
+ Implementing more consequences for player actions
887
+ Expanding descriptions to create a richer narrative
888
+ Incorporating media elements
889
+ Creating more diverse paths through the game
890
+
891
+ #===============================================
892
+
893
+
894
+ # Text-Based Game Improvement Suggestions
895
+
896
+ ## 1. Expand State Variety
897
+ - Add a new location: "Mountain Pass"
898
+ - Include states like "steep_climb", "avalanche_risk", "hidden_cave"
899
+ - Expand the "forest" location:
900
+ - Add states like "dense_thicket", "mysterious_clearing", "ancient_tree"
901
+
902
+ ## 2. Increase Choice Diversity
903
+ - Add more choices to existing states. For example, in "village_start":
904
+ - "talk to elder"
905
+ - "visit market"
906
+ - "investigate strange noises"
907
+ - Ensure most states have at least 3 choices
908
+
909
+ ## 3. Enhance Transition Complexity
910
+ - Create more interconnected states. For example:
911
+ - Allow travel between "forest" and "mountain_pass"
912
+ - Add shortcuts or secret passages between non-adjacent locations
913
+
914
+ ## 4. Implement More Consequences
915
+ - Add consequences to more choices. For example:
916
+ - In "forest_forest":
917
+ - "forage for food" -> `lambda player: player.add_item('wild berries')`
918
+ - "take shortcut" -> `lambda player: player.update_status('lost')`
919
+
920
+ ## 5. Enrich Descriptions
921
+ - Expand existing descriptions with more vivid details
922
+ - Example for "village_start":
923
+ ```python
924
+ "description": "You wake up in a small village nestled between rolling hills. The air is filled with the scent of freshly baked bread and the sound of a distant waterfall. Villagers bustle about, whispering excitedly about a rumor of lost treasure."
925
+ ```
926
+
927
+ ## 6. Introduce Cyclic Content with Variations
928
+ - Add time-based changes to revisited locations
929
+ - Example:
930
+ ```python
931
+ 'village_start': {
932
+ "description": lambda player: f"You return to the village square. It's now {player.time_of_day()}. " +
933
+ ("The market is bustling with activity." if player.time_of_day() == "day" else
934
+ "The streets are quiet, lit by flickering torches.")
935
+ }
936
+ ```
937
+
938
+ ## 7. Create Meaningful Dead Ends
939
+ - Add optional quests or side adventures
940
+ - Example: "help_lost_child" state in the village that doesn't progress main story but provides rewards
941
+
942
+ ## 8. Integrate Media Elements
943
+ - Add placeholder media to enhance immersion:
944
+ ```python
945
+ "media": [
946
+ {"type": "image", "url": "/api/placeholder/400/300", "alt": "A picturesque village at dawn"},
947
+ {"type": "sound", "url": "village_ambience.mp3"}
948
+ ]
949
+ ```
950
+
951
+ ## 9. Enhance Narrative Progression
952
+ - Add a main quest storyline with multiple stages
953
+ - Introduce side quests for additional depth
954
+
955
+ ## 10. Increase Player Agency
956
+ - Add more impactful choices that significantly alter the game's direction
957
+ - Implement a simple inventory or skill system that affects available choices
958
+
959
+ ## 11. Extend Game Length
960
+ - Add more locations and states to create a longer, more involved adventure
961
+ - Implement quest chains that span multiple locations
962
+
963
+ ## 12. Improve Replayability
964
+ - Add random events that can occur in each location
965
+ - Implement multiple endings based on player choices and achievements
966
+
967
+
968
+ #===============================================
969
+
970
+ # Updated Text-Based Game Configuration with Side Quest
971
+
972
+ ## New State: help_lost_child
973
+
974
+ Add this new state to the 'village' section of your `all_states` dictionary:
975
+
976
+ ```python
977
+ 'village': {
978
+ # ... existing states ...
979
+
980
+ 'help_lost_child': {
981
+ "description": "You encounter a crying child in the village square. They seem to have lost their way home.",
982
+ "choices": ['help child', 'ignore and continue'],
983
+ "transitions": {
984
+ 'help child': 'village_child_quest',
985
+ 'ignore and continue': 'village_start'
986
+ },
987
+ "consequences": {
988
+ 'help child': lambda player: player.update_status('helping_child')
989
+ },
990
+ "media": []
991
+ },
992
+ 'child_quest': {
993
+ "description": "You decide to help the lost child. After asking around and searching the village, you finally locate their home.",
994
+ "choices": ['return child', 'ask for reward'],
995
+ "transitions": {
996
+ 'return child': 'village_child_reunion',
997
+ 'ask for reward': 'village_child_reward'
998
+ },
999
+ "media": []
1000
+ },
1001
+ 'child_reunion': {
1002
+ "description": "You return the child to their grateful parents. They thank you profusely for your kindness.",
1003
+ "choices": ['accept thanks', 'request reward'],
1004
+ "transitions": {
1005
+ 'accept thanks': 'village_start',
1006
+ 'request reward': 'village_child_reward'
1007
+ },
1008
+ "consequences": {
1009
+ 'accept thanks': lambda player: player.update_status('local_hero')
1010
+ },
1011
+ "media": []
1012
+ },
1013
+ 'child_reward': {
1014
+ "description": "The child's parents offer you a small pouch of coins as a reward for your help.",
1015
+ "choices": ['accept reward', 'decline reward'],
1016
+ "transitions": {
1017
+ 'accept reward': 'village_start',
1018
+ 'decline reward': 'village_start'
1019
+ },
1020
+ "consequences": {
1021
+ 'accept reward': lambda player: player.add_item('coin pouch'),
1022
+ 'decline reward': lambda player: player.update_status('selfless_hero')
1023
+ },
1024
+ "media": []
1025
+ },
1026
+ }
1027
+ ```
1028
+
1029
+ ## Updated Transitions
1030
+
1031
+ To incorporate this side quest into the existing game flow, we need to update some transitions in the 'village_start' state:
1032
+
1033
+ ```python
1034
+ 'village': {
1035
+ 'start': {
1036
+ "description": "You're in the village square. The usual bustle of village life surrounds you.",
1037
+ "choices": ['explore village', 'gather supplies', 'rest', 'look around'], # Added 'look around'
1038
+ "transitions": {
1039
+ 'explore village': 'village_rumor',
1040
+ 'gather supplies': 'village_supplies',
1041
+ 'rest': 'village_start',
1042
+ 'look around': 'village_help_lost_child' # New transition
1043
+ },
1044
+ "consequences": {
1045
+ 'gather supplies': lambda player: player.add_item('basic supplies')
1046
+ },
1047
+ "media": []
1048
+ },
1049
+ # ... other states ...
1050
+ }
1051
+ ```
1052
+
1053
+ ## Explanation of Changes
1054
+
1055
+ 1. New States:
1056
+ - `help_lost_child`: Introduces the side quest
1057
+ - `child_quest`: Represents the process of helping the child
1058
+ - `child_reunion`: Concludes the quest if you don't ask for a reward
1059
+ - `child_reward`: Offers a choice to accept or decline a reward
1060
+
1061
+ 2. Updated `village_start`:
1062
+ - Added a new choice: 'look around'
1063
+ - Added a new transition to `village_help_lost_child`
1064
+
1065
+ 3. Consequences:
1066
+ - Added status updates: 'helping_child', 'local_hero', 'selfless_hero'
1067
+ - Added item reward: 'coin pouch'
1068
+
1069
+ These changes create a meaningful dead end by:
1070
+ 1. Providing an optional quest that doesn't directly progress the main treasure hunt story
1071
+ 2. Offering multiple choices within the side quest, allowing for different outcomes
1072
+ 3. Implementing consequences that affect the player's status or inventory, providing rewards for engagement
1073
+ 4. Allowing the player to return to the main story flow after completing (or ignoring) the side quest
1074
+
1075
+ This side quest adds depth to the village location, gives the player more to do, and provides character-building opportunities without derailing the main narrative. It also demonstrates how you can implement similar side quests or meaningful dead ends in other locations of your game.
1076
+
1077
+ #================================================================================
1078
+
1079
+ Certainly! Let's implement the "help_lost_child" side quest as a meaningful dead end in the village. This will add depth to the game without necessarily progressing the main story. Here's how we can incorporate this into your current configuration:
1080
+ Updated Text-Based Game Configuration with Side QuestClick to open document
1081
+ To further improve this side quest and make it even more engaging, you could consider:
1082
+
1083
+ Time sensitivity: Make the quest available only at certain times or for a limited number of turns.
1084
+ Skill checks: If your game has a skill system, you could add checks for persuasion or perception that affect the outcome.
1085
+ Long-term consequences: The status changes (like 'local_hero') could affect how NPCs interact with the player later in the game.
1086
+ Branching outcomes: You could add more complex branches, such as the child being in actual danger, leading to a mini-adventure.
1087
+
1088
+ Would you like me to elaborate on any of these ideas or show how to implement them in your configuration?
1089
+
1090
+ """
1091
+
1092
+ tipsupdatedconfigatbeinningofthisspace = """{
1093
+ 'village': {
1094
+ 'start': {
1095
+ "description": "You wake up in a small village. You hear a rumor about a lost treasure.",
1096
+ "choices": ['explore village', 'gather supplies', 'rest', 'look around'],
1097
+ "transitions": {'explore village': 'village_rumor', 'gather supplies': 'village_supplies', 'rest': 'village_start', 'look around': 'village_help_lost_child'},
1098
+ "consequences": {
1099
+ 'gather supplies': lambda player: player.add_item('basic supplies')
1100
+ },
1101
+ "media": []
1102
+ },
1103
+ 'rumor': {
1104
+ "description": "You hear more details about the treasure hidden in the ancient ruins nearby.",
1105
+ "choices": ['decide to go', 'ignore'],
1106
+ "transitions": {'decide to go': 'village_supplies', 'ignore': 'village_start'},
1107
+ "consequences": {
1108
+ 'decide to go': lambda player: player.update_knowledge('treasure location')
1109
+ },
1110
+ "media": []
1111
+ },
1112
+ 'supplies': {
1113
+ "description": "You gather supplies for your journey.",
1114
+ "choices": ['head to forest', 'stay in village'],
1115
+ "transitions": {'head to forest': 'forest_forest', 'stay in village': 'village_start'},
1116
+ "media": []
1117
+ },
1118
+ 'help_lost_child': {
1119
+ "description": "You encounter a crying child in the village square. They seem to have lost their way home.",
1120
+ "choices": ['help child', 'ignore and continue'],
1121
+ "transitions": {
1122
+ 'help child': 'village_child_quest',
1123
+ 'ignore and continue': 'village_start'
1124
+ },
1125
+ "consequences": {
1126
+ 'help child': lambda player: player.update_status('helping_child')
1127
+ },
1128
+ "media": []
1129
+ },
1130
+ 'child_quest': {
1131
+ "description": "You decide to help the lost child. After asking around and searching the village, you finally locate their home.",
1132
+ "choices": ['return child', 'ask for reward'],
1133
+ "transitions": {
1134
+ 'return child': 'village_child_reunion',
1135
+ 'ask for reward': 'village_child_reward'
1136
+ },
1137
+ "media": []
1138
+ },
1139
+ 'child_reunion': {
1140
+ "description": "You return the child to their grateful parents. They thank you profusely for your kindness.",
1141
+ "choices": ['accept thanks', 'request reward'],
1142
+ "transitions": {
1143
+ 'accept thanks': 'village_start',
1144
+ 'request reward': 'village_child_reward'
1145
+ },
1146
+ "consequences": {
1147
+ 'accept thanks': lambda player: player.update_status('local_hero')
1148
+ },
1149
+ "media": []
1150
+ },
1151
+ 'child_reward': {
1152
+ "description": "The child's parents offer you a small pouch of coins as a reward for your help.",
1153
+ "choices": ['accept reward', 'decline reward'],
1154
+ "transitions": {
1155
+ 'accept reward': 'village_start',
1156
+ 'decline reward': 'village_start'
1157
+ },
1158
+ "consequences": {
1159
+ 'accept reward': lambda player: player.add_item('coin pouch'),
1160
+ 'decline reward': lambda player: player.update_status('selfless_hero')
1161
+ },
1162
+ "media": []
1163
+ },
1164
+ },
1165
+ 'forest': {
1166
+ 'forest': {
1167
+ "description": "You enter the dense forest, heading towards the ruins.",
1168
+ "choices": ['travel further', 'return to village'],
1169
+ "transitions": {'travel further': 'ruins_ruins', 'return to village': 'village_start'},
1170
+ "media": []
1171
+ },
1172
+ },
1173
+ 'ruins': {
1174
+ 'ruins': {
1175
+ "description": "You reach the ancient ruins. The entrance is dark and eerie.",
1176
+ "choices": ['enter ruins', 'return to forest'],
1177
+ "transitions": {'enter ruins': 'ruins_explore', 'return to forest': 'forest_forest'},
1178
+ "media": []
1179
+ },
1180
+ 'explore': {
1181
+ "description": "You explore the ruins, encountering traps and puzzles.",
1182
+ "choices": ['solve puzzle', 'avoid traps'],
1183
+ "transitions": {'solve puzzle': 'ruins_hiddenPassage', 'avoid traps': 'ruins_ruins'},
1184
+ "media": []
1185
+ },
1186
+ 'hiddenPassage': {
1187
+ "description": "You solve a challenging puzzle and unlock a hidden passage.",
1188
+ "choices": ['enter passage', 'go back'],
1189
+ "transitions": {'enter passage': 'ruins_treasureRoom', 'go back': 'ruins_explore'},
1190
+ "media": []
1191
+ },
1192
+ 'treasureRoom': {
1193
+ "description": "You enter the treasure room and find the treasure chest.",
1194
+ "choices": ['take treasure', 'leave'],
1195
+ "transitions": {'take treasure': 'ruins_celebrate', 'leave': 'ruins_ruins'},
1196
+ "consequences": {
1197
+ 'take treasure': lambda player: player.add_item('treasure')
1198
+ },
1199
+ "media": []
1200
+ },
1201
+ 'celebrate': {
1202
+ "description": "You celebrate your discovery and decide to bring the treasure back to the village.",
1203
+ "choices": ['return to village'],
1204
+ "transitions": {'return to village': 'village_return'},
1205
+ "media": []
1206
+ },
1207
+ },
1208
+ 'village_return': {
1209
+ 'village_return': {
1210
+ "description": "You return to the village with the treasure and share it with the villagers.",
1211
+ "choices": ['end adventure'],
1212
+ "transitions": {'end adventure': 'end_end'},
1213
+ "media": []
1214
+ },
1215
+ },
1216
+ 'end': {
1217
+ 'end': {
1218
+ "description": "Your adventure ends here. The villagers are grateful and everyone's lives improve.",
1219
+ "choices": [],
1220
+ "transitions": {},
1221
+ "media": []
1222
+ },
1223
+ }
1224
+ }
1225
+ """
1226
+
1227
+ with gr.Row():
1228
+ with gr.Column(scale=1):
1229
+ gr.HTML(originalconfigatbeinningofthisspace)
1230
+ with gr.Column(scale=2):
1231
+ gr.HTML(claude3_5_06072024configtips)
1232
+ with gr.Column(scale=1):
1233
+ gr.HTML(tipsupdatedconfigatbeinningofthisspace)
1234
+
1235
  with gr.Tab("Test and Edit Config"):
1236
  gr.HTML("The main issue is frequent changes add more chances for bugs in how ")
1237
  with gr.Tab("Full Manual - Test Example State Machine"):
 
1422
  with gr.Tab("Export Options"):
1423
  gr.HTML("Placeholder - My Custom JS, Playcanvas, Unreal Engine")
1424
 
1425
+ with gr.Tab("Config Writing Considerations"):
1426
+ gr.HTML("Player Stats, Inventory and NPCS not implemented yet, so traversal type games best aka graph like structures <br> Game is like a universal translator so any concept can be covered")
1427
+
1428
  with gr.Tab("Asset Generation Considerations"):
1429
  gr.HTML("With some ideas from gemini-1.5-flash-api-0514 and reka-flash-preview-20240611 <br><br>Licenses for the spaces still to be evaluated")
1430
 
1431
  with gr.Tab("Save files"):
1432
  gr.HTML("For Dynamic events overnight or when player is not active what can LLMS edit? <br><br>eg. Waiting for a letter from a random npc can be decided by the llm <br>eg. Improved Stats on certain days (eg. bitrthday) <br>Privacy <br>User Directed DLC eg. Rockstar Editor with local llm guide")
1433
  gr.HTML("Some ideas - In game websites eg. GTA esp stock markets, news; ")
1434
+ gr.HTML("Placeholder for huggingface spaces that can assist - https://huggingface.co/nvidia/Nemotron-4-340B-Instruct (Purpose is supposed to be synthetic data generation), https://huggingface.co/spaces/gokaygokay/Gemma-2-llamacpp ")
1435
  gr.HTML("Placeholder for models small enough to run on cpu here in this space that can assist (9b and under) <br>initial floor for testing can be https://huggingface.co/spaces/Qwen/Qwen2-0.5B-Instruct, https://huggingface.co/spaces/Qwen/Qwen2-1.5b-instruct-demo, https://huggingface.co/spaces/stabilityai/stablelm-2-1_6b-zephyr, https://huggingface.co/spaces/IndexTeam/Index-1.9B, https://huggingface.co/microsoft/Phi-3-mini-4k-instruct")
1436
 
1437
  with gr.Tab("Images"):