First of all, survive. Attack: close combat, range attacks, surprises. Defend, avoid getting hit, look for items and score points. After a limited number of rounds, the game ends and a living beaver with the max points wins.
-
Build the game contract
yarn build
-
Start backend node.js server (Only if you prefer websockets, otherwise skip it)
yarn dev
-
Start local static http server, e.g.
yarn serve
-
Open the game at
http://localhost:9001/
In order to deploy and spawn along with games:
yarn deploy-session:local 23:20
or
node js/tools/deploy-spawn-session.js --env local --time 23:20
Games config can be found here:
js/tools/deploy-spawn-session-config.js
In order to deploy and spawn a single game to the existing hub
yarn deploy-session-game:local 23:20
or
node js/tools/deploy-spawn-session-game.js --env local --time 23:20
Omitting date in the commands above will result in spawning games without time limits
In order to use jnio wallet in aos update the $HOME/.aos.json
In lua directory run
aos CyberBeaversToken
.load token.lua
Send({ Target = ao.id, Tags = { Action = "Transfer", Recipient = 'ksovq4pOatEoWzbxe8Iu8xeuhQshnoSpbKZ0TcDlMko', Quantity = '1000000' }})
Send({ Target = ao.id, Tags = { Action = "Balances" }})
Game slot lasts 6 minutes
- 5 minutes game
- 1-minute break During break, first 30 seconds is Leaderboard. Second 30 seconds is lounge area.
Every six minutes a cron is triggered which executes deploy scripts. Deployment is as follows:
- Build contract
- Deploy new game contract and spawn it
- Transfer tokens to game process
- Set up game config, game start and end
- Deploy new chat contract
Only a limited number of players can access the game. Before the game begins there is a queue for players to register.
Maps are created using the Tiled editor. In order to create a new map:
- Download and install the editor.
- Clone this repository (
git clone git@github.com:warp-contracts/cyberpunk-beavers.git
) or simply download it as a zip file from https://github.com/warp-contracts/cyberpunk-beavers - Go to
<your_path>/cyberpunk-beavers/public/assets/maps/tools/templates
directory. - Open the
sand_template.tmx
file. - The
Tiled
editor should open, and you should see something similar to:
The main areas of the editor marked above are:
- Editor area - this is a place, where you build you map - i.e. put tiles from a specific tileset on a specific layer
- Layers area - these are the 3 layers that are defined for each map.
- Tilesets area - these are 3 different tilesets that are meant to be used on a corresponding layer
ground
tileset on agound_layer
decorations
tileset on adecoration_layer
obstacles
tileset on aobstacles_layer
- Select the
ground_layer
in theLayers
section - Select the whole map in the editor (
cmd+a
on Mac) - Remove all the selected tiles (
backspace
on Mac) You should end-up with something similar to: - Repeat the above steps for the
decoration_layer
andobstacles_layer
NOTE: you can also start with simply editing the template - which is probably a better idea at start.
- Select the
ground_layer
in theLayers
- Select the
ground
tileset in theTilesets
NOTE Remember to choose a proper tileset for the layer that you're currently changing. Again:ground
tileset on agound_layer
- this is the base layer, the tile type may affect the amount Action Points (AP) being used - e.g. the "road" tiles does not use any AP, the "light sand" tiles use 1 AP, "dark sand" use 2 AP, etc.decorations
tileset on adecoration_layer
- this a layer with "decorations" that can be placed on top of the base "ground" layer (e.g. some sand on the road). Some of the tiles from this group may also affect the AP being used (e.g. the small stones use 3 APs).obstacles
tileset on aobstacles_layer
- the tiles on this layer block the movement entirely.
- Select on of the tiles from the
ground
tiles - e.g. the "dark sand" tile. - Place it on the layer using the
Stamp Brush
tool
NOTE Get familiar with other tools available, especially -Bucket Fill Tool
,Shape Fill Tool
,Eraser
... More details can be found here. - When you've finished the
ground_layer
, switch to thedecoration_layer
(and change the tileset todecorations
!) - After the
decoration_layer
is finished - add some obstacles on theobstacles_layer
(and switch tileset toobstacles
). After playing for a while you should have your map prepared - for example:
Assuming that you're happy with the results - it's time to export your map.
Save it first as a new file - File->Save As...
.
Then go to File->Export As...
, set a proper name (e.g. ao_map.json
), file location and choose the JSON map files
format.
The exported file should like similar to:
Having the map exported, we can now post it to Arweave. You can do however you want to do it, an example script that is using Turbo bundler is here. If you want to use the above script:
- set the
file
and themapName
variables.
- put your wallet in the
.secrets
directory - run the script using node.js
node js/tools/create-map-tx.js
. You should see sth similar to a result:
- After posting the map to Arweave, please share your results on our Discord (i.e. the transaction id from the response in previous point and a screenshot of the map itself) - if it has interesting design and is formally correct - we might use it the game!
NOTE: if you're manually posting the map to Arweave, be sure to add these tags:
[
{
"name": "Data-Protocol",
"value": "warp-beavers-map"
},
{
"name": "Name",
"value": "<your-map-name>"
},
{
"name": "Map-Api-Version",
"value": "v1"
},
{
"name": "Terrain",
"value": "desert"
}
]