Ambreville
Mar 05, 2008, 10:32 AM
Is there any way to make air unit recon missions interceptable?
|
View Full Version : Intercept on Recon Ambreville Mar 05, 2008, 10:32 AM Is there any way to make air unit recon missions interceptable? GeoModder Mar 05, 2008, 10:55 AM There's more then meets the eye here. You probably also want a way to make recon units interceptable during wartime only. A good thing would be to give diplomatic penalty points for doing recon missions on empires which you don't have open borders with. :D Ambreville Mar 05, 2008, 11:01 AM There's more then meets the eye here. You probably also want a way to make recon units interceptable during wartime only. A good thing would be to give diplomatic penalty points for doing recon missions on empires which you don't have open borders with. :D Not necessarily. A "recon" (call it a "spy") aircraft can be shot down during peace times (ask Gary Powers about that one). :lol: It wouldn't matter anyway. War is the basis for the scenario mod I am putting together. The issue here is no so much diplomacy et al, but how you actually intercept a recon mission... Dom Pedro II Mar 05, 2008, 11:13 AM I think this would have to be done in the SDK, but it would actually be fairly simple to do in the SDK. I would assume that the reason they didn't make recon interceptable is because the recon feature was considered the weakest of the air missions and the risk therefore would not be worth the reward. I don't think it was a matter of difficulty. Here... add this line to the recon function: if (interceptTest(pPlot)) { return true; } That should do it. Ambreville Mar 05, 2008, 11:38 AM Alright -- Thanks! What software do I need to make that change (is notepad enough)? In what file is the change to be made? Ambreville Mar 05, 2008, 11:40 AM The thing about this is that I can make recon-specific aircraft that would have a better chance of avoiding interception (??) On the other hand, they wouldn't be able to take on most other air missions. Dom Pedro II Mar 05, 2008, 12:49 PM The thing about this is that I can make recon-specific aircraft that would have a better chance of avoiding interception (??) On the other hand, they wouldn't be able to take on most other air missions. Well, are you asking me if you can make recon-specific aircraft that have a high evasion chance and can't perform any other air mission? Because the answer to that is yes. This can be done in the XML. If you're asking me if there's a way to make a recon-specific unit that has a high evasion chance when doing recon missions and can perform other air missions but with a lower evasion chance, the answer is no. However that too could be modded to be allowed. EDIT: Actually, there would have to be some SDK modifications to make the computer disregard the combat value of the unit to allow it to defend itself when intercepted but not allow for airstrikes. Any air unit with a strength value can airstrike. Ambreville Mar 05, 2008, 01:21 PM Well, are you asking me if you can make recon-specific aircraft that have a high evasion chance and can't perform any other air mission? Because the answer to that is yes. This can be done in the XML. If you're asking me if there's a way to make a recon-specific unit that has a high evasion chance when doing recon missions and can perform other air missions but with a lower evasion chance, the answer is no. However that too could be modded to be allowed. EDIT: Actually, there would have to be some SDK modifications to make the computer disregard the combat value of the unit to allow it to defend itself when intercepted but not allow for airstrikes. Any air unit with a strength value can airstrike. My last post wasn't really a question, just a comment (sorry for the confusion). My question is what is the SDK file in which I need to make the changes you originally described, and do I need special software to make the edit? I know nothing of SDK -- thus the questions. ;) Dom Pedro II Mar 05, 2008, 01:32 PM You'd need a program that can compile the SDK files. I recommend using this: http://forums.civfanatics.com/showthread.php?t=166933 And the file you're looking for is the CvUnit.cpp file. Ambreville Mar 05, 2008, 01:38 PM You'd need a program that can compile the SDK files. I recommend using this: http://forums.civfanatics.com/showthread.php?t=166933 And the file you're looking for is the CvUnit.cpp file. Thanks! I guess I'll try my hand at SDK now... :twitch: jkp1187 Mar 05, 2008, 01:49 PM I like this idea. I think it should be complemented with two things, though: 1.) A ban on combat aircraft being able to perform recon missions with closed borders in peacetime. 2.) Creation of a dedicated reconnaissance aircraft that IS able to perform recon missions with closed borders (the way that the caravel or submarine can cross closed borders in peacetime.) Would be nice to use the U-2 aircraft that someone created over in the unit graphics area. * In light of how such missions sometimes went (e.g., Francis Gary Powers' mission,) I would continue to allow those recon aircraft to be intercepted...although they should get a very high evasion percent chance. Although I would give them a strength value of 0. Ambreville Mar 05, 2008, 01:52 PM The only way I'd implement this is if only recon aircraft could perform recon missions. I'd strip the recon mission from all other combat aircraft. This should reflect what you described. Ambreville Mar 05, 2008, 01:53 PM * In light of how such missions sometimes went (e.g., Francis Gary Powers' mission,) I would continue to allow those recon aircraft to be intercepted...although they should get a very high evasion percent chance. Although I would give them a strength value of 0. Correct ;) ...now if I could just find someone to help me out with the night mission idea... jkp1187 Mar 05, 2008, 02:05 PM The only way I'd implement this is if only recon aircraft could perform recon missions. I'd strip the recon mission from all other combat aircraft. This should reflect what you described. Err...well, I wouldn't be keen on that. Recon is something easy that any acft could perform....but the recon acft could do it with less likelihood of being shot down, and can do it in peacetime. I'd give the U-2 a very big range...and, if possible, give it a +1 to sight (akin to sentry). Dom Pedro II Mar 05, 2008, 02:18 PM I'd give the U-2 a very big range...and, if possible, give it a +1 to sight (akin to sentry). That's not going to do anything. The range of a recon mission is determined by a globally defined number that is not reflected by the unit's own visibility range. Of course, it would be possible to create a new promotion ability that would increase recon range. With regards to spying on civs you're at peace with, this is possible though incorporating diplomatic consequences would require a bit more work. jkp1187 Mar 05, 2008, 03:28 PM By "range", I refer to: distance unit can travel before it performs its mission. That should be in the XML. I think it should have a very long range to permit spying over landlocked areas. (And also to differentiate it from the shorter ranged air combat units.) By "visibility", I meant the area over which the unit can remove Fog of War when performing the recon mission. You are quite right -- even enabling Sentry for the air units doesn't work. Do you know where this info is located? Will it require SDK? Dom Pedro II Mar 05, 2008, 04:38 PM By "visibility", I meant the area over which the unit can remove Fog of War when performing the recon mission. You are quite right -- even enabling Sentry for the air units doesn't work. Do you know where this info is located? Will it require SDK? I meant the visibility before. This is not a hard-coded number. You can find it in the Global Defines XML file. do a search for recon. However, this will change the recon visibility range for all air units. To make something that does it for specific units will require SDK work and I've already added it to my to-do list for my upcoming promotions modcomp (thanks for bringing up the issue ;) ). Ambreville Mar 05, 2008, 06:57 PM How does CIV4 compute interception odds anyway? Is it a two step process (check bomber's % evasion first, if not evade then check fighter % interception)? or A one step process (bomber modified evasion % minus fighter modified intercept %)? Dom Pedro II Mar 05, 2008, 07:12 PM There's a random chance of evasion based on the probability... if evasion fails, it looks for the best interceptor. If one is found, then there is a chance for interception based on the unit's current interception chance. which... now that I look at it, if the fighter is set to 100% interception chance, then the only time the intercept promotion would be useful is when the unit is damaged. Ambreville Mar 05, 2008, 07:27 PM There's a random chance of evasion based on the probability... if evasion fails, it looks for the best interceptor. If one is found, then there is a chance for interception based on the unit's current interception chance. which... now that I look at it, if the fighter is set to 100% interception chance, then the only time the intercept promotion would be useful is when the unit is damaged. So, provided there is only one available interceptor for the job, damage reduces its chances of interception? If the interceptor has a basic 100% interception chance, any further intercept promotion is worthless... Dom Pedro II Mar 05, 2008, 07:38 PM Yes, if the unit is damaged, it's interception chance is reduced. And yes, it appears that if the unit is NOT damaged, the interception bonuses are useless. Of course, you could reduce the fighter's 100% chance of interception and that would make the promotions useful again. Ambreville Mar 05, 2008, 08:02 PM Yes, if the unit is damaged, it's interception chance is reduced. And yes, it appears that if the unit is NOT damaged, the interception bonuses are useless. Of course, you could reduce the fighter's 100% chance of interception and that would make the promotions useful again. That's good enough. Basically intercept promotions allow a moderately damaged fighter to remain as high up as 100%. That's not bad. I can reduce the bombers average evasion scores, which then allows a similar reduction of intercept scores without affecting the scenario's game balance. surdanis Mar 05, 2008, 08:57 PM did you ever get to changing that cpp file, Ambreville? i'd like to know, cuz I need help with making a certain building constructible in a foreign city! thanks Ambreville Mar 05, 2008, 09:11 PM did you ever get to changing that cpp file, Ambreville? i'd like to know, cuz I need help with making a certain building constructible in a foreign city! thanks Nope. It might be some time before I ever get to trying my hand at SDK. Besides, this has to do with units -- not buildings. jkp1187 Mar 06, 2008, 09:10 AM I meant the visibility before. This is not a hard-coded number. You can find it in the Global Defines XML file. do a search for recon. However, this will change the recon visibility range for all air units. To make something that does it for specific units will require SDK work and I've already added it to my to-do list for my upcoming promotions modcomp (thanks for bringing up the issue ;) ). Hmm. Wouldn't it be simpler to create a new unit class (call it, say, "Air Recon Units"), assign the U-2 to that class, otherwise make it identical to air units and tell Global Defines to increase the recon visibility for just that class (so normal air units would not be included)? Dom Pedro II Mar 06, 2008, 10:11 AM Hmm. Wouldn't it be simpler to create a new unit class (call it, say, "Air Recon Units"), assign the U-2 to that class, otherwise make it identical to air units and tell Global Defines to increase the recon visibility for just that class (so normal air units would not be included)? It doesn't work like that. You can't tell the global defines to just change one unit class. The program pulls the number from the specified tag in the global defines XML. So if you just created a new tag for "air recon units" in the global defines, it would just ignore it because it hasn't been told to pull from that number. If you change the number from whatever it is now.. let's say it's 5. If you change it from 5 to 10, it will always take the value of 10. The kind of unit will not matter whatsoever unless you change the SDK to take this into account. The global defined reference will have to be removed altogether from the recon visibility range to be different for different units. You could change the SDK so that it uses a value from the unit class infos, but if you're going to change the SDK and add new attributes and tags to the XML, you might as well make it a promotion instead. jkp1187 Mar 06, 2008, 10:16 AM Sorry -- I just realized that I used the wrong wording, and just want to make sure we're on the same page. Instead of "unit class", I meant: unit category (e.g., "Gunpowder units", "Armor Units", etc.) (Unit class is something different, of course.) Dom Pedro II Mar 06, 2008, 10:28 AM Sorry -- I just realized that I used the wrong wording, and just want to make sure we're on the same page. Instead of "unit class", I meant: unit category (e.g., "Gunpowder units", "Armor Units", etc.) (Unit class is something different, of course.) Again, it's the same problem. Global defines are... well.. global. Meaning that it applies one value for everything. Global defines exist so that players can easily change the values in the XML rather than to force them to go into the SDK to change a relatively hard-coded number. So when you go into the setReconPlot(..) function in the CvUnit class, you'll see something like this: pNewValue->changeAdjacentSight(getTeam(), GC.getDefineINT("RECON_VISIBILITY_RANGE"), true, this, true); Don't worry about most of that. The key is the bold portion. What this means is that it's going to look through the global defines, find this tag, and then use the number you've entered there. So if it's 5, then it's going to use 5. If you put 10, it's going to use 10. And it makes absolutely no difference what unit class, unit combat, domain, or anything else you assign to the unit. The global define and the unit's information are not in any way linked.. right now. But this code would be different. pNewValue->changeAdjacentSight(getTeam(), getReconRange(), true, this, true); Because now we're pulling a value based on this particular unit's information. Of course, the code change would be a bit more substantial because the getReconRange function current does not exist, and you'd have to create it and create a new variable to store that information.. but that work is relatively light compared to some things. jkp1187 Mar 06, 2008, 10:54 AM Understood. Thanks for explaining it. Dom Pedro II Mar 06, 2008, 10:56 AM But not to be a total buzzkill, the good news is that its on the list for things for me to do for my promotion modcomp. ;) Ambreville Mar 06, 2008, 11:00 AM Yay! . . . . . . . . .:D jkp1187 Mar 06, 2008, 11:46 AM But not to be a total buzzkill, the good news is that its on the list for things for me to do for my promotion modcomp. ;) Not at all. I have to learn more C++, this is as good a project as any to start. :D Another thought: would it be better to create a new mission order, accessible only to the "air recon" unit category? This way, the normal air units can continue to use the regular recon order, while the air recon untis would use the special recon order that will give the extra visibility? Ambreville Mar 10, 2008, 06:52 PM Not at all. I have to learn more C++, this is as good a project as any to start. :D Another thought: would it be better to create a new mission order, accessible only to the "air recon" unit category? This way, the normal air units can continue to use the regular recon order, while the air recon untis would use the special recon order that will give the extra visibility? I think it would be better to keep the recon mission for recon units, and if you really want to use other air units for recon, in that case substantially decrease the recon visbility range for the latter (no more than 1 or 2 square radius). The visibility radius really ought to be a function of the aircraft range anyway (and therefore the map scale). So for example, when you run a WWII Pacific War game, with 1 Turn = 1 Month, your recon radius can be quite large. With a WWII Battle of Britain scenario that covers basically England and Germany, with 1 Turn = 1 Day or a few Hours (if this were possible in CIV), the recon range ought to be much smaller obviously! Ninja2 Mar 11, 2008, 09:06 AM Gedemons Air Force mod has that intercept-recon-missions, if it's not too late... Ambreville Mar 11, 2008, 09:45 AM Do you have a link to that mod by any chance? Ninja2 Mar 11, 2008, 03:25 PM The thread is here (http://forums.civfanatics.com/showthread.php?t=239144). I have the mod itself on my harddrive, which I can't access at the moment. I'll get it later. Where to upload it, then? Ambreville Mar 11, 2008, 03:27 PM Sorry, but your link doesn't work... ---------------------------- Never mind. It's OK now. It bombed the first couple times I tried it. Sorry... Ninja2 Mar 11, 2008, 03:29 PM Yeah, I had a http:// to spare. It's fixed now. :) I suppose I'll add the file to the database, and then just post a new link in the thread. Ambreville Mar 11, 2008, 03:33 PM This is a warlords 2.08 mod, right? Ninja2 Mar 11, 2008, 03:45 PM The original download link says "BtS Air Forces Module", and so does the thread name, but I haven't gotten around to testing it in 3.13 yet. So I can't say for sure. I was planning to pick some elements and add them to my Merged Mod, but I haven't had time yet. Ninja2 Mar 11, 2008, 03:49 PM Okay, it's been added to the database again... the link is in the last post in Gedemons thread. Ambreville Mar 11, 2008, 04:40 PM OK, thanks for all the info on this! Portus Mar 13, 2008, 11:13 AM Have you try give "hidden nacionality" to recon units, like privateer...:) Dom Pedro II Mar 13, 2008, 11:30 AM This is about the recon mission for air units. Not the recon ground units. Portus Mar 13, 2008, 11:45 AM oopps i like alot the concepts that Ambreville is proposing thats way i was subtle trying to contribute with something to help the experiments :blush: . |
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.