Mod-Modders Guide to Fall Further

Haven't messed with combat too much overall, but that is where you want to work. I would suspect there might be a bit of an issue with how you coded it. Did you only change pCombatDetails-> data, or did you also change iCombat, iStr or iModifier?

I did not change pCombatDetails->data. Only the iStr...So, I should get into the pCombatDetails? I hoped I could avoid it.

EDIT
By the way, I have done some tests with iModifier as well. And this had worked like a charm, but, unfortunatelly, it is the strength I need to increase not the combat modifiers. If it was about the combat modifiers, I wouldn't have to mod the dll in the first place...:)
 
Find something in pCombatDetails that you can "hitch a ride" with. That saves you from having to understand how to work with a Struct. Possibly iBaseCombatStr, iCombat, iMaxCombatStr, or iCurrCombatStr.

I have checked the whole method again and again. iStr do not change after my assignment and iMaxCombatStr gets its value from iStr.
It should have worked, unless there is another place where the final combat stregths are calculated.
The fact is, that it doesn't take in account the extra strength for the combat result as it is, but it is certain that it does get the increase in strength from the function...I keep searching...
 
I found it! It was a call in resolvecombat.
Btw, the whole thing needs rewriting. The parameters for maxcombatstr are confusing as hell, and the tweaks adding more conditions didn't help either...

Anyway, now I can go on and implement the rest of the stuff :D.

EDIT: I could do the rewritting for FF if you wanted to. I will certainly do it anyway for my mod, but in a slower pace. If it is for FF, however, I can do it much faster ;).
 
I guess it would depend on precisely what kind of a rewrite you had in mind and how well it worked out in the end. Typically I aim not to rewrite major functions like that until I have added something signifigant which requires the AI or general logic to approach matters from a different way (in this case that would most likely be fractional affinity and polishing of how damage types are handled so that a single unit can have multiple damage types at once)
 
Well, first thing of all, I want to ask 2 things...

1)Is there a reason the method is not
Code:
CvUnit::getMaxStr(CvPlot* pPlot, CvUnit* pOpponent, CvCombatInfo* pCombatDetails=NULL, bool IsDefender=false);
?
This way the method would have all the info needed, and wouldn't have to do all these conversions with pAttacker ending up to be even the calling object itself, nor the requirement to check so many times for the same thing(IIRC the barbarians are checked both in the bonuses vs civilization and attacker vs defender). In addition, the necessity for flipping the modifiers would have been avoided. It could still be called with pOpponent=NULL, and IsDefender=true, to get its own max strength on the present terrain, or with pOpponent=NULL, IsDefender=false, to check for its own maxstrength without the terrain modifiers.

2) What is actually the iExtraCombatModifier and why in combat log I get a (Extra combat -20%) when I attack and I have +20% str from combat I promotion against an opponent with no modifiers?(Grassland, no combat promotions on unit, racial promotion of opponent elf, racial promotion of attacker dwarf).
 
Not sure why they chose to go the way they did, I would imagine it was from this being one of the first functions written and one of the most frequently modified. As they realized a new need for checking it, instead of changing the call method and having to revert all links, they did funky gymnastics in the start of the function. Doesn't seem to be called too often though, so it's a loose excuse at best if right.

ExtraCombatMod is meant for Combat I and the like, also accounts for Homeland when in your own territory. Not sure why it displays backward, probably a text output mistake.
 
Not sure why they chose to go the way they did, I would imagine it was from this being one of the first functions written and one of the most frequently modified. As they realized a new need for checking it, instead of changing the call method and having to revert all links, they did funky gymnastics in the start of the function. Doesn't seem to be called too often though, so it's a loose excuse at best if right.

ExtraCombatMod is meant for Combat I and the like, also accounts for Homeland when in your own territory. Not sure why it displays backward, probably a text output mistake.

This is great. I also noticed that it is called in few places, I had to temporarily change it to include my modifications(at frst), so that I can have the opponent info as well.
So, my evaluation about the fact it needs to be rewritten was correct, after all. I just wanted to make sure I didn't miss something. :)

I will look a bit more into iExtraCombatMod, because I am pretty sure iModifier does the combat+promotion+plot str modification thing.
 
Maybe you are meaning some other function that I am translating it as. I don't see iExtraCombatMod anywhere, so I assumed you meant iExtraModifier, which calls for getExtraCombatPercent() (combat & homeland), and is the first thing loaded into iModifier. But of course scrolling down a bit more I see that it is actually just a dummy variable which holds each new potential modifier as it is loaded...
 
Maybe you are meaning some other function that I am translating it as. I don't see iExtraCombatMod anywhere, so I assumed you meant iExtraModifier, which calls for getExtraCombatPercent() (combat & homeland), and is the first thing loaded into iModifier. But of course scrolling down a bit more I see that it is actually just a dummy variable which holds each new potential modifier as it is loaded...

Yes, this is the one...I am going to finish rewritting the function today, if all go well. Then, I will have to test it. Propably this will take 10 times the time I need to write it, and that may increase if further debugging needs arise...
 
I tried searching a bit and couldn't find a suitable answer to a quick question.

How do I remove all yields from peaks?
 
CIV4YieldInfos.xml, not modified previously so you have to fetch it from the BtS/Assets/XML/Terrain folder. For each of the three yields, place a -2 in PeakChange or whatnot. That exact change will be included with the next patch if GIT doesn't forget it on us like I forgot it last time.
 
Tried to make the CivSelector work for Multiplayer again, found out that it was written perfectly in the first place. Problem is that the "modders method" for communication in MP games (sendModNetMessage) doesn't work yet while you are still in the setup screen. So there is no method to make the machines send and recieve data which the exe wasn't already expecting to send out at that point. So the only way it would ever work would be to let you load the game, then force a save and reload/rejoin before anyone gets a chance to notice the OOS. That would be hard to code, and painful to sit through, so CivSelector will simply never be available for Multiplayer games.
 
Those of us who play multiplayer appreciate the work anyways and always, Xien.

If it OOS's on the first turn, could we still use it and then load the game afterwords if we so choose?
 
I have it completely disabled for MP (clicking on the option won't give the popup), so right now you can't. But if people really think it is worthwhile to have that option I can re-enable it and try to make sure that the hover text makes it VERY clear that you WILL get an instant OOS by using it. By reloading the game you will reveal who all of the players are, but if the mild mystery of wondering who is in the game isn't an issue I can see it as being a slightly favorable approach to manually selecting each Civ in order to avoid certain ones (like Kuriotate who have a very confusing OOS right now).


Oh, and I have enabled AIAutoPlay for Multiplayer games. You have to turn on the MP option to allow it, but if you do then any player is allowed to trigger autoplay which will affect all players in the game. Can be useful if you suspect one of the players fell asleep at the keyboard, but didn't turn on the turn timer (just CTRL+SHIFT+X to have the AI finish up his current turn), or to get an interesting scenario where you let the AI run things for 1 or 2 hundred turns and then try to deal with what you are find upon returning :) In the future I might look into making it possible to enable Autoplay on a per-player basis, but that will be a more significant re-write than this was, so needs me to be in a programming mood instead of just relaxing between assignments :)
 
That AI Autoplay toy is going to be fantastic - one of my beta testers has a habit of going on breaks during which you'd think he could cure cancer or solve world peace.

I do think the instant OOS would be bearable in some cases, as long as you're aware it's coming. The randomness without the Kuriotates would be nice - and for someone like me who runs multiplayer tests, it'd be nice to be able to knock out certain AIs from time to time.
 
I agree. My friend and I experience about 50% OOS or CTD when starting new (base FFH) games anyway and it's not hard to recover from by reloading the initial auto-save.
 
Is there an easy way to cap the XP gained from ranged combat? I really like the feature but I did an 250 turns AIAutoplay on Emporer with my FF modmod and the lizards ended up with 79 combat V javelin throwers. Well, I am trying hard to get the AI better, but such a stack of doom means the AI could beat down all other AIs easily and that is not exactly what I want.
 
Easy to do, from inside the DLL. Only tricky part is deciding HOW to do it.

Base the cap on a global define?
Base it on the damage dealt with this strike?
Base it on a comparison of the attacker/defender?
Base it on a promotion defined limit?
Base it on Gamespeed/Handicap?
Track it seperately from normal XP and cap it individually?
 
Back
Top Bottom