summaryrefslogtreecommitdiff
path: root/README.md
blob: 800d823c60def7bcf7eed7e5185ce4d6642fb50b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Akkamon: a demo pokemon mmo written in Phaser3 typescript and Akka Java

![core-idea](./readme-media/header.gif)

> "One trainer is no trainer."

In akkamon the goal was to let many users interact with each other in parallel like in a typical MMO game, in this case we copy the pokemon formula and make it an MMO.

- [x] You can walk around the world and see your friends walking
- [x] You can invite your friend to start an interaction with you
- [x] You can start a battle with somebody else that is online
- [ ] You can actually play the pokemon battle (UNDER CONSTRUCTION)

Like the actual battle, many things that you would expect from a pokemon MMO were not within the scope of the project. The Game Engine [^gameengine], User Interface, Websockets API, and Actor model backend had to written from scratch, which took a lot of time.



# Install from source

## Before you start

Starting the installation requires a couple things:
* Java JDK version 16.0.1 preferably
* Gradle 7.1.1 was used in this project, but `./gradlew` provided should work instead of `gradle` in the installation commands
* A recent version of Node.JS with npm

## Install steps

1. Use npm to install client side dependencies (for example phaser3, typescript, rollup)

```sh
cd client
npm i
```

2. Building the project with gradle automatically pulls the dependencies in `domain/build.gradle` and `api/build.gradle`

```sh
# OPTIONAL: If you want to list dependencies
cd domain
gradle dependencies
cd ../api
gradle dependencies
cd ..
gradle assemble
```

# Start playing

## Run the services

To start playing we need to start two services, the Phaser3 client and Akka backend.

First, in the project root

```sh
gradle run
```

Then, in the client module, in another shell session

```sh
// this command takes 20s seconds to transpile the typescript into javascript :(
npm run phaserDev
```

The Phaser3 client listens on `localhost:10001`. Assigning client sessions to an Id in the backend is still buggy since no authentication is used. Try connecting once at a time, and restart the `gradle run` server when you disconnect just to be sure (it's starts up quickly).

In theory, an arbitrary number of clients could connect to the backend. Not tested yet.

## In-game controls

* Overworld

| Key                | Does            |
| ------------------ |:---------------:|
| `a`                | open pause menu |
| up/left/right/down | walk around     |

* Pause menu / Phone menu / Yes-no menu

| Key                | Does            |
| ------------------ |:---------------:|
| up/down | go option up/down          |
| left    | close menu                 |
| right   | confirm option             |

* Battle FIGHT/ITEM/PKMN/RUN menu

| Key                | Does            |
| ------------------ |:---------------:|
| up/left/right/down | go option  up/left/right/down |
| space              | confirm option  |

* Battle moves menu

| Key                | Does            |
| ------------------ |:---------------:|
| up/down            | go option up/down |
| space              | confirm option  |
| left               | go back  |


# Tests (or lack thereof)

Sadly, there are no real tests yet.


[^gameengine]: Not completely from scratch, but I had to add stuff to connect it with the Websockets communication.