1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

"Covert Operations" Mod Collaboration Thread

Discussion in 'Civ5 - Mod Components' started by sman1975, Dec 21, 2017.

  1. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    The AI Function:

    The basic approach of this function is for the AI would look something like this:
    1. Every turn, the AI would decide which of its civs will plan to conduct an operation several turns in the future
    2. Provide some level of warning to the human player a few turns before the operation to give them some opportunity to respond.
    3. Launch the operation, apply the results, inform the human player of the operation with varying levels of specificity
    4. Let the human player decide how/if to respond

    This module attempts to give some of the advantage back to the AI - based on the new capabilities the mod creates. I'm not sure how deep I'll run with this feature, but initially, it will look something like this:
    * The AI will have a list of "impacts" they can launch against the human player - these range from stealing gold, destroying city production, destroying buildings, lowering tech/golden age/policy progress, etc.
    * Every turn, the module will cycle through all the AI players and decide if it can launch a potential impact in X turns (say 5-10 down the road).
    * If it decides to launch, the module will check the human player's defensive posture and decide IF it should "warn" and if so, how "specific" the warning should be. Certain buildings, techs, policies will improve the defensive posture.

    The warnings would be a Notification (on the right side of the screen) that says something like (with the later ones being more specific due to better defensive posture):
    "Officials outside of the capital are reporting an increase in non-English tradesman, many with cargo that doesn't look like normal trade goods." <== Vague report
    "Local magistrates near Nottingham have arrested suspicious individuals with Greek accents loitering around important buildings. Subsequent interrogation has found no specific threats." <== Not a very specific report
    "Local magistrates in Nottingham have arrested suspected Greek operatives with caches of poison materials. All indications are they and other unknown compatriots are preparing hostile actions against us." <== Much more specific report
    "The Sheriff of Nottingham arrested a Greek Arsonist as they were preparing to poison water supplies in Nottingham. Some of the Arsonist's compatriots escaped and are preparing to attack Nottingham in the next 2-3 turns." <== Very specific report

    The human player would see these reports and decide if he needed to build more defensive buildings (that help catch operatives and impact mission results). He could also put more units in the city area, as the number of units in the area impact mission results. There may be a tech or policy that might help defensive posture. This would give the player the option to dedicate resources to an area to protect it from attack.

    * After a few turns have passed, the AI would then launch the impact at the human player, and results applied. A notification would appear informing the player of the attack.
    * If enough defensive posture exists, a new Notification would appear that informs the player who actually launched the attack. It would be up to the player then to decide if they will denounce or DOW.
    * If they decide to DOW, the amount of Warmonger Hate assigned would be eliminated, as if the attacking AI player had actually declared war ON the human player.

    There are other small tweaks to add to give the appearance of planning, sophistication, etc., but these will come after a bunch of testing of this concept.

    Appreciate any thoughts/suggestions on this approach. Getting the AI right is critical to prevent the Covert Ops mod from simply becoming a human player "cheat mod" rather than adding a new entire layer of fun to the game.
     
  2. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    Initial artwork on the 8 Cover Operator class of units. Picture 1 is the first four units (L-> R, T -> B): Vagrant, Arsonist, Assassin, and Saboteur. Picture 2 is the Radical, Provocateur, Operative, and Agent.

    If you have a better looking model/unit in mind for any of these, please let me know.

    upload_2017-12-31_10-4-0.jpeg upload_2017-12-31_10-4-19.jpeg

    Working on icons now....
     
  3. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    Not much time to work on these, but here are my first 4 unit icons. Takes a lot more time than it should, unfortunately... Am definitely NOT an artist.

    upload_2018-1-1_6-52-45.jpeg
     
    Last edited: Jan 2, 2018
  4. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    A bit of progress - icons, v2...

    upload_2018-1-2_5-37-24.jpeg
     
  5. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    OK... Finally.... Have said "See ya next year!" to visiting family, so hopefully can get back to "work" on this! Assuming the new kitten ever gets off my keyboard! :crazyeye:
     
  6. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    Buildings are completed/tested - all seem to be working correctly.

    Below are the summary tables of what the mod design currently does. Almost all of this is completed/tested, and looks pretty functional:

    upload_2018-1-6_17-8-19.jpeg upload_2018-1-6_17-8-30.jpeg upload_2018-1-6_17-8-41.jpeg

    Unit costs are a guess on my part, on how expensive the units should be. Initial guestimate is to set the number on twice the amount for the "normal" infantry unit of the era. Can always change it later. Also, there is a (perhaps temporary) build limit of 3 of each type of these units. Another thing: concerning the "Minimum Operator Level" - Level 1 operators can only perform level 1 missions. Level 2 can perform both level 1 and 2 missions. They will also perform level 1 missions better than a level 1 operator. And so on up to level 4...

    The "mission results" on slide 2 (change success, survival, incident) are primarily placeholders. In the test version, they will probably be set at something like 75%, 90%, 10% across the board for testing. In fact, one of the primary goals of testing is to get player feedback on what the proper numbers should be for each separate mission. Also, the current version of the mod provides a small, but escalating chance the operator, if he survives the mission, can remain in place and not flee to the player's capital city. Higher operator levels have a better chance to remain. Saves a lot of walking to get back to where you were/wasted turns...

    Minor "typo" on the building slide. The prereq tech for the Intel Fusion Center is Computers, not Telecommunications. Earlier version of the mod....

    Some work still required to complete the promotions, but won't take long. After that, I need to spend some time adding some "insurance" into the mod - adding more tests in the LUA code looking for things that can cause crashes or inconsistencies in performance/results. That almost always takes longer than expected but is a good investment to save testers a lot of headaches. With a little luck, I believe I should be able to get the "Non-AI" version of the mod working early next week. It will be "human only" playing, so it really isn't a complete version. But still, it will help to test it to make sure at least the human player features work - or perhaps collect tester input on ways of improving the gaming experience.

    The AI version will probably take several days to code, and a couple more to test. Still looks like we could have a final BETA version done in 1-2 weeks.
     
    Last edited: Jan 6, 2018
  7. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    Progress update: I haven't tested it nearly enough, but.... V1 of the mod is just about ready for testing. It's a little rough for my tastes, but as the mod is such a departure from normal Civ V play, perhaps it's best to release it for testing to get as much feedback as possible on where to steer development/refining. Am hoping to put it out tomorrow, with the large caveat, that it's in "experimental" form, not even Alpha. Still, it's been pretty fun to play during testing, so hopefully y'all will agree.

    One of the things I didn't like is the "temp" models I picked for testing. They were a little wimpy, so I scavenged a few models from previous mods to "butch" them up a bit. I think they look more like "covert operators" now. Hopefully, you do to. Here are some screen shots to give you an idea:

    Vagrant/Arsonist Assassin/Saboteur Radical/Provocateur Operative/Agent
    upload_2018-1-8_17-55-14.jpeg upload_2018-1-8_17-55-29.jpeg upload_2018-1-8_17-55-41.jpeg upload_2018-1-8_17-55-53.jpeg

    Hopefully, they look more like Covert Operators.
     
  8. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    More screenshots. Promotions 1-4:

    upload_2018-1-8_18-25-25.jpeg upload_2018-1-8_18-25-35.jpeg upload_2018-1-8_18-25-47.jpeg upload_2018-1-8_18-26-1.jpeg
     
  9. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    Some touch ups on the artwork, screenshots. Mod is ready for testing, will post in a few.

    upload_2018-1-9_6-17-0.jpeg upload_2018-1-9_6-17-12.jpeg upload_2018-1-9_6-17-22.jpeg upload_2018-1-9_6-17-33.jpeg upload_2018-1-9_6-17-49.jpeg upload_2018-1-9_6-18-11.jpeg upload_2018-1-9_6-18-24.jpeg upload_2018-1-9_6-18-36.jpeg
     
  10. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    The mod is released! Please feel free to drop in to offer any/all suggestions on how to fix it or make it better or what direction to take it next:

    https://forums.civfanatics.com/resources/covert-operations-v1.26667/

    The mod is "EXPERIMENTAL" as far as stability goes. So please be advised it will have issues as you're testing it. I've added quite a bit of safety features into the LUA code, but there's probably (almost always) never enough. It should be fairly stable in gaming environments where there aren't a lot of other mods loaded. If you're playing with 20 other mods at the same time, I'd expect to see quite a few problems.

    Still, this is the best way to make it stronger - collecting feedback from players with different configurations, and adding the changes that will make it even better. Thanks!
     
    Last edited: Jan 9, 2018
    Tekamthi likes this.
  11. Tekamthi

    Tekamthi Prince

    Joined:
    Aug 12, 2016
    Messages:
    350
    wow thanks for all this hard work! i never thought i'd see these active spies back in civ 5... i think this might be the only missing feature from the franchise's past.

    I've only tried the "great spies" mod a handful of times, and never got a good sense of what was going on w/ it.. but was curious... I know its not the focus here, but is it too complex for VP AI? I've occasionally seen AI great spies running around but tbh had no idea what was going on. I understand you've tried to make things as AI accessible as possible here.... appreciate that!
     
  12. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    @Tekamthi - thanks. I'm hoping I can get this mod working well enough to get the "feel" of the spies I loved in Civ2. Definitely an entire layer of gaming experience Civ V is missing.

    My current plan is to "simulate" the AI's use of the Covert Mission functionality. I don't plan on letting them "use" units running willy-nilly all over the board, doing nothing useful, then getting frittered away much too easily. I've seen how the AI "manages" civilian units, and it's not impressive. This dynamic means the mod is a significant boost to human player's power, with the AI suffering even more - and that's not anything anyone really wants. From my examination of the Great Spy mod code, it attempts to mitigate some of this, but I'm not sure how effective it really works. After thinking about it for a while and experimenting with similar approaches in earlier versions of this mod, I believe the AI would use these civilian units about as ineffectually as it uses its other civilian units - not well at all...

    So, instead of giving them units, I'll "simulate" Covert Operations along the lines described in post #21. With my limited programming ability (and the API's underwhelming ability to actually control AI unit behavior) - it should represent a leveling of the playing field and remove some of the human player's advantage. It won't be as "sexy" as watching AI covert operators moving in for the kill, but at least it should be more balanced in how much these missions impact overall game play and experience. This approach should also greatly improve compatibility with other mods. So, if the virtual AI covert ops mod is set up correctly, it should work fine with VP.

    It will take a lot of feedback from players such as yourself - to get the settings right for both the human and AI players. I'm really needing this feedback more for this mod than any other I've done - there's just so much here, and it requires several pairs of eyes to balance it all out.

    So - there are no bad suggestions, comments, complaints, etc. I have very little pride of authorship for this mod, which means you can't hurt my feelings with any feedback, as I'm not entirely sure how players other than myself would like to use it. So, I'm really interested in what you think and appreciative for helping me make whatever changes are needed to get the mod into a better place.

    THANKS!

    and P.S. - remember - this version mod is only "half finished." It only offers Covert Ops to the human player. I wanted to get this part stabilized first, or at least close to it. After that, I'll start work on V2 (as described at the bottom of post #20) - it will be much easier for me to design that actual AI functionality. I believe it will look like that described in post #21, but who knows - further development of the human functions may mean we need to take it in a completely different direction. Can't wait to find out how it works out!
     
    Last edited: Jan 10, 2018
  13. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    I'm liking this version of the Arsonist better... Shall we use him in the next version? :devil:

    upload_2018-1-10_10-6-22.jpeg upload_2018-1-10_10-7-44.jpeg upload_2018-1-10_10-22-46.jpeg
     
    Last edited: Jan 10, 2018
  14. Tekamthi

    Tekamthi Prince

    Joined:
    Aug 12, 2016
    Messages:
    350
    thats cool, I can appreciate that the AI just can't do some things.

    Will the AI version still be tied to a unit in some way? ie can I take out my opponent's spies somehow? having some kind of unit relevance for everyone would be nice, but then again you're still relying on AI's unit management ability. maybe AI version can just trigger in a much dumber way, like as soon as it crosses into an enemy border, or something really easy its bound to stumble over. maybe even just having the automated AI version affected by number of AI spy units that exist. some kind of spy vs. spy action would be high on my wishlist if AI wasnt completely inept at it. There was an old mod for civ 5 called "cloak and dagger" that gave a civilian the ability to kill other civilians. was very OP sometimes, but a great addition to some games nonetheless, especially vs human.. not sure if any of that code might be interesting/salvageable

    thinking out of the box a little, have you considered making them a combat unit instead of civilian? if they were "invisible", ignored "ZOC", could enter rival territory & use enemy roads, had very high withdraw chance.. maybe a few other obscure survivability/mobility promos.. could still be very spy-like but better managed by AI?

    Anyway I love the design ideas so far... just throwing in some entirely speculative ideas I'd be curious about.. definitely will add this to my mod list for next games and try to get you some feedback

    new arsonist looks great!
     
    Last edited: Jan 10, 2018
  15. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    My original thoughts on the AI was using a Notification (the messages on the right side of the screen) to give hints/clues to the human player a few turns before any actual operation would hit him. This would give the human player some time to respond to help prevent impacts. The report would have different degrees of "quality" based on several factors (defensive buildings in the target city, friendly units nearby, certain techs, etc). The "quality" of the report would alter the contents, i.e. a higher quality report would give better information - such as game turn the attack will occur, what type of attack, identity of attacker, etc. Lower quality reports would have more vague information, and might often be simply wrong - a false alarm.

    Some of the responses a human player might use after seeing this Notification would be to place "defensive" buildings, e.g. Walls, Castle, Constabulary, Police Station, etc., in the city - as these buildings lower the chance of successful Covert Op attack. These buildings also would increase the chance of the human player discovering the identity of the civ launching the attack. It would still be up to the player to decide what to do about the attack, but any "friends" of the human player might denounce and or DoW the attacking civ.

    Another thought was to use the number of human player's units in the cultural border of the target city to also help lower the chances of attack and increase chances of identifying the attacker. Any friendly "Covert Operator" units would be much better at this than normal units. My thoughts were if the target city is surrounded by military and covert ops units, the chance of successful attack should be much, much lower.

    I liked your thoughts about actually using combat units for the covert operator units - it's a concept I've used in other mods to help bypass the AI civilian usage problems (e.g. the Field Marshall unit in the Napoleon at War mod, and others). The AI tends to use combat units in a better manner and they tend to survive much longer than civilian units - especially with the extra withdraw promotion. They also had lots of defensive promotions, ignored ZOC, but enemy roads/invisibility is a nice touch for covert operations.

    The overall difficulty remains, however, of getting the AI to use these capabilities in a somewhat human-like manner. The real problem is related to how the AI gives commands to units and how poorly individual units respond to directives from LUA code. For example, you can use LUA to "push a mission" to a unit (e.g. "Move to location X/Y") - and the unit might seem to follow that direction. For a turn. Or two. Then other missions are pushed to the unit and it goes off doing whatever the AI would have wanted it to do in the first place. You can push a mission to a unit every single turn, and the observed behavior won't be significantly different. This is especially true if I'm trying to build a unit in my capital, then move it halfway across the map and have it loiter in the vicinity of a different civ's capital. Then hang around there until certain criteria are met to launch such a covert op against that city. I just don't see that working very well, even if really good criteria could be developed (criteria that integrate covert operations planning into the overall AI Grand Strategy, etc.).

    The current mod design is set up so it can scale larger (meaning more missions added) with minimal effort. After reading your suggestions, I'm almost inspired to add 2 different classes of Covert Operators - one class of civilian units, one class combat units - with the combat units incorporating some of your suggestions. Sort of like the British using MI-6 assets (civilian) and SAS assets (military) - or for the U.S. - how CIA/private contractors and military units from Special Operations Command interoperate. This may mean dividing up the different missions between these two unit types: some missions only civilian units can do, some only military units, and maybe some missions both could use.

    Getting the AI to use two different approaches could mitigate some of the AI ineffectiveness in using the new units. By two approaches I mean the AI would never train the civilian units, and use the "virtual attack" methods we've been discussing for their missions, but letting the AI train the "combat" covert operator units and at least attempt to coerce them to move out and use some of the new capabilities. It won't be perfect, and far less effective than the human units, but there are work-arounds (i.e. better stats, extra promotions for the AI versions of the units, etc.) to help with that.

    Early days - and there's still chances to add great ideas without breaking too much existing code. Let's see how these ideas percolate over the next few days and I can start adding pieces in then.
     
    Last edited: Jan 10, 2018
  16. Tekamthi

    Tekamthi Prince

    Joined:
    Aug 12, 2016
    Messages:
    350
    thats cool, thanks for the detailed explanation. maybe the combat unit thing would better fit a second mod that complements this one.. I think the design you have worked out is really good, actually, and might allow for deeper set of features than if you had to balance things pefectly.

    In addition to the buildings/units, would love to see the human's spy units being useful in reacting to these threats.. speculating further, maybe the AI spy action event could be focused on some tile, the alert is a general area notification for 1-3 cities, and some kind of human spy activity is required to zero-in and uncover the plot. Your description of a timer reminds me of the show '24'. some kind of jack-bauer-esque mini-game might be a fun distraction amongst all the other civ chaos
     
  17. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    So, a second mod ("Special Operations") to compliment the "Covert Operations" mod? Love it! And it doesn't muddy the intent/design of this mod too much either. Pure military units and pure civ units. Nice, tidy.

    The "timer" is a bit of a misnomer. In my original (cocktail napkin version) design, every X turns, the mod would decide if an AI civ would be allowed to "Plan" a covert op. It would then decide the exact launch turn (about 10 turns down the road). At Turn - 5, the mod would issue the human player some kind of warning. The specificity of the warning depended on the overall espionage posture of that civ - and a bit of luck. So, the better the quality of reporting, the closer the warning would be to actual launch turn - off either a bit early or late. A low quality report might give the turn wrong by 3-5 turns too soon or too late. A high quality report may be only off by 1 turn or on the money.

    In the cases we've been discussing, this would give the human player the chance to build/move some covert operators into the area, which would help them better prevent the attack. Sort of what you're describing. Adding more than a single city to the mix is an interesting bit too - i.e. if the quality of the report is low, there may be 3 cities in the warning. If the quality is excellent, maybe only 1 city - and a much higher chance the city in the warning is the actual target city and not a different one.

    The build limits (currently 3 units of each type in the class) prevent stockpiling operators near friendly cities unless you never want to go on offense at all. And keeping obsolete versions of units hanging around cities will have limited effect, since the older units have much smaller influence than the latter ones do. For example, if you have level 1 operators (vagrant/arsonist) around and the AI is attacking with level 4 operators ("virtual" operative/agent) they won't have much impact on stopping the attack. OTOH, a level 4 operator defending against a level 1 attack would be extremely effective.

    As far as AI on AI attacks, this would be much more streamlined - and perhaps the human player might never know? Will have to think more about that one...

    Jack Bauer mini game? Perhaps I can add some kind of defensive "counterintelligence" missions - where they have to hang around in an area and it raises the defenses for XX turns? Hmmmm.... Maybe that's already in the design, even if it's passive. Or tie a CI mission into the normal "prevent tech stealing" process?

    Great suggestions. Keep 'em coming. This stuff doesn't write itself, ya know! It needs inspiration - and so do I! :lol:
     
    Last edited: Jan 10, 2018
  18. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    Experimenting with the AI - looking promising. Am trying to reuse some of the Notification icons to inform the human player when they are attacked. Not finished yet (e.g. no attacker ID or international response messages added to the mission result) but here's what I'm leaning towards:

    upload_2018-1-11_7-50-39.jpeg upload_2018-1-11_7-50-53.jpeg upload_2018-1-12_9-19-22.jpeg upload_2018-1-12_10-1-35.jpeg upload_2018-1-12_10-9-41.jpeg

    Or would a specialized popup be better?
     
    Last edited: Jan 12, 2018
  19. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    FYI - currently I'm "cleaning up" the existing code so that it will accommodate AI covert ops - and at the same time fixing more than a couple "typos" and adding more traps and safety features. Since a few of these boo-boos probably impact game play and testing, I'll probably release a new version of the mod in the next few hours. It shouldn't affect saved games, and will hopefully be working better. Will let you know when it's released. Thanks.
     
    Tekamthi likes this.
  20. sman1975

    sman1975 King

    Joined:
    Aug 27, 2016
    Messages:
    901
    Location:
    Dallas, TX
    New version (V1b) is posted. I've seen a little bit of intermittent odd behavior - more details in the "Updates" tab. Also a summary of changes there.

    Nothing drastic, and the mod should behave, more or less, better than before. Especially in the "Team International Reactions" where teams/DoFs of a target civ denounce or DoW an attacking civ. Code is cleaner and several poor coding examples improved.

    Continuing to work on the AI portion. Have rewritten much of the code that was originally completed/tested with only the human player in mind. This is mostly fixed, so that the AI can reuse the same functions when it conducts operations, either against the human or other AI players. Currently, the AI can successfully attack with all 13 missions and the international responses are working as well. Need to do some work on "virtualizing" what happens to the AI Covert Operator after the mission.

    So - the "Process AI covert mission" component is almost complete. Still need to work on the "Schedule AI covert mission" and "Warn human player about an upcoming AI covert mission" components. Getting those two finished will just about complete the major sections of the mod.
     

Share This Page