Skip to content

CuCuGS (Implementation of @f1rpo's CuCu-GS-PoC) in AdvCiv-SAS - #19

Open
wonderingabout wants to merge 14 commits into
mainfrom
CuCuGS-PoC-claude-code-test
Open

CuCuGS (Implementation of @f1rpo's CuCu-GS-PoC) in AdvCiv-SAS#19
wonderingabout wants to merge 14 commits into
mainfrom
CuCuGS-PoC-claude-code-test

Conversation

@wonderingabout

Copy link
Copy Markdown
Owner

wonderingabout and others added 12 commits December 31, 2025 13:32
…ityAI + update 48 civs DLL

- "<!-- custom: use this pattern i found somewhere in the code, in case it is safer, and cache repetitive calls for performance optimization. Note: also cache GET_TEAM(getTeam()) to kTeam. Note 2: we had issues in the past in AdvCiv-SAS when caching these to a CvTeam cast (i don't know too much about these, check if accurate), that were solved using a CvTeamAI cast rather, so preferring this whenever it seems safe enough (check if accurate). I applied this to all GET_TEAM calls i spotted in this file +/- additional kOwner or kPlayer extra caching when needed, and after specifically testing this in autoplay, we get the exact same outcome vs before (t341 win, exact same score at scores it seems as well, so this also looks good to merge) -->"
- update 48 civs DLL
- update docs
… change

no longer requires to start a custom game and return to main menu and start a new cusotm game, now changes dynamically before custom game starts depndeing on map we select
…selection with random support

rarely buggy for some reason weirdly, but mostly works if exiting the game or current custom game window or such
- Added DLL wrapper functions (getVictory/setVictory) in CyInitCore for Python access
- Modified CvInitCore to preserve victory settings through resetGame() calls
- Implemented victory condition dropdowns with Yes/No options for each victory type
- Fixed Civ4 widget naming quirk: numbers get stripped from widget names in events
- Solution: Use text-based unique IDs (Victory_VICTORY_TIME, Victory_VICTORY_CONQUEST, etc.)
- Used dictionary mapping approach inspired by CvExoticForeignAdvisor and Sevopedia patterns
- Victory settings now persist correctly and can be changed before game launch
- All 6 victory types (Time, Conquest, Domination, Cultural, Space Race, Diplomatic) functional

Technical challenges solved:
- Widget ID collision when using same name for multiple dropdowns
- Number-stripping behavior in Civ4's event system (VictoryDropdown1 → VictoryDropdown)
- Event handler registration using dictionary lookup for dynamic widget identification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… update docs

note: randomization is a bit hacky but it works as intended (we randomize manually since it was hard to do it ourselves from what i understood of Claude code's explanation thanks), later on we may revisit implementing this correctly, but since it works fine no reason to.
@wonderingabout
wonderingabout force-pushed the tech-rework branch 3 times, most recently from ce78916 to 6b0135c Compare January 2, 2026 06:50
@wonderingabout
wonderingabout force-pushed the tech-rework branch 14 times, most recently from e1718db to 55a2425 Compare January 4, 2026 06:50
@wonderingabout
wonderingabout force-pushed the tech-rework branch 13 times, most recently from c710f6d to 3d62f3c Compare January 22, 2026 06:35
@wonderingabout
wonderingabout force-pushed the tech-rework branch 4 times, most recently from 3111892 to 4679093 Compare January 30, 2026 04:53
@wonderingabout
wonderingabout force-pushed the tech-rework branch 12 times, most recently from b6d970e to d9e8051 Compare February 3, 2026 12:00
Deleted generated text files are available in the commit history if needed.
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