Configure Patterns
In this guide:
- action-RPG 3d-game
- patterns (new space-related entity)
- pattern-blueprints interconnections
- 3d viewer for Creator Studio
Prerequisites
Choose one of two options to install Creator Studio:
- Docker setup (Recommended)
- Manual installation
Install PolkadotJS browser extension.
Import seeder account you used during Creator Studio installation.
Navigate to
http://localhost:3000
in the browser.Click
disconnected
button and connect to the local node and local ipfs:Click
connect wallet
button -> SelectPolkadot{.js} wallet
-> Select seeder account, which you have imported before:
Case 1: Creating a blueprint from a pattern
Open
select space
page.Select Dark Forest (our new action-RPG game).
Open
space overview
page.Scroll to Supported Patterns.
Here we can see the
Sword
Pattern. It defines in-space entity and interpretations needed for a blueprint to be associated with this particular pattern. In our case we already have a blueprint namedOld curved sword
adapted.Let's create another blueprint for this pattern!
Click
create new
button in the pattern card.Setup needed properties
Creator studio guides us to fill necessary fields with files and/or metadata. In this case, it prompts us to add
name
anddescription
plus 3 interpretations:- default-view
- inventory-view
- 3d-model
You can use corresponding resources from seeder files to create a Fire Sword!.
Click
submit
when you're satisfied with all data you added.
Verification
We can check if Fire sword was created successfully.
Open
blueprints
page.You should see "Fire sword" there. Let's explore it. Click on sword to open the blueprint overview page.
Let's look closer at our 3d model.
Find the corresponding interpretation in the
Interpretations
section and click on the spinning sword model to open fullscreen gallery view.Look at our 3d-model a little. What a cool sword!
Now we can mint an item from our blueprint.
Close our fullscreen gallery and click
mint item
in the top right corner of the page. Change name ot the item if you wish. Click+ Mint item
again and fill in your Polkadot{.js} password to sign the transaction.Let's finally check our sword in the game.
Click
RUN
button under the game cover to launch Dark forest. Click play in the game when it's loaded.You should see your Fire sword in your character inventory.
[Optional] Blueprint update
Hmmm. Seems we've forgotten to add an actual fire effect for our sword.
Let's add it.
Close the game (click on the arrow in the bottom left corner and then
close
button)Open Fire sword blueprint again find the 3d-model interpretation and open the edit window (pencil icon)
Add the
fire-effect
tag to it, clickedit interpretation
and sign your transaction in polkadot prompt.We should see interpretation with a brand-new fire-effect tag now.
Let's check it in-game again.
Hooray! It has a cool fire effect now in our game. Feel free to slaughter some monsters with it if you'd like to play our game a little.
Case 2: Adapt blueprint to pattern
Now let's make Fire sword adapted for usage in Ninja Rian (first demo game by Asylum)
Go to
select space
page and select Ninja RianOpen
space overview
page and findWeapon
pattern for Ninja Rian.Again, we can see only
Old curved sword
blueprint but not Fire sword. Seems it is missing some interpretations to be recognized by Ninja Rian.We can solve it!
Click
adapt existing
We can see a new page which asks us to select a blueprint for adaptation. Select our already familiar Fire sword. We can see it has 1 missed interpretation.
Looks like we need to add 2d-sprite-atlas.
Submit
After that you can, as usual, click
submit
and sign your transaction.Now Fire sword supported by Ninja Rian.
Verification
Let's launch the game. Select any level and open your inventory.
We can use our Fire sword in Ninja Rian now!
Case 3: Interoperable Items and Drop
Performing some game conditions, player can receive special NFT items. Space Client can initiate Item minting for Player, and when NFT appears in block, Game Client renders Item directly in space. The next steps guide you though the possible scenario, where Space Client drops Player some Items, and Player uses these items within different spaces.
Restart Asylum Node and reseed data (see how to reseed data in Docker).
Start the
Ninja Rian
space and pass through the first level. Use 'WSAD' to move and 'JKL' for actions. One of the NPC is guaranteed to drop theOld curved sword
.Close the space and go to
Dark Forest
. You can equip theOld curved sword
you just obtained inNinja Rian
. Pass through the level and kill a specific highlighted NPC, which will dropKerosene Lamp
.Kerosene Lamp
is working as a world exploring Item - its idea is to reveal hidden places. Equipping it will help you to find a Chest. Open the chest, and you'll find another Item -Clover Leaf
.Equipping
Clover Leaf
, you can find the green title above the character's HP bar. In this space it's used as an Item, which doesn't affect game balance.Let's get back to
Ninja Rian
again. EquipClover Leaf
. Now you can passively earn unique coins, for which you can buy items in-game store.Similarly, by equipping
Kerosene Lamp
, you can discover unreachable before spaces, where you can get more in-game goods helping proceeding levels.