Resource icon

C3X: EXE Mod including Bug Fixes, Stack Bombard, and Much More Release 21

Is it now possible to limit units to specific governments?
Yes. Units can be limited to city improvements. Have the gov specific small wonder that generates world wide improvements in your cities. And then these units will require that improvement to be built.

What I'm not sure is that if you switch out of the gov, the SW will then stop working. Will the SW generated improvements remain?
 
Last edited:
It seems like the issue of the AI not switching off a unit that has reached its number limit still remains. Here are the debug screenshots. I made sure to have installed version 20. I manually switched the Scout (AI) build to settler but as you can see, it's still in the menu and with a heavy perfume, the AI will try to build them again.

Also, I forgot. How do you display the the AI build preference ranking?
 

Attachments

  • Screenshot (822).png
    Screenshot (822).png
    1.3 MB · Views: 55
  • Screenshot (823).png
    Screenshot (823).png
    141.7 KB · Views: 39
  • Screenshot (824).png
    Screenshot (824).png
    842 KB · Views: 39
  • Screenshot (825).png
    Screenshot (825).png
    266.6 KB · Views: 46
  • Screenshot (826).png
    Screenshot (826).png
    1.2 MB · Views: 51
That is not difficult to reproduce. Let's have Civ 1, Civ 2 and Civ 3 where Civ 2 and Civ 3 have the right of passage and Civ 1 and Civ 2 share a border. Move unit of Civ 3 into the border tile of Civ 2. Then attack it directly with units of Civ 1.
Alright, I'll look into it again but I'm pretty sure I already tested that back when I fixed that bug.

I also wanted to ask about a feature that limits the production of units to specific number. If we have something like "Super Death Star" limited to 2 does it allow each Civ to produce 2 units of this type? Can they replenish their losses of such unit(s)? Or is it 2 for the whole map. I have not tested this feature yet but I have high expectations of it.
Yes and yes to your first two questions. The limits are applied per-player and are based off the number of units a player has on the map, so if a unit is destroyed it can be replaced.

Can you still chop down LM Forests for shields? Would be handy if you couldn't, stops the player from planting forests on virgin land then chopping them down for a 'free' one-off shield bump which feels like cheating.
I think so. As I recall, chopped status is unrelated to LM terrain, so you can chop each tile once regardless of what kind of forest is or was on it.

Here's a tiny request to add to the list - to be able to sell/remove Aquaducts and Sewers
... Is it possible to combine the two building requirements so you need five libraries including one in the city you want to build the college in?
... Don't know how hard it would be to have the option to switch between a flat speed or a bonus, but would be useful when you don't use the feature as an actual railway. Although flying creatures would get an unearned bump.
I've gotten several requests now to make aqueducts & hospitals sellable so I'll try to prioritize that. I expect it would be a simple change.
It should be possible to combine building requirements like you described, I'll add that to the list and hopefully get around to it.
Fast roads would be doable too and actually very simple. The way limited railroad movement works right now is that the cost of moving along a railroad is scaled by the number of moves the unit's type has. To make RRs work like fast roads, all you have to do is not apply that scaling. It's so simple I ought to have done it long ago, you might be the first to ask.

It seems like the issue of the AI not switching off a unit that has reached its number limit still remains. Here are the debug screenshots. I made sure to have installed version 20. I manually switched the Scout (AI) build to settler but as you can see, it's still in the menu and with a heavy perfume, the AI will try to build them again.

Also, I forgot. How do you display the the AI build preference ranking?
Press P when viewing an AI city for the production ranking. Is there anything unusual about the Scout (AI) unit or your setup here? You might have to send it to me since I can't imagine what's wrong. In my testing the unit limit applies to the AI as it should.
 
Looks like this project has been going on for a while but haven't looked much into this previously. This can be interesting when compared to Thinker Mod codebase which is also a binary mod project to patch different game features into SMAC. The codebases are vastly different starting with the different compiler and C++ version used but there are certainly some generic ideas that can be applied as both of these mods have to modify the game at runtime. Some of the game code was originally reversed in OpenSMACX but it has been included in Thinker Mod.

Dealing with Civ3 there is certainly easier time with some limitations as up to 32 players are allowed where in SMAC the limit was set at 8 players at compile time, the first one is natives in both. I'm wondering now how much of the code structure was carried over from SMAC into Civ3, at least some of the bugs like the submarine issue seemed to be quite similar in both games. What kind of reverse engineering tools were used to gather the header definitions for the game, did not see if this was mentioned?
 
What should I send you? My biq plus the pedialcon so you can test it?
Yes, the BIQ plus whatever else I'd need to load it up. I want to poke around inside the game as it runs to see how it's determining whether or not the limit has been reached for that Scout (AI) unit.

Dealing with Civ3 there is certainly easier time with some limitations as up to 32 players are allowed where in SMAC the limit was set at 8 players at compile time, the first one is natives in both. I'm wondering now how much of the code structure was carried over from SMAC into Civ3, at least some of the bugs like the submarine issue seemed to be quite similar in both games. What kind of reverse engineering tools were used to gather the header definitions for the game, did not see if this was mentioned?
I've been using Ghidra to reverse the executables. Most of the structures in the header were decoded by Antal1987 before me, and he was using IDA. I wasn't able to get his IDA project (as I recall he posted a link to it somewhere but the link was dead) so I imported his Civ3Conquests.h into Ghidra and continued working from there.

I don't know how much code was shared between Civ 3 and SMAC but I don't feel like it would be very much, just based on how the Civ 3 code looks. It's not generic or modular, it's like it was written for Civ 3 specifically. And the few ways the game is modular, its modules were never reused. For example, Civ 3 has its own horribly overengineered sound format called AMB files and it has its own little graphics library in jgl.dll. Both of those were never used for SMAC or anything else as far as I could tell.
 
Wow, I have really been missing a lot. Does anybody have the EXE provided by PC Games? It's not online anymore. :(
 
Hi Flintlock! Happy new year everyone, BTW.
I encounter some bug. Every time I try to load auto-saved game, it crashes, but when I restart it loads successfuly. Have someone reported similar thing?
 
Hi folks, I've really lost track of this thread and recent releases (has there been any talk of splitting C3X out into its own subforum?) so apologies if some of this is rehashing topics already covered or even implemented, but I've been collecting some more ideas that I'd like to apply in future projects:
  • Allow barbs to spawn (camps) or pop (huts) any unit marked as available to them, perhaps if a number of civs have the indicated technology. Either in addition to or an alternative to them capturing cities, this would help make them more relevant through long games.
  • Allow barbs to capture and enslave, which could lead to a snowball uprising and again keep them relevant.
  • Create Victory Point Locations on (popped) goody huts, specific resources, or otherwise appear somehow on random maps. This would allow for new score-based strategies for random maps, and especially provide another path to victory for short game modes.
  • Make all trait flags provide half-price improvements. IIRC commercial at least does not, which seems like an oversight.
  • Now that there's a unit limit, how about a unit spawn limit from buildings (eg Knights Templar will only produce up to 20 crusaders)
  • I'm not very clear on how collateral damage works even without C3X, but can it be made to combine with bombardment to hit all units in the stack? This would effectively be a Civ4 style bombardment mechanic which would incentivize against doomstacks.
  • Speaking of which... unit stack limit! I don't know how complicated this would be to enforce, but it would have major implications for tactics.
Finally, to revisit a couple that I brought up before and would very much like to see:
  • City base maintenance, either as a flat amount or vary per size/government like unit support. I believe the holdup was just about how to present it in the UI.
  • Restricting "detect invisible" to only apply to the same land/sea/air class of units.
As always, thanks for all the great work! I've appreciated how C3X has come to be a must-have even outside of CFC.
 
Collateral damage would be great for low yield tactical nukes and make them a good but not overpowered answer (and less diplomatically and environmentally straining) answer to doom stacks. So instead of the charm function halving the def stats of all the units in the tile, it would simply apply the bombardment on all of them.

A few more ideas:

The option to give units range for their air defense values. Long range SAM systems like the Patriot have the range of 160km, that's more than tube artillery. So they should be able to cover a radius of 2 tiles around them.

The option of city improvement preventing another improvement from even appearing in the menu. The palace can prevent courthouses and police stations from being built.

A unit limit on how many each city can produce. So we can have things like immobile defenders and artillery that the AI won't overbuild or get auto produced out of control. A coastal fortress for example would only auto produce 1 coastal battery.
 
  • Allow barbs to spawn (camps) or pop (huts) any unit marked as available to them, perhaps if a number of civs have the indicated technology. Either in addition to or an alternative to them capturing cities, this would help make them more relevant through long games.

Wow, you read my mind, I was just thinking about a similar thing. It's quite boring that barbarians have only two units availible which can't be upgraded. I have not inspected source code, but I think it would not be very complicated. There should be function to get latest availible upgrade of some unit, right? For example, barbarians have warriors and horsemen. When all civs (or maybe half of them) research Iron Working, call that function and change primary barbarian unit to Swordsman. I think it works kinda that way.
 
So I've tested it again in my mod and in stock game on debug mode. Strangely enough, it worked fine in stock game debug with the Scout unit limit being set to 2. Yet in my mod it doesn't. It seems to be the same with the whole PTW targeting. If you could look into that again that would be appreciated. Maybe play the mod till you get catapults and bombard with them. There maybe something that happens in modding that prevents the C3X patch from doing its work.

I can't attach my mod's unit folder. It's too large. But make sure you open the the game with a unit folder that has Aaglo's Haida Canoe: https://forums.civfanatics.com/resources/haida-canoe.56/ because that unit is already out on the map. And don't open the tech tree or make Battering Rams, Ballistae and Slingers.

Edit: I've just found out that by using the Palace as a prerequisite building for making the Scout (AI) unit, it cancels out the patch's unit number limit.
 

Attachments

Last edited:
Wow, you read my mind, I was just thinking about a similar thing. It's quite boring that barbarians have only two units availible which can't be upgraded. I have not inspected source code, but I think it would not be very complicated. There should be function to get latest availible upgrade of some unit, right? For example, barbarians have warriors and horsemen. When all civs (or maybe half of them) research Iron Working, call that function and change primary barbarian unit to Swordsman. I think it works kinda that way.
I have been upgrading the Barbarian units for years. They now have the Celtic Swordsman with increased hit points as the basic unit, with the Cossack with increased combat stats and hit points as the spawned unit. Then I may give them some additional special units as well. I have upgraded the Sea unit to the Privateer, or in Test of Time, the Pirate ship. Theov's scenario also had boosted Barbarian units. It does make the game more challenging as I have also reduced the Civilization bonus against barbarian units. Do not get me started on using the Dinosaurs in the Test of Time scenario for Barbarians. I have decided that an Upgraded T-Rex unit is overdoing it.
 
... and some more feedback about the optimization of the trade net:

One of the longest interturn times in my test game on a 250 x 250 map. It occurred when several AI civs became access to Mutual Protection Pacts:

View attachment 679578

One of the shortest interturn messages in that game with positive account (here I also was pleased, that the change to half-year turns in the interface, starting with WW2, worked very well):

View attachment 679579

I also received two turns with negative accounts from the "interturn tool", as seen in the post above.
Edit: Another turn with a negative account:

View attachment 679634
i liked the graphics and units you are using, so, what mods are you using? I'm trying to return to Civ3
 
Back
Top Bottom