Database Schema & Cheatsheet: Difference between revisions

From JFTSE Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 104: Line 104:
| 15  || 5  || 100  || [NULL]  || 1  || 14  || Dance Time  || [NULL]  || 3  || 0
| 15  || 5  || 100  || [NULL]  || 1  || 14  || Dance Time  || [NULL]  || 3  || 0
|}
|}
=== Map_2_Scenarios ===
Establishes the link between maps (`S_Maps`) and scenarios (`M_Scenarios`). Without defining mappings in this table, the scenario system will not function correctly.
This table uses a many-to-many relationship, ensuring that:
* Each scenario can be assigned to multiple maps.
* Each map can be associated with multiple scenarios.
The relationship is defined as follows:
{| class="wikitable"
! Column !! Description
|-
| `scenario_id` || References `M_Scenarios.id`, linking the scenario.
|-
| `map_id` || References `S_Maps.id`, linking the map.
|}
The mapping structure allows flexibility, ensuring that game modes can be dynamically adjusted based on the assigned scenarios.


=== Guardian_2_Maps ===
=== Guardian_2_Maps ===
Line 143: Line 162:


=== S_Relationships ===
=== S_Relationships ===
Defines additional connections between entities.
Defines connections between various entities within the game, enabling precise control over item drops, multipliers, and other gameplay mechanics. Relationships are established using two key fields:
* Uses:
 
** `id_f` (`id_from`) and `id_t` (`id_to`) to establish relationships.
* '''`id_f`''' (`id_from`): Represents the originating entity of the relationship, such as a Product or Multiplier.
** When linking products to guardians, `productIndex` is used for `id_f`, and `guardian_2_maps.id` for `id_t`.
* '''`id_t`''' (`id_to`): Represents the target entity of the relationship, such as a Guardian, Boss Guardian, or Map.
** The `type` and `role` fields control drop behavior.
 
** Relationships can be toggled for in-game use using the `status` field.
When linking products specifically to guardians, the '''`productIndex`''' from the product definition is used for '''`id_f`''', and the '''`guardian_2_maps.id`''' (not the direct Guardian or Boss Guardian ID) is used for '''`id_t`'''. Each relationship is further described by its type and role, defining how it influences gameplay.
** The `id_f` (`id_from`) corresponds to the first entity in the relationship (e.g., Product, Multiplier).
 
** The `id_t` (`id_to`) corresponds to the target entity (e.g., Guardian, Boss Guardian, Map).
Relationships can be individually toggled on or off via the '''`status`''' field.
** For Guardian/Boss Guardian relationships, `guardian_2_maps.id` is used instead of direct Guardian IDs.
 
** Each relationship type and role determines how the relationship functions in game.
==== Advanced Item Drop Control (Role ID 1) ====
Additionally, enhanced item drop control is available specifically for the '''Item Drop''' role (role ID '''1'''):
 
* Default item weight is '''20.0''' when no specific weight is provided.
* A fixed weight of '''15.0''' is used to determine scenarios where no item is awarded (displayed as an "X").
* Drop exclusivity can be defined specifically for:
** '''`forHardMode`''': Drops exclusive to [[Guardian Hard Mode]].
** '''`forRandomMode`''': Drops exclusive to [[Guardian Random Mode]].
* The '''`levelReq`''' field, currently unused, is reserved for future use to restrict drops based on player levels in a planned progression system.
 
'''Quantity Determination for Item Drops:'''
{| class="wikitable"
! Condition !! Quantity Result
|-
| '''`qty`''' is set, '''`qtyMin`/`qtyMax`''' not set || Exact quantity from '''`qty`'''
|-
| '''`qty`''' not set, '''`qtyMin`/`qtyMax`''' set || Random quantity between '''`qtyMin`''' and '''`qtyMax`'''
|-
| All quantity fields '''NULL''' || Defaults based on item type:
* '''Material''': Min 1 / Max 3
* '''Quick''': Min 5 / Max 100
* '''Parts & Others''': Min 1 / Max 1
|-
| '''`qty`''' and '''`qtyMin`/`qtyMax`''' both set || Random quantity between '''`qtyMin`''' and '''`qtyMax`'''
|}
 


=== S_Relationship_Types ===
=== S_Relationship_Types ===
Defines different types of relationships that can exist in the game currently supported.
Defines supported relationship types, describing what entities can be linked together:


{| class="wikitable"
{| class="wikitable"
Line 178: Line 222:


=== S_Relationship_Roles ===
=== S_Relationship_Roles ===
Defines the role of each relationship in gameplay currently supported.
Defines the supported roles that relationships can take, describing their in game functionality:


{| class="wikitable"
{| class="wikitable"
Line 203: Line 247:
|}
|}


=== Notes & Additional Information ===
* The database schema is subject to updates as new mechanics and features are introduced.
* Some tables may have additional columns not explicitly documented if they are not required for core functionality.
* Unused fields, such as `levelReq` in `S_Relationships`, are placeholders for future game progression updates.


[[Category:Server]]
[[Category:Server]]

Latest revision as of 20:30, 24 February 2025

Database Schema & Cheatsheet

This page provides an overview of the database structure used in Fantasy Tennis, showing the key tables, their columns, and relationships. The schema diagram below visually represents how different entities connect within the system.

Schema

Database Schema
Database Schema

Tables of Interest

Tables might worth looking into as they are important on setting up your own Fantasy Tennis Server Configuration inside the Database.

Config

The `config` table is used to store various server wide settings that control gameplay mechanics, security settings, logging behavior, and feature toggles. Each configuration entry consists of:

  • name – The unique identifier of the config setting.
  • description – A short explanation of what the setting controls (may be null).
  • value – The actual configured value.
  • type – The data type of the value (e.g., boolean, int, double, string).

Administrators can modify these values to tweak server behavior, enable or disable features, and adjust game mechanics dynamically.

Below is a list of currently supported configuration values along with their default settings.

Name Type Default Value Description
anticheat.enabled boolean false Enables or disables the built-in anticheat (JFTSE exclusive).
anticheat.port int 1337 Port used for the anticheat system (JFTSE exclusive).
dev.packets.handle boolean false Handles developer/debug packets.
packets.id.translate.enabled boolean true Enables translation of packet IDs.
logging.packets.all.enabled boolean true Enables logging of all network packets.
network.encryption.enabled boolean false Enables network encryption for secure communication.
password.encryption.enabled boolean false Encrypts player passwords upon login.
player.level.max int 60 Maximum player level (JFTSE exclusive, levels above 65 require client modifications).
command.room.mode.change.player.level int 60 Minimum required level to change room mode via command.
game.bonus.global.gold int 5 Global gold bonus multiplier (Single Player).
game.bonus.global.exp int 5 Global experience bonus multiplier (Single Player).
game.bonus.wongame.exp double 0.2 Experience bonus for winning a game (Basic & Battle).
game.bonus.wongame.gold double 0.2 Gold bonus for winning a game (Basic & Battle).
logging.packets.console-output.enabled boolean true Enables logging of packets in console output.
matchplay.guardian.hard.won.ranking-point.multiplier double 1.0 Multiplier applied to ranking points in Guardian Hard mode.
game.map.allow.snowmoon boolean false Allows Snow Moon map in Guardian mode.

Notes:

  • Config values marked as JFTSE exclusive are unique to this server implementation and may not be available in other Fantasy Tennis servers.
  • Those values represent the development chosen defaults and does not represent values set within the JFTSE hosted server.

M_Scenarios

Each game mode has multiple scenarios. A scenario marked as "default" is always selected first. If multiple scenarios are active (`status = 1`), the default scenario is prioritized. If multiple active scenarios are marked as default, the first one retrieved from the database is chosen.

Scenario types:

  • Guardian Normal (non Boss Battle) → `GUARDIAN`
  • Boss Guardian → `BOSS_BATTLE`
  • Boss Guardian v2 (new mechanics defined through scripting) → `BOSS_BATTLE_V2`

S_Maps

Defines all available maps and references client map id's.

id bossPlayTime breathTime description isBossStage map name playTime triggerBossTime useBreathTime
1 [NULL] 100 [NULL] 0 0 Rubycrab [NULL] [NULL] 0
2 [NULL] 100 [NULL] 0 1 Emerald Beach [NULL] [NULL] 0
3 10 100 [NULL] 0 2 Twinkle Town 15 10 0
4 [NULL] 100 [NULL] 0 3 The Aeolos [NULL] [NULL] 0
5 [NULL] 100 [NULL] 0 5 Life Wood [NULL] [NULL] 0
6 5 100 [NULL] 1 4 Snow Moon [NULL] 8 0
7 5 100 [NULL] 1 6 Arena [NULL] 3 0
8 5 100 [NULL] 1 7 Monslava [NULL] 3 0
9 5 100 [NULL] 1 8 Monslava Blue [NULL] 3 0
10 5 100 [NULL] 1 9 Devaberg [NULL] 3 0
11 5 100 [NULL] 1 10 Atlantis 8 4 0
12 5 100 [NULL] 1 11 Temple [NULL] 3 0
13 [NULL] 100 [NULL] 0 12 Room of Shadow [NULL] [NULL] 0
14 5 100 [NULL] 1 13 Machine City [NULL] 3 0
15 5 100 [NULL] 1 14 Dance Time [NULL] 3 0

Map_2_Scenarios

Establishes the link between maps (`S_Maps`) and scenarios (`M_Scenarios`). Without defining mappings in this table, the scenario system will not function correctly.

This table uses a many-to-many relationship, ensuring that:

  • Each scenario can be assigned to multiple maps.
  • Each map can be associated with multiple scenarios.

The relationship is defined as follows:

Column Description
`scenario_id` References `M_Scenarios.id`, linking the scenario.
`map_id` References `S_Maps.id`, linking the map.

The mapping structure allows flexibility, ensuring that game modes can be dynamically adjusted based on the assigned scenarios.

Guardian_2_Maps

Connects a guardian (or boss guardian) to a map with a specific scenario. Each scenario has a unique set of guardians available for matches.

Skill_2_Guardians

Links skills to guardians. The connection is made through `Guardian_2_Maps`, associating skills with a guardian in a specific scenario and map. If no `guardian_2_maps` entry is set, it defaults to `btItem`, which is predefined for guardian types. `btItem` is shared among similar guardian types (e.g., Dokaro and related "ro" types).

S_Guardian_Multipliers

Defines multipliers for Guardian Mode, applicable for gold or experience.

These multipliers can be linked in the `S_Relationships` table.

id description multiplier
1 default exp multiplier 1.0
2 default gold multiplier 1.0
3 exp x3 3.0
4 exp x4 4.0
5 exp x5 5.0
6 exp x6 6.0
7 exp x7 7.0
8 gold x7 7.0
9 gold x5 5.0
10 gold x3 3.5
11 exp x3 3.5

S_Relationships

Defines connections between various entities within the game, enabling precise control over item drops, multipliers, and other gameplay mechanics. Relationships are established using two key fields:

  • `id_f` (`id_from`): Represents the originating entity of the relationship, such as a Product or Multiplier.
  • `id_t` (`id_to`): Represents the target entity of the relationship, such as a Guardian, Boss Guardian, or Map.

When linking products specifically to guardians, the `productIndex` from the product definition is used for `id_f`, and the `guardian_2_maps.id` (not the direct Guardian or Boss Guardian ID) is used for `id_t`. Each relationship is further described by its type and role, defining how it influences gameplay.

Relationships can be individually toggled on or off via the `status` field.

Advanced Item Drop Control (Role ID 1)

Additionally, enhanced item drop control is available specifically for the Item Drop role (role ID 1):

  • Default item weight is 20.0 when no specific weight is provided.
  • A fixed weight of 15.0 is used to determine scenarios where no item is awarded (displayed as an "X").
  • Drop exclusivity can be defined specifically for:
  • The `levelReq` field, currently unused, is reserved for future use to restrict drops based on player levels in a planned progression system.

Quantity Determination for Item Drops:

Condition Quantity Result
`qty` is set, `qtyMin`/`qtyMax` not set Exact quantity from `qty`
`qty` not set, `qtyMin`/`qtyMax` set Random quantity between `qtyMin` and `qtyMax`
All quantity fields NULL Defaults based on item type:
  • Material: Min 1 / Max 3
  • Quick: Min 5 / Max 100
  • Parts & Others: Min 1 / Max 1
`qty` and `qtyMin`/`qtyMax` both set Random quantity between `qtyMin` and `qtyMax`


S_Relationship_Types

Defines supported relationship types, describing what entities can be linked together:

id Description
1 Product to Guardian
2 Product to Boss Guardian
3 Product to Map
4 Multiplier to Guardian
5 Multiplier to Boss Guardian
6 Multiplier to Map
7 Product to Map (Guardian Mode)
8 Product to Sell Price

S_Relationship_Roles

Defines the supported roles that relationships can take, describing their in game functionality:

id Description
1 Item Drop
2 Exp Multiplier
3 Gold Multiplier
4 Item Sell Price

K_Status

Defines the different status types used in game.

id Description
1 Active
2 Inactive

Notes & Additional Information

  • The database schema is subject to updates as new mechanics and features are introduced.
  • Some tables may have additional columns not explicitly documented if they are not required for core functionality.
  • Unused fields, such as `levelReq` in `S_Relationships`, are placeholders for future game progression updates.