An open API service indexing awesome lists of open source software.

https://github.com/namek/artemis-odb-entity-tracker

:game_die: Visual Entity Tracker for ECS library: artemis-odb
https://github.com/namek/artemis-odb-entity-tracker

artemis-odb ecs entity-component-system gamedev java kotlin

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

          

### 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](https://travis-ci.org/Namek/artemis-odb-entity-tracker.svg?branch=master)](https://travis-ci.org/Namek/artemis-odb-entity-tracker)

Server and Client that provides online tracking of [artemis-odb](https://github.com/junkdog/artemis-odb) World state.

![screenshot](/screenshot.png?raw=true)

## Installation

**Note**: Due to https://github.com/Namek/artemis-odb-entity-tracker/issues/7 about artemis-odb 2.x support, the latest version of Entity Tracker is commit [0703ecdbcb11c1554e312a4f9b195f19b02ef228](https://github.com/Namek/artemis-odb-entity-tracker/commit/0703ecdbcb11c1554e312a4f9b195f19b02ef228). If you need this please apply the version to the following configuration.

### Maven

```xml

net.namekdev.entity_tracker
artemis-entity-tracker
0.4.0-SNAPSHOT

```

### Gradle

```groovy
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.

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

## Option 2. Network Connection

Host `Entity Tracker Server` inside your game:

```java
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](https://github.com/Namek/artemis-odb-entity-tracker/releases)) or build it yourself (see `Build` section below)
2. run [StandaloneMain.java](artemis-entity-tracker-gui/src/main/java/net/namekdev/entity_tracker/StandaloneMain.java) file or setup GUI manually:

```java
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`