pigeon.catcher@home

Development of Oasis SA:MP Server #1

Hi there!

I am developing a GTA SA-MP server called Oasis. Despite being an older game from 2004, it still has small community around it. Creating a server for it has been a longtime dream of mine, as I’ve been playing SAMP since childhood. Recently, some members from the open.mp Discord server reached out for help with their server development, and I decided to join in.

The server is entertainment-themed, featuring several game modes. I decided to develop the server in an unconventional way, using the C++ language instead of the internal scripting language Pawn to improve my skills and for more flexibility in development. Since I am honing my skills, I am more motivated to work on this. I am using the open.mp component system for game mode development.

I plan to release a series of posts in the format of a developer diary about the development of this project where I discuss issues I’ve encountered while developing or to share experience I’ve received.

I designed the architecture of the game mode, which includes several components: a core manager, a textdraw manager (to draw custom UI), and a command manager. A lot of attention was given to the command manager (processor). First, I created a command and argument parser using a hashmap and C++ metaprogramming features. Command arguments are converted into the appropriate data types and then passed to command handlers that define the behavior of different commands. When creating a command, I include the command’s help information in the command manager to automatically generate the help dialog. In the future, I plan to implement a role system in the command manager to more conveniently restrict access to commands (for example, for admins). I developed a callback verifier to ensure compliance with a specific callback format using a C++ metaprogramming feature called concepts. This is a new feature with little documentation, so I had to go to Stack Overflow, where some guy helped me solve the problem I had.

The server has localization support, so players speaking languages such as English, Russian and Portuguese can play the server together! I used library called tinygettext. It supports standard GNU Gettext PO translation files, so it’s pretty easy to translate the project in any language. I made the localization system capable of macros expanding to enable support for human-readable colors, for example.

Currently, the server has two modes - freeroam mode and DM mode. In freeroam mode, not much has been implemented yet, but you can spawn a car and just drive around the world. For now, I’m focusing on developing the DM mode, where you can enter one of three server-generated rooms with different weapon sets and maps to compete with friends in shooting. In the future, there will be the ability to create custom rooms with flexible map settings, round time, HP, armor, and weapons.

Oasis DM Rooms

Oasis DM

I am planning to develop other modes, such as PTP (Protect the President, more on it later), Cops & Robbers, Race and Derby.

I have also implemented a minimalist speedometer.

Oasis Speedometer

After the DM mode, I plan to move on to the PTP (Protect the President) mode. This is a popular mode on another server called UIF, where you play in one of three teams (secret service, police, and terrorists). Your goal is to save the president and vice president, or to kill them, depending on which team you play. It’s simple but fun game, and old GTA physics makes it more funny. In Oasis we plan to extend this mode further, making it even more interesting.

To simplify project deployment for developers, I integrated a VSCode feature called Dev Containers for quickly setting up the development environment using Docker. I’ve always been annoyed by the long setup time required to start developing, so I implemented this first. I am also in the process of integrating Nix into the project, but I have encountered cross-compilation issue that I haven’t been able to resolve yet. Nix allows for more reproducible and predictable builds than Docker. The project also includes a CI/CD system, which further speeds up development and testing on the dev server.

Join the development team by contacting me, if you love making games!

Also please join the project’s Discord server.

Stay tuned!