User Tools

Site Tools


dev_setup

Setting up your Development Environment

Video form

Prerequisites

  • 64-bit OS: No Windows XP support whatsover
  • Java JDK 8 x64 ( the latest version )
  • Git ( and Git commands on Windows )
  • Optional: RenderDoc for graphics debugging
  • Optional: VisualVM for realtime profiling and debugging

Architecture overview

Chunk Stories is a big project made out of many components that all slot in one another. The three big projects, chunkstories-api, chunkstories-core and chunkstories form the basis of what is considered “the base game” and are effectively what is distributed in the client downloads section.

This apparent complexity is not without it's load of advantages: since no mod code will be written against chunkstories, an Android port, with a completely different codebase could still run all the content it wants, as long as it implements their correct version of the API. Another benefit is for contributors that would otherwise be confused by the breadth and complexity of the implementation code, they can stick to only editing the core project to add in the gameplay stuff.

This however does mean if one wants to write mods against a bleeding (unreleased) version of the game, one has to install the entire development environment. Fortunately, it's not nearly as complicted as it looks and requires mostly cloning 3 github repos ( and keeping the up to date ) and running one command in each of them, in order.

Building

First you need to clone both chunkstories-api and chunkstories-core as both are needed to compile this. You can try to build from the artifacts in the repo, but only those used in released versions of the games are guaranteed to be present.

  • Open a bash terminal ( using Git bash on Windows )
  • I recommend using a common folder for putting the 3 repos in. I typically chose 'git', but pick whatever you want.
  • mkdir git; cd git
  • git clone https://github.com/Hugobros3/chunkstories-api.git
  • git clone https://github.com/Hugobros3/chunkstories-core.git
  • git clone https://github.com/Hugobros3/chunkstories.git
  • in the chunkstories-api folder: ./gradlew install
  • in the chunkstories-core folder: ./gradlew install
  • You're done! go into the chunkstories folder and you can now build the implementation and run the game !

The local maven repository on your computer (.m2 folder) now contains copies of both the api and core content the chunkstories engine requires. These are not automatically rebuilt when building the implementation as they are completly seperate projects, so keep that in mind.

Gradle Tasks

  • ./gradlew client:shadowJar builds the Client executable (chunkstories.jar)
  • ./gradlew server:shadowJar builds the Server executable (server.jar)
  • ./gradlew converter:shadowJar builds the Map converter executable (converter.jar)
  • ./gradlew launcher:createExe builds the launcher executables (.exe and .jar as well)
  • ./gradlew buildAll builds all of the above

Bash scripts in `chunkstories`

  • ./build_local_deps.sh will automatically build both api and core, assuming they are in the same parent folder as this.
  • ./debug-client.sh will start the client jar under debug conditions: Java remote debugging enabled, using the current directory as it's work directory ( and not .chunkstories ), and using ../chunkstories-core/res as it's core content distribution.
  • ./debug-server.sh will start the server jar under debug conditions: Java remote debugging enabled, using the current directory as it's work directory ( and not .chunkstories ), and using ../chunkstories-core/res as it's core content distribution.
dev_setup.txt · Last modified: 2018/03/09 19:03 by gobrosse