Refactor egs_sheets and ai_sheets into standalone libraries, remove preprocessor hacks#791
Open
Copilot wants to merge 7 commits into
Open
Refactor egs_sheets and ai_sheets into standalone libraries, remove preprocessor hacks#791Copilot wants to merge 7 commits into
Copilot wants to merge 7 commits into
Conversation
…d on Linux - Create ryzom_egs_sheets library from existing egs_sheets source files with NO_EGS_VARS - Update sheets_packer_shard to link the new library instead of compiling files directly - Remove WIN32 restriction from sheets_packer_shard build - Add egs_sheets library to server/src build when tools or server enabled Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor egs_sheets to separate library for integration
Refactor egs_sheets into separate library, enable sheets_packer_shard on Linux
Feb 17, 2026
…_impl.cpp - Replace writeDirectory() conditional compilation with CSheets::setWriteDirectory() settable from outside (EGS sets from IService, packer sets from arg) - Move CStaticItem::getBaseWeight() to egs_sheets_egs_impl.cpp (depends on CWeaponCraftParameters) - Move CStaticLootTable::selectRandomLootSet() and selectRandomCustomLootSet() to egs_sheets_egs_impl.cpp (depends on RandomGenerator) - Move QuarteringQuantityByVariable initialization to egs_sheets_egs_impl.cpp (depends on EGS CVariable globals) - Remove all #ifndef NO_EGS_VARS guards from egs_sheets source files - Remove NO_EGS_VARS from CMakeLists.txt files Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
…QuarteringForcedQuantities linkage Move QuarteringForcedQuantities definition entirely to egs_sheets_egs_impl.cpp as static const (no cross-TU linkage needed since it's only used locally). Remove unused nel/net/service.h and NLNET namespace from egs_sheets_egs_impl.cpp. Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Refactor egs_sheets into separate library, enable sheets_packer_shard on Linux
Refactor egs_sheets: remove NO_EGS_VARS hack, clean library separation
Feb 17, 2026
…y and sheets_packer_shard - Replace extern CVariable<bool> LoadOutposts/EGSLight with CSheets static members (setEGSLight/setLoadOutposts), resolving undefined references - Add resists.cpp to ryzom_egs_sheets library for CCreatureResists symbols - Fix DNO_AI_COMP -> NO_AI_COMP typo (CMake adds -D prefix automatically) - Guard registerScriptComp() with #ifndef NO_AI_COMP in ai_service/sheets - Remove unused EGSLight/LoadOutposts CVariable defs from sheets_packer_shard - Remove resists.cpp from sheets_packer_shard (now in the library) Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Refactor egs_sheets: remove NO_EGS_VARS hack, clean library separation
Refactor egs_sheets to separate library, remove NO_EGS_VARS hack
Feb 17, 2026
- Make CCreature::readGeorges/serial virtual, add onScriptComp() hook - Create CCreatureAI subclass that overrides onScriptComp to create fight script comps (depends on ai_script_comp.cpp) - Create CSheetsAI subclass that overrides packSheets to load CCreatureAI objects instead of plain CCreature - AI service calls CSheetsAI::initInstance() before CSheets::getInstance() - Move script comp lists to protected for subclass access - Remove NO_AI_COMP compile definition from sheets_packer_shard Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Refactor egs_sheets to separate library, remove NO_EGS_VARS hack
Refactor egs_sheets and ai_sheets into clean libraries, remove all preprocessor hacks
Feb 17, 2026
…ightSelectFilter vtable dependency The sheets_packer_shard linker failed with 'undefined reference to vtable for CFightSelectFilter' because sheets.h included ai_script_comp.h which declared CFightSelectFilter with virtual methods defined in ai_script_comp.cpp (not compiled by the packer). Fix: Extract CFightScriptComp base class into ai_script_comp_base.h. sheets.h now includes only ai_script_comp_base.h (no CFightSelectFilter). ai_script_comp.h includes ai_script_comp_base.h for backward compatibility. Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Refactor egs_sheets and ai_sheets into clean libraries, remove all preprocessor hacks
Refactor egs_sheets and ai_sheets into standalone libraries, remove preprocessor hacks
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
sheets_packer_shardtool couldn't build on Linux because EGS and AI sheets code was entangled with service globals viaNO_EGS_VARSandNO_AI_COMPpreprocessor guards. This refactors both into clean base classes usable by tools, with service-specific behavior in proper subclasses.EGS sheets →
ryzom_egs_sheetslibraryegs_sheets/into a standalone static library underryzom/server/src/egs_sheets/extern CVariable<bool>references (LoadOutposts,EGSLight) with static setters onCSheetsIService::WriteFilesDirectorywithCSheets::setWriteDirectory()getBaseWeight,selectRandomLootSet,selectRandomCustomLootSet,QuarteringQuantityByVariable) toegs_sheets_egs_impl.cppin EGS properAI sheets → base/subclass split
CCreature::readGeorges()/serial()virtual, addedonScriptComp()hook (no-op in base)CCreatureAIoverridesonScriptComp()to create fight script comps viaCFightScriptCompReaderCSheetsAIoverridespackSheets()to loadCCreatureAIobjects into the base_Sheetsmapai_script_comp_base.hfromai_script_comp.hsosheets.hdoesn't pull inCFightSelectFilter(which has vtable inai_script_comp.cpp)Build changes
WIN32gate fromsheets_packer_shard(now builds on Linux)NO_EGS_VARSandNO_AI_COMPcompile definitions entirelyryzom_egs_sheetslibrary builds underWITH_RYZOM_TOOLS OR WITH_RYZOM_SERVEROriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.