Skip to content

Move object data into SLK tables with -slkobjects - #1626

Merged
Frotty merged 2 commits into
masterfrom
objmerge-run-arg
Nov 17, 2026
Merged

Frotty merged 2 commits into
masterfrom
objmerge-run-arg

Conversation

@Frotty

@Frotty Frotty commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds an opt-in -slkobjects run arg that moves a built map's object modifications (war3map.w3u, .w3t, .w3b, .w3a, .w3h, .w3q) into SLK tables and profile .txt files with wc3libs' new ObjMerger (inwc3/wc3libs#109). The game loads these faster than it applies object modification files.

  • wc3libs bumped from 0542c41400 to 19bf6ba502. Besides ObjMerger, the only change visible to WurstScript is ObjMod.Obj.copy() keeping file order, which WurstScript does not call.
  • Flag: -slkobjects, off by default, named for the SLK optimisation map makers know. It comes from wurst_run.args (+slkobjects for release builds only) or the command line, so it reaches CLI -build, Build Map and Run Map.
  • Merge (MapObjectMerger): done in memory on the open archive. The base is the bundled game data for the data set the map's war3map.w3i selects, and tables and profile files the map already ships take precedence. It writes the files, removes object files left empty and logs the report: objects merged per type, modifications moved and kept, and each skipped object with its reason.
  • Only published maps are merged: Build Map and the CLI merge the output map before compression; Run Map launches an SLK copy (<cached>_slk.w3x). The cached map keeps its object files, because the next build compares them with the objects it generates.
  • Classic targets refused: a wc3Patch before 1.32 fails before compiling, since the merged tables are Reforged data.
  • Docs: docs/OBJECT_DATA_SLK.md; CHANGELOG entry.

Testing

  • SlkObjectsBuildTests: with the flag, the output map gets the tables, a reduced w3u and no w3h, and the cached map is unchanged. Without it, the output object files are unchanged and no tables are written. A classic target is refused before compiling.
  • RunArgsTests: the flag is off unless requested.
  • Full suite on Windows: 3815 tests, 0 failures.
  • CLI build of a sample project with a unit, an item, a buff and a 6-level ability: w3u, w3t and w3h removed, w3a reduced to the level-6 cooldown, h000 reads HP 1234 and its name from the tables. The cached map matched a build without the flag.

Not covered

  • Run Map with the flag has no automated test and has not been launched in game.
  • Reforged targets before 3.0 (1.32 to 2.0) are accepted but ship the 3.0.1 tables, including their balance values for stock objects.
  • Only tested on Windows.

Bumps wc3libs to 19bf6ba502, which adds ObjMerger (inwc3/wc3libs#109).
The opt-in -mergeobjects run arg moves a built map's object modifications
into SLK tables and profile files, which the game loads faster. Whatever
the formats cannot hold stays in a reduced object file, and the build log
reports what was merged, what was kept and why.

Map builds merge the output map before compression; Run Map launches a
merged copy. The cached map keeps its object files, because the next build
compares them with the objects it generates. Projects pinning a classic
wc3Patch are refused before compiling, since the merged tables are
Reforged game data.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T13:36:58.454703Z c3e1699 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

SLK is the name map makers know this optimisation by.
@Frotty Frotty changed the title Merge object data into SLK and profile files with -mergeobjects Move object data into SLK tables with -slkobjects Nov 17, 2026
@Frotty
Frotty merged commit ed67de0 into master Nov 17, 2026
2 checks passed
@Frotty
Frotty deleted the objmerge-run-arg branch November 25, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant