RPG based in a world where cellular automata have run rampant. Developed using libGDX. All rights reserved
This project (and LibGDX) uses Gradle to install dependencies, but you need to ensure your java environment and android sdk are properly set up first. We use primarily intellij IDEA to develop (but you can use others) and will do our best to guide you through the process. In addition to the guide below, you can find more information in libGDX's dev environment set up guide.
If you're having trouble, check the troubleshooting section at the bottom of this section and contact us on our Gitter Chatroom; we're more than happy to assist.
You will need Java Development Kit 7 (6 and 8 will not work! JREs will not work).
On windows, download and install the appropriate JDK from Oracle.
On *buntu, sudo apt-get install openjdk-7-jdk
. You may also need to set the $JAVA_HOME
environment variable to your jdk dir (probably usr/lib/jvm/java-7-openjdk
or similar). You can do this by editing etc/environment
.
Install the Android Stand-alone SDK Tools (not the ADT bundle!) using (this link)[http://developer.android.com/sdk/installing.html].
install exactly the following:
You may need to set an environment variable, $ANDROID_HOME to the android sdk's directory.
D/l and install using included instructions here.
Once your development environment is ready, navigate to the root directory of the project, and run ./gradlew clean
(or gradlew.bat
if you're on Windows) to download and install dependencies. This will take a few minutes.
Now that you have all of the dependencies you can make and run a build using ./gradlew desktop:run
. Please ensure this works before trying to import into intellij.
Finally, import the project as a Gradle Project in your favorite IDE. Follow LibGDX's import guide to import the project. That particular link is for Eclipse, but if you look on the table of contents, you will see setup guides for various other IDEs.
workingDir=\android\assets
, mainClass=desktop.DesktopLauncher
workingDir=\
, mainClass=desktop.TexPacker
workingDir=\
, mainClass=desktop.AllTestSuite
JDK Required: 'tools.jar' seems to be not in IDEA classpath. Please ensure JAVA_HOME points to JDK rather than JRE.
Your $JAVA_HOME
is pointing at an incomplete JDK or a JRE, verify that $JAVA_HOME
is pointing to the right place, or try re-installing the JDK.
*buntu: JAVA_HOME or ANDROID_HOME are set in
/etc/environment
are not working
You must log out and log back in to re-load the environment globally. To check these variables, open a terminal and enter $JAVA_HOME
or $ANDROID_HOME
.
.gradlew
won't run!
Make sure it is marked as executable using chmod +x ./gradlew
.gradlew clean
FAILURE: SDK location not found
$ANDROID_HOME environment variable is not set properly. You may need to edit it or reboot.
Gradle is giving me unusual build errors!
Ensure that you are using the copy of gradle provided in the repository (gradlew
), or that you are using version 2.4
Gradle's stacktrace isn't formatted with symbolic links to code in IntelliJ IDEA
With the recent addition of IDEA version 15, java-grade and android-gradle misbehave when they are in the same project. To fix this, open the desktop module settings in IntelliJ, and remove any references to android-gradle under Facets
ArrayIndexOutOfBoundsException: 0 at LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:951)
This seems to occur when running the project on an xorg-server with more than one monitor attached. Ensure that xorg-xrandr
is installed and configured correctly.
# build-targets
android/
desktop/
html/
ios/
# main codebase
core/src/io.github.emergentorganization.cellrpg/
/PixelonTransmission # main game class
/components/ # component classes used in entity-component system
/core/ # classes deemed generalizable enough for possible use in other projects
/entityfactory/
/Entities/ # entities for entity-component system
/events/ # event classes for pub/sub event system
/input/ # player input controllers
/managers/ # classes which act as middlemen in use of assets by systems
/scenes/ # in-game scene classes
/systems/ # controllers for entity components
/tools/
/mapeditor/ # in-game map editor classes
/menus/ # in-game GUI menu classes
/mixpanel/ # metric collection/reporting
/physics/
/postprocessing/ # custom shaders
/profiling/ # helper scripts for performance testing
/saves/ # game state i/o helpers
# raw assets not *directly* used by game
art/ # NOTE: !!! assets used by all targets are in `android/assets/resources`
# helper libraries
aurelienribon/
profilingViolinist/
The codebase is organized using the Entity–component–system pattern. In short, every in-game object has an entity which is composed of components. Component behavior is controlled via various systems. This allows for a wide variety of entity attributes to be shared while maximizing performance (since systems don't waste time on entities without relevant components) and minimizing entity boilerplate (entity definition is primarily a listing of components and values which define the entity).
Events in the game are organized using the publish-subscribe pattern. Using this pattern, entities and systems can respond to a wide variety of contextual events without needing to maintain game state information; they need only to subscribe to the events of interest on the entities they care about.
My most typical workflow goes something like:
./android/assets/resources/log4j2.xml
to enable detailed logging on classes I am working onIf modifying art assets, the steps are a bit different:
android/assets/resources/textures/unpacked
spritify.sh
script to collect sprites into intermediate spritesheetandroid/assets/resources/data/colliderProject
For particle effects:
android/assets/resources/particleEffects
Building for a Release:
git checkout demo
, git pull origin master
, git push origin demo
s to merge in latest commitsgit tag -a v0.4.0 -m "loadouts PoC release"
./gradlew desktop:dist
to create jar in Cell-RPG/desktop/build/libs/
~/.prefs/My Preferences
AKA %UserProfile%/.prefs/My Preferences
(for windows). There are a lot of random experiments sprinkled in here that might catch your interest. For example: