Skip to content

underware-gg/pistols

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pistols at Dawn

Formerly known as Pistols at 10 Blocks

A fully on-chain game, made with love, by Underware, with Dojo, for Realms, on Starknet.

Started as a joke with Calc at Autonomous Worlds Istanbul 2023. Winner of the Dojo Game Jam #3

Follow us on @Pistols_gg and the #duels channel in the Realms Discord

                                          ~~^             ^J~                                                           
                                         ~5G5!           75~                                                            
                                       .~PBG~        ^75P7                                                              
                                      ^?5BY~~^     YP5J~                                                                
                                    ^!J5GGPJ7      ?P^,                                                                 
                           ... ^!?Y5P7GB&&@&5J???7?YPY5YYJ?~7!!~~~~!!~^7~~~~~~!~~~~~^^~^^^^^^^^^^~^^[!]vvvvv!::)      
                      .. ^~~JPB###&#B?^PB#55Y?7YG5?J7?BG5YJ?7777!!!7777?777?7?????JJJJYJJYJJJJYYYYJY[!]~~~~~!::)      
                  .. ~7JPBBBB5?~?YJ~??~YGP7!???YGPJ5BGPBGPP555P5YYG###GGGPPGPPPPPPPPPPGGPGGPGGBB#B##[!]^^^^^!::)      
               . ^75B##BG55J~::~Y7~!75BG5~^::^~~!!7?J?J55BPPPB#BPG&&&#########BB#BBBBBBBBBGPGBBBBBBB[!]               
              ^7P##BGGGP5YY^:.:^~?J??YPGJ?7???YYY555GGBBGBBB#&&#B#/~~~~~~~~^^^^^^^^^^^^^^^~~~~^^^^^^^^^^^^^^)         
          .:!5###GPP5J?777JY55PGB########&##########BGP55YJ?7/~^^^                                                      
         ^JB##GP5Y?77J5GBB#####BP5GBJ!!!77JJ!~^^^^^^        /                                                           
       ~YB#GP55YY5GB##BPY7!~~?Y   ^!      7~                                                                            
     .^Y##BG5555B&&#P?^:      :?~  ^^.   ^!!                                                                             
    ?B#BGP5P##&@&Y^            ^~~~~~!                                                                               
   P#BBG5YP###&B~..   -__ /\\             ,        ,,                     ,        -_____                       
  B#PBG5J5B&#&#!.       ||  \\  '        ||        ||               _    ||          ' | -,    _   ;            
 J#5PGGY?YBB#@B^.      /||__|| \\  _-_, =||=  /'\\ ||  _-_,        < \, =||=        /| |  |`  < \, \\/\/\ \\/\\ 
 YGGGGPJ?JGBB@#7.      \||__|| || ||_.   ||  || || || ||_.         /-||  ||         || |==||  /-|| || | | || || 
 JP5?~^...^?JG&#^       ||  |, ||  ~ ||  ||  || || ||  ~ ||       (( ||  ||        ~|| |  |, (( || || | | || || 
 ~PY!::. .:7?YBB^     _-||-_/  \\ ,-_-   \\, \\,/  \\ ,-_-         \/\\  \\,        ~-____,   \/\\ \\/\\/ \\ \\ 
  ~55J!~:^7?5PY^        ||                                                         (                                                                                                                               
    ~?YYYJ?7!^              A game of honour, chance and betrayal. Defend thine honour, scound! By Underware.gg
       ^^^                                                                                                                       

Overview

Thou art an offence to all that is decent, dog. I challenge you... to a duel!

Pistols at Dawn is an onchain game, in which you face off against another Lord in a pistol duel to defend your honour.

A righteous smoulder in your eye and your smoothbore, flintlock pistol held lightly at your side, cocked and ready, you stand in the misty morning field. Holding back the gorge rising in your throat, you shake that mongrel's hand and turn, taking your first step. Your feet crunch in the crisp morning grass, one step, two steps, three. You hear the snap of a cloak, the gasp of your second, and a sharp, booming crack, then your left arm explodes into pain. That traitorous scum shot early! Gritting your teeth against the pain, and without turning around, you keep stepping foward. Four, Five, Six, Seven, Eight, Nine... Ten. You turn around, slowly, a dark menace in your shoulder, and raise your pistol. The cur stands there, a defiant sneer upon his face, and throws his still smoking pistol to the ground. You take a deep breath, and whisper "May you find honour in death, you wretch!"

Blood sprays in a beautiful arc from his head, and he drops like a felled log. Silence, interrupted only by the spattering of blood from your arm, into the morning grass.

Team

  • Recipromancer — Founder, Renaissance Chaos Mode - @recipromancer
  • Mataleone — Co-Founder & Tech Lead. Engineering, backend, infra, smart contracts - @matalecode
  • FortunaRegem - Frontend & Product Lead. Engineering, frontend, UI, game design - @FortunaRegem
  • Amaro — Art, Design, UI & Animations - @AmaroKoberle
  • Parsa - Comms, Marketing, Operations - @ParsaBolor
  • Nehkee - Comms, Marketing, Operations - @paceking1

Other Contributors

  • @voltrevo — Engineering, initial commit/reveal mechanism
  • @MononokeArts - Art, Brand & various other contributions
  • Jubilee - R&D, Technical 3D systems

Contents

  • /client: Main game web client (typescript, Vite)
  • /dojo: Dojo contracts (cairo)
  • /sdk: Pistols at Dawm SDK (typescript)
  • /dreams: Daydreams AI agents (typescript)
  • /gamejam: Original Dojo Game Jam #3 contents
  • /assets: Assorted test assets
  • /verifier: Contracts verifier

Assets

Development notes

Environment Setup

Dojo Book

Install Rust + Cargo + others

# cleanup if you used to use dojoup
rm -rf ~/.dojo
rm -rf ~/.local/bin/scarb
rm -rf ~/.local/share/scarb-install
rm -rf ~/.cargo

# Install Rust >=1.90
# https://www.rust-lang.org/tools/install
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# open new terminal
rustup override set stable
rustup update

# install asdf
# https://asdf-vm.com/guide/getting-started.html
brew install asdf

# configure asdf
# https://asdf-vm.com/guide/getting-started.html#_2-configure-asdf
# add this to ~/.zshrc
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
. <(asdf completion bash)

# install Scarb+Dojo plugins
# https://docs.swmansion.com/scarb/download.html#install-via-asdf
# https://book.dojoengine.org/installation#installing-with-asdf
asdf plugin add scarb
asdf plugin add katana https://github.com/dojoengine/asdf-katana.git
asdf plugin add torii https://github.com/dojoengine/asdf-torii.git
asdf plugin add sozo https://github.com/dojoengine/asdf-sozo.git
asdf install scarb 2.12.2
asdf install sozo 1.7.1
asdf install katana 1.7.0
asdf install torii 1.8.2
# enable to your user account (optional)
# asdf set -u scarb 2.12.2
# asdf set -u sozo 1.7.1
# asdf set -u katana 1.7.0
# asdf set -u torii 1.8.2

# Install starkli
# https://github.com/xJonathanLEI/starkli
curl https://get.starkli.sh | sh
starkliup

# Install pnpm
curl -fsSL https://get.pnpm.io/install.sh | sh -

# other stuff you will need
pnpm install -g turbo
brew install llvm@19
brew install jq
brew install protobuf
cargo install toml-cli

# test dojo
cd dojo
sozo build
sozo test

# install packages
cd ../client
pnpm install
  • Install the Cairo 1.0 extension for Visual Studio Code / Cursor

Launch Dojo

Terminal 1: Katana (local node)

cd dojo
katana --disable-fee --chain-id KATANA_LOCAL --invoke-max-steps 10000000 --allowed-origins "*"

# or preferably...
cd dojo
./run_katana

Terminal 2: Torii (indexer)

Uncomment the world_address parameter in dojo/Scarb.toml then:

cd dojo
torii --allowed-origins "*" --index-pending --world 0xbee2bb53422762f6c51fb478a8a5da41a64ad678860d02800e0dbdac23dc36

# or preferably...
cd dojo
./run_torii dev

Terminal 3: Sozo commands / migration

Migrating to localhost:

# build world and systems
cd dojo
sozo clean
sozo build

# migrate to local Katana
./migrate dev

# migrate other profiles...
# ./migrate <PROFILE_NAME>
./migrate slot

For Starknet chains, create env files for SN_SEPOLIA (.env.sepolia) and/or SN_MAIN (.env.mainnet)

export STARKNET_RPC_URL=https://sepolia.your-favorite-rpc-provider.com/xxx/
export DOJO_ACCOUNT_ADDRESS=0x1234
export DOJO_PRIVATE_KEY=0x1234

then migrate...

# enable env
source .env.sepolia

# migrate to local Katana
./migrate sepolia

# clear env if you want to work on another profile
source .env.clear

Terminal 4: Client

Install dependencies

cd client
pnpm i

Configure default NetworkId in your .env file. Minimal configuration:

# default network
# VITE_NETWORK_ID=KATANA_LOCAL
# VITE_NETWORK_ID=STAGING
# VITE_NETWORK_ID=SEPOLIA
VITE_NETWORK_ID=MAINNET

All available options...

# default network
VITE_NETWORK_ID=KATANA_LOCAL
# VITE_NETWORK_ID=STAGING
# VITE_NETWORK_ID=SEPOLIA
# VITE_NETWORK_ID=MAINNET

# online status (matchmaking)
VITE_PUBLISH_ONLINE_STATUS=true

# optional/alternative service urls
VITE_CLIENT_URL=https://play.pistols.gg
VITE_ASSETS_SERVER_URL=https://assets.underware.gg

# optional/alternative dojo urls
VITE_SLOT_NAME=pistols-mainnet-2
# VITE_RPC_URL=https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_9
# VITE_TORII_URL=https://api.cartridge.gg/x/pistols-mainnet-2/torii
# VITE_TORII_GRAPHQL_URL=https://api.cartridge.gg/x/pistols-mainnet-2/torii/graphql
# VITE_TORII_SQL_URL=https://api.cartridge.gg/x/pistols-mainnet-2/torii/sql

# Socials config
VITE_DISCORD_CLIENT_ID=<OAUTH2_CLIENT_ID>
VITE_DISCORD_REDIRECT_URL=<OAUTH2_REDIRECT_URL>

# enables additional Vite debug features and info in console
VITE_DEBUG=1

Start the client

# https server (preferred)
# https://localhost:5173
cd pistols
turbo devs

# http server (not compatible with Cartrige Controller)
# http://localhost:5173
cd pistols
turbo dev

Open https://localhost:5173 (or http://localhost:5173)