Skip to content

Commit

Permalink
feat: June 10th Alpha Updates (#564)
Browse files Browse the repository at this point in the history
This release sees a simplified setup and an updated readme. I hope that
helps get more people into running things themselves!

Some zone issues should be mitigated - the protocol and collection
rewrite is still needed and this feature shouldn't be considered
complete until then.

## Content

### Features

* #556
* #557

### Fixes

* #547
* #548
* #554
* #559

## Engine

### Features

* More authentic engine commands
* New repathing logic - runs on last waypoint only
* `stopaction` on `p_op*` implicitly, `busy2` command
* Secondary pointer support for `queue`, `timer`, `walktrigger`
* `<p,mesanim>` support
* New unpacking code, reorganized tool folder

### Fixes

* #546
* #549
* #550
* #551
* #553
* #555
* #558
* #560
* #561
* #562
* IfPlayerDesign decoder preventing character customization
  • Loading branch information
Pazaz authored Jun 10, 2024
2 parents bf153cb + 4280ab3 commit 04cfa70
Show file tree
Hide file tree
Showing 617 changed files with 13,338 additions and 11,553 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Server.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/devcontainers/typescript-node:0-18
FROM mcr.microsoft.com/devcontainers/typescript-node:22

ARG USERNAME=vscode
ARG USER_UID=2000
Expand All @@ -12,4 +12,4 @@ WORKDIR /app
RUN apt-get update && apt-get install -y openjdk-17-jre-headless

RUN chown vscode:vscode /app
USER vscode
USER vscode
39 changes: 23 additions & 16 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,38 +1,45 @@
## Server settings
# This is a comment!
# Uncomment lines if you want to change them from their defaults

PUBLIC_IP=localhost
WEB_PORT=80
GAME_PORT=43594
# PUBLIC_IP=localhost
# WEB_PORT=80
# GAME_PORT=43594

# LOGIN_HOST=127.0.0.1
# LOGIN_HOST=localhost
# LOGIN_PORT=43500
# LOGIN_KEY=SuperSecretKey

# FRIEND_HOST=127.0.0.1
# FRIEND_HOST=localhost
# FRIEND_PORT=43501
# FRIEND_KEY=SuperSecretKey2

# WORLD_ID=0
# LOCAL_DEV=true
# MEMBERS_WORLD=true
# XP_MULTIPLIER=1
# SHUTDOWN_TIMER=50

# HTTPS_ENABLED=false
# ADDRESS_SHOWPORT=true
# CLIRUNNER=false
# CI_MODE=false
# SKIP_CORS=false

# DATABASE_URL=mysql://root:password@localhost:3306/lostcity
# DB_HOST=localhost
# DB_NAME=lostcity
# DB_USER=root
# DB_PASS=password

# website management
# ADMIN_IP="127.0.0.1"
# ADMIN_IP=localhost

# SKIP_CRC=false
# JAVA_PATH="C:\Program Files\Eclipse Adoptium\jdk-17.0.11.9-hotspot\bin\java"
# DATA_SRC_DIR=data/src
# VALIDATE_PACK=true
# STRICT_FOLDERS=true
# BUILD_ON_STARTUP=true
# UPDATE_ON_STARTUP=true

# JMODS=player1,player2,player3

## World settings

WORLD_ID=0
MEMBERS_WORLD=true
XP_MULTIPLIER=1
LOCAL_DEV=true
# SHUTDOWN_TIMER=50
# CLIENT_PATHFINDER=true
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:18
FROM node:22

WORKDIR /app

RUN apt-get update && apt-get install -y openjdk-17-jre
RUN apt-get update && apt-get install -y openjdk-17-jre-headless

COPY package*.json ./

Expand Down
69 changes: 41 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,69 @@
# 2004scape Server
<div align="center">

[Website](https://2004scape.org) | [Discord](https://discord.gg/hN3tHUmZEN) | [Rune-Server](https://www.rune-server.ee/runescape-development/rs2-server/projects/701698-lost-city-225-emulation.html)
<h1>2004Scape Server - May 18, 2004</h1>

**disclaimer: All server code has been written from scratch for this project, Jagex has never had any source code leaks.**
[Website](https://2004scape.org) | [Discord](https://discord.2004scape.org) | [Rune-Server](https://www.rune-server.ee/runescape-development/rs2-server/projects/701698-lost-city-225-emulation.html) | [Getting Started](#getting-started)

**status: in-development, not ready for players**. Contributors are welcome to help out.
**status: alpha, in-development**
Contributors are welcome to help out!

---
**All server code has been written from scratch for this project.**
**Jagex has never had any source code leaks.**
</div>

This project aims to replicate an authentic RuneScape experience from May 2004. It should be considered an emulator first and foremost, as replicating behaviors by emulating the underlying systems is the biggest focus. The config system and scripting system is as close to authentic as we understand it, and is continually refined as we learn more info.
## Mission Statement

---
> [!IMPORTANT]
> Our goal is to authentically, accurately, and precisely emulate old RuneScape to our best knowledge. There are countless hours behind adding and quadruple-checking every bit of logic that goes into this.
*To Jagex*: This project comes out of love for the game. As MMOs age, their previous versions are lost to history. An experience becomes ephemeral and time-limited. We're aware that you have no backups for this era and so we're putting in the effort to recreate what we can.
It won't ever profit off your trademarks. Without this project, this version of the game only lives in our memories. Screenshots and videos are scarce, and the original data is lost to time. This is no easy task.
Caches and clients are sourced from old PCs that played the game at a given time. That gives us the original maps, models, and NPC / Item / Scenery configurations. Then we can unpack that data into a readable and workable format based on what we've been able to observe Jagex doing, as outsiders.

*To players*: So happy to have you interested! RuneScape 2 launched on March 29, 2004. We have no copies of that revision, but we do have some client caches from May 2004. This project emulates *May 18, 2004*, which was live until June 1 of that year. It has Treasure Trails and Big Chompy Bird Hunting. The next revision after this added Elemental Workshop I.
The server side (engine, quests, combat, skills) was not preserved and that's what we're recreating here. The engine takes a lot of effort and is not perfected, but you should consider it our best interpretation of behaviors we can measure.

We try to take very little liberties when it comes to guessing, our sources are era-videos, era-screenshots, and RS3/OSRS/RSC.

Our content language of choice is a recreation of RuneScript: this gives us the same limitations, and the opportunity to recreate bugs out of the same circumstances. We don't simply see a bug and add it as an edge case, we have the script and engine work together to reproduce the exact reasons behind the bug.

## Getting Started

1. Download this repo to your computer
2. Install our list of [dependencies](#environment-dependencies)
3. Open the folder you downloaded in a command prompt
4. Run `npm install`
5. Run `npm start`
4. Run `npm start`

Now open [http://localhost](http://localhost) in your browser and play!

Advanced users: You can customize your setup by copying the `.env.example` file to `.env`. This is not necessary for a simple localhost setup.
> [!IMPORTANT]
> If you run into issues please see our [common issues](#common-issues) or hop in Discord.
### Using the setup script
> [!TIP]
> Windows users: We have a script called `quickstart.bat` that will launch the server for you, combining steps 3 and 4 above.
You can instead run `setup.sh` to get your repository ready for running the server. Manually download RuneScriptCompiler.jar, from [environment dependencies](#environment-dependencies), and then run `setup.sh` to run the above commands.
> [!TIP]
> Advanced users: You can customize your setup by copying the `.env.example` file to `.env`. This is not necessary for a simple localhost setup.
### Using the DevContainer

An alternative way to set up your environment is to utilize a [Development Container](https://containers.dev/). In order to start the Dev Container, you'll need to install [Docker](https://www.docker.com/products/docker-desktop/). If you're running Windows, I suggest getting Docker Desktop. Linux users can use whatever means they prefer to install Docker. Once docker is installed, install the VSCode extension [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).

Make sure to still grab the RuneScriptCompiler.jar from the [environment dependencies](#environment-dependencies) as that can't be automatically installed yet.

Once that is done follow these steps:
Follow these steps:

1. Make sure Docker is running
2. Open VSCode and run `Dev Containers: Clone Repository in Container Volume`
3. Select `GitHub` as the remote Source
4. Find your fork of this repo
5. Select the branch you want to work from
6. At any point once the container has started and you can see the files in VSCode, drag the RuneScriptCompiler.jar into the root of your repo
7. Once the startup script is finished, run `npm start`
6. Once the startup script is finished, run `npm start`

Once the container starts, it automatically starts running `setup.sh`. You can cancel this and do the [Getting Started](#getting-started) steps manually as well. If you let the startup script finish before moving RuneScriptCompiler.jar into the root of your repo and the script fails, you just need to run `npm run server:build` again before starting your server.

Another option for building your Dev Container is to instead clone your repository onto your local machine first and then run `Dev Containers: Open Folder in Container` and work that way by mounting the local files into your container. This way, you can have RuneScriptCompiler.jar in your workspace from the get-go. **Note: The npm scripts are much slower when the container is running this way.**
Once the container starts, it automatically starts running `setup.sh`. You can cancel this and do the [Getting Started](#getting-started) steps manually as well.

## Environment Dependencies

- [NodeJS 20](https://nodejs.org/) (current LTS)
- [NodeJS 20.6+](https://nodejs.org/) (22 is fine as well)
- [Java 17+](https://adoptium.net/)
- If you're using VS Code (recommended), [we have an extension to install here.](https://marketplace.visualstudio.com/items?itemName=2004scape.runescriptlanguage)

Java is required for our RuneScript compiler.

RuneScriptCompiler.jar is not yet open-source, sorry for any inconvenience.
> [!TIP]
> If you're using VS Code (recommended), [we have an extension to install on the marketplace.](https://marketplace.visualstudio.com/items?itemName=2004scape.runescriptlanguage)
## Development Workflow

Expand Down Expand Up @@ -90,6 +92,17 @@ It's recommended to install a suitable plugin/extension for your IDE, to show yo

Configuration for the linter can be found in `.eslintrc.cjs`.

## Common Issues

* `bad option: --import`
You are using an older version of Node (maybe 18). We are targeting 20.6+

* `'"java"' is not recognized as an internal or external command`
You do not have Java 17 installed.

* `has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0`
You are likely using Java 8 or Java 11. You can either reinstall Java 17 or become an advanced user, and set `JAVA_PATH=path-to-java.exe` in your .env file.

## Credits

Thanks to all the current contributors, every PR you submit gets us closer and closer to feature completeness.
Expand Down
2 changes: 1 addition & 1 deletion data/src/pack/inv.pack
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
139=generalshop14
140=inv_140
141=reward
142=duel_arena_arrows
142=stakeinv
143=shrimp_and_parrot
144=crafting_rings
145=crafting_necklaces
Expand Down
34 changes: 17 additions & 17 deletions data/src/pack/npc.pack
Original file line number Diff line number Diff line change
Expand Up @@ -251,25 +251,25 @@
250=lady_of_the_lake
251=king_arthur
252=beggar
253=npc_253
254=npc_254
255=npc_255
256=npc_256
257=npc_257
253=khazard_guard_cells
254=khazard_guard_drunk
255=khazard_guard_chest
256=khazard_guard_standard
257=khazard_guard_cutscene
258=general_khazard
259=npc_259
260=npc_260
261=npc_261
262=npc_262
263=npc_263
264=npc_264
265=npc_265
266=npc_266
267=npc_267
268=npc_268
259=khazard_barman
260=kelvin
261=joe_fightslave
262=fightslave
263=hengrad
264=lady_servil
265=jeremy_servil
266=jeremy_servil_arena
267=justin_servil
268=local
269=bouncer
270=npc_270
271=npc_271
270=khazard_ogre
271=khazard_scorpion
272=npc_272
273=npc_273
274=npc_274
Expand Down
8 changes: 4 additions & 4 deletions data/src/pack/obj.pack
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
71=cert_obj_70
72=obj_72
73=cert_obj_72
74=obj_74
75=obj_75
76=obj_76
77=obj_77
74=khazard_helmet
75=khazard_armour
76=khazard_cell_keys
77=khali_brew
78=obj_78
79=ice_arrow_4
80=ice_arrow_3
Expand Down
5 changes: 5 additions & 0 deletions data/src/scripts/_test/scripts/cheats/cheat_clearinv.rs2
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// official name
[debugproc,clearinv](inv $inv)
if ($inv = null) {
$inv = inv;
Expand All @@ -6,6 +7,8 @@ if ($inv = null) {
if ($inv = inv) {
// inv is unprotected and we cannot check in content if something is (currently)
inv_clear($inv);

mes("Inventory wiped.");
} else {
if_close;
if (p_finduid(uid) = true) {
Expand All @@ -14,6 +17,8 @@ if ($inv = inv) {
if ($inv = worn) {
buildappearance(worn);
}

mes("Inventory wiped.");
} else {
@please_finish;
}
Expand Down
19 changes: 0 additions & 19 deletions data/src/scripts/_test/scripts/cheats/cheat_give.rs2

This file was deleted.

5 changes: 2 additions & 3 deletions data/src/scripts/_test/scripts/cheats/cheat_help.rs2
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ if (p_finduid(uid) = true) {
~mesbox("@blu@Client commands|@whi@::debug@bla@ - Toggles the debug overlay|@whi@::chat@bla@ - Switches the chat font-era|@whi@::perf@bla@ - Show FPS");

// Content
~mesbox("@blu@Content testing|@whi@::reset@bla@ - Reset your progress|@whi@::minlevel@bla@ - Set all your stats to level 1|@whi@::maxlevel@bla@ - Set all your stats to level 99|@whi@::setlevel@bla@ - Set a skill to a specific level");
~mesbox("@blu@Content testing|@whi@::reset@bla@ - Reset your progress|@whi@::minlevel@bla@ - Set all your stats to level 1|@whi@::maxme@bla@ - Set all your stats to level 99|@whi@::setstat@bla@ - Set a stat to a specific level");
~mesbox("@blu@Content testing|@whi@::addxp@bla@ - Add XP to a skill|@whi@::setxp@bla@ - Set your XP in a skill");
~mesbox("@blu@Content testing|@whi@::bank@bla@ - Open your bank anywhere|@whi@::bank_preset@bla@ - Fill your bank with common items|@whi@::clearinv@bla@ - Clear a named inventory|@whi@::give@bla@ - Give yourself any item");
~mesbox("@blu@Content testing|@whi@::1hp@bla@ - Set your health to 1|@whi@::foodbank@bla@ - Fill your bank with food|@whi@::energy@bla@ - Restore your run energy");
~mesbox("@blu@Content testing|@whi@::dragslaystart@bla@ - Start testing dragon slayer|@whi@::dragslaybank@bla@ - Fill your bank with necessary items for dragon slayer");
~mesbox("@blu@Content testing|@whi@::fmtest@bla@ - Give yourself items to test firemaking|@whi@::fmbank@bla@ - Fill your bank with firemaking items");
~mesbox("@blu@Content testing|@whi@::fishtest@bla@ - Give yourself items to test fishing");
~mesbox("@blu@Content testing|@whi@::giverunes@bla@ - Give yourself items to test magic|@whi@::magicbank@bla@ - Fill your bank with magic items");
~mesbox("@blu@Content testing|@whi@::tele@bla@ - Teleport to specific coordinates|@whi@::jtele@bla@ - Teleport to specific coordinates in Jagex's format");
~mesbox("@blu@Content testing|@whi@::north@bla@/@whi@::east@bla@/@whi@::south@bla@/@whi@::west@bla@ - Teleport 1 tile in a direction|@whi@::up@bla@/@whi@::down@bla@ - Teleport 1 tile up or down|@whi@::telelevel@bla@ - Teleport to a specific level at your current position");
~mesbox("@blu@Content testing|@whi@::tele@bla@ - Teleport to specific coordinates|@whi@::tele up@bla@ - Teleport up a level|@whi@::tele down@bla@ - Teleport down a level|@whi@::north@bla@/@whi@::east@bla@/@whi@::south@bla@/@whi@::west@bla@ - Teleport 1 tile in a direction");
~mesbox("@blu@Content testing|@whi@::home@bla@ - Teleport to Lumbridge|@whi@::varrock@bla@ - Teleport to Varrock|@whi@::falador@bla@ - Teleport to Falador|@whi@::draynor@bla@ - Teleport to Draynor Village");
~mesbox("@blu@Content testing|@whi@::portsarim@bla@ - Teleport to Port Sarim|@whi@::rimmington@bla@ - Teleport to Rimmington|@whi@::alkharid@bla@ - Teleport to Al Kharid|@whi@::seers@bla@ - Teleport to Seers Village");
~mesbox("@blu@Content testing|@whi@::giants@bla@ - Teleport to Giants in Edgeville Dungeon");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[debugproc,maxlevel]
// official name
[debugproc,maxme]
if_close;
if (p_finduid(uid) = true) {
def_int $max_xp = 130344310;
Expand All @@ -21,6 +22,7 @@ if (p_finduid(uid) = true) {
givexp(agility, $max_xp);
givexp(thieving, $max_xp);
givexp(runecraft, $max_xp);
mes("You're maxed.");
} else {
@please_finish;
}
10 changes: 10 additions & 0 deletions data/src/scripts/_test/scripts/cheats/cheat_pvp.rs2
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@ if (npc_finduid(%aggressive_npc) = true) {
if (.finduid(%npc_aggressive_player) = true) {
mes("Aggressive NPC's target: <.displayname>");
}
}

[debugproc,pvp]
if (p_finduid(uid) = true) {
p_telejump(0_52_60_37_37);
}

[debugproc,duel]
if (p_finduid(uid) = true) {
p_telejump(0_52_51_42_4);
}
Loading

0 comments on commit 04cfa70

Please sign in to comment.