diff --git a/community-contributions/dungeon_extraction_game/README.md b/community-contributions/dungeon_extraction_game/README.md new file mode 100644 index 0000000..19995a9 --- /dev/null +++ b/community-contributions/dungeon_extraction_game/README.md @@ -0,0 +1,133 @@ +# The Neural Nexus + + + +TODO: + +* Set boundaries to user inputs. +* Add sounds to the scene +* Add voice acting for the Game master's descriptions. +* Add voice input. +* Control End of game. +* Use video for the final scene: escape or death. +* Allow different settings like space, medieval, classic, etc. +* Control difficult and increase with deepness. +* Control deepness and time to die. +* Generate a score based on total treasures, exp gained and deep reached. + +## Requirements + +AI services access configuration: + +* A `.env` file with the credentials required to access the different LLMs is required: + + * `OPENAI_API_KEY`: Required always as it's used by the *"storyteller"*. + * `XAI_API_KEY`: Required if Grok's illustrator is used. + *(Less prude, faster and portrait mode)* + * `GOOGLE_API_KEY` Required if Gemini's illustrator is used. + + Obviously the used services must have been topped up with a small amount to generate + the responses and the images.\ + *Refer to each service's current billing information.* + +There are 6 variant implementations for the illustrator component, some of them may have +additional dependencies: + +* `illustrator_dalle_2`: *(Set as default)* + + The Dall·E 2 implementation uses standard OpenAI client and should work out of the box. + Although Dall·E has proven to be a bit prude and rejects to draw some combat scenes. + +* `illustrator_dalle_3`: + + The Dall·E 3 implementation uses standard OpenAI client and should work out of the box. + Although Dall·E has proven to be a bit prude and rejects to draw some combat scenes. + This version gives noticeable better images than Dall·E 2 but at an increased cost + +* `illustrator_grok`: + + The Grok 2 Image implementation uses standard OpenAI client and should work out of the + box. + It's faster but does not support quality or size controls. + + Images are generated in a *portrait mode*, so it fits specially well on mobiles. + + Grok is much less prude with violence and may draw combat scenes, at least against + fantasy enemies, and blood. + +* `illustrator_gpt`: + + The GPT Image illustrator uses standard OpenAI client, should work out of the box but + it requires the user to be verified on OpenAI platform to have access to it. + +* `illustrator_gemini` + + The Gemini illustrator uses the new Google SDK, `genai`, which replaces the old one + used on the course, `generativeai`, this new one can be installed with: + + `python -m pip install google-genai` + + *Both `generativeai` and `genai` can be installed at the same time without problems* + +* `illustrator_grok_x` + + The Grok_X illustrator uses the xAI SDK, `xai-sdk`, this can be installed with: + + `python -m pip install xai-sdk` + +## Configuring the service and game + +All services and game values can be set at `config.py` file. + +## Game launch + +The game can be launch from terminal, just navigate to game's root folder + +* `cd community-contributions\dungeon_extraction_game` + +and run the following command: + +* `python -m game`\ + *Notice the `-m` is required due to the project's structure and import strategy.* + +Game will take a few seconds to set up service and configure then logs will start to +show, among them the service address. + +It will attempt to launch your default browser directly to the game's page. + +The game can be stopped by hitting `ctrl + c` on the same terminal. + +## Playing the game + +Once on the browser the Starting screen will be shown: + +![The Chair](images/start_view.jpg) + +There you should input the kind of game you want to play on the lower box and submit. + +Your input can be as simple as a single word, like “spaceship”, or as detailed as you +like. + +![Set the adventure](images/start_input.jpg) + +From that point on, only your imagination (and the Storyteller’s) will set the limits. + +Once submitted, the image will update to reflect the scene, accompanied by a description, +your inventory, your adventurer’s status, and sometimes a few suggestions for what to do +next. + +![R'lyeh arrive](images/start_adventure.jpg) + +Although the game begins in English, if you switch to another language the Storyteller +understands, it will seamlessly continue in that language. + +You’re free to type any action you want, the Storyteller will adapt. +Still, it’s instructed to keep the world coherent, so don’t expect to go completely off +the rails. + +![Adventurer acts](images/first_input.jpg) + +The game continues this way until you either escape with your treasures... +or meet your end. + +![Adventurer dies](images/tragic_end.jpg) diff --git a/community-contributions/dungeon_extraction_game/game/config.py b/community-contributions/dungeon_extraction_game/game/config.py index 945d987..7cf3735 100644 --- a/community-contributions/dungeon_extraction_game/game/config.py +++ b/community-contributions/dungeon_extraction_game/game/config.py @@ -15,7 +15,7 @@ from .storyteller import narrate, set_description_limit load_dotenv(override=True) -# Choose draw function. +# Choose draw function. (Choose one from the imported ones up there) DRAW_FUNCTION = draw_dalle_2 # Define a sample scene description for testing purposes. @@ -173,6 +173,8 @@ UI_CONFIG = Interface_Config( input_button='Imprint your will', input_label='Cognitive Imprint', input_command='Awaiting neural imprint…', + game_over_field='Game Over', + game_over_label='Disengage Neural Links', start_scene=START_SCENE) diff --git a/community-contributions/dungeon_extraction_game/game/interface/interface.py b/community-contributions/dungeon_extraction_game/game/interface/interface.py index b7b48e1..8d24269 100644 --- a/community-contributions/dungeon_extraction_game/game/interface/interface.py +++ b/community-contributions/dungeon_extraction_game/game/interface/interface.py @@ -15,6 +15,8 @@ class Interface_Config(NamedTuple): input_button: str input_label: str input_command: str + game_over_field: str + game_over_label: str start_scene: str diff --git a/community-contributions/dungeon_extraction_game/images/advance_adventure.jpg b/community-contributions/dungeon_extraction_game/images/advance_adventure.jpg new file mode 100644 index 0000000..0d2a5be Binary files /dev/null and b/community-contributions/dungeon_extraction_game/images/advance_adventure.jpg differ diff --git a/community-contributions/dungeon_extraction_game/images/first_input.jpg b/community-contributions/dungeon_extraction_game/images/first_input.jpg new file mode 100644 index 0000000..a4a319e Binary files /dev/null and b/community-contributions/dungeon_extraction_game/images/first_input.jpg differ diff --git a/community-contributions/dungeon_extraction_game/images/start_adventure.jpg b/community-contributions/dungeon_extraction_game/images/start_adventure.jpg new file mode 100644 index 0000000..80686a7 Binary files /dev/null and b/community-contributions/dungeon_extraction_game/images/start_adventure.jpg differ diff --git a/community-contributions/dungeon_extraction_game/images/start_input.jpg b/community-contributions/dungeon_extraction_game/images/start_input.jpg new file mode 100644 index 0000000..d0b3f4f Binary files /dev/null and b/community-contributions/dungeon_extraction_game/images/start_input.jpg differ diff --git a/community-contributions/dungeon_extraction_game/images/start_view.jpg b/community-contributions/dungeon_extraction_game/images/start_view.jpg new file mode 100644 index 0000000..2ea18d3 Binary files /dev/null and b/community-contributions/dungeon_extraction_game/images/start_view.jpg differ diff --git a/community-contributions/dungeon_extraction_game/images/tragic_end.jpg b/community-contributions/dungeon_extraction_game/images/tragic_end.jpg new file mode 100644 index 0000000..10eaf04 Binary files /dev/null and b/community-contributions/dungeon_extraction_game/images/tragic_end.jpg differ