Create a Pokémon-inspired on-chain game with MUD
latticexyz / emojimon Goto Github PK
View Code? Open in Web Editor NEWEmojimon: a MUD tutorial
Home Page: https://emojimon.vercel.app
Emojimon: a MUD tutorial
Home Page: https://emojimon.vercel.app
Create a Pokémon-inspired on-chain game with MUD
The MUD changelog documents all breaking changes: https://mud.dev/changelog
or remove distance check from contracts
looks like forge is used by SNAP on ubuntu, which means it's blocking everything in the process:
[contracts] Error:
[contracts] FORGE - training program for SNAP (version 2006-07-28)
[contracts]
[contracts] usage: forge [options] [options]
[contracts] options:
[contracts] -help
[contracts] -verbose
[contracts] -pseudocount [1] (absolute number for all models)
[contracts] -pseudoCoding [0.0] (eg. 0.05)
[contracts] -pseudoIntron [0.0]
[contracts] -pseudoInter [0.0]
[contracts] -min-counts [0]
[contracts] -lcmask [-fragmentN]
[contracts] -utr5-length [50]
[contracts] -utr5-offset [10]
[contracts] -utr3-length [50]
[contracts] -utr3-offset [10]
[contracts] -explicit [250]
[contracts] -min-intron [30]
[contracts] -boost (file of ID )
[contracts] Error running "forge clean"
how to fix this?
When trying to build the tutorial from a fresh clone, I get the following error message related to unknown file extension
Node version: v16.14.2
pnpm version: 8.6.12
Trace:
[contracts]
[contracts] > [email protected] dev /emojimon/packages/contracts
[contracts] > pnpm mud dev-contracts --tsgenOutput ../client/src/mud
[contracts]
[client]
[client] > [email protected] dev /emojimon/packages/client
[client] > wait-port localhost:8545 && vite
[client]
[client] Waiting for localhost:8545..node:internal/errors:464
[contracts] ErrorCaptureStackTrace(err);
[contracts] ^
[contracts]
[contracts] TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".json" for /emojimon/node_modules/.pnpm/@[email protected][email protected]/node_modules/@latticexyz/world/abi/World.sol/World.json
[contracts] at new NodeError (node:internal/errors:371:5)
[contracts] at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:87:11)
[contracts] at defaultGetFormat (node:internal/modules/esm/get_format:102:38)
[contracts] at defaultLoad (node:internal/modules/esm/load:21:14)
[contracts] at ESMLoader.load (node:internal/modules/esm/loader:359:26)
[contracts] at ESMLoader.moduleProvider (node:internal/modules/esm/loader:280:58)
[contracts] at new ModuleJob (node:internal/modules/esm/module_job:66:26)
[contracts] at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:297:17)
[contracts] at ESMLoader.getModuleJob (node:internal/modules/esm/loader:261:34)
[contracts] at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:81:21) {
[contracts] code: 'ERR_UNKNOWN_FILE_EXTENSION'
[contracts] }
[contracts] ELIFECYCLE Command failed with exit code 1.
[contracts] cd packages/contracts && pnpm run dev exited with code 1
made InitSystem into a lib to test the new initializer config: https://github.com/dk1a/emojimon/blob/18d12df918685416a023fb3b3cb49b22bf04ca19/packages/contracts/src/init/LibInit.sol
maybe you want it upstream
To use playerEntityId
in HasValue
you have to make it checksummed first (via ethers' getAddress
for example)
My component in question is essentially an AddressComponent
in solidity, and an Entity
component in ts
(there's no Type.Address
in recs
, and using Type.String
instead doesn't change the fact that the address component's values are checksummed in ts)
import { defineComponent, Metadata, Type, World } from "@latticexyz/recs";
const Entity = {
value: Type.Entity,
} as const;
export function defineEntityComponent<M extends Metadata>(
world: World,
options?: { id?: string; metadata?: M; indexed?: boolean }
) {
return defineComponent<typeof Entity, M>(world, Entity, options);
}
I think if my address component were a uint256
instead, then its values might not have been checksummed. It should probably be normalized on the netwoking end, rather than changing playerEntityId
edit: confirmed it, address and uint256 components will be parsed by network differently, so I have to manually getAddress(playerEntityId)
if I'm using it in HasValue
of an address component
In the README there's a link to a tutorial https://mud.dev/tutorials/emojimon/, but it returns 404 error
This is the error I saw in the console when I executed "pnpm run dev" after step I've tried this many times, and sometimes I can spawn player in step 1 (without this error), but after i finish the step4, the map will go black, or i cant spawn player
The player icon flashed when I clicked on the map with my mouse, but it didn't actually spawn
I've been trying for a few days now, but changing the operating system doesn't fix the problem
useMapConfig
(changed approach)MapSystem
from the starter kit?Encounter.tsx
to EncounterScreen.tsx
to not conflict with Encounter RECS componentmay help with optimistic rendering issues, since "move up" can be done atomically, regardless of current position, vs "move to x,y" which can fail if in a queue of other moves
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.