Skip to content

Commit a32a523

Browse files
committed
Initial public commit
0 parents  commit a32a523

File tree

362 files changed

+72723
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+72723
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/
2+
*.iml
3+
target

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Shattered Plans
2+
3+
Shattered Plans is a turn-based strategy game by [Jagex Ltd.][jagex] It was originally released in 2008 as part of [FunOrb][], which was sadly shut down in 2018 without any successor. This repository is a fan project that restores Shattered Plans to a playable state. Based on a decompiled archive of the original Shattered Plans client, it includes a reimplementation of the original FunOrb server, which makes Shattered Plans playable again in both singleplayer and multiplayer modes.
4+
5+
[![Screenshot of Shattered Plans gameplay.][screenshot.png]][screenshot.png]
6+
7+
## Running the game
8+
9+
Running Shattered Plans requires [Java 17 or newer][download-java] and the latest version of the game JAR. You can then run the game by running the following command:
10+
11+
```sh
12+
java -jar shattered-plans-0.0.5.jar --local-server
13+
```
14+
15+
As the name suggests, passing the `--local-server` flag will run a Shattered Plans server locally, allowing you to play the game in singleplayer mode. Other players can connect to your server by running
16+
17+
```sh
18+
java -jar shattered-plans-0.0.5.jar --host <HOST>
19+
```
20+
21+
replacing `<HOST>` with your IP address. By default, the server runs on port 43594, but you can specify a different port using the `--port` flag. A few other options are also available, pass `--help` to see them all.
22+
23+
## What works, what doesn’t, and other limitations
24+
25+
All singleplayer functionality should work flawlessly. Most multiplayer functionality works as well. However, there are some bugs, unimplemented features, and other limitations:
26+
27+
* When you start the game, you will be presented with a login screen. You may enter any username/password combination you like, and the server will not check it. In fact, attempting to create an account will not work: the server does not record any persistent user state.
28+
29+
* Lobby and in-game chat are supported, but adding users to your friends or ignore list is not, so there is no way to send private messages.
30+
31+
* Resigning is implemented, but offering a draw or a rematch is not currently supported.
32+
33+
* Rated games are not implemented.
34+
35+
* Achievements are not implemented.
36+
37+
* There may be bugs in the server protocol, which can lead to disconnects or desyncs. Please report any bugs you come across, providing as much information as possible, and I will do my best to fix them.
38+
39+
There are also some very minor improvements over the original game, but these will most likely not even be noticeable to most players.
40+
41+
## Community
42+
43+
If you’d like to find people to play with, or if you have any questions, [join the FunOrb discord server!][funorb-discord] This is obviously a small hobby project, so I cannot guarantee my time, but I’ll do my best to be helpful.
44+
45+
[screenshot.png]: docs/screenshot.png
46+
47+
[download-java]: https://www.oracle.com/java/technologies/downloads/
48+
[FunOrb]: https://en.wikipedia.org/wiki/FunOrb
49+
[funorb-discord]: https://discord.gg/MGfDrDf
50+
[jagex]: https://www.jagex.com/

docs/cache.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# The resource cache
2+
3+
All game resources are identified by an integer triple consisting of a page id, a group id, and an item id. A *page id* is an integer in the range [0, 254] that identifies a *resource page*, which is a group of broadly related resources. Shattered Plans uses the following resource pages:
4+
5+
| page id | contents |
6+
| ------: | ---------------------------------------------------------------- |
7+
| `0x00` | common string constants |
8+
| `0x01` | common graphics |
9+
| `0x02` | common font data |
10+
| `0x03` | huffman codes |
11+
| `0x04` | Shattered Plans string constants |
12+
| `0x05` | Shattered Plans graphics |
13+
| `0x06` | Shattered Plans JPEG graphics |
14+
| `0x07` | Shattered Plans font data |
15+
| `0x08` | Shattered Plans sound effects 1 |
16+
| `0x09` | Shattered Plans sound effects 2 |
17+
| `0x0A` | Shattered Plans music 1 |
18+
| `0x0B` | Shattered Plans music 2 |
19+
| `0x0C` | Shattered Plans extra strings (tutorial messages and star names) |
20+
| `0x0D` | Quick Chat data |
21+
| `0x0E` | Jagex logo animation data |
22+
23+
On the server, pages are stored in a set of `res_xx_yyyy.dat` files, where `xx` is a (hexadecimal) page id and `yyyy` is a group id. Many pages only have a single group, which is usually (but not always) `0000`, but some pages are split into multiple groups.
24+
25+
Each page has an associated *page index*, which maps string group and item names to integer group and item ids. On disk, page indexes are stored in special `res_FF_00xx.dat` files, where `xx` is the page id. This is why there are only 254 page ids: the special `0xFF` pseudo-page id is reserved for index data.
26+
27+
Finally, the special `res_FF_00FF.dat` file stores the *master index*. The master index stores a table of all the page ids known to the server, and it includes a version number for the page, along with a CRC32 and a Whirlpool hash of the page index file.
28+
29+
## `MasterIndex` format
30+
31+
| type | description |
32+
| ------------------------------- | ------------------------------------------ |
33+
| 5 bytes | unknown |
34+
| `u8` | `pageCount` |
35+
| `MasterIndexEntry[pageCount]` | |
36+
| 1 byte | unknown |
37+
| `u8[64]` | whirlpool hash of the master index entries |
38+
39+
### `MasterIndexEntry` format
40+
41+
| type | description |
42+
| ------------------ | ------------------------------------------ |
43+
| `u32` | CRC32 of the page index data |
44+
| `u32` | page version |
45+
| `u8[64]` | whirlpool hash of the page index data |

docs/screenshot.png

389 KB
Loading

pom.xml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>net.alterorb</groupId>
8+
<artifactId>shatteredplans</artifactId>
9+
<version>0.0.5</version>
10+
11+
<name>Shattered Plans</name>
12+
<url>https://alterorb.net</url>
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<maven.compiler.release>17</maven.compiler.release>
17+
<netty.version>4.1.79.Final</netty.version>
18+
</properties>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.jetbrains</groupId>
23+
<artifactId>annotations</artifactId>
24+
<version>23.0.0</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.xerial</groupId>
28+
<artifactId>sqlite-jdbc</artifactId>
29+
<version>3.36.0.3</version>
30+
</dependency>
31+
<dependency>
32+
<groupId>io.netty</groupId>
33+
<artifactId>netty-transport</artifactId>
34+
<version>${netty.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>io.netty</groupId>
38+
<artifactId>netty-handler</artifactId>
39+
<version>${netty.version}</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>commons-cli</groupId>
43+
<artifactId>commons-cli</artifactId>
44+
<version>1.5.0</version>
45+
</dependency>
46+
</dependencies>
47+
48+
<build>
49+
<plugins>
50+
<plugin>
51+
<groupId>org.apache.maven.plugins</groupId>
52+
<artifactId>maven-compiler-plugin</artifactId>
53+
<version>3.8.1</version>
54+
</plugin>
55+
<plugin>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
<artifactId>maven-jar-plugin</artifactId>
58+
<version>3.1.0</version>
59+
<executions>
60+
<execution>
61+
<id>default-jar</id>
62+
<configuration>
63+
<forceCreation>true</forceCreation>
64+
</configuration>
65+
</execution>
66+
</executions>
67+
</plugin>
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-shade-plugin</artifactId>
71+
<version>3.3.0</version>
72+
<executions>
73+
<execution>
74+
<phase>package</phase>
75+
<goals>
76+
<goal>shade</goal>
77+
</goals>
78+
</execution>
79+
</executions>
80+
<configuration>
81+
<createDependencyReducedPom>false</createDependencyReducedPom>
82+
<filters>
83+
<filter>
84+
<artifact>*:*</artifact>
85+
<excludes>
86+
<exclude>META-INF/**/module-info.class</exclude>
87+
<exclude>META-INF/MANIFEST.MF</exclude>
88+
<exclude>META-INF/**/pom.xml</exclude>
89+
<exclude>META-INF/**/*.properties</exclude>
90+
</excludes>
91+
</filter>
92+
</filters>
93+
<transformers>
94+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
95+
<mainClass>launcher.ShatteredPlansLauncher</mainClass>
96+
</transformer>
97+
</transformers>
98+
</configuration>
99+
</plugin>
100+
<plugin>
101+
<groupId>se.eris</groupId>
102+
<artifactId>notnull-instrumenter-maven-plugin</artifactId>
103+
<version>1.1.1</version>
104+
<executions>
105+
<execution>
106+
<goals>
107+
<goal>instrument</goal>
108+
<goal>tests-instrument</goal>
109+
</goals>
110+
</execution>
111+
</executions>
112+
<dependencies>
113+
<dependency>
114+
<groupId>org.jetbrains</groupId>
115+
<artifactId>annotations</artifactId>
116+
<version>23.0.0</version>
117+
</dependency>
118+
</dependencies>
119+
</plugin>
120+
</plugins>
121+
</build>
122+
</project>

0 commit comments

Comments
 (0)