Dynamic loading

From PSwiki
Jump to navigation Jump to search

(Go back to the main GSoC 2015 page)


mechanisms.png

Skills needed

Our server and client are all coded in C++ and the database is MySql. The dynamic reload will have to be implemented server side, by studying the database schema and the current caching mechanisms. Good knowledge of C++ is needed for this project along with mysql knowledge.

Overview

One of the most powerful elements of a MMO server is to allow custom and scriptable rules. This includes behaviours for NPCs, combat rules, experience, stats and skills progression, etc.. All are maintained in the database and then loaded at runtime in memory. Having hundreds of users connected 24/7 and a persistent world, requires the server to be always available. At the same time we want to allow administrators to add or change the scripts to improve and enhance the server while the users are connected. For this we already implemented the dynamic reloading of some of the most critical aspects, for example the description of the in game items, and the stats of items. This project consists in allowing the majority of the scripts and other configuration information to be reloaded at runtime without the need to restart the server. The main items include: special locations in the world, character creation data, quests information, etc...

Details

The first step will be to analyze the database schema and review the list of relevant tables which should be reloadable with a /reload command.

Here is a first list to give an idea of what's needed:

  • accounts - we have a sort of cache at the moment used to speed up loading/unloading of players stats when they connect/disconnect. Will be very good to have an explicit command to flush this cache given a player ID.
  • action_location - very important to be able to reload this info. we should have a command to reload by sector and everything.
    • We can reload all this by the gm console, but we cannot select the sector, so all is reloaded at the same time, putting some stress on the server. Will be better to select the current sector or all sectors separately.
  • armor_vs_weapons - This table contains the rules related to the damages inflicted by a specific weapon against a specific armor, it's quite important to be able to reload this info
  • character_creation and char_create* - all these tables are very important, and should be reloadable with the live server to allow changes to the background, history, events of the character creation.
  • character_skills - this should be already complete, but need to be tested more. ( /killnpc reload )
  • character_traits - same as previous
  • characters - same as previous
  • command* - not high priority, but can be nice to have in the long run
  • hunt_locations - this table keeps track of the areas where new items are spawned, it's high priority
  • item_animations - medium priority
  • item_categories - low priority as it changes very rarely
  • item_instances - important, will be good to be able to reload an item specifying its ID
  • item_stats - this should be already complete, but need to be tested more. ( /reload item <ID> )
  • loot_* - keeps the information of which items are found on each mob, high priority
  • merchant_item_categories related to character reload, should be tested on complex cases
  • movement - to be reviewed with the team and decide if we want it
  • natural_resources - this keep tracks of all the natural resources spawning in game, it's high priority
  • npc_disallowed_words - used to maintain quests, medium priority
  • npc_* (excluding the above 2 tables) - all related to dialogues, ka or specific knowlege, very important and some are linked to character reload, others not and should be separated
  • progression_events - very needed as most of the rules are defined here
  • quest_* - very important, reload needed, at the moment it's partially working, only on simple cases. Complex quests crash the server
  • race_info - maintains information of base stats/skills of each race, their 3d meshes, ... medium priority
  • sc_npc_definitions - part of character reload for NPCs
  • sc_waypoint* - NPC movements, high priority
  • sectors - very low priority, changes rarely
  • security_levels - low priority, changes rarely
  • skills - very low priority, changes rarely
  • spell_glyphs - keep combinations of glyphs to create new spells. quite important, needed
  • spells - keeps description and definition of spells. quite important, needed
  • tips - low priority, but still useful
  • trade* - keeps all the transformations and combinations of crafting. It's extremely important to enable faster implementation of crafting
  • trainer_skills - needed, part of character reload for NPCs
  • traits - needed, used for defining which traits are available
  • tribes - needed, defines base base of a tribe, warning can have dependencies with npcclient

Some UI elements can be required for some complex reloading features, but in general most of the reloading will be done with command line from the client console.