1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Missile variation

Discussion in 'Civ4 - Final Frontier Plus' started by PsiCorps, Jun 25, 2012.

  1. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,411
    Location:
    Britain
    I've just tested out the Doomsday Missile as it currently is within the FFP & B5 Mods. At present it works exactly the same as the Nuclear Missile in a standard game of Civ. I've added a unit into the B5 mod that can clear the Radiation Clouds left after the 'Nuke' strike so I have no issue with the after effects of using this weapon against targets. What I would like to do is add a Genetic version of this weapon.

    What it would do is the same as a standard missile in everything but the effect it has on the Star System. For now I'll call them Genetic Missiles (BioGenic Weapons has already been used in Star Trek) for the sake of simplicity.

    Genetic_Missile_I would remove 1 population point each turn over the course of 3 turns.

    Genetic_Missile_II would remove 2 population point each turn over the course of 5 turns.

    Genetic_Missile_III would remove 3 population point each turn over the course of 6 turns.

    That would be what I would ideally like to see. However if the game mechanics don't allow for the population to be reduced by this much each turn then I would settle for the next option.

    Genetic_Missile_I would remove 3 population points on the turn it hits.

    Genetic_Missile_II would remove 5 population points on the turn it hits.

    Genetic_Missile_III would remove 7 population points on the turn it hits.

    Use of these weapons would have the same negative diplomatic effect that using Nukes would have in a standard game of Civ.

    So, is it possible to add a variation of the existing missile in either form that I've mentioned?
     
  2. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    The one time effect version is much easier. The linger effect version is possible, but requires adding data that is checked every turn.

    It is doable in Python, although the AI wouldn't know about the special side effects, or diplomatic consequences, of that missile type. It's a bit tricky, but not too bad. They will also require an actual target unit - the nuke's ability to target an empty plot is, I think, controlled entirely by the iNukeRange flag not being -1 but if that is not -1 it also applies all the nuke effects (unit damage, non-combat unit chance of being killed, population reduction, radiation clouds, and building destruction - although this last one could be controlled via Python as well since it is done entirely in Python).

    Adding a new tag in the unit XML for it, "bGenetic" or some such thing, and then using that to do it all in the DLL is also possible but a bit more work. You could, in this case, include adding some sort of awareness to the AI for the unit's intended usage against star systems and possibly some awareness of the diplomatic effects (although the effects of nukes in this are seem to have little to no deterrent, so I am not sure if there are any).

    I could whip up some Python for the one-time version of the effect, if you'd like.
     
  3. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,411
    Location:
    Britain
    If you can that would be perfect. It would mean Civ's could make better use of their missiles by converting them to a Genetic Warhead. For use against populations you want to eradicate they would need to use a few more missiles rather than just the one that erodes the population over a few turns.
     
  4. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Sadly, it turns out that it is nothing like as easy as I thought.

    My idea had been to use the onCombatResult event handler. Sadly, air attacks do not ever trigger this event handler. So my nice, not too fancy but probably covers everything needed, code that I was testing turns out to never get called when you attack with a missile. It appears that air combat in general does not specifically generate an event to handle, whether an interception or attacking a non-air unit. When the missile dies it does not even generate a unitKilled event since no killing player is specified, although that would not actually be useful since any data indicating what or where it attacked is cleared before it would happen anyway.

    In theory it might be possible, but very awkward, to do via the selectionGroupPushMission event. That would be called before a lot of stuff happens like the actual combat, and any interception check. If the genetic missile unit is supposed to be impossible to intercept then there is some slim chance that it might be possible to do there - but I'm not sure if all the necessary information is available. It actually looks like what it reports for a missile attack is just a MISSION_MOVE_TO mission instead of a MISSION_AIRSTRIKE (which I would have thought would appear in there somewhere but does not show up in the PythonDbg.log file). With only a MISSION_MOVE_TO to look for, every time a unit moves it would have to check if it was a group consisting of 1 unit which is a missile of this sort (I don't think air units ever attack as a group) and if so check to see if the destination plot (obtained via rummaging around in the selection group's mission data queue) is an enemy location.

    Sounds like a lot of trouble to go through to try something I'm not really sure would work well, if at all. Making DLL changes, and adding a new tag for the unit XML, would probably not be much more complex, possibly less, and would certainly work. The easiest thing to do there would probably be to have it piggyback on the nuke code, doing everything which that does except the specific effects.
     
  5. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,411
    Location:
    Britain
    Oh well, it was a nice idea while it lasted. Thank you for looking into this and trying to get it to work.
     

Share This Page