Skip to content

Endless Quest is an Autonomous World made with MUD

License

Notifications You must be signed in to change notification settings

EndlessCrawler/endlessquest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Endless Quest

  ______     __   __     _____     __         ______     ______     ______    
 /\  ___\   /\ "-.\ \   /\  __-.  /\ \       /\  ___\   /\  ___\   /\  ___\   
 \ \  __\   \ \ \-.  \  \ \ \/\ \ \ \ \____  \ \  __\   \ \___  \  \ \___  \  
  \ \_____\  \ \_\\"\_\  \ \____-  \ \_____\  \ \_____\  \/\_____\  \/\_____\ 
   \/_____/   \/_/ \/_/   \/____/   \/_____/   \/_____/   \/_____/   \/_____/ 
      ______     __  __     ______     ______     ______  
     /\  __ \   /\ \/\ \   /\  ___\   /\  ___\   /\__  _\         |v0.1.0 
     \ \ \/\_\  \ \ \_\ \  \ \  __\   \ \___  \  \/_/\ \/         |
      \ \___\_\  \ \_____\  \ \_____\  \/\_____\    \ \_\     _  _|_  _
       \/___/_/   \/_____/   \/_____/   \/_____/     \/_/    |;|_|;|_|;|
                                                             \\.    .  /
                          An infinite multiverse of           \\:  .  /
        \,/               persistent and generative            ||:   |
                          fantastical dream worlds,       \,/  ||:.  |
                /`\       each populated by endless            ||:  .|
                          & thematically consistent            ||:   |
                          fantasy destinations, and   /`\      ||: , |
                          an intruiguing population            ||:   |
                          of strange and marvellous            ||: . |
             _____        beings, all AI generated!           _||_   |
      ____--`     '-~~_                                  __---`   ~`--,__
 ~-~-~                  `~~----__-~,.-`~~--~^~~--.__,--~'      fDm       `~~

What has happened to me? The last thing that I remember, I went to sleep just like any other night.
Now I'm here in this strange place, wherever this is. This feels like a dream, but I can't wake up.
There are others here too. Deadly beasts, sentient artefacts, devious tricksters, lost souls, and... the Lord of this Realm. They all seem bound to this place, but I'm not. I've got to get out of here!

A love letter to the Autonomous Worlds Hackaton, May 18th to 26th 2023.

TLDR

Endless Quest is an an autonomous world engine for generating infinite, dynamic roleplaying challenges; no two the same. Quest encounters are powered by a sophisticated, behavioural AI storytelling system that ensures narrative and stylistic consistency.

Endless Crawler is used to generate each realm map, with encounters generated and persisted as they are first explored by players. Realms allowing endless re-interpretation of the Endless Crawler chambers across an infinite number of thematically consistent worlds.

About

Endless Quest is an endless, generative roleplaying game, in which you play a traveller lost in the infinite realms of the dreaming. As you travel through each realm, you will discover infinite unique locations and the lost souls bound to them; no two alike. Each location and character that you meet in Endless Quest is unique, and indeed, each of its many realms is generated - in its entirety - dynamically by an AI storyteller.

Each realm generates endless unique locations and characters that are thematically consistent, from one of four sub-themes and eight different kinds of encounters that are unique to that realm. Locations and characters are generated once only, the first time that they are discovered, after which they are persisted permanently on-chain.

Once a location has been generated it will remain, however each traveller's visit will be a dynamic, story driven experience that responds to the player, powered by the AI storyteller.

Team:

Endless Quest more screenshots

Made with...

Repo Structure

AI

The core of the generative experience is run by two GPT prompts, both detailed in /AI/Prompts/:

Art Assets are generated using DALL-E via OpenAI API, as detailed in GenerativeArt.md

MUD3

A Phaser MUD client

Setting up a local server

Install Node.js 16+ (we use version 18)

  • Install pnpm
$ npm install --global pnpm
$ brew install libusb
$ curl -L https://foundry.paradigm.xyz | bash
# restart the terminal or open a new one
$ foundryup
  • Do this setup...

Edit MUD3/env.contracts if you want to use your own Anvil private key.

$ cd MUD3
$ pnpm install
$ cp env.contracts packages/contracts/.env

Start local server

To start a local server on http://localhost:3300 :

$ pnpm run dev

To use a local sync server, edit MUD3/packages/client/.env to contain this, and restart:

VITE_SERVER_URL=ws://localhost:8787

OpenAI API Keys

Your OpenAI API key needs to be stored on cookies. A GPT-4 key is preferred, but it also works with GPT-3. The first time the app is loaded on a browser, empty cookies will be created for editing.

cookie name value
OPENAI_API_KEY sk-xxxxxxxxxxxxxxxx
OPENAI_ORG_ID org-xxxxxxxxxxxxxxx
GPT_MODEL gpt-4 or gpt-3.5-turbo

Deployment

Fund your wallet

The wallet used for deployment must have ETH on the network.

# Lattice testnet
$ pnpm mud faucet --address <address>

# Other networks
$ pnpm mud faucet --faucetUrl <faucetService> --address <address>

MUD deployment

Paste the deployment wallet private key to PRIVATE_KEY in MUD3/packages/contracts/.env

Edit profiles at MUD3/packages/contracts/foundry.toml

# deploy locally (http://localhost:8545)
$ cd MUD3/packages/contracts
$ pnpm mud deploy

# deploy to the lattice testnet
$ cd MUD3/packages/contracts
$ pnpm mud deploy --profile lattice-testnet

# deploy to optimism mainnet
$ cd MUD3/packages/contracts
$ pnpm mud deploy --profile optimism-mainnet

If in error and need to retry...

$ pnpm mud deploy --profile lattice-testnet --priorityFeeMultiplier 5

Deploy contracts to testnet...

$ cd MUD3/packages/contracts
$ pnpm deploy:testnet
> chainid 4242

Build distribution...

$ cd MUD3/packages/client
$ pnpm build
$ ls -l dist/

If you get some out of memory error like below, increase node memory and try again...

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
$ export NODE_OPTIONS=--max-old-space-size=8192
$ pnpm build

Development notes

Install a fresh MUD from template

Need Node 18 and Foundry (see above)

$ npm install -g pnpm
$ pnpm create mud@canary MUD
? Template
> phaser

Upgrade MUD

Check latest version here

$ cd MUD3
$ pnpm mud:up

Specifig tag...

$ cd MUD3
$ pnpm mud set-version --tag next && pnpm install
# or...
$ cd MUD3
$ pnpx @latticexyz/cli@next set-version --tag next

Specific version...

$ cd MUD3
$ pnpm mud set-version -v 2.0.0-alpha.1.197
$ cd packages/client
$ pnpm mud set-version -v 2.0.0-alpha.1.197
$ cd -
$ cd packages/contracts
$ pnpm mud set-version -v 2.0.0-alpha.1.197
$ cd -
$ pnpm install

About

Endless Quest is an Autonomous World made with MUD

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 46.4%
  • TypeScript 43.6%
  • JavaScript 6.2%
  • SCSS 2.5%
  • HTML 1.3%