Added README.md doc and some images.
This commit is contained in:
133
community-contributions/dungeon_extraction_game/README.md
Normal file
133
community-contributions/dungeon_extraction_game/README.md
Normal file
@@ -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:
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
The game continues this way until you either escape with your treasures...
|
||||
or meet your end.
|
||||
|
||||

|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 196 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 229 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 240 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 186 KiB |
Reference in New Issue
Block a user