Too Boring To Play™ is a proof-of-concept of fully decentralized MMORPG game. It means that there is no single entity who could stop this game or change its mechanics or data. Once it is deployed, it cannot be changed in any way other than by taking predefined game actions.
This goal is achieved by implementing the essential game mechanics in contract-oriented Solidity language, and deploying it into Ethereum blockchain. Ethereum is a cryptocurrency with the support of complex scripting. Each player action is signed in client app and then sent to the blockchain as a transaction. Every Ethereum node in the network validates whether this transaction conforms to the game mechanics and rejects it if not. After accepting it, the transaction is practically irreversible.
The application is written in TypeScript with extensive use of React framework, which is responsible for almost all user interface (usually by using Material-UI components). For rendering of the tiled game map Phaser engine was used. Phaser objects communicate with the rest of the application via contexts, which are injected into it through the constructor of Phaser game. Contexts enable for example listening to the events and emitting them, notifying user about important matters, reading from local cache and writing into it or communicating with the Ethereum blockchain.
For storing data in the browser, Dexie library is used. It works as a wrapper for integrated IndexedDB and allows defining the data model, indexing it by user-defined indexes and querying it in a way similar to SQL.
For authentization and communication with Ethereum blockchain, injected Ethereum provider (according to the EIP-1193 standard) is used. The most convenient way is to install MetaMask extension into your browser, create an account, buy some ether (which is Ethereum native currency, needed to perform transactions against the blockchain) and play the game. For now the game is deployed on Ropsten testnet, so you can request some ether for free for example here. Another way when developing is to simulate the blockchain locally, for example with Ganache.
Game mechanics are implemented as Solidity language contracts, then compiled by Truffle framework and deployed into Ethereum blockchain. There are also generated TypeScript wrapper classes from the compiled versions of contracts by using web3x-codegen tool, which allows to implement the communication with these contracts from the client application in a type-safe manner.
npm run build
, this directory contains compiled version of web application, ready for deployment.truffle compile
, this directory contains contracts compiled by Truffle, which are ready for deployment.npm run docs
, this directory contains app documentation, generated by Typedoc.npm run build
.npm run codegen
, this directory contains TypeScript definitions of Solidity contracts from contracts.npm install
to download and install required dependenciestruffle compile
to compile Solidity contracts (Truffle framework not part of the project, must be installed separately)npm run codegen
to generate TypeScript code from contracts (configuration in contracts.json)npm start
for immediate start or npm run build
for compiling it into build directorytruffle migrate
to deploy contracts code into blockchain (deployment configuration in truffle-config.js)npm run docs
to generate Typedoc documentation into docs directoryCopyright © 2020 Marek Polák
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Licenses to 3rd party software are part of the software itself, list of used software can be found in package.json.
All used media are of own production and are therefore covered by the same license.
Generated using TypeDoc