-
Notifications
You must be signed in to change notification settings - Fork 12
Getting Started
Paul Speed edited this page Aug 20, 2016
·
7 revisions
- Reference dependencies or download jars
- Hook up the server
- Hook up the client
The easiest way to use SimEthereal is with a build system that supports maven-style repositories. Gradle is my personal favorite. In that case, one need only include the SimEthereal dependency.
Gradle:
compile "com.simsilica:sim-ethereal:1.1.1"
Maven:
<dependency>
<groupId>com.simsilica</groupId>
<artifactId>sim-ethereal</artifactId>
<version>1.1.1</version>
<type>pom</type>
</dependency>
For direct IDE setup as in the JME SDK, you will need the SimEthereal jars as well as the related dependencies.
Download the latest release of SimEthereal from: https://github.com/Simsilica/SimEthereal/releases
Dependencies:
- JME Networking: should already be a library in your SDK.
- SimMath: https://github.com/Simsilica/SimMath/releases
- slf4j: http://www.slf4j.org/download.html From which you will need at least the API jar.
Setup the game-specific constants that the client and server will share:
private static final int gridSize = 64;
/**
* The 3D zone grid definition that defines how space is broken
* up into network zones.
*/
public static final ZoneGrid ZONE_GRID = new ZoneGrid(gridSize, gridSize, gridSize);
public static final float MAX_OBJECT_RADIUS = 5;
/**
* Defines how many network message bits to encode the elements of position
* fields.
*/
public static final Vec3Bits POSITION_BITS = new Vec3Bits(-MAX_OBJECT_RADIUS,
gridSize + MAX_OBJECT_RADIUS,
16);
/**
* Defines how many network message bits to encode the elements of rotation
* fields.
*/
public static final QuatBits ROTATION_BITS = new QuatBits(12);
/**
* Defines the overall object protocol parameters for how many bits ar used
* to encode the various parts of an object update message.
*/
public static final ObjectStateProtocol OBJECT_PROTOCOL
= new ObjectStateProtocol(8, 64, POSITION_BITS, ROTATION_BITS);
/**
* Defines the 3D zone radius around which updates will be sent.
*/
public static final Vec3i ZONE_RADIUS = new Vec3i(1, 1, 1);
For a complete example, see: GameConstants.java
A good place to start would be the more extensive Documentation page.
Also be sure to check out the case study example at Example.
And check the background reading at Resources.