Basic Question: Reviewing Game Files To See How Game Works

tman2000

Prince
Joined
Feb 11, 2025
Messages
480
I have a few things I want to do, but I'll be very specific to help make answering easier.

I want to change the growth rate for towns. I can modify a value in the database which is "percent" for growing towns, but it doesn't seem to affect anything. I can change the exponent value for settlement growth, but I don't want to affect city growth. Also, I want to actually see the formula that uses the exponent, and I do want to change it.

How do I actually view the innards of the game? I understand a lua script can plop in new functions, but I don't know what functions I'm modifying.

What's the starting point for this? Same for the UI. I know you can use JS. I specifically want to unlock a production menu for towns, and control what goes in it. I don't know how to "see" how this is structured for cities normally nor where toggling city v town on or off changes things.
 
The game no longer uses LUA as of Civ VII. It now uses javascript. Most all of the javascript files are in:
Code:
Base/Modules/base-standard/ui
Base/modules/core/ui
Core are generally applicable files, not specific to any game element. Base-standard is most of what you see in game. Production-chooser has most of what is relevant to the production screen. When you see document is DOM. All the actual display is HTML. The logic is javascript. It's largely down the rabbit hole you go. The first thing I would do is figure out how it populates the list of items you can build. Likely if you try to queue an item that isn't valid choice, like you're missing the tech for it, it will not take it. So how it populates the list is how you tell what is valid. It queues it when the user clicks on it. So what happens you click is how you add something to the queue.

There are mods that auto-repair damaged tiles. They might make it easier to determine what you need to do.
 
The game no longer uses LUA as of Civ VII. It now uses javascript. Most all of the javascript files are in:
Code:
Base/Modules/base-standard/ui
Base/modules/core/ui
Core are generally applicable files, not specific to any game element. Base-standard is most of what you see in game. Production-chooser has most of what is relevant to the production screen. When you see document is DOM. All the actual display is HTML. The logic is javascript. It's largely down the rabbit hole you go. The first thing I would do is figure out how it populates the list of items you can build. Likely if you try to queue an item that isn't valid choice, like you're missing the tech for it, it will not take it. So how it populates the list is how you tell what is valid. It queues it when the user clicks on it. So what happens you click is how you add something to the queue.

There are mods that auto-repair damaged tiles. They might make it easier to determine what you need to do.
I've gone done the rabbit hole a ton lately. There are some inner variables that are access in the ui scripts, but no visibility on them. It's deeply frustrating. There are variables that exist in the database and others which are referenced in the scripts, but a lot are hidden inside the engine.

Like, if I knew the name of some variable I could change it, but if it's not used in the ui panel scripts, I wouldn't know about it. Oddly, some parts of the UI are done inside the engine and can't be changed. It comes off as, I don't know, sloppy? Is this how all games are programmed?
 
Back
Top Bottom