Building a Game Fully On Chain
ETHCC 3 · March 2020 · 18:17
Ronan Sandford discusses building a game entirely onchain.
Speakers
Topics
From ETHCC 3, hosted by Ethereum France.
Transcript
okay I will start now so very happy to be here to present eternal so I am runnin like creator of eternal and so basically eternal is a multiplayer dungeon procedurally generated on the blockchain inspired by classic text and grid based multi-user dungeon games you can see example here of few of the inspiration and some like screen capture of the game on a mobile so it's a game is basically you're in a dungeon a little character and you can move around
fight monsters and collaborate as well we saw the player to fight the particular thing but yeah so I mean yeah it's another example of his screen capture from the desktop here where it shows a map of the Alpha running on a test net right now so all of this room has been generated by player around playing the game the team is basically Jia myself run an Lumia and yeah we are basically a team of game developer and designer so yes a particular thing about this game is that every reaction it's a fully Unchained so every meaningful
action you can make in the game is basically a transaction so whether it's move attack and so it means the whole of the game are set in the smart contract there is no server to trust and it also means that all the items have a functionality set in the contract and because it's on the blockchain another property that increasingly are he that it's a shared world so the game is inherent in multiplayer and so another thing obviously interest player here is that we follow the standards that although items that they collect in the game tradable and interoperable with other
game potentially so we follow FC Twente for base currency 71 for unique items and yes he won 155 for common item which like partially fungible between themselves so the reason we make a game blockchain I think is similar to many is that there is at least two issue in traditional game many free to play which he can of the some where it's some of the same type of game but this this games in the traditional market once I did once I did economy so it's basically the player are just observe the cannot influence or gain from the game economic
growth and the other aspect is that the gamer rule rules like drop rate and black boxes so Trust is required and unfair change may happen under request so it's basically the ability to influence the game developer at the expense of the one who can't we don't feel it's right so with blockchain we can have a guarantee rarity which provide the real economy for the game item and reward active players then true ownership which gives player a part of the game independent of the Creator so they can use the other aspect which really link to to inertia peace into ability of the time so they can potentially be used in
other game and application and basically the items are owned by the player and so it changed the relationship between the player on the game developer they have to now have an ally in incentive to work together for for the game to flourish but with eternal we go further basically we saw game we can't change the whole so we can't be influenced we can't be unfair because as soon as the game is launched the hula said what you mean for the right time is that now they are not only data a visual representation of an item there are also functional items so we move
from a decorative only value of the item to a functional value obviously in some game even if if the option and of change they still have a functional value but now it's not an intrinsic part of the item it's dependent on itself part so what it mean I mean yeah so it makes a game world independent of the crater so and I think we believe that it leads to a greater immersion when you know that the world doesn't change and you don't need it feel more evil and it's the same way as when you realize that your item will not cannot be taken from you it didn't make it move here and so to make an analogy of the people of the previous
slide in that case the game world itself is owned by the player the logic basically the logic and the items so we are building we are using different we are basically currently exploring we are in alpha stage we are exploring different EVM chain so it is a lot of work going on we are still early in the space but yes so building is that kind of overview of what we are using and again like a few screening in capture to again show you how it look and it's basically a web-based fully web-based so here is architecture of the architecture of our game so there is two user here of
the they have a client which basically any any device that as I can run a web browser and then zap make action on the smart contract and so we have a back-end system just to make the experience a little bit like a lot better because we have obviously when everything on the blockchain you have some issue like for numbers the map if we had to fetch all the events that are happening on the map when you load the game it will be like a nightmare so what we do is that our back-end system we cache all the event and provide the WebSocket server so whenever things up and every client are updated so and on top of that we can add online presence when there is a new player online you can know you can
interact with other players and so on the by being on the web we can have a very simple onboarding flow so you you come to the website you choose the character you set up a wallet and then you make one payment so this is not a free-to-play game you just make one payment but then we implemented mechanism which abstract away the transaction it's basically a similar to the burner wallet except that you still have a wallet that that you set up before but you can make any action with a like a transparent like this I click a this button and it make a transaction behind the scene and the way
it work is a basically the payment value that you put in the first place is to on a smart contract and every movie submitted on behalf of video so you can think of a meta transaction like system and then every move basically will reduce that so to pay the gas or on the on the side chain and then play off a field when needed and at the core of the game is a dungeon contract which basically enforce the rule of the game and the way it works is that all the character that you own are actually NFT so you can play make your character in the dungeon and get XP get coins and I mean the coin will belong to you by the
character itself we love that are that increased so you can then trade it and the way it work is that when you go join the dungeon you are basically giving ownership of your character to the dungeon and from that point on the dungeon but you are bound by the whole your character is bound by the rule of the dungeon so as you explore further into the dungeon you always run the risk of not being able to go back and so if is so basically to get back on because since to get back ownership of the item you need to exit the dungeon you have to make strategic decision because if you die you you will lose your item and you will use part of your XP
so the expiry you lose your kite Aaron will be able to create a new character and can keeping some of the eggs and the idea of that is that in increased imagine and so we believe that you will feel that you are yourself in the dungeon and I think that's basically is the core of fully online gaming is a feeling of presence where you suddenly feel you are part of the world that you can't feel in any other game and on the technical side like we had to implement randomness because we wanted to have this kind of feeling first of all for the procedurally generated aspect and for the combat mechanism and so we came to the solution where we basically for
every action that we 100 Ness you will record the block number on either you will not perform the actual action you will just record the block number and as soon as the transaction is mined the front end will be able to compute the outcome at that point so we just need to wait one block but what it means is that now the contract need to for the next action need to actualize the previous action but you will be able to do so because at that point it will have access to the previous block cache and be able to to perform the outcome and so basically you can in in other word it's a smart contract live in the past but it's guaranteed to be able to compute
the present so we use pure function on the smart contract side so we can actually use the same exact function in the VM on the front end and back end who kind of without the need to implement the logic and then obviously if you know a good block cache you know that not all of them are saved so we have a block cash register that store it that's all and you do that every time we play your make connection but there is a possibility that no player come for a certain amount of time and then we have bought that will ensure that that the blocker shafts are saved and obviously as you can imagine making a fully owned chain game
strained so we basically designed the game around this constraint so the first thing it's slow so we make a turn-based game there is computation limitation so we designed simple rule but sometimes you can replace complex rule by simple rule plus more data and so that's what we do with a combat system I will not go into detail you I invite you to play but it's it has some depth while the mechanical remain simple then multiplayer of some constraint is not necessarily only about blockchain but about the fact that we wanted player to come and go and so we couldn't make it ok I wait the turn of the other etc and we couldn't do time base because it's on
the time of transaction available so we have kind of a different mechanism that the monsters that live in in that world are shared among the player but they are kind of one-to-one combat mechanism that you can but you can still collaborate to fight then there is other challenge so obviously a munchkin is a fully Unchained game but that's kind of the dream so now we are on the side chain we are waiting for Leo to solution to mature and they are actually maturing so we expect this to coming a very soon be able to to actually make the dream of LMT but for now our goal is to really did an EVM public version like X die or magic that can support what we need it will
already give us some benefit like for example the fact that the game is independent of the crater it will not be independent of of these of the very data of the chain but will be independent of a self and then the other challenge is randomness and there is also some work going on with vdf and other solutions we are looking at them but for now yeah we just rely on on the side chain we have unknown yeah because one thing we need is that we want them to have one of unpredictable random number at every at every block and we are looking actually forward to see more game exploring that space to be exciting to see
more more gaming example we we launched an alpha so we launched it on the P way test net so could with the 5 second block time and a very low gas cost we add like hundred player and like say average gameplay was quite impressive 17 minute and they kind of try the game quite intensively we had also a great feedback and so on x focus now is about designing the economy and the and the business model and so there is still a lot of work to do but we are really happy of alpha and so here you can see the old map only after 2 weeks there was 2400 room and actually your
room is not only moving because you on containment storage means they had to fight the monster to go pass and more you go deeper in the dungeon the more the monsters are difficult and so that's actually quite impressive so yeah I mean that that's basically it so you've if you want if you have a web browser or whatever you can just scan this QR code and there is 100 key available and you can play thank you questions yeah you said that your games are inherently slow because of the
blockchain but do you wait for a certain number of confirmations block confirmation to confirm an action to the user or do you do some optimistic information given to the user like on the pending block or after one or two confirmations when wait one confirmation okay and if there is a reorg do you yeah I mean potentially it could be things like that on the side chain we are working on it will be unlikely so it's more like you are on the UI we will have to do some work yeah I kind of to say actually something else happen yes that's that's okay so that's another challenge for the future yeah definitely I should have mentioned that I are you planning to do an SDK I would
like to see and blockchain RPG maker or something that's great we we uh tried you to have a part of player doing creating thing in the game so we might maybe it won't be that but it will be something well play your concrete hi if the win are Zulus are of the player can be random in some way aren't you afraid of being seen as a gambling
game because if your character is worth something and you can sell it to other people it it have value if you lose it in the dungeon or thing like that if you grab more coins which also have value it could be seen as a gambling game so I wonder how you you manage that yeah yeah it's a good question we feel that the randomness part is is not as important for the skill so if you look at the combat mechanism it's really a
tactical game and random lie is like a mini game I've randomly spot but it's more of a skill game so I mean compared to poker for example is definitely more skill than poker like I mean that no more question okay thank you thank you [Applause] [Music]