Sid Meier's Civilization VI

Sid Meier's Civilization VI

Community Extension
72 Comments
WildW  [author] Jul 3 @ 10:59pm 
@豐參 輝群 I do not understand the question. I assume there is a translation error. I will do my best to explain what this mod is:

Enabling this mod modifies the GameCore DLL (the native binary that handles most of the game logic) to allow lua scripts to access more functions that aren't available normally (plus some other things). The title people usually give this kind of mod is "Script Extender" because it extends scripting capabilities.

Essentially, this mod extends the modding support of Civilization VI.
豐參 輝群 Jul 2 @ 9:11am 
If I changed the .dll, then I have to enable this mod?
s3boun3t Mar 8 @ 12:51am 
please make this compatible with linux
faber_avgust Mar 3 @ 12:29pm 
Any news?
PhantomJ_M Dec 26, 2024 @ 9:55am 
Imo the problem is on how the art resources are loaded. They set fixed size arrays to load different classes of asset. To fix it will need a complete rework of the asset load algorithm, which I think its almost impossible to achieve by modders
CaptainUnknown Dec 24, 2024 @ 7:42pm 
Thanks. I joined the discord but have to run for now. I will do some tests on different OSes of the game to better understand the problem. It would be useful to know if it's renderer specific or not.
WildW  [author] Dec 24, 2024 @ 6:34pm 
@CaptainUnknown I use Ghidra (any will work tho), I can send you some of the scripts and other minor tools I use too. Make sure when you're attaching a debugger you bypass the anti debug with a tool like the one here https://github.com/Ricardonacif/steam-loader .

Triggering the bug is done just by using mods that add a lot of assets. Anything over 8192 assets can cause undefined behavior, my assumption is that the D3D11Resource buffer is being overflowed and additional assets are stored in unallocated memory. Though I'm not sure why there is a limit in the first place, beyond that this could be a limitation with Dx11 and 12.

If it is a Dx limitation I don't think this bug would exist on other renderers, so it's probably not on Max or Linux. Though I have never tested. Maybe relevant: https://learn.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-resources-limits .

If you want a longer conversation, ping me @ WildW in this server
https://discord.gg/kPnh3C8Dtb
CaptainUnknown Dec 24, 2024 @ 5:36pm 
@WildW thanks, I'll give it a shot. Have you done any analysis on the game exe in a decompiler (Ida pro, ghidra, binary ninja)? There are a few sections where the string "attempting to add... over %d items" is mentioned. It's connected to the Lua state. I think there could be potential from walking back form those functions, but I wanted to be able to trigger the bug first before I continue.

I am also curious if this bug is present in all versions (win, linux, mac) or just Windows?
WildW  [author] Dec 24, 2024 @ 5:12pm 
For anyone interested in figuring out how to link in the custom event system (events in code, not in game), it's also worth taking a look at and decompiling firetuner. It was written in C# so decompiling it is almost like looking at the source code. It must be linked to the event loop somehow. Also contact me and look on the dev branch of this mod. I am very close but lost motivation recently.
WildW  [author] Dec 24, 2024 @ 5:07pm 
@CaptainUnknown Use the warfare expanded mods and track the asset limit with my asset counter mod. I know where you can generally start with looking into the asset limit, but if you have any shot at it you need to be capable of analyzing and debugging compiled code without access to any debug symbols or source code since what you need to change is in the exe which has never had its debug symbols leaked (unlike the GameCore DLLs).
WildW  [author] Dec 24, 2024 @ 5:03pm 
@faber_avgust I would need help from someone experienced in analyzing and modifying multithreaded windows programs. This requires some knowledge in assembly and C.
CaptainUnknown Dec 23, 2024 @ 4:56pm 
Does anyone know of a way to trigger the asset limit on turn one? I would be willing to explore fixing the limit but I've never triggered it
faber_avgust Dec 21, 2024 @ 11:41am 
WildW what kinda help do you need?
WildW  [author] Dec 18, 2024 @ 6:45pm 
@faber_avgust thanks for the suggestion. If help is available and willing I'd gladly accept it, though I do feel like I've gotten very close on my own. With my University finals just having finished I'll be spending more time in this shortly.
faber_avgust Dec 13, 2024 @ 7:44am 
@WildW Hey, maybe we need to try find someone who as you said have a skills and can do smthng. I think we can open a fundraiser for paying someone, i'm sure there's a lot of civ fans who will send some money, if we can resolve this problem.
伯劳萌萌哒 Oct 19, 2024 @ 7:12am 
Can asset restrictions be lifted? Very necessary
伯劳萌萌哒 Oct 19, 2024 @ 3:59am 
warfare?
WildW  [author] Sep 13, 2024 @ 9:38pm 
@Random Space Marine Check out my Asset counter mod. I posted an update on it there. Short story is that it probably isn't being fixed in a mod anytime soon if ever.
Solar dude Sep 13, 2024 @ 9:24pm 
Any news on the asset limit?
Nahueformaline Sep 10, 2024 @ 12:10am 
Very creative. More Mods!!!!!!!!!!!!!!!!
PhantomJ_M Aug 15, 2024 @ 2:51pm 
Yes I second this. I am sending tickets twice a day- when i wake up, when i go asleep
WildW  [author] Aug 15, 2024 @ 9:14am 
Firaxis just deimplemented the launcher and won't be reimplementing it in civ 7! It seems like they're willing to listen to the community.

So for all those still interested in seeing the asset limit resolved. Methinks there's no better time than now to open support tickets and send bug reports about it. We might at least get a statement on it if not a fix.
WildW  [author] Aug 2, 2024 @ 1:11pm 
Version 1.3.0-beta released!

The console is now hidden by default. To enable it, open Civ 6's game files and navigate to /Base/Binaries/Win64Steam and create the file CommunityExtension.ini and paste this below!

[Settings]
EnableConsole=1

In-game, you can tell the version number from the button at the top right of your UI that says "CE v1.x.x"
Obb Aug 1, 2024 @ 2:52am 
Arf, that’s bad news, I’ll still keep a bit of hope nonetheless. ^^
What’s for sure is that’s fascinating to read ! Thanks for the share !

For your third paragraph : Yes I noticed too, that everything seems to add up for the limit, even if they will never show up in the game. So I also thought it could be a possible approach to get around the problem… Sad to read otherwise !

Thanks for your work and efforts, once again !
And well done for civfanatics, well deserved.
WildW  [author] Aug 1, 2024 @ 1:43am 
Update on the Asset Limit problem: PhantomJ_M looked into it and discovered that a fixed size array contains and maps all the game's assets. It's not possible to just change the size of the array because the entirety of the systems in place that interface with assets could assume the data to be of a certain size and it's stored as a global variable so there's a good chance it's not possible to allocate more memory for it either as it could overwrite and be overwritten by other code and variables. Bottom line is that neither of us know how to fix it.

The alternative approach is unfortunately workarounds, such as bundling assets together and preventing assets from being pushed to the array once the limit is hit (which will still break graphics but could prevent crashes). The latter solution could be used to play the game in strategic view methinks.

CONTINUE BELOW
WildW  [author] Aug 1, 2024 @ 1:43am 
An approach we once considered was unloading assets that we could assume won't show up in a game (such as city styles that aren't used by any loaded civilizations), but waiting until a game is being loaded is likely too late to make any changes to the resource list.

I'm not sure why Firaxis wouldn't just allocate more memory for the array in the source code, maybe there's something to do with directX or a lack of foresight and years of coupling which complicates this.

Consider the asset limit a problem we can't solve, not unless we get help from someone who really knows what they're doing when it comes to directX or reverse engineering. Though, even if we could find that person, I don't have the funds to pay them.
KrumStrashni Jul 30, 2024 @ 6:58am 
@WildW is this capable of alleviating the infamous asset limit that causes graphic glitches with heavy mods?
WildW  [author] Jul 30, 2024 @ 5:01am 
@Kane you cannot. This mod is binary incompatible with civ 5. It can only work on civ 6.
Kane Jul 30, 2024 @ 3:49am 
Can I use the above program on civ5 as well? I want to modify civ5 dll easily, but I don't know how.
WildW  [author] Jul 20, 2024 @ 10:02am 
If you have a suggestion, feel free to mention it. I prefer if you do it on the issue tracker, makes it easier to track that way, but here is alright too.
WildW  [author] Jul 20, 2024 @ 10:00am 
@Justin this is indeed a patch. If you're familiar with Vox Populi/Community Patch from civ 5, this is basically the script extender and potentially bug-fixing part of that project but for civ 6.
Justin Jul 20, 2024 @ 8:12am 
is this some sort of patch? Do you take recommendations?
WildW  [author] Jul 18, 2024 @ 12:31pm 
I've got a new category on Civ fanatics for this mod!
https://forums.civfanatics.com/threads/community-extension-main-thread.690878/
Coltwk45 Jul 16, 2024 @ 9:30am 
post directly on civ V VP page its very active and they'll direct you to the right guys
WildW  [author] Jul 16, 2024 @ 12:16am 
@Coltwk45 no but I probably should. I didn't know what category to post in there, though I guess if need be it can just be moved by a moderator.
Coltwk45 Jul 16, 2024 @ 12:10am 
Have you posted on Civfanatics?
WildW  [author] Jul 12, 2024 @ 5:30pm 
Strictly speaking though, yes, everything that VP did is possible . Whether it's realistic depends on a lot of things, which is what I meant to inform.
WildW  [author] Jul 12, 2024 @ 5:24pm 
@Coltwk45 That all depends on the available interested parties. Civ 6's modder demographic generally doesn't have knowledge in C++, let alone skills in the additional complications that developing this mod presents. It's hard to say if we'll gain enough traction for something like that to even be attempted, let alone become anywhere near the scale of VP.

I do my best to abstract what's going on behind the hood so application of this mod is accessible, but so far, It's just been me, and I can't do everything myself.
Coltwk45 Jul 12, 2024 @ 3:44pm 
wait a second... no way. Please tell me you''ll be able to make a vp version of civ 6 now??
WildW  [author] Jul 12, 2024 @ 11:08am 
New release: v1.2.0-beta.

Read about it in full in the change notes.
skaz88 Jul 8, 2024 @ 8:28pm 
I also think that Firaxis is just too lazy to fix the asset limit so anything you are able to do in that area will be a miracle.
GaussTheWizard Jul 4, 2024 @ 8:35pm 
A Civ script extender? Oh ♥♥♥♥♥♥♥♥♥♥♥♥♥
UzukiShimamura卯月 Jul 4, 2024 @ 3:32am 
@WildW His work should be helpful for you but better not to copy it since what he did is hardcoding new constants into the functions about city plots. It might be better to read the parameter in the GlobalParameters table and de-hardcode parameters used in functions. His mod released was so simple that it should not be hard for you to decompile it and understand what he did.
柚鳥 ナツ Jul 4, 2024 @ 12:32am 
1
WildW  [author] Jul 3, 2024 @ 10:38pm 
@UzukiShimamura卯月 Thanks for the nice words! I do take requests for bug fixes and I can look at those. I don't want to replace the work that PhantomJ_M has done though so I'll reach out to them about it first. DLL mod compatibility is indeed possible with something I know they're currently working on, but whatever their progress on it is remains unknown to me.
WildW  [author] Jul 3, 2024 @ 10:27pm 
UzukiShimamura卯月 Jul 3, 2024 @ 3:32am 
Definitely one of the best works in civ6 modding! I would be happy to see some bugfixes (e. g. Great work yield modifier not stacking, or the hardcoded 3-hex city range limit) integrated in this mod since it will be a little bit harder to maintain dll-mods compatibility. Hope this one to be the must-have of all modders and players!
Komodo Bebop Jul 3, 2024 @ 2:42am 
Any mods so far that use this?
Justin Jul 2, 2024 @ 9:33pm 
thanks for uploading
DaniAngione Jul 2, 2024 @ 8:33am 
Amazing, great work!

About the asset limit, I think it's more like a matter of them never caring about it rather than it being hard and they never fixing it... But we'll see. Best of luck to whoever decides to tackle it!