Files
DarkflameServer/resources/worldconfig.ini
Aaron Kimbrell 9bf2ff4d44 feat: Raw reading on zone load and scene tools (#1910)
* feat: raw terrain parsing for scene data

Replace old dNavigation/dTerrain raw parser with new Raw module in
dZoneManager. Parse heightmaps, color maps, and scene maps from .raw
files to determine which scene a position belongs to. Build scene
adjacency graph from terrain data and scene transitions.

Adds NiColor type, SceneColor lookup table, eSceneType enum, terrain
mesh generation with OBJ export, and debug slash commands for scene
visualization.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: deduplicate terrain grid lookup logic, remove unnecessary cast

Add IsValidForSceneLookup(), GetSceneIDAtGrid(), and GridToWorldPos()
to Raw::Chunk. Use them in GenerateTerrainMesh, GetSceneIDFromPosition,
SpawnScenePoints, and SpawnAllScenePoints instead of duplicated inline
math. Remove unnecessary static_cast in LoadSceneTransitionInfo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: add version < 32 support to raw terrain parser

The parser was only correct for v32 files. For v<32:
- colorMapResolution is width-1, not width
- Color map reads width*width*4 bytes (BGRA per-pixel), not colorMapRes^2*4
- No DDS lightmap
- No texture settings byte or blend DDS
- Scene map: v31 reads (colorMapRes+1)^2 cells with border skip,
  v<31 skips 1 byte
- No mesh data

Verified against all 309 .raw files across multiple client versions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: log and reject legacy raw terrain format, clean up ReadRaw API

Log a clear message and throw if the zone uses a legacy raw format
(LUZ version < 30) since no known maps use it. Remove ReadLegacyRaw
and the mapVersion parameter from ReadRaw.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: revert v33 scene field renames to unknown1/unknown2

These fields are skipped by the client in every known build (ptr += 12
and ptr += 4). No client ever reads them into a struct. Keep the
original unknown1/unknown2 names from main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: load the zone without scene lookups when its raw terrain is missing or unreadable

Log at debug when it parses; build the terrain mesh only for the OBJ export; read the zone name and description only for version 31 and later, as the client does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: look up the scene at a position as the client does, in constant time

Chunk bounds span (width - 1) * scale; the nearest scene map cell is used and the far edge is kept one cell inside. Chunks are indexed by grid cell when they form a grid. Skipping reads instead of seeking, so a cut-off file can't seek past the end. Terrain mesh indices follow the vertex order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: scene point commands take a step and use brick LOTs from the BrickIDTable

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: rename NiColor::ToXYZ to Luminance

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: raw terrain reading, scene lookup, scene graph and scene commands

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: close the OBJ file before removing it so the test passes on Windows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep the zone boundary lines and read the luz scene count as the client does

Each boundary line's destination is read as a map ID and an instance ID into a LWOZONEID. The scene count is a byte before version 37 and a u32 from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: name the fourth flair colour byte padding

The client never sets or reads it, so it holds leftover memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep the scene map of version 31 and older raws

These files have a (resolution + 1)^2 scene map, kept in sceneMapLegacy. Version 31 uses its first resolution rows and columns; older versions are all scene 0, as in the client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: simplify the raw heightmap size check

The dimensions are capped at kMaxResolution, so the product can't overflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: remove the scene point spawn commands and send /getadjacentscenes as one message

The spawn commands were only for testing. /getscene and /getadjacentscenes stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-27 09:22:28 -05:00

112 lines
4.6 KiB
INI

# URL to the code repository for the hosted server
# If you fork this repository and/or make changes to the code, reflect that here to comply with AGPLv3
source=https://github.com/DarkflameUniverse/DarkflameServer
# 0 or 1, should disable chat
disable_chat=0
# Spatial partitioning settings
# 205/12 is 1-1 with LU's terrain. Make sure to keep this ratio correct!
# so 102/24 would be half the size, which nets better phys times.
# 154/18 is a good middle road
phys_spatial_partitioning=1
phys_sp_tilesize=102
phys_sp_tilecount=24
# Gameplay settings
# Extra feature for DLU, gives a character 2 extra backpack spaces when leveling up
disable_extra_backpack=0
# Extra feature for DLU, shows vanity in the world like extra NPCs and plaques commemorating the project and its creators
disable_vanity=0
# Extra feature for DLU, enables you to race solo
solo_racing=0
# Disables the anti-speedhack system. If you get kicked randomly you might want to disable this, as it might just be lag
disable_anti_speedhack=0
# 0 or 1, check server fdb (res/CDServer.fdb) against clients
check_fdb=0
# 0 or 1, DLU leaderboards will rate Avant Gardens Survival based on score by default.
# This option should be set to 1 if you would like it to reflect the game when it was live (scoring based on time).
classic_survival_scoring=0
# If this value is 1, pets will consume imagination as they did in live. if 0 they will not consume imagination at all.
pets_take_imagination=1
# Disables loot drops
disable_drops=0
# Hardcore mode settings
hardcore_mode=0
# Drop your entire inventory on death + coins (drops on the ground, so can be retrieved)
hardcore_dropinventory_on_death=1
# Enemies drop their max hp * this value. 0 will effectively disable it.
hardcore_uscore_enemies_multiplier=2
# Percentage of u-score to lose on player death
hardcore_lose_uscore_on_death_percent=10
# Allow civilian players the ability to turn the nameplate above their head off. Must be exactly 1 to be enabled for civilians.
allow_nameplate_off=0
# Turn logging of IP addresses for anti-cheat reporting on (1) or off(0)
log_ip_addresses_for_anti_cheat=1
# These are the 5 items items that are shown in the "Help" menu in-game along with their coresponding descriptions below.
help_0_summary=Got an issue?
help_1_summary=Stuck loading?
help_2_summary=Missing features?
help_3_summary=Get smashed?
help_4_summary=Want to contribute?
help_0_description=Go to the DarkflameServer repository on GitHub to view issues and discussions about the server emulator!<br/><br/><a href="https://github.com/DarkflameUniverse/DarkflameServer"><font color="#0000EE">Click Here to go there!</font></a><br/><br/>
help_1_description=Try switching networks, using a VPN, or using your phone's hotspot to resolve the issue.<br/><br/>
help_2_description=While DarkflameServer is a mostly complete emulator, there are still some features that aren't implemented. You can track these on the GitHub issues page.<br/><br/>
help_3_description=Skill issue!<br/><br/>
help_4_description=Visit Discussions on the DarkflameServer GitHub page<br/>to ask questions and collaborate with other devs!<br/><br/>
# Toggleable quality of life feature to allow users to skip most cinematics.
allow_players_to_skip_cinematics=0
# Customizable message for what to say when there is a cdclient fdb mismatch
cdclient_mismatch_title=Version out of date
cdclient_mismatch_message=We detected that your client is out of date. Please update your client to the latest version.
# Auto reject properties which contain no models | must be 1 in order to auto reject.
auto_reject_empty_properties=0
# comma delimited list of items to not drop in hardcore mode
hardcore_excluded_item_drops=6086,7044
# Reduces the UScore gained from the below uscore_reduction config options by x (i.e. uscoreGained * hardcore_uscore_reduction)
hardcore_uscore_reduction=
# Any given enemy will only have its uscore gain reduced 1 time
# Worlds that should have their uscore reduction applied at a global level (i.e. for worlds with lots of skeletons)
hardcore_uscore_reduced_worlds=
# Specific LOTs that should have their uscore reduced (i.e. for worlds with a mix of skeletons and normal enemies)
hardcore_uscore_reduced_lots=
# Excludes this comma delimited list of LOTs from giving UScore in hardcore mode
hardcore_uscore_excluded_enemies=
# Disables hardcore mode for specific worlds, if hardcore is enabled
hardcore_disabled_worlds=
# Keeps this percentage of a players' coins on death in hardcore
hardcore_coin_keep=
# Export terrain meshes to OBJ files when zones load
# OBJ files will be saved as terrain_<zoneID>.obj in the server directory
export_terrain_to_obj=0
# save pre-split lxfmls to disk for debugging
save_lxfmls=0