Modding tools(framework) written on typescript

izica

Chieftain
Joined
Feb 25, 2025
Messages
27
I almost lost my mind after spending several evenings editing XML files, trying to create my own civilization. This led me to the thought that I’d like to have a more declarative way to develop content mods.

So, I decided to create a tool that would help me do this faster and with less pain.

Now, I want to share the results of my week of work with you.
Maybe someone besides me will find it interesting and useful for their own mod development.

According to my estimates, the tool currently covers about 60-80% of cases, but it can be further improved.

Feel free to share your suggestions, ideas, and criticism.

At the moment, it covers creation and managing:
  • Modinfo
  • Civilizations
  • Units
  • Buildings
  • Improvements
  • Unique Quarters
  • Traditions
  • Progression trees
  • Game effects(modifiers)

 
Last edited:
Hey, I thought this looked very helpful, and I tried to install it, but I do not understand how to use it, honestly. Can you help me? Much appreciated
 
Hey, I thought this looked very helpful, and I tried to install it, but I do not understand how to use it, honestly. Can you help me? Much appreciated
  1. First, you need to install node.js. https://nodejs.org/en
  2. Next, download the repository (click the green Code button in the top right and select Download ZIP).
  3. Then, extract the folder and open the directory using the terminal.
  4. Install the packages via the terminal using the command npm install.
  5. The repository contains a build.ts file, which holds the main code for declaring the mod. There's also a folder with examples.
  6. In build.ts, the last line is mod.build('./example-generated-mod');, which defines the path where the generated mod will be saved.
  7. When running the npm run build command in the terminal, the mod will be generated and saved to the specified path. Additionally, you can specify a different path to build the mod directly into the mods folder.
 
Version 1.1 released
Added
  • import custom files, for example sql, added example
  • constants
    • PLUNDER
  • Database nodes
    • improvements
    • districtFreeConstructibles
    • constructibleValidResources
    • constructibleValidBiomes
    • constructibleValidFeatures
    • constructibleValidTerrains
    • constructiblePlunders
    • startBiasBiomes
    • startBiasTerrains
    • startBiasResources
    • startBiasRivers
    • startBiasFeatureClasses
    • startBiasAdjacentToCoasts
    • visArtCivilizationBuildingCultures
    • visArtCivilizationUnitCultures
  • ImportFileBuilder properties
    • actionGroups
    • actionGroupActions
  • CivilizationBuilder properties
    • startBiasBiomes
    • startBiasTerrains
    • startBiasResources
    • startBiasRiver
    • startBiasFeatureClasses
    • startBiasAdjacentToCoast
    • visArtCivilizationBuildingCultures
    • visArtCivilizationUnitCulture
  • ConstructibleBuilder properties
    • improvement
    • districtFreeConstructibles
    • constructibleValidResources
    • constructibleValidBiomes
    • constructibleValidFeatures
    • constructibleValidTerrains
    • constructiblePlunders


 
Last edited:
  1. First, you need to install node.js. https://nodejs.org/en
  2. Next, download the repository (click the green Code button in the top right and select Download ZIP).
  3. Then, extract the folder and open the directory using the terminal.
  4. Install the packages via the terminal using the command npm install.
  5. The repository contains a build.ts file, which holds the main code for declaring the mod. There's also a folder with examples.
  6. In build.ts, the last line is mod.build('./example-generated-mod');, which defines the path where the generated mod will be saved.
  7. When running the npm run build command in the terminal, the mod will be generated and saved to the specified path. Additionally, you can specify a different path to build the mod directly into the mods folder.
thanks :)
 
  1. First, you need to install node.js. https://nodejs.org/en
  2. Next, download the repository (click the green Code button in the top right and select Download ZIP).
  3. Then, extract the folder and open the directory using the terminal.
  4. Install the packages via the terminal using the command npm install.
  5. The repository contains a build.ts file, which holds the main code for declaring the mod. There's also a folder with examples.
  6. In build.ts, the last line is mod.build('./example-generated-mod');, which defines the path where the generated mod will be saved.
  7. When running the npm run build command in the terminal, the mod will be generated and saved to the specified path. Additionally, you can specify a different path to build the mod directly into the mods folder.
and then i change the code in the build.ts, right?
 
Version 1.2

Added
  • new UniqueQuarterBuilder
  • unique quarter example
  • autobinding improvements to civilization
  • autobinding quarters to civilization
  • Database nodes
    • uniqueQuarters
    • uniqueQuarterModifiers
    • gameModifiers
Fixed
  • age transition
  • civilization legacy
 

[1.2.3]

Added

  • NPM support: now you can install this package from npm

Updated

  • almost all node attributes now are optional
  • constants
    • REQUIREMENT
    • COLLECTION
    • EFFECT
    • UNIT_CLASS
  • UnitBuilder
    • unitUpgrade
    • unitAdvisories
  • Database
    • unitUpgrades
    • unitAdvisories

Fixed

  • fixed multiple civilization unlocks
 
This is fantastic! Thank you for putting this together. Will have to see how I can contribute to this.
 

[1.3.0]​

Added​

  • CivilizationUnlockBuilder
    • Added an example to examples/civilization.ts
  • LeaderUnlockBuilder
    • Added an example to examples/civilization.ts
  • Constants
    • CIVILIZATION_DOMAIN
      • Added .from(AGE) method
  • Nodes
    • CityNameNode
    • LeaderCivilizationBiasNode
    • LeaderUnlockNode

Fixed​

  • Skip empty files during mod generation

Updated​

  • DatabaseNode
    • Added cityNames
  • CivilizationBuilder
    • Generates and auto-binds city names based on localizations
  • ProgressionTreeNodeBuilder
    • Added the ability to hide bindings
  • Reworked civilization unlocks
  • ModifierBuilder
    • isDetached: boolean
      • modifiers not attached to a specific entity but added to the game-effects file, such as cascade modifiers
  • ConstructibleBuilder
    • adjacencyYieldChanges
    • If building or improvement is not provided, it is auto-detected based on constructibleType
 
Thanks for putting this together, looks phenomenal, very easy to use so far - not that I've got that far yet!

I'm starting to try and work out how to wrangle localization (for Latin 🤓), and was looking at what I could do in terms of generating the ActionGroups and ActionCriteria etc to import the loc files, and comparing to what I could see in the Firaxis files - suspect I'm gonna have to wrangle some rather gnarly tooling to try and maintain similar structures to make it easier to diff the locs with the base files. I noted a few differences in naming while I was poking around -
  • where Firaxis uses the format [age_name]-age (e.g. antiquity-age) for Criteria, ACTION_GROUP.ts has these Criteria IDs flipped to age-[age_name] (e.g. age-antiquity)
  • where Firaxis suffixes these with -persist (e.g. antiquity-age-persist) for Criteria, ACTION_GROUP.ts has these Criteria IDs as -exist (e.g. age-antiquity-persist)
  • Firaxis seem to have similar IDs on both ActionGroup and Criteria - but with [age_name]-age on the Criteria, and age-[age_name] on the ActionGroup
Wondering if you'd welcome a PR tweaking these to align (not that I've tested it yet and have anything ready to go), or if this was a decision to avoid clashing with something Firaxis does elsewhere - I'm new to civ modding, but have been programming for long enough to know these sorts of things are sometimes workarounds to get around annoying 3rd party issues! I'm sure I could define my own ActionGroups in the build script as well, but figured having the built-in consts align with the Firaxis ones might be good, especially for those of us cargo-culting our way through

(Edited with a few corrections!)
 
Last edited:
Sweet as, have opened a PR.

GUI tool looks great, though it wasn't immediately obvious to me how to add a new node?
PS: I'm not a software developer, so there might be crashes or issues when launching the app.
Could've fooled me - looks like you're a software developer to me!
 
Sweet as, have opened a PR.

GUI tool looks great, though it wasn't immediately obvious to me how to add a new node?

Could've fooled me - looks like you're a software developer to me!
Each node has a menu button on the right, which allows you to add child nodes.

If you need help or have feature requests, you're welcome to Helpline discord (link in the GUI post).
 
Back
Top Bottom