/artemis-odb-entity-tracker

:game_die: Visual Entity Tracker for ECS library: artemis-odb

Primary LanguageKotlin

PLEASE NOTE! This branch is deprecated!

This branch holds an old prototype of the Entity Tracker which is a discontinued version. Instead, there is a WIP version on the develop branch. To read more about its current state see gh-pages website: http://namek.github.io/artemis-odb-entity-tracker/

Entity Tracker

Build Status

Server and Client that provides online tracking of artemis-odb World state.

screenshot

Installation

Note: Due to #7 about artemis-odb 2.x support, the latest version of Entity Tracker is commit 0703ecdbcb11c1554e312a4f9b195f19b02ef228. If you need this please apply the version to the following configuration.

Maven

<dependency>
	<groupId>net.namekdev.entity_tracker</groupId>
	<artifactId>artemis-entity-tracker</artifactId>
	<version>0.4.0-SNAPSHOT</version>
</dependency>

<!-- uncomment in case you need GUI inside your game -->
<!--dependency>
	<groupId>net.namekdev.entity_tracker</groupId>
	<artifactId>artemis-entity-tracker-gui</artifactId>
	<version>0.4.0-SNAPSHOT</version>
</dependency-->

Gradle

dependencies {
	compile "net.namekdev.entity_tracker:artemis-entity-tracker:0.4.0-SNAPSHOT"

	// uncomment in case you need GUI instantiated directly from your game
	// compile "net.namekdev.entity_tracker:artemis-entity-tracker-gui:0.4.0-SNAPSHOT"
}

How to use

Option 1. Simple Usage

Import both Entity Tracker and Entity Tracker GUI libraries into your project.

artemisWorld.setManager(new EntityTracker(new EntityTrackerMainWindow()));

Option 2. Network Connection

Host Entity Tracker Server inside your game:

EntityTrackerServer entityTrackerServer = new EntityTrackerServer();
entityTrackerServer.start();
artemisWorld.setManager(new EntityTracker(entityTrackerServer));

There are 2 options to run Entity Tracker GUI that connects with EntityTrackerServer:

  1. run external app (you can download *-app from releases) or build it yourself (see Build section below)
  2. run StandaloneMain.java file or setup GUI manually:
final EntityTrackerMainWindow window = new EntityTrackerMainWindow();
final Client client = new PersistentClient(new ExternalInterfaceCommunicator(window));

client.connect(serverName, serverPort);

Custom Local/Networked Listener

Generally speaking, EntityTracker expects WorldUpdateListener interface implementation, e.g. it may be some window listener.

To achieve network version one can just mimic implementation of ExternalInterfaceCommunicator by implementing Communicator interface and passing it to Client.

Build

Build libraries with sources:

mvn clean package

Build GUI client app as external executable:

mvn clean package -P app and you'll find artemis-entity-tracker-gui/target/artemis-entity-tracker-gui-{version}-app.jar