Giter Site home page Giter Site logo

chrisfarms / ds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from playmint/ds

1.0 0.0 0.0 14.55 MB

Downstream Game Client

Shell 0.14% JavaScript 31.74% C# 9.45% TypeScript 33.46% Makefile 0.14% HLSL 0.33% Dockerfile 0.11% ShaderLab 0.99% Solidity 23.63%

ds's Introduction

Downstream is a fully onchain game platform and creation tool.

Build your own game with Downstream

Follow the guide to build your own game with Downstream.

Build and run a local platform instance

Get building on top of Downstream

Clone Repository (with submodules and LFS)

Clone Repository

The repository needs cloning with LFS and recursive submodules.

  • Install Git: Git SCM for download and installation.
  • Install Git-LFS: Visit Git-LFS
  • Initialise Git-LFS: Run the following command:
    git lfs install
    
  • Clone the Repository: Use the following command:
    git clone --recurse-submodules https://github.com/playmint/ds
    

⚠️ 🖥 Windows

Windows users must ensure they have symlinks enabled.

  • Go to ds
    cd ds
    
  • Set symlinks to true
    git config core.symlinks true
    
Running with Docker

Running with Docker

If you only need a local copy of the game built (without development helpers like hot reloading etc), then the easiest way is to provision using Docker Compose.

Install Docker Desktop

docker compose up --pull=always

This will fetch the most recently built images for the game and run them without requiring a full build.

Once ready, the client will be available at http://localhost:3000

See "Running Local with different Map Setups" section for deploying different maps,

Docker Trouble shooting

Docker Trouble shooting

1. Hardware Virtualisation If when trying to run Docker you hit this error:

hardware assisted virtualization and data execution protection must be enabled in the bios

You will need to enter your BIOS and activate Hardware Virtualisation. This is usually the case for AMD processors.

Advanced options for contributors

Building from Source

Building from Source

For deploying locally with maximum flexibility and minimum rebuild times, you can install the whole tool chain and then create a local build with make.

Install tools

Follow the instructions for installing tools.

Build & Run

In the ds directory, run

make dev

In your browser, open http://localhost:3000/

Rebuilding after core changes:

If you have built the map during the make dev flow and since, there have been changes in the Unity scene you will need to rebuild the map. To do this, it is adviced to clean all build artifacts with

make clean

Once you are done, you can either build everything again with make dev or you can just build the map by using the make map command.

Running locally with different maps

Running locally with different maps

By Default, running make dev will spawn a one hex sized map and running with docker will spawn (the only slightly larger) "tiny" map.

1. Using pre-built Maps

The ds/contracts/src/maps/ folder contains a few pre-made maps.

In order to force one of these maps to be deployed with a local build of the game you need to set the MAP env variable.

For docker builds this must be done by editing the .env file in the root of the repository.

MAP=quest-map

For make builds (and OSX docker builds) the MAP variable can be set as part of the make command; e.g.

MAP=quest-map make dev

2. Claiming a zone

Once your build has succeeded, http://localhost:3000/ will take you to the Downstream homepage. Here you can sign in via Metamask, Wallet connect or use one of our Burner wallets. When deploying locally, a wallet called the "LocalDevAccoint" will already own Zone 1. You can connect using said wallet to speed things up. If you want to claim a new one using any other login method, make sure to note down the Zone Number as you will need to pass it through our ds cli tool using the -z flag.

3. Apply a map after deploying

After doing a standard docker or make build, you can run the DS apply command and point it at one of the map folders. For example: ds apply -n local -z 1 -R -f ./contracts/src/maps/quest-map/

4. Build your own map and deploy it

Once the game is running locally, browsing to http://localhost:3000/tile-fabricator will show the Tile Fabricator.

Once in the Tile Fabricator, you can design and export a map file. If you want to pre-populate your map wih buildings you will need to import .yaml files that define the buildingKinds.

If you then rename the .yml file to a .yaml and move it to your desired location, you will be able to run the ds apply command, like so: ds apply -n local -z 1 -f ./path/to/mymap.yaml

5. Generating the performance-test map

This is only possible with the make deploy flow and cannot be triggered for a docker build. To generate the performance-test map (used to push the limits of number of tiles and plugins) run:

NUM_ARENAS=4 make contracts/src/maps/performance-test

...this generates a map configuration in contracts/src/maps/performance-test

You can then either start locally via MAP=performance-test make dev or manually ds apply -n local -z 1 -R -f contracts/src/maps/performance-test

References

For more information, check the reference page

ds's People

Contributors

chrisfarms avatar hypnoshock avatar ldunnplaymint avatar jackplaymint avatar playmintpaul avatar 5p0rt5beard avatar steedie avatar chris-baker avatar tboho1 avatar petemint avatar okwme avatar goblinoats avatar joergkiesewetter avatar

Stargazers

 avatar

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.