0xBrawler: Tech stacks and mechanism design for Autonomous World |Sunway University | ETHKL 2023
Ethereum Malaysia·Wed, Oct 9, 2024, 12:00 AM
The ETHKL 2023 conference is a two-day event that covers a wide range of topics, including Zero Knowledge Proofs, Layer 2, DeFi, Data infrastructure, security, and more. This gathering brings together industry experts and pioneers to explore the latest advancements in Ethereum. Attendees will have access to insightful discussions and presentations on various subjects related to Ethereum technology.
Transcript
all right uh let's move on to the next session uh let's welcome Alex from Blake games uh to share with us text Texs and mechanism designed for autonomous World Round of Applause please testing testing okay all right okay uh see see the screen all right okay uh before we start just quick show of hands I'm going to ask three questions uh how many of uh the people here um played games on a weekly basis all right how many of you guys have played onchain games for once okay uh how many of you guys are building launching games cool all right let's get into it um so basically uh we're uh BL Blade game is a fully oning game Studio we're building across the L2 Stacks so um we've used quite a bit of different stuff from uh zkps to trying out fully homomorphic encryptions to um op stack rollups to some uh research on uh Dojo um so I'm going to talk about some of the stuff how we got here what we've learned um building these games and having a ton of players kind of flooding the RPC and what breaks or whatnot and then I'll talk about tech STX and then while all of a sudden you have autonomous world kind of a quick rundown of History what happened in mid 2022 to up until now after uh dark first and then lastly I'll talk about some things that are interesting to you guys uh is kind of where do we use these technology to make interesting mechanisms um so uh right after e Denver we talked to a few uh zkp researchers and we're thinking about making a hidden information game uh that's a dungeon game so the basic idea of dungeon game is basically you take a group units and then you go to the dungeon there's some uh creeps you can kill there's some loot you can uh you can uh capture but then at the same time uh it's a ins synchronous game so where players can preempt and then just put units in the in the dungeon and then Ambush you and then we basically if you go in with like uh 10 units at 10 fighting Power we want something that can compute and then the the other opponent have like five five fighting Power we want something that's you don't know that five F fighting Power you basically you're in the dark and then the computation results only comes in uh as encrypted and you only know oh the opponent probably has uh no less than five units right so that's something that we can do so we asked uh uh a Zer knowledge proof researcher and then we came up with something that's um using fully homomorphic encryptions so that's basically two people two parties will come in and then and run some computations and you only know the results instead of the the data that's uh participated in it so that kind of worked um but then obviously FH is slower and then it has a lot of proving cost and then putting that onto it's evm have pretty high high uh gas cost plus uh something that uh the dojo uh Dojo person described also um if you want to run like customized block time for example you don't want 12 seconds you want like two seconds um and then you had to basically run an app chain but then run an app chain you need to run your own provs which which is extra cost for early stage uh game studios we don't think that's a good fit so we move on to another game so the second game that we built is called loot Royale it's uh fully onchain real time um Battle Royale game it's uh four people freefor all games and then that's using mut dodev uh you guys probably familiar with this or uh this kind of earlier version of uh there were kind of early uh early Runners of uh fent games uh so we used this we launched about like 16 to 17 17 days ago we're currently running at like 20K unique burner wallet addresses and then about like 20 more than 20 I think we're at 24K sessions completed uh so if you want to play the game you can just go to rollup royal. netify doapp and then just try it out um so this is basically the game build um on the top right you can basically see there's a uh smart contract wallet that's that's there so that's a burner wallet that's uh stored in your cash browser cash and then there is basically a timer that says time to move that basically is two seconds um so per two second the the app chain that we uh customize produce a block and then uh players will basically just move from block to block to kind of uh capture these loot boxes and then uh you basically grow your fighing power but then eventually you'll be basically clashing and walking to the same tile and then a compute what happen this happens on two levels either you can take U block height and do a hash number and then basically turn that into a random number from minus 65 to positive 65 uh or you can use automata vrf which if you really used it it kind of slows the game game down a little bit because you basically have the fetching number from vrf so U we're the version we can turn it on and off but just something that like when you're building games you can keep in mind of um and then last and then basically everybody Tak some St some money and then play it and then eventually there's only one person stand last standing and then that's the end of the game so so that you can basically Fork some of the U backend code and then put that into a wallet put that into a chain or put that into onto a cross Chain Bridge and then play it with their tokens so that's kind of the magic and kind of beauty of uh really fully unchin games that you can uh it's really composable um and then you can do like profit shares and stuff um so what we learned from that uh so thanks to our cumi uh uh so we broke the RPC for a few times so basically the the game is down for in the two first two to three hours it broke like two times uh because the sudden influx of uh traffic so um basically at the third point so basically you had to do a lot of RPC scaling uh um you have to basically you you need your own custom nose as well as uh indexers uh RPC hit rate is delicate what does that mean so when you send a bunch of transactions onto the blockchain um some transactions doesn't get bundled into that particular block and then that'll basically drag your uh your unit to the original pos position because every move is actually a transaction so how do you actually make sure the RPC hit race is um uh is uh is uh kind of less laggy because you'll be basically seeing a lot of just a Tex doesn't go through or kind of just like movement and go doesn't go through so how do you optimize your smart contracts to the to to a place where RPC hits more often and more accurately is a is a big issue and then also like when you really put like trying to put like smart contract wallet into the game whoever's building it feels like it's pretty intuitive but then actually when you actually to to push this to like let's say like 10,000 players there's quite a bit of people don't understand the difference between a smart contract wallet that's in browser and then a plugin that's metamask um so when you design those you have to be very careful with uh uiux design uh to make sure this is like pretty intuitive one of the way to do it is uh uh just to embed this and then have your faucet to kind of just send tokens and then uh people don't even see the wallet and then they just play with it uh we our our version kind of have kind of exposed wallet uh front end and then just everybody asking oh what's how's this different from what metamask which one should we use so that's something you can avoid um or you can just mint have people just kind of Click iner but then at the same time that just mint a 6551 token and then people can use that as a wallet kind of link to their social addresses and stuff um and then lastly definitely have your if if you scale Beyond certain point then having customized indexers if you're building just like more people let's say just kind of like battle bit remaster you have 100 people playing at the same time the same room definitely you you you need to have your own indexer to pick up data and then the the second game that we're working on is uh basically writing code in C and then that's in uh uh ECS in component system design patterns and then you can basically put let's say just creep spawns or attacks or kind of just uh loots and stuff and then prove that part of the logic with SEC awesome um so that's that game will be running on a server but then at the same time the game play part part of the gameplay or entirety of the gameplay will be able to prove uh is provable on zom you can also do that with Cairo on Kyo and which Shan which some the game built by topology is doing right now um but then there's something that you need need to also very be careful with that's something we're figuring out we're definitely open to talk to you guys like on hash to kind of just jam on ideas on this uh which is uh how do you actually write those circuits and then how does those circuits kind of reduce verification cost or even more like proof costs because for example like TI wasam is using Halo 2 and then the the the subsequent the following uh Groth 16 uh sorry the following Halo 2 doesn't have like a dedicated proof aggregation system that reduces large amount of TP proving cost so that's something that's also something when you try to grow audiences um yeah textex so M uh we're short on time so we just speed up a little bit so mod basically have a very nice onchain database it's SQ light basically it's the when you query data it's very the data size is quite small and then it's easier to put into browser a lot of browser game you can actually make it with mud quite easily um and then it's just better at dealing with State changes versus some of the stuff you see at like diamond proxies and stuff uh world is basically just a corner kernel or kind of environment for you for you to put assets control and control versions and stuff indexers uh bear in mind if you use mut we1 is not I don't think it's available to public right now but then the mut V1 V2 index is quite different uh further down the road if you want to build like games that runs with better a lot more players you might want to write your own indexer in go language instead of solidity just to accommodate much more traffic uh some of the useful links if you want to take picture or you can DM us on on on Twitter I'll just send the deex link um Emoji M basically you want to play out with the basic tutorial if anybody have played with frint tech and stuff Progressive web web app that basically skips the entirety of uh App Store and stuff uh so there's like already made libraries out there U mud tokens definitely remember to write a withdrawal function from World contract uh so that like even if you issue token you want to take it out or you want to put it on on the Dex the tokens runs on war contracts and definitely R withraw draw function uh there there's some interesting like design challenges for Sky strive which is the kind of just like a flagship game for mud dodev U that people are running different kind of plugins frenzy plugins basically in a 3X3 Square your units attacks any 3x3 range units automatically and then returns to the same position um and then there's Unity good integration with mud coming out Dojo I'll save us some time because um is gets talked quite a bit in the previous previous session and then there's Keystone Argus and Pima they have different features Key's basically running for gas optim optimization purposes they have pre compiles the pre compile is basically turning a lot of the bodes let's say like ZX ABCD e FG 1 2 3 4 into zerox2 and then that saves a lot of gas and kind of block spaces um and then also they use go language to roll the entire op stack rollup Frameworks so to just to play more be able to develop more kind of RTS or MMO PG games they have a pretty cool RTS game coming up next year uh so definitely check them check them out Argus is more kind of just kubernetes for game engines you write confix and then they they they they provide quite a bit of um technical help and then you can B basically uh deploy with any of the current existing uh Lachine game engines and then they have some game shs that just uh scales the game much better uh because the state changes are managed in their respective shards and then they have some customized Secrets here which gets talked about quite a bit you want to customize game the pace of the game uh they have some games in the pipeline you want to watch their video uh I think happened October you can check that video there Pima there some a few games that is live already uh the good thing is you can basically write JavaScript with it uh so definitely try try it out um so what are some of the role of Frameworks that you'll be working with uh if you're not building on optimism or you just want to have more freedom over how the game is paced uh so you can do all layer uh it's a great for it's pretty good for U games that doesn't have a big room and then you have like 400 people playing the same room and you want you want to manage those State changes all at the same time uh so if you're running let's say like a Reddit or like a WhatsApp channels they' be basically spining up like 20 rollups and then manage room one to 20 and then 21 to 40 per rollup and then they roll those States back to their uh Beacon layer so you can scale your game horizontally across different rollups and then if let's say Saturday Sunday today uh quite a bit of people playing you can basically ask them to scale up like four day rollups for you and then weekday maybe not that many people playing you can ask them to drive it down to like five and stuff uh so pretty pretty neat uh rollup frame there we're working with them on Cera there's a pretty famous game primordium that's out there um and they're uh they're offering a lot more kind of customization U across the op stack frame Mar definitely check them out and then there's conduit I think h& announced some Partnerships with them on during token 2049 so there's something you can check it out as well ZK wome there's something that I think that's quite interesting like if you use these optim um kind of op stack kind of tech Stacks it's great for turn-based games if you want to run like Tower Defense games or like shooting games or any type of like real really real Time games you probably want to put some of the games Logic on uh on on the server and then it's easier to run and then uh you use uh Zer knowledge proof to prove it so use rest uh use Bevy engine and then use R zero or you want to use tasm just use C++ or C um or lastly there's a very interesting new project that um uh that's coming out that's after you use these and you have like 5,000 play players playing you use NE one to drive down the proof proving cost if you're let's say generating like 200k proofs um 200k proofs uh a month you probably will need never one they'll go live on seola test net next month messaging protocols with 3mq sending Labs uh just check those out pretty good messaging tools why all of a sudden you have autonomous worlds well uh right after doc forest was created in 2020 uh there were just a small group of builders on nosis chain on the theum were building games um and but then zerx Park announced that autonomous World residency in 2022 uh they demoed a game uh I think one or two games in last year's deathcon Batar and then they were they have a secret Sky tournament hosted then that's kind of where the initial core of people and then C and Argus was also building out uh around that time and then they gathered together and put put together a book called The autonomous world book you can check out some of the stuff on aw. network um but then they just like spread kind of the book around and then just make it kind of like a mafia stuff Mafia kind of thing and then a Moving Castle was kind of the uh project um team that put the put the book book together if you want to read out the book I think there's there's copies that's out there U that's on that's on the internet you can just search for it it's out there uh there's some pretty interesting pieces I think strongest crypto gaming thesis by up sheep that's quite nice um there's also like luden from um from mud that wrote case for autonomous World um timekeeping for digital gauze is very interesting you should you should check it out they're basically describing kind of building virtual physics and like kind of just laws of a virtual world running on fully on blockchain uh and then then uh in May there's aent game Summit and then there's like e Global atonas World haath and then now all of a sudden you have people that building on stocket people building on like optimism and then like on salana and different kind of U Builders that's out there just kind of you have a a sudden influx of new Builders that's sit out there uh and then also definitely make sure that you check out loot first that means basically loot bag uh Realms cson Caverns as well as um um some of the uh stuff that's out there why is it important some of the games and autonomous worlds that you're using have to have have stories So Stories can range from a newspaper a article a novel or kind of characters spell books skill trees and all that stuff so you can find those fully on chain out of the metadata that's stored on on Realms let's say a map or like weapons on let's say on loot back so definitely try it out um some of the stuff I put there basically from low Fidelity is just a few words you can basically use uh stability uh stability Excel U stabil diffusion to turn this into high five high fidelity characters and then just ask your ask the community around you or your friends to kind of just run these content contest which I think is quite interesting especially when you're like bootstrapping early communities of any games just having these like shared stories and then having these like rooms for imagination is quite important um mechanism design so this is something that that we've recently talked about with a friend called gink uh you can follow him on Twitter um so ERC 6555 56551 basically decouples your account from approval functions and then what you can do is basically run these little arcades then you can basically program a little arcade let's say just like a ping pom game or let's say like a tank game and then you say hey hey if this player pays 0.1 uh 0.01 e and then play the game if they finish the game I store like 10 usdc within the within the ERC uh 6551 token if they finished it then they can take the money otherwise they had to pay like one usdc to particip particip participate in the game so that way you can basically have a ton of different little arcades that's running fully on chain you can test this with a group of friends of yours and then just like use it as an interesting contest uh with them so that's a sync battle like what does sync battle means so you'll be basically you have also program characters so like shin have this code that basically program your characters and say like in condition a your program your character does this condition B your program does this and then you have another players is also condition a does this condition B does this and then basically you can have a sync battle between two kind of ancient entities and then both of them holds like 100 usdc and whoever wins takes the other per other person's 100 usdc so that's very very interesting design space you can basically use AI to fight against each other and then just speculate on them and then there's one last thing called like player own NPC basically you just do these like miniature dexes uh toal exchanges and then say oh uh I have these much resources if you give me this I'll give you that uh so that's very interesting design patterns there sikan it just came out I think two days ago uh we're running a little short out on time you can take a picture on this but very very interesting so remember like at the beginning we talked about FH and information game they have a challenge response system that deals with hidden information and then uh if you propose this Challenge and then search after X amount of time if the player doesn't respond you can slash them onchain and then because these messages are only visible to that particular addresses the rest of the players cannot see them so there's quite a bit of uh excitement you can or fear you can put in players heart to kind of just using these hidden information techniques there's more stuff that's written by ton.
commit reveal schemes multiart computation I'll just not talk about too much on this and then uh Real Time games like if you really really just want to run like World of Warcraft uh a fork on World of Warcraft on a blockchain check out using remember like it's not there it's not been talked about for quite some time but State Channel still works quite nicely because if you're just running for like five people or seven people and then they're farming they're kind of just farming a boss they you can just basically Run State channels and then communicate State changes and then after you close that session like you leave that particular room the kind of state changes are summarized and push it back you you push ckp to the DA layer or to the roll up layer and then just that that concludes that um there also very interesting like Ryan burmar like um workman's um basically running these like ckp machines and then if you have more people running the machines you have more ticks and then people are reward based on uh the number of proofs that you proof it's also very very interesting and then the games kind kind of just gradually slows down over time uh and then the game kind of just concludes on certain time and then that's pretty much it that's a speedrun so if you have any questions um uh be happy to answer that or if you want to talk about game design and stuff any question from the floor we have about five minutes so maybe two or three questions show off hence all right uh well then thank you uh Alex oh oh yes yeah sorry so uh the aw space is growing very fast and then there's certainly opportunities in here you can see we we partner with a lot of the ZK teams and uh you know aw team so now we're growing a little slightly faster so we just need like a front end guy so yeah if you're interested yeah we're hiring yeah whoever that's interesting interested please there's a chance here Reach Out is your opportunity all right okay thank you thank you Alex
Automatic transcript — names and jargon may be misspelled.