/ao-java

Java game client and server based on the popular argentina MMORPG Argentum Online

Primary LanguageJava

ao-java Build Status

Rewriting Argentum Online in Java, using Artemis, Kryonet and libGDX.

ECS (entity-component-system)

To understand ECS, I recommend to read this. Using artemis framework has been really useful to start rewriting this game.

Kryonet

Avoid creating huge game protocol since we can use Requests and Responses, which can be processed easily with 'visitor' design pattern. Read more here

libGDX

It allows us to create application game logic, create screens and render all that we need using OpenGL.

Getting Started

Clone repo

git clone https://github.com/ao-libre/ao-java.git

Requirements

Important: you need to use Java SE Development Kit (JDK) 8 (Java 1.8) to make it run

Download link: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Run

  • Go to folder and use following commands to run client ./gradlew desktop:run or server ./gradlew server:run
  • Or generate distribution jars ./gradlew desktop:dist ./gradlew server:dist

Server

If you want to run server in local machine and don't want to open ports, add following property to VM Options:

  • -Dserver.useLocalhost=true

Conflicts running Client and Server in same machine

To avoid recompiling shared module and regeneration of .class files, which will probably bring some execution errors like ClassNotFoundException, you can add this argument to skip fluid task in both client and server run configurations:

  • -x :shared:fluid

Import in IntelliJ

  • Select 'Import Project'
  • Find and select build.gradle file
  • Create run configurations using gradle tasks (desktop:run, server:run)

Here is an image showing how it should look like: imagen

How to change Java Version?

If you have another version of Java already installed, please change: https://kodejava.org/how-do-i-set-the-default-java-jdk-version-on-mac-os-x/

If you use IntelliJ, use the JDK that comes with the project if is not working change it by yourself like in the picture below:

IntelliJ IDEA -> Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle

imagenintellij

Modules

components

Contains all components (ECS related)

core

Game client logic, screens, GUI, client systems (ECS): on runtime should have a replicated World.

desktop

Contains assets and desktop game launcher.

server

Server logic and systems (ECS), database connection (TBD), etc.

shared

All stuff shared between client and server, like network requests and responses, objects, maps, etc.

Images

alt text

Key Config to play

Default

Combat

ATTACK_1 = CONTROL_LEFT ATTACK_2 = CONTROL_RIGHT MEDITATE = M USE = U HIDE = O INVENTORY = I SPELLS = K TALK = ENTER DROP = T TAKE = A EQUIP = E

Move

MOVE_LEFT = LEFT MOVE_RIGHT = RIGHT MOVE_UP = UP MOVE_DOWN = DOWN

Alternative wasd - Active activate with F1

Combat

ATTACK_1 = SPACE ATTACK_2 = SHIFT_RIGHT MEDITATE = M USE = SHIFT_LEFT HIDE = O INVENTORY = I SPELLS = K TALK = ENTER DROP = T TAKE = L EQUIP = E

MOVE

MOVE_LEFT = A MOVE_RIGHT = D MOVE_UP = W MOVE_DOWN = S