Dev:How to Develop

From The Mana World
Revision as of 13:04, 15 June 2026 by Jinkers (talk | contribs) (Re-did the whole 'Quick start local server' instructions to reflect current git repositories and available tools based on my recent experience.)

Developing for The Mana World

Quick Start for local server

IMPORTANT NOTE: Server is created and primarily tested in Linux and thus the below instructions are for a Linux deployment. Instructions for a Windows deployment are not yet documented and are probably best managed via Docker image.

1. Install Dependencies

Python

  • Required: 3.6+, installed in $PATH as 'python3'

Compiler

  • g++ 7.5 or higher
  • glibc 2.27 or higher
  • clang++ is not supported, but will likely work

Other

* gh, cmake

Open command line/terminal

~$

2. Clone repository

2.1 Run the following command in a temporary directory git clone https://git.themanaworld.org/tmw/ 2.2 Navigate into the newly created directory


3. Install binaries

3.1 Configuration Run cmake -S . -B build to generate the useable files in a directory called build. By default, the linux install location is $HOME/.local, but can be altered by defining CMAKE_INSTALL_PREFIX on the command line like so: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=<dirname>. 3.2 Build Run cmake --build build to compile the various binaries using the build directory. 3.3 Build Test To run the tests, ensure Google Test is available: git submodule update --init --recursive Then, run the following snippet to configure, build and run the tests, respectfully: cmake -D TMWA_BUILD_TESTS=ON -S . -B build
cmake --build build
cmake --build build -t test
Note that test coverage is not yet complete. 3.4 Install Run cmake --install build to install the compiled binaries using the build directory. If you specified an install directory outside of $HOME, you may need sudo permissions.


4. Get Server data

Note: By default we'll use .local/var/tmwa, but you can choose another directory if you wish. 4.1 Navigate to ~/.local/var/tmwa/ 4.2 Create a clone of the server-data repo git clone git@github.com:themanaworld/tmwa-server-data.git 4.3 Navigate into the newly created tmwa-server-data 4.3 Initialise submodules to get client-data and tools: git submodule update --init --recursive 4.4 Run make to finish setup make

5. Launch server and connect

5.1 Within the serverdata directory, run the run-all script and confirm that all three servers have started correctly (emphasis added)

./run-all
LAN test of LAN IP of the char-server: LAN test (result): LAN source.
read_gm_account: file 'save/gm_account.txt' read (0 GM accounts found).
mmo_auth_init: save/account.txt has 4 accounts (0 GMs)

'''The login-server is ready (Server is listening on the port 6901).'''

LAN test of LAN IP of the map-server: LAN test (result): LAN source.
mmo_char_init: 0 characters read in save/athena.txt.
Id for the next created character: 150000.
'''The char-server is ready (Server is listening on the port 6122).'''

Attempt to connect to login-server...
parse_login: connection #4, packet: 0x2710 (with being read: 6), server: The Mana World.
Connection of the char-server 'The Mana World' accepted.
Connected to login-server (connection #4).
Awaiting maps from map-server.
From login-server: receiving 0 GM accounts.
read db/quest-log.txt done (count=31)
read db/item_db_chest.txt done (count=250)
read db/item_db_foot.txt done (count=19)
read db/item_db_generic.txt done (count=278)
read db/item_db_hand.txt done (count=17)
read db/item_db_head.txt done (count=240)
read db/item_db_leg.txt done (count=52)
read db/item_db_offhand.txt done (count=6)
read db/item_db_trinket.txt done (count=23)
read db/item_db_use.txt done (count=144)
read db/item_db_weapon.txt done (count=56)
read db/mob_db_0_19.txt done
read db/mob_db_20_39.txt done
read db/mob_db_40_59.txt done
read db/mob_db_60_79.txt done
read db/mob_db_80_99.txt done
read db/mob_db_over_100.txt done
Exp for mob 'Freddy' generated: 54289230
read db/mob_db_over_150.txt done
read db/mob_skill_db.txt done
read db/skill_db.txt done
Maps Loaded: 141                                                              
NPCs Loaded: 10172 [Warps:848 Shops:40 Scripts:1074 Mobs:8210]                     
npc: OnInit Event done. (327 npc)
'''The map-server is ready (Server is listening on the port 5122).'''

Attempting to connect to char-server...
Connected to char-server (connection #4).
Receiving information on 0 GM accounts from login-server.
Map-Server 0 connected: 141 maps, from IP 127.0.0.1 port 5122. '''Map-server 0 loading complete'''

5.1.a If the run-all script cannot find the login-server, char-server, and/or map-server command/s, ensure your .local/bin (or wherever you installed said binaries if not following the default) is added to PATH: PATH=$PATH:~/.local/bin/ 5.2 Launch client of your choice, specifying your local client-data directory with the -d parameter. For example: ./ManaPlus-x86_64.AppImage -u -d ~/.local/var/tmwa/tmwa-server-data/client-data 5.3 On the server selection dialogue, click 'Add'

Server Selection with 'Add' hightlighted
Server Selection with 'Add' hightlighted

5.4 Enter '127.0.0.1' (by default) for the server Address, choose a Name for it, and hit 'OK' 5.5 Register a new user and log in

6 (optional) Set your user as a GM

Note: there's probably a more elegant way to do this... this worked for me 6.1 Go into tmwa-server-data/login/save/ 6.2 Open the first account.txt file and copy the ID of your user (should be 2000000 for a first user) 6.3 Open the gm_account.txt and paste your user ID after the commented line as below to set your user to GM level 99

// <account ID> <level>
2000000 99

You should now have a working Local server with GM 99 on your account.

Making Content

Making Map Content

See Mapping Tutorial.

Adding Map Content to Local Server

The server have its own version of the collision data of a map. To update it, on server-data folder, simply run:

make maps

Adding Art Content

Use dyecmd to ensure your artwork is sane (32 bit, PNG, alpha, without any pallete and other data). This command is provided at the ManaPlus package. See the ManaPlus Website for help with XML files. (You may need to look at sitemap)

Adding Music Content

All music must be OGG Vorbis with 44100 Hz resolution.

ADDING QUESTS & SCRIPTS

Edit the txt files at "server-data/npc". Use "make maps" to generate the imports, if you added a new NPC.

Restart map-server when you change any script, and it'll have effect. You can also use "@serverexit 101" if you're using the test server wrappers; Or use "@reloadnpc" command if you changed a single file. Map-Server will report any errors or warnings on your code. You must not introduce any new error or warning to have your new quest/script accepted.

The scripting references can be found at "doc/server/scripts", which should have been included by "init.sh all".

Bit Masking

Bit Masking helps us reduce our variable count while offering a dynamic method of script writing that is versatile and flexible to both linear and non-linear script writing.

Development:Bit_mask_tutorial

Generating client updates

This is NOT necessary if you're using the connect_to_local_server wrapper.

  • Shutdown all your servers.
  • First we are going to check the config files to be sure the paths are correct.
cd /evol-all/tools/update/
ls
Output:

addmods.sh adler32.c commit.txt createnew.sh musiccommit.txt update_music.sh adler32 commit_old.txt create_music.sh files news.txt update.sh End of output

  • The easiest solution is to create a symbolic link to that directory

ln -s <Path to Public Webserver Dir> /evol-all/tools/update/upload/

example: ln -s /var/www/updates /evol-all/tools/update/upload/

  • Save the file and get back in the terminal.

edit /evol-all/server-data/conf/import/login-server.conf

Change update_server to reflect the hostname & location of the server updates.

TMW's test-server example: update_server: "http://updates.themanaworld.org/test-updates/"

  • Now we can make us a update.
cd /evol-all/server-data/
make updates
  • Each time you want to make new updates
make sure you have a new commit then
cd /evol-all/server-data/
make updates


Obsolete (for historical references)

gitlab.com/revolt git.themanaworld.org/evolved

Getting Art Content Into The Game (obsolete)

  • Post [CPT] or [WIP] art on the graphics development forum.
  • Work with the Art Director and collaborators on getting the art consistent.
  • When finished, edit topic as [FND].
  • Art Director approves [FND] art and marks it [RC]. Should the art need animation or special effect, the Art Director requests xml for it. If not, the Art Director commits it and marks as [GIT].
  • XML Team reviews or drafts xml related to the art, then commits the .png and .xml. Topic can be marked as [GIT].
  • Art content affected: client-data/graphics/sprites then related directory for .png and .xml animation addition.
  • Project developer requests database entry reservations from a General Content Team developer.
  • Map entry server data affected: resnametable.txt and .wlk files in the data directory, map content files in the npc directory.
  • Map entry client data affected: .tmx files in the maps directory.
  • Map entry requires the running of the .tmx converter (aka java converter) before commits can be made.
  • Art content server data affected: entry made in the item_db.txt, mob_db.txt or mob_skills_db.txt in the db directory.
  • Art content client data affected: entry added in items.xml, monsters.xml or other identification file.

Handling General Content Team [REQ]s (obsolete)

  • General Content Team member adds a [REQ] topic to the graphics development forum.
  • General Content Team member adds the [REQ] topic as a hyperlink under "Required Art" on the Art in Development page.
  • Art Director attempts to network with other artists to assign the art to an artist.