Giter Club home page Giter Club logo

opcraft's Introduction

OPCraft

An infinite, unstoppable World.

The main branch client is automatically deployed to craft.mud.dev.

Visit the frozen world of the first public playtest of OPCraft at opcraft.mud.dev.

Read more about the creation of OPCraft and the crazy things that happened during our first public playtest on the Lattice blog.

Built using MUD and Noa.

Running locally

  1. Run yarn to install dependencies
  2. Run yarn start in packages/client
  3. In a new terminal, run yarn anvil:node in packages/contracts
  4. In a new terminal, run yarn deploy:anvil in packages/contracts

Running locally with HMR

Parcel + HMR doesn't fully work and React changes will cause a full page reload unless we take a few extra steps to link packages locally and use Vite for bundling.

  1. Clone mud repo locally (next to your opcraft dir)
  2. Run yarn && yarn link:packages from within mud repo to install its deps and link packages
  3. Run yarn && link:mud from within opcraft repo to install its deps and link mud packages
  4. Run yarn dev in packages/client (note yarn dev not yarn start like above)
  5. In a new terminal, run yarn anvil:node in packages/contracts
  6. In a new terminal, run yarn deploy:anvil in packages/contracts

opcraft's People

Contributors

alvrs avatar biscaryn avatar holic avatar kooshaba avatar ludns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opcraft's Issues

install error

Error: Couldn't find package "swarm-js@^0.1.40" required by "[email protected]" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "nofilter@^1.0.4" required by "cbor@^5.2.0" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "[email protected]" required by "[email protected]" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "[email protected]" required by "[email protected]" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "memorystream@^0.3.1" required by "solc@^0.4.20" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "yargs@^4.7.1" required by "solc@^0.4.20" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "rimraf@^2.2.8" required by "fs-extra@^0.30.0" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "require-from-string@^1.1.0" required by "solc@^0.4.20" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "[email protected]" required by "[email protected]" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "[email protected]" required by "[email protected]" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "[email protected]" required by "[email protected]" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "[email protected]" required by "[email protected]" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "util@^0.12.0" required by "[email protected]" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:721:66)
    at new MessageError (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
    at /Users/nft/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:323:13
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

TODO

Didn't want to spam you with issues but wanted to keep track of rough edges as I find them:

  • move to pnpm for monorepo/package management (faster, less error prone)
  • move local dev to single script, using pnpm recursive option or something like overmind
  • gravity/physics feels weird, player should feel heavier
  • client should recalculate position/physics on block updates (maybe just in same chunk), otherwise you're left floating if a block under you is mined
  • scrolling should rotate selected item
  • regaining focus in game engine after being outside (esc) shouldn't immediately interact with the world (clicking back into the game will e.g. immediately mine a block)
    (not as big an issue now that there's a block break animation)
  • should only be able to jump from a block, not from air (currently can fly by spamming jump)
  • no way to toggle off sound once toggled on
  • holding down mouse while breaking a block should start breaking the next block under cursor
  • hovering over a block should highlight the whole thing rather than one face?
  • mining grass should give a dirt block?
  • consider moving to debug for console logs so they can be namespaced and filtered
  • need ways to toggle developer tools (query UI, sound, coords, etc)
  • leaves on ground show under the world rather than the next block down

Error when installing to run locally on Windows WSL 2 with Ubuntu 20.04 distro

I tried the installation using the following LTS versions of node v16.0.0, v16.10.0, v18.13.0 and v18.14.0.
All yarn execution failed a the same point of the installation. Below you have the full log of execution.
Any hint?

$ yarn
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
warning Pattern ["aabb-3d@github:fenomas/aabb-3d"] is trying to unpack in the same destination "/home/claudio/.cache/yarn/v6/npm-aabb-3d-0.2.1/node_modules/aabb-3d" as pattern ["aabb-3d@fenomas/aabb-3d"]. This could result in non-deterministic behavior, skipping.
[3/4] Linking dependencies...
warning "@typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning "workspace-aggregator-6554f31c-f32f-414a-8e57-ee4ab57f9e6c > client > @latticexyz/[email protected]" has incorrect peer dependency "[email protected]".
warning "workspace-aggregator-6554f31c-f32f-414a-8e57-ee4ab57f9e6c > client > @latticexyz/[email protected]" has incorrect peer dependency "[email protected]".
warning "workspace-aggregator-6554f31c-f32f-414a-8e57-ee4ab57f9e6c > contracts > @nomicfoundation/[email protected]" has incorrect peer dependency "@nomiclabs/hardhat-ethers@^2.0.0".
warning "workspace-aggregator-6554f31c-f32f-414a-8e57-ee4ab57f9e6c > client > @latticexyz/utils > [email protected]" has unmet peer dependency "typedoc@>=0.23.0".
[4/4] Building fresh packages...
$ husky install && (forge --version || yarn foundryup) && yarn lerna run prepare
husky - Git hooks installed
/bin/sh: 1: forge: not found
yarn run v1.22.19
$ curl -L https://foundry.paradigm.xyz | bash && bash ~/.foundry/bin/foundryup
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1825  100  1825    0     0   3642      0 --:--:-- --:--:-- --:--:--  3642
Installing foundryup...
######################################################################## 100.0%

Detected your preferred shell is bash and added foundryup to PATH. Run 'source /home/claudio/.bashrc' or start a new terminal session to use foundryup.
Then, simply run 'foundryup' to install Foundry.


.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx

 ╔═╗ ╔═╗ ╦ ╦ ╔╗╔ ╔╦╗ ╦═╗ ╦ ╦         Portable and modular toolkit
 ╠╣  ║ ║ ║ ║ ║║║  ║║ ╠╦╝ ╚╦╝    for Ethereum Application Development
 ╚   ╚═╝ ╚═╝ ╝╚╝ ═╩╝ ╩╚═  ╩                 written in Rust.

.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx

Repo       : https://github.com/foundry-rs/
Book       : https://book.getfoundry.sh/
Chat       : https://t.me/foundry_rs/
Support    : https://t.me/foundry_support/
Contribute : https://github.com/orgs/foundry-rs/projects/2/

.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx

foundryup: installing foundry (version nightly, tag nightly-3861b3f7d6e173cf709e4a99c1584db92fbd6c63)
foundryup: downloading latest forge, cast, anvil, and chisel
################################################################################################################# 100.0%
foundryup: downloading manpages
################################################################################################################# 100.0%
foundryup: installed - forge 0.2.0 (3861b3f 2023-02-14T00:04:02.369811784Z)
foundryup: warning:
There are multiple binaries with the name 'forge' present in your 'PATH'.
This may be the result of installing 'forge' using another method,
like Cargo or other package managers.
You may need to run 'rm ' or move '/home/claudio/.foundry/bin'
in your 'PATH' to allow the newly installed version to take precedence!
foundryup: installed - cast 0.2.0 (3861b3f 2023-02-14T00:04:02.369811784Z)
foundryup: warning:
There are multiple binaries with the name 'cast' present in your 'PATH'.
This may be the result of installing 'cast' using another method,
like Cargo or other package managers.
You may need to run 'rm ' or move '/home/claudio/.foundry/bin'
in your 'PATH' to allow the newly installed version to take precedence!
foundryup: installed - anvil 0.1.0 (3861b3f 2023-02-14T00:04:42.24566469Z)
foundryup: warning:
There are multiple binaries with the name 'anvil' present in your 'PATH'.
This may be the result of installing 'anvil' using another method,
like Cargo or other package managers.
You may need to run 'rm ' or move '/home/claudio/.foundry/bin'
in your 'PATH' to allow the newly installed version to take precedence!
foundryup: installed - chisel 0.1.1 (3861b3f 2023-02-14T00:04:42.171854916Z)
foundryup: warning:
There are multiple binaries with the name 'chisel' present in your 'PATH'.
This may be the result of installing 'chisel' using another method,
like Cargo or other package managers.
You may need to run 'rm ' or move '/home/claudio/.foundry/bin'
in your 'PATH' to allow the newly installed version to take precedence!
foundryup: done
Done in 12.74s.
yarn run v1.22.19
$ /home/claudio/src/opcraft/node_modules/.bin/lerna run prepare
lerna notice cli v4.0.0
lerna info Executing command in 1 package: "yarn run prepare"
lerna ERR! yarn run prepare exited 1 in 'contracts'
lerna ERR! yarn run prepare stdout:
$ chmod u+x git-install.sh && mud types
Compiling contracts
Clearing forge build output directory ./out
Cmd:
forge build -o ./out
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run prepare stderr:
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: spawn forge ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn forge',
  path: 'forge',
  spawnargs: [ 'build', '-o', './out' ]
}

Node.js v18.14.0
error Command failed with exit code 1.
lerna ERR! yarn run prepare exited 1 in 'contracts'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.