SMAN's The Ancient World at War (AWAW) - The Black Swan Companion Mod

Finished the Black Death and reworked Storms at Sea. Rewrote several shared functions, to make it easier to reuse the content for different events that have similar outcomes.

For example, Storms damages across a wide area (up to 5x5) but on on sea tiles. Black death also reaches a wide area (6x6) but damages both land and sea units.

The logic to implement the damage has been pushed into a reusable function that is highly selective as to size and damage severity. So if I add a new event that needs to damage all aircraft in a 2x2 square, the code it done.

I'll put this reusability to the test on the "Supervolcano" global event I'll try next.

After that is a rework of the Maunder Minimum as a global event (the single-civ version is already done, which I'll rename into some other food-damaging event), so hopefully the rework won't be too painful.

I think these are my last 2 before working the ingame events.

A sample of the effects of a "moderate" Black Death event:

1678140949199.png

Formatting isn't final, but the working parts of the code are getting there.
 
Light day today, lots of IRL distractions. Unavoidable.

Thought of 4 new events (that are really just 1 piece of code that already exists, with a few adjustments).

Basically divide the map in half, with 1 half in the middle, the other consisting of both polar regions.

The mirrored event El Niño/La Niña would impact the polar zones (lower food/more food bonsuses) for many cities in this zone. Can't decide if it should be global or tied to one civ though.

The other mirrored event El Sirocco / Monsoons impact the middle zone, but in a different way. First would look for some desert tiles and if it finds a city near one would inflict some building/improvement damage. Second event would look for marshes/jungles then a city nearby. It would have a food bonus but also a small chance to damage buildings/improvements.

Just writing this down to come back to later.
 
SMAN,

I think El Niño/La Niña should be global.

Very good idea about El Sirocco, big impact on desert tiles .
Great work !
 
A quick clarification on a "global" event. As it's programmed right now, all events take place in a "box" of tiles - think TopX/TopY - BottomX/BottomY.

A global event means it applies "impacts" to all entities in the box. a normal event only applies impacts to the civ who owns/spawned the event.

So in global Storms at Sea, there's a 3x3 - 6x6 box. It starts with a single civ. Mod finds a ship in that civ and it becomes the center of the storm, and the box is 3 tiles in any direction (for storms, typhoons is same event but with a 6x6 box).

This event applies damage to all things on the water in the box (even embarked) for any civ.

Black Death is similar. A civ's city is selected, but then a 5x5 box is looked at and units from all civs inside that box are hit by the results.

So, in keeping with this, if we say El Niño is going to hit during a civ's turn, a city in that civ will be selected, and a NxN box will be established, and results applied to all civs.

For example if we say the box is 20x / 5y, any city inside that box would have its food stores hit, maybe population losses, maybe improvements pillaged.

Of course, the size in X could be the entire map width...

As you see, there is much to consider on things like these, and I'm not 100% sure we'll have a good understanding of how well-balanced the individual events are without a lot of playing/feedback. One thing I know, it won't be "right" at first publishing!
 
Thank you for all your explanations.

Obviously, it will take several hours of play on different maps and with different civs to see how the mod works.

I hope to be able to test the mod soon.
 
Sorry about delay on updating. Yesterday was a bad day. Not much accomplished. Slow start today too, I'm afraid. Medical problems... :blush:

Am working on the new mirrored events and found this picture. I think it'll be the basis used to complete those 4 events.


So, La Niña/El Niño will impact the "Temperate Zone" while Monsoons/El Sirocco will hit the tropical zone. This way we cover the entire map, except for some ice tiles that no one cares about.

I'll calculate the Top/Bottom Y's for these events at game start, based on the size of the map. For example, if the map is 100 tiles tall, Tropical Zone is Y = 30..70 (40 tiles tall). Temperate Zone is Y = 71..91 (20 tiles tall) and Y = 9..29 (20 tiles tall).

Or something like that.

I still haven't decided if these events hit the entire zone or if they, like Black Death, will be focused on a "center point" and impacts spread from that point. So if the map is 100 tiles wide, the width of the impact zone could be 100 tiles wide (global impact) or 20-30 wide (regional impact). May include both possibilities, with the global impact being quite rare.

More of my "note taking" here. For later reference.

OK, back to work.


EDIT: I'm thinking. Since there's so much to test in this mod, perhaps I should do a "limited release" of it on Civfanatics, so you can download and test the main version of the mod while I work on the in-game event functions?

That way perhaps you could find any bugs I didn't find in testing?

Just a thought...
 
Last edited:
SMAN,

Take your time. The most important is your health. I dont want to see you disappear and have health problems like the last time.

You are doing an incredible job to allow us to still appreciate Civ V. The image you have made is excellent, very well explained.


Of course, you can put your "limited release" on Civfanatics and If I find any bugs I will let you know as soon as possible.
You do an amazing job, thank you again
 
Thanks, that's appreciated. I definitely need to do a better job of balancing things out.

I did manage to get a couple of hours in before being chased off the computer by the Mrs. Took much longer than it should have, but I've got a decent "starting point" for my "Supervolcano" global event. The screen grabs don't do the effect justice. Last picture is to show the contrast between the "normal" game volcano and the new effect:

1678311458706.png 1678325876238.png 1678325960781.png

Technically, it's an improvement, placed by LUA. Still needs cosmetics work, and I'm not 100% sure how it's going to work in the game. Supervolcano may be my first multi-turn event. Up to now, all events resolve their impacts immediately. I've always thought the Maunder Minimum should be multi-turn, but I haven't quite finished that design yet.

What I'm thinking now is Supervolcano will erupt in a mountain near a city, and it will reach out effects in a 11x11 box (5 tiles in every direction from center), damaging all there, initiating civ and any other civ's units nearby.

BTW, the "map box unit damage" function determines damage based on distance from the center. So, any units at the center will get 100% damage. In a 11x11 box, units 3 tiles away get 50% damage, etc.

Since this is a volcano (mountain) no units will get 100%, but if the box is 11x11, then units next to the mountain will get close to 90%.

The multi-turn angle is half cosmetics - to keep the new "improvement" visible longer, just for fun. But I'm thinking on turns after the initial eruption, units/improvements/city populations might still have a chance to be damaged, with damage getting lower for each turn. Eventually the damage stops, and this improvement is removed.

Anyways, my time is done for now. More tomorrow, but maybe just a bit.


UPDATE: I've added a new terrain feature, similar to the ones added in WAW V6. It covers tiles like Fallout, destroying any improvements already on the tile. It is scrubbed off the map the same way Fallout is. Random tiles surrounding the Supervolcano will be covered in this ash and have no yields until it is cleaned:
1678376303857.png 1678376494781.png
 
Last edited:
Am almost done with the Supervolcano event. Took longer than I'd planned, but the results look a lot better than a simple report/popup:
1678393927253.png

Still have adjusting to do on the functions, as they are over producing volcanic ash tiles. Need to tweak the formulae a bit, but it's almost there.
 
SMAN,

the Supervolcano event is very good, very interesting and devastating.

This mod can completely change a game.

Amazing job!
 
It's been slow going as I'm still rewriting functions from the original mod. Mostly to make functions reusable. This greatly assists in adding new events in the future. Before everything was tailored to specific events, which means the normal plague had its own function and support routines, as did the Black Death, even though they're the same event only on a different scale. So I've been taking common code elements out and moving to a new function that both events call. Have done this for several events already, and am pretty happy with the results.

Last few hours have been refining the Supervolcano event, and a lot of the reporting functions. The original reporting functions work, but they need cleaning up so all the events "look" the same way when they're reported. Getting the formatting right takes more time than it should, but I'm getting there. Maunder Minimum is my next focus, and the last global event to complete.

Once that's done, I'll finish the 4 events we talked about a couple of days ago. They won't take long as they will now have those reusable effects functions. Will speed things up a lot.

After that, I plan on releasing a test version on Civfanatics for download. While you test that version, I'll finish the in-game events. When those are done, I'll fix any bugs you find then release the combined version on Steam.

TBH, I'll be glad to get this done. It's a good mod, I think, and will make game play more interesting/fun. But the code has been painful to fix. Like taking someone else's mod that was 75% completed, and finding all sorts of problems with it as you try to finish it. It might have been easier to simply start over.

I'm much more interested in working on the scenario management engine, as I think that will be key to releasing the mods I really want to play myself!

Soon!
 
SMAN,

I realize that you are working really hard to release this mod.

This mod has so many things to bring to our games (more interesting, fun but also new thoughts on leading your game, placing your cities, units...).

You are right, working on the scenario management engine is very important with the possibility of playing exciting scenarios (intervention of the gods, famine, drought, storm, plague, earthquake...).
A mod rich in events with exciting scenarios to play (trojan war, Hannibal, Alexander the great, Mongols invasions, the persians conquest, Age of vikings, the crusades, Justinian I, Hundred Years' War....

I hope to play the test version soon and if possible with your HTW custom civs at the same time.
 
Good morning. Rough day yesterday, not much progress. Spent most of my time looking for ways to "highlight" tiles impacted by BS events. Attempted about 10 different approaches, all of them really failing badly. About the only good thing I can say about yesterday is that if I decide to attempt this again in the future I already know what WON'T work, which will save a lot of time... :lol:

OK, am off to finish V0.0 of the mod. This will be the version released on Civfanatiics. V1.0 will be the fixed version with ingame events added, and released on Steam. Am getting tired of all the effort on the mod so it's a good time to finally finish it. More interesting work ahead!

------------------------------------

EDIT:

Much better day today than yesterday. Maunder global event is done. Took several existing function rewrites to make the code more portable, cleaner running. Will test just how portable when I complete the El Nino function tomorrow - which is quite similar in what it damages, but the size of impact and amount of damage is much smaller. Looking at the code, what took about 4 hours today to correct (Maunder) means I'll need about 10 minutes tomorrow to complete El Nino.

And any future functions that damage improvements, cities, etc. over a "box" of map (of any size) can be completed quickly.

This was my biggest lesson learned on this mod - the individual events were quickly (and dirty) written as a one-off event. Even though there are many events that have similar impacts. When I started to fix them last week, I should have simply started over, spending an entire day or two design reusuable functions from the beginning. Would have been much easier to complete.

Anyways, all the positive, negative, and global functions are complete. Will work on the remaining "dual" functions (good or bad) of El Nino/Nina and Monsoons/El Sirocco tomorrow. The "bad" event logic is what I completed today, so those events should be just a few lines of code. The positive one, unfortunately, will require some rewriting like I did today, so that if 3 events award a food bonus to a city, they'd use the same basic award function and not 3 different ones that look almost identical.

Fortunately the bonuses for those positive events are fairly modest and won't touch too many other functions.

While V0.0 is released here and being tested, I will continue to work on cleaning up these duplications and hopefully when the "real" version goes out on Steam, it will be a helluva lot nicer than what we have today.

After completing the dual functions, I need to go back through each function to test how it operates. To make sure none of the later changes broke anything that was working before. I also need to clean up a little of the reporting text (consistent formatting between events mostly). But I don't think that will require much work. All in all, V0.0 is getting close to done. Will have a better idea at the end of tomorrow how much time is still needed before it's released here on civfanatics.

Cheers!
 
Last edited:
SMAN,

Glad to see things are progressing well and that V0.0 is getting close to done with all the positive, negative, and global functions are complete.

Great job!
 
Progress slow, painful. Am spending over half my time screwing around with reporting issues, getting the notifications and popups looking right. Incredibly frustrating work. You'd be surprised how much time it takes to figure out how to print the letter 'ñ..."

The problem is fixing output in one function often breaks other functions that use parts of the support functions for both. I'm just about to stop work on this and put it off until later. The poor quality of the initial design is making the end product just plain ugly.

If the mod didn't have to report anything it actually would be a fairly simple design. But deciding what the human players should know about the events, impacts, etc., then tracking the data needed to report these results severely clutters up the code. On many of the events, the reporting lines of code are 3 times more than the actual event implementation code.

Anyways, still working the last couple of mirrored events. Just not making good progress unfortunately...
 
SMAN,

Finalizing the mod seems difficult.

You have already done a very good job. I hope you will succeed. But it is also possible that you need to take a break from the mod.

This mod It's really a very good idea and I will continue to follow your work hoping for good news tomorrow.
 
Sorry for the gloom and doom earlier. Just getting frustrated putting in so many hours and making so little progress, due to all the backtracking/code rewrites.

New code for Black Swan V0.0 is done right now. I still need to go back through all the events and make sure that I didn't break any of the working events while adding code for later events. Shouldn't take too long.

I was tempted to shelve the project and come back to it for a complete re-write, and I still may rework it before V1.0 goes out. But as I look at the code now, there's not a whole lot of ways I could rewrite/combine/trim functions right now. Much of it has been fixed over the past week or so. It's still no where near how I'd design it from scratch, but as most programmers know, writing a program a second time takes about half the time as the first.

And I'm counting on that for the scenario management engine (SME). There's enough existing code (5 different versions) I can reuse that no matter what problem I run in to, I've already solved it in one of the previous versions.

I won't have much time tomorrow to work on BS, lots of IRL distractions. Need about 5 hours to finish V0.0 before releasing it. The reporting will probably still need work, but no need to hold up the mod testing trying to get text formatted perfectly. I'm hoping by mid-week to get it to you.

At that point, I'll probably start working SME for a few days just for a break. Will come back to BS when I get a good stopping point and finish the ingame events, and perhaps the rewrite. I'm hoping to get feedback from you and finish V1.0 sometime this month, or early next month.

The BS rewrite is tempting because now that so much of the event logic is finished, it would be easy to codify much of the behavior into a table that could be processed by 4-5 main functions, instead of the 30+ we have now. It would be much faster and much smaller in memory as well. But, the numbers that would go into that table are based on the ones that exist now, so any testing on V0.0 will still be useful to evaluate balance/impacts - which TBH is the hardest part. I want Black Swan to provide lots of variety to gameplay, but I don't want it to take over or fundamentally change the gaming experience.

Your help on getting that balance will be critical!

OTOH, if you want to wait a few days and test the reworked version only, that would also be OK with me, and might make more sense.

Anyway, thanks for the kind words. Almost ready for testing!
 
Last edited:
Sman,

Glad to see that your morale is better!
I'm not a programmer so you know what's best: if any testing on V0.0 will still be useful to evaluate balance/impacts I will do it 😊
I will have little time this week apart from Thursday but on the other hand I will have a lot of free time next week.
 
After several hours of trying to fix the broken reporting I've decided to stop this mess. A rewrite it is. It works out well, since your time is limited. I'm hoping to get the new version to you next week. That way you'll be testing the actual version that we want to release. And not testing one that will be rewritten anyway.

Sorry for the delays, but the end product will be much better, stronger, reliable, and much more efficient.

I'm also tied up a lot the next couple of days (my car finally died, so I need to find a new one), but am hoping for the best.

Appreciate the patience! Believe me, no one wants Black Swan done more than me! :crazyeye:
 
SMAN,

No worries, I completely understand the situation.

You did the best you could but you're right it's better that I can test the best version.

Me too, I can't wait to have Black Swan! We'll have to wait but you're doing your best, thank you.
If you can send me the new version on CivFanatics next week, I'm totally available on Tuesday and Thursday to test it.
 
Top Bottom