The Easiest Way to Build Fully On-Chain Games | shora, PixeLAW | ETHTaipei 2024
ETHTaipei·Wed, Oct 9, 2024, 12:00 AM
The Easiest Way to Build Fully On-Chain Games | shora, PixeLAW | ETHTaipei 2024
Transcript
so before talking about the easiest way to freeing game I will talk about my self introduction and uh what is freeing game and what is autonomous world so my name is sh Z SH on X Twitter and I'm working on pixelo as a co-founder uh we uh pass PR from stocket at is a Global Paris ton last year and we keep building also uh recently I I'm helping a 3 Tech which is a which is casual re re games and uh individually I wrot some articles like the for reasons we must pay attention to autonomous autonomous world and the survey of definition of autonomous world so what is fre engine game I think the definition of fre engine game is really really simple that is a type of w three games that how everything on chain apart from the front end so we have everything except for we have everything on chain except for Content the famous examples are dark voice and opcraft I think and I we like op C example this is a free version of Minecraft so then what is autonomous World in my in my opinion uh the autonomous war is not currently is currently undefined but there are some statements about what is autonomous world so let me introduce the quote from rudence Z expart so autonomous worlds have hard diic boundaries formalized introduction rules and know need for privileged individuals to keep the world alive so basically well is a kind of free game but uh so if Builders deploys a smart contract about their game the World the game Logics will keep moving and which execute rojects and they treat our states automatically and forever so it's a kind of world so that's because we call our game as our automous world so it is a little bit different but uh it's a kind of free enging game but there are some controversy about the definition of autonomous world so that's why I conducted the survey of the definition of autonomous for so this is a graph about the percentage of yes response for do you consider this project autom War as a result that e e is the most closest close close project to the to aut world and uh roots are is about 38% people and the interesting point is uh pre poker is not autonomous World PR po game is a obviously game but no one consider it as world so I as the reason about this so we cannot So currently we have no differential about the autonomous world but uh we have uh some major properties to distinguish automas for or not and uh the biggest reasons are the biggest properties for auto to become automous or our composability and in prity I think that's because uh we are trying to build a new world on the new experience try to create a new experience that is not existed before blockchain so the biggest properties for blockchain is composability and interoperability I think so that's why we are we PR we high value on composability and interoperability and also there are some properties are except for this like uh permission lessness and immutability autonomy and wildness and the persistence I think our freeing po game is not autonomous world that's because PR poker has no wildness so that's no there is no narrative to be world and also R po game is a session based game so there is no persistance also to build our game and a we use our ECS model so the ECS model means our entity component system pattern for programming those are uh which is are based on Kyo on stet and the M but of 3 those are framework that utilize our ECS model so entity represents ID of the object and components store the data and F FES to The Entity and system executes Logics and which toes only components this is a point and the benefits of e ECS model is here e model ECS model can solve the problems of maintainability and composability and meability especially when Builders want to add new function to the world to the world they can do the simply by Def new SC scripts so thanks to ECS model we can we can get our our composability then so let's go to the easiest way to build reing games but uh so buing guard game itself is really real very hard but uh building free on is more tough so to build free on games Builders have to work on a lot of things uh not only for smart contract which uh to trat to trat game Logics we have to write the tons of type scripts for front end and we have to integrate front end and the back end and uh we had to set up environments and uh we have to De and so K who is building a sky which is a game uh see uh he tweets like this so we and building building fre G is really tough so most for most talented teams are at least uh it takes two or three months to build so to solve this problem I divide we divide 3 games to Ras um we stop building a fre game as a one module we divide frech games to several layers so we have our content layer and application layer and core layers so if if we do so if we got our high composability of the our world and uh if we want to build a new application or new free engine game you can just focus this section so you do not need to build a free engine uh front end things and the core layer things so this is a paradigm shift to build free games before dividing divide before doing this uh we have to do to build a free game uh you have to do r environment set up back development frend development and integrate them and deployment but uh thanks to this uh Ray modules what we should do is our environment set up and the smart contuct development that is only for game Logics and R deployment so so that's why we are building a pixel so what is pixel pixel is a fre onch pixel based platform people can build a various applications on pixels so for users are users can players can select the game mode or pixel then if you click uh this icon you can play paint game on Pixel so we have several games on Pixel under the front end is like this so uh we have uh currently we have paint game lock paper scissors game s game pleasure Hunt game and M sweeper and Tic Tac door against our AI agent on 2048 all of these games are free on chain so so let me talk about the Aral of pel core so we use our ECS system and weuse we use our pixels as entities each pixel has several components like our X and Y and owner and carus and S and our we have update pixels to uh treat uh these components by calling update pixel function we can interact with pixels if you want to build a new application you need to call update pixel system so you don't need to care about what uh how update pixel function is working under how about the coordinates or pixels you just call update pixels if you want to build our new free launching games on Pixel so so core components are like this so pixels component is are coordinates and color or to represent color in content and the owner of the pixel and the application name of the pixels and the text can be used for Emoji to show emoji on front end or there's a time stamp and action action can be used to to take our action for users so if you click uh move action pixel there might be happens or uh move movement can happen of the pixels let me talk about this later so also we have some several comp uh core systems like uh basically uh we provide uh how to register and update your application and uh update pixel functions so as I said uh to build a new C game in your in your smart contract you just call update pixel function so uh let me talk about how to build 2048 game on Pixel as I said uh there are three steps on environment set up and writing smart contract then deploy the application so environment setup is really easy so just you just get clone up template Lory and our toal compos of the then so to build 2048 game uh uh basically you have to you have to implement two function to build our fre engine game on Pixel so init function and intera function in it function is a function to register your application and control permissions for interaction between applications also so and the intera function is called by cont and default to process each actions and interact with the core so what you should do is uh you write a code in interact function the inside of interact function you if you are not if your game is not initial you will you have to call init game and the move Direction C function and there are some per functions so to implement in function or to register your application to pixel cord you just uh call up update application function provided by pixel 4 app manifest can be used for can be used to tell your applications components and system to pixel core and also then interact function is like this so interaction function function is c for each actions by front end so initialize pixel is the game is not started so to to distinguish our initialize pixels or not you can see you can read the pixel Action Pro parties then to and also in to initialize your game uh you just deare the ownership of pixels and create action buttons by updating by updating pixels so if you want to have a action buttons like this on pixel you just uh what you should do is just update pixels and uh you just are what you should do is update color and uh application name and uh basically uh the tech can be used to uh show Emoji like the like Al and uh action can be used uh to represent to to tell to tell actions of the of that pixels if initializing initialization of the game is done up app execute action following the command so if you click move left button uh the interactive action called move function so move actions uh can be implemented like this so first you will read the current status and set local values and the write game Logics uh or 2048 game then which can be used to execute actions for local vales then so local vales is updated and after that what you should do is just a c pixel update function for each pixels also as our for 2048 game if status change the game creates new number randomly that's all for deploying runting smart contract parts so to deploy 2048 game to pixel uh you can use Soo command basically Soo command is provided by Doo environment and so build to build your contract so migrate to deoy your contracts and also you can initialize your contract by by by online and uh up uploading your manif to to your components to your to tell your applications components and systems I think that's very easy and you can do whole things in one hour or so you are getting us to so as a result we can play a 2048 game on Pixel the interesting point is uh if you deploy your game to the pixel a pixel core and the pixel team cannot stop your deployment so it's a it's a permissionless composability of of wordss and also building on Pixel is very very very easy so what you should do is just initialize your application and cod update pixel functions also we have some other features like our Q systems permission systems and ml agent on Pixel so for Q systems which enable the building scheduled applications like such as a snake game and Conway Game of Life thanks to this systems uh we the pixel the pixel can move around the pixel ground but uh if pixel mve uh it also when we play 2048 game d snake or con Game of Life pixel can uh come in our our game fields so that cision might happen to to with the cision we have also permission permission systems which can specify permissions for interoperability with other games so your game can select uh whether your game will interact with other application like snake game or com gam or not also we can Implement ml agent on Pixel so you can battle with ml agent by using gizer so as a summary uh let me talk about the benefits of this architecture so we divided freeing game to several layers like front end and application layers and the C layers so to build a freeing game you just uh what you should do is just a focus on game logics the cor rayer has the pixel update functions and the pixel entities and pixel components so you just call pixel update function to build our free engine games so this is really easy to build funing games so there is no need to build core systems and H ends you can build a new funing game in 30 minutes for very easy application also uh but sa so that means each application can only update pixel to tr pixel States so we have tighten the diic B is for a digital much user world so we allow permissionless composability but uh we have stable World also uh there is some teams who is working on who is building a fre engine game or autonomous War like a our like that method so pment team has a reach front end also reach front end but uh user can build uh their own canu their own application on their pment stre or word so they can use uh FR and and the core rojects for the to create their own new application free engine gam so so this is the links for Pixel and uh uh my articles so that's all thanks for [Applause] listening does anyone have questions for sh um so the pixel low is building on autonomous world the mod framework right so mud M uh m is the frame marks so we are building a dojo building building on Dojo oh okay so um so if I I I'm trying to build a uh let's say snake game and the other one is trying to build the uh 20 48 game why we have to share the same core layer like um why would I want to much by your pixel so your question means uh why all of the games have the same states is it corre yes yeah it's interesting point but uh basically uh our purpose is of building autonomous world it's not a in in my opinion it's not a single free engine G so we provide our we provide this uh world and uh it can be regarded as a kind of metaverse things and the platform so and uh we give uh we give a high composability because uh we anyway so we give a high composability of the our works so as a result we have a anyway uh a lot of people can build our various various application on our world and uh we believe that we will have a new experience by doing that so I I think the interaction between games can is not our is we we could not in we could not enjoy interaction between our games before blockchain right so we just explore the new experience by using blockchain does this make sense cool um another quick question so if I want to build U like your example is build this snake game or 2048 can I build something more like a bit more modern games like maybe like the farming game on Facebook with social features yeah yeah yeah I think so uh theoretically you can build anything so you can uh so you can just treat the numerical values it's not uh it's not uh we call it as a color but uh you can interpretate uh the numerical values as other information so you can totically build anything awesome thank you thanks so much okay so if you have more questions please feel feel free to come to sh after the talk okay so and thank you so much shk you
Automatic transcript — names and jargon may be misspelled.