[DOTO] Dawn Of The OverLords

hi LeBashar,

thanks for the reports. both issues should go to f1rpo from advc civ,
ill let him know.

the second one - you can adjust settings in the globals xml files. i havnt changed these.


****
my computer dropped dead, so i cant mod for now,
hopefully ill be able soon, to issue a new version with many impotent updates from advanced civ.
(i have backups for all my work )
 
I hope you don't mind if we continue the discussion about range strikes here, or at least about the implementation details.
hey f1rpo,

iv been working my *** off on the ranged...

i think theres a bug in this function in plot.cpp:

CvUnit* CvPlot::getBestDefender.

after a ranged attack is carried, it does not get the best defender, ig gets the same one.
how to test:

use my last sdk folder - 238 from my 104 git.
start game
via world builder - add 10+ catapults
add 4 warriros barbarians

attack range with al catapults -
the combat limit of the catapult of 50% will apply for the whole stack once one warrior has reach the 50% mark.

i tested both in vip and more, im pretty sure its the this function, since in vip it is vanilla civ,


BINGO -
now i know im right -
<DefineName>LFB_ENABLE</DefineName>
<iDefineIntVal>0</iDefineIntVal>
when left from behind is on,
there is a bug for air range strike,
does not get the best defender.....

edit:
well to be exact:
</Define>
<Define>
<DefineName>LFB_USECOMBATODDS</DefineName>
<iDefineIntVal>0</iDefineIntVal>
without this , it works well.
seems left from behind, does not consider air combat limit or air units .
im trying to find a fix in int CvUnit::LFBgetDefenderCombatOdds...hard so far.
My quick impression is that this clause
if (pAttacker == NULL || pAttacker->getDomainType() != DOMAIN_AIR || pLoopUnit->getDamage() < pAttacker->airCombatLimit())
in CvPlot::getBestDefender should filter out units whose damage limit has been reached. Though if you say that it works correctly without LFB, then perhaps it's something else. I hope I can look into it more tomorrow or the day after – if you haven't worked it out by then anyway.
 
hey man,
yeah , thanks,
i got over the board with the overflow posts... sorry for that....

ok,
so, as i told you, the problem is specific to the combatodds part of LFB.
but, i followed the line you wrote, which i, missed somehow...
and i changed it to :

Code:
//if (pAttacker == NULL || pAttacker->getDomainType() != DOMAIN_AIR || pLoopUnit->getDamage() < pAttacker->airCombatLimit())
                            if (pAttacker == NULL 
                                //NONE AIR UNITS WITH AIR ATTACK - WITH AIRCOMBAT LIMIT FILTER
                                || pAttacker->getDomainType() != DOMAIN_AIR && pLoopUnit->getDamage() < pAttacker->airCombatLimit()
                                //NONE AIR UNITS WITH NO AIR ATTACK
                                || pAttacker->getDomainType() != DOMAIN_AIR && (pAttacker->airCombatLimit() == 0  || pAttacker->airCombatLimit() == 100) 
                                //NONE AIR UNITS WITH COMBAT LIMIT AND NO AIR ATTACK VALUE
                                || pAttacker->getDomainType() != DOMAIN_AIR && pLoopUnit->getDamage() < pAttacker->combatLimit() && pAttacker->airBaseCombatStr() == 0
                                //NONE AIR UNITS WITH NO COMBAT LIMIT AND NO AIR ATTACK VALUE
                                || pAttacker->getDomainType() != DOMAIN_AIR && (pAttacker->combatLimit() == 0 || pAttacker->combatLimit() == 100) && pAttacker->airBaseCombatStr() == 0
                                //AIR UNITS WITH ATTACK LIMIT
                                || pAttacker->getDomainType() == DOMAIN_AIR && pLoopUnit->getDamage() < pAttacker->airCombatLimit()
                                //AIR UNITS WITH NO ATTACK LIMITS
                                || pAttacker->getDomainType() == DOMAIN_AIR && (pAttacker->airCombatLimit() == 0  || pAttacker->airCombatLimit() == 100)                       
                            )

and, this one works :)
but i dont know if thats a really good implementation though.
theres two effects for this fix, good and bad:
1. ranged attack with 0 damage, would not be carried out and move , wont end - which is great - before, attack, wasted the move. simply cant attack the plot - no defenders == null.
2. the ranged, cant bombard the city in that case , since defender is null - and the mission comes to a false:
Code:
if (!canRangeStrikeAt(plot(), iX, iY))
    {
        return false;
    } // UNOFFICIAL_PATCH: END
i can still bombard a city with the available regular bombard mission.
i want to over write the above,
and state -
if (!canRangeStrikeAt(plot(), iX, iY))
{
ALLOW BOMBARD THE CITY, from what ever air range.
return false;
} // UNOFFICIAL_PATCH: END

what are your thoughs?


p.s. -
you see how i learn and implement? you gave me the jump start to start adding and changing things on my own :)
 
hey man,i got over the board with the overflow posts... sorry for that....
No worries. I'm not sure where to discuss this really. Don't want to inundate this thread with technical minutiae either.

I've noticed that the checks in CvPlot::getBestDefender are duplicated in CvPlot::hasDefender. That's not a problem with range strikes – but with BtSBBAI. (Edit: Actually, it was BBAI that added hasDefender and copy-pasted the code.) I was going to change this so that those conditions are in one function that both getBestDefender and hasDefender can call (but I got sidetracked). The development version of AdvCiv already has most of those checks in a new function CvUnit::canDefendAtCurrentPlot and getBestDefender calls that new function. hasDefender has one additional check: canAttack (checked for the attacker). That filters out defenders whose damage limit is reached. getBestDefender has such a check only for air damage; other damage limits only apply in CvUnit::canMoveInto after choosing a defender. In BtS/AdvCiv this all works out in the end, but it seems cleaner to me to check all damage limits already in getBestDefender. So I'll try to move the damage limit checks to CvUnit::canDefendAtCurrentPlot. Or rather, I'll probably put them in another auxiliary function. That "checkDamageLimits" function would then be the place for the range strike conditions that you've added, and hopefully they can be simplified a bit this way.

Apart from that, I think you're right that the Lead From Behind code should also take into account range strike combat limits. This line
iDefenderHitLimit = maxHitPoints() - pAttacker->combatLimit();
in CvUnit::LFBgetDefenderCombatOdds cares about regular combat limits, so probably the range strike limit should matter at that point too.
1. ranged attack with 0 damage, would not be carried out and move , wont end - which is great - before, attack, wasted the move. simply cant attack the plot - no defenders == null.
Yeah, I've seen that. That was pretty bad.
2. the ranged, cant bombard the city in that case , since defender is null - and the mission comes to a false:
I wasn't aware that range strikes can bombard city defenses. How is that supposed to work – hit a defender so long as the damage limit hasn't been reached and otherwise the city defenses? That sounds rather nonintuitive. Maybe the bombard mission could be given a greater range instead (namely the air range)?
i want to over write the above, and state - [...] ALLOW BOMBARD THE CITY, from what ever air range.
You could just call CvUnit::bombard I guess. There's a canBombard check at the start though, so the canBombard conditions may have to be changed regardless of how bombardment is triggered in the UI. On that note, of course it would be nice if the UI could show somewhere which unit is targeted, the chance to hit and the maximal possible damage. Or if range strike could be triggered with a right-click when the unit has no regular attack ability. In fairness, most (all?) of that is also missing for air strikes.
you see how i learn and implement? you gave me the jump start to start adding and changing things on my own :)
I'm happy if I did. You do seem to have gotten the hang of things with the DLL. Hopefully that'll also make it easier to realize some of your other ideas e.g. for strategic resources.
 
Last edited:
its fine, we can speak here.

hasDefender a - yeah i saw the duplicate , so i embedded my alter also there.
your plan sounds clean indeed.
ill mark again that i fear advc 097 merge so much :)

Apart from that, I think you're right that the Lead From Behind code should also take into account range strike combat limits. This line
at first i tried to apply reference to air also, but i couldn't get it to work , so i went with the getbest like you suggested. all my code packages are on the git if you wanna see.

Yeah, I've seen that. That was pretty bad.
better now :)

wasn't aware that range strikes can bombard city defenses
theres a reference to what happen if theres a city, and then reduce damage of bombard rate.
im thinking of return false to can range strike if the city is fortified, so no ranged attack should be allowed if theres a city defense, even 1 %.
or, maybe just make ranged attack , depend on the city defense to be pretty hard.
2 different approaches.

You could just call CvUnit::bombard I guess. There's a canBombard check at the start though, so the canBombard conditions may have to be changed regardless of how bombardment is triggered in the UI. On that note, of course it would be nice if the UI could show somewhere which unit is targeted, the chance to hit and the maximal possible damage. Or if range strike could be triggered with a right-click when the unit has no regular attack ability. In fairness, most (all?) of that is also missing for air strikes.
ui could be nice, but, for now need functionality.
i tried to tie bombard when theres a city, though yet to success, i guess i should condition the mission_ , like in the paratroop on the kdefinition,

I'm happy if I did. You do seem to have gotten the hang of things with the DLL. Hopefully that'll also make it easier to realize some of your other ideas e.g. for strategic resources.
:)


besides the notes on the matter,
im dealing with crashes on my end, not mod related i think. the game sometimes wont load , it fails on the bar load, of mp/ voice,
and sometimes on python.
perhaps something in the compiler i did wrong, seems maybe python thing i dont know, it is so irritating, im not sure what to do.




EDIT:

so , i formed in the system i want, for now.

land siege units can:
mission ranged attack
mission bombard (normal - but not ranged).
same as air units.
damage and hit on both with have a random factor.

i tested and it looks good, i added ui stuff also.
now i need to test the ai and how he does.
after that,
i want to try and have the bombard ,mission, as an airbomb mission == ranged.

i guess if i could have just, activated airbomb + air strike, to land units, that would have been easier.
 
Last edited:
ill mark again that i fear advc 097 merge so much :)
If I can get it cleaned up soon, you could perhaps adopt that part directly while your own code is still fresh on your mind. Well, I'll let you know in any case.
[...] so no ranged attack should be allowed if theres a city defense, even 1 %.
or, maybe just make ranged attack , depend on the city defense to be pretty hard.
2 different approaches.
I see. Both sound reasonable. I guess air combat should work the same way, so you may have to change that too. Or make range strike work like air combat, meaning that city defense does not hamper ranged/air attacks against the garrison and bombardment (of the city defenses) as a separate mission.
i tried to tie bombard when theres a city, though yet to success, i guess i should condition the mission_ , like in the paratroop on the kdefinition,
gDLL->getEntityIFace()->AddMission(&kDefiniton);
That's just for the animation, right? To allow bombarding defenses from a non-adjacent tile, CvUnit::bombardTarget would have to look for a target city within a range of tiles instead of just:
for (int iI = 0; iI < NUM_DIRECTION_TYPES; iI++)
i guess if i could have just, activated airbomb + air strike, to land units, that would have been easier.
Sure would've been nice to reuse the AI code.
besides the notes on the matter,
im dealing with crashes on my end, not mod related i think. the game sometimes wont load , it fails on the bar load, of mp/ voice, and sometimes on python.
I'd check the log files after a crash; you know, app.log, init.log, audio.log, xml.log, PythonErr.log.
 
If I can get it cleaned up soon, you could perhaps adopt that part directly while your own code is still fresh on your mind. Well, I'll let you know in any case.
no rush, ill do it when your ready.
i feel version 096e is pretty solid for play, ofc, updates are something i eager too, but, 096e, all and all is pretty good (havent tried my extra aggressiveness changes)

I see. Both sound reasonable. I guess air combat should work the same way, so you may have to change that too. Or make range strike work like air combat, meaning that city defense does not hamper ranged/air attacks against the garrison and bombardment (of the city defenses) as a separate mission.
i went with:
mission ranged : if city has defense - you can range attack units, even if its just 1%.
mission bombard - normal behavior

gDLL->getEntityIFace()->AddMission(&kDefiniton);
That's just for the animation, right? To allow bombarding defenses from a non-adjacent tile, CvUnit::bombardTarget would have to look for a target city within a range of tiles instead of just:
for (int iI = 0; iI < NUM_DIRECTION_TYPES; iI++)
the bombard seaeches for a close by cities - i think looking in all tiles - might result if finidng more than one city, which might cause both cities defenses to be affected.
i aim towards the air_bomb mission behavior.

Sure would've been nice to reuse the AI code.
i now think this will actually be, the best implementation, clean defined , ai usable.
will need some minor changes same as in the ranged strike now.
i will try to investigate what actually controls the prevent land units/sea from having access to these missions. i did see a domain ref there, but removing it did not help,
so i will look deeper.
of course some air unit ai for the units will be needed.

I'd check the log files after a crash; you know, app.log, init.log, audio.log, xml.log, PythonErr.log.
that would be great , though, i had a look at these briefly,could not make anything out of it.
now , i just start the game over and over , until it loads ( i delete cache files each time) its silly, but i have no idea why.
my main suspect is actually the compile setting for the dll.



------------------------
added to post:

im almost done with the initial implementation of the new ranged combat system.
i tested it in various situations.
heres a summary i wrote:
Spoiler :


Ranged combat system revised a bit by me.

based on VIP - Vincentz original ranged strike code. with f1rpo support.

affects
1. land or sea units.
2. units with air range >0 + air combat > 0

mission types and definitions:
1. Bombard - Normal vanilla bombard
- will have random damage factor.

2. ranged strike
-will have random damage factor
-units cannot bombard a city if its has city/building defense
-if a unit has ignore city/building defense - it will be able to range attack - but without collateral damage.

both missions will end movement.
cannot commit an attack on an invalid tile that does now meet the conditions above.


Air strike and bombard:
will now have random damage factor.

fix - left from behind - seems if a unit is damaged - it picks it from the stack and not the strongest
todo - optional components with game options.
option for a ranged attack to first reduce city defense only than attack units (original vip design)
somehow make the bombard mission to be ranged , same as air bombard.
wish - use air strike and air bombard for land / sea units - optimal implementation for ai, existing mechanism.
 
Last edited:
the bombard seaeches for a close by cities - i think looking in all tiles - might result if finidng more than one city, which might cause both cities defenses to be affected.
i aim towards the air_bomb mission behavior.
Oh, that's true. Hadn't thought of that.
i will try to investigate what actually controls the prevent land units/sea from having access to these missions. i did see a domain ref there, but removing it did not help,
On a quick glance, I also only see the domain check and a iBombRate>0 check (which is different from iBombardRate – as you probably know).
now , i just start the game over and over , until it loads ( i delete cache files each time) its silly, but i have no idea why.
AdvCiv and DotO don't access the XML cache, but the "Catalog" files (I guess that's the file system cache) are probably accessed, so I can't just claim that deleting the cache folder is pointless.
my main suspect is actually the compile setting for the dll.
If the crashes only occur when you attach a debugger, then Steamless could help. But I think you had the same issues with a non-Steam installation. :sad:
 
i dunno,
i havent seen this crash in the past 2 days.
when i play with my friend online, i change the doto folder to doto104 than i get the version we are playing to be also doto.
maybe this causes this issue. i found that deleting the cache helps a bit.

yes, i found nightinga'les post on steamless, i indeed couldnt attach the debugger properly.
so now im working without, but ill just install my older civ4 version. not sure i wanna go with steamless.


air missions,
well i did play with it yesterday,
i got a catapult to have air strike mission :)
but, i didnt get a plot target in green, maybe something with the plot check for available air strike.
i went through the codes , theres many places to change, but, i feel this could be pretty cool and feasible.
but i decided now to focus with what we have from vincentz.
task list:
get unit mechanism work - done
get ai tweaks - not yet
code optimiation - not yet
xml stuff optimization - more todo

:)
 
hey all Doto players,
i see some downloads of the latest version was made,
so im pleased of this.

if anyone wants a development version to help test and play,
the git master is clean and ready to test:
https://github.com/keldath/kmod-adv-Doto

ranged attack for siege units are now a part of Doto thanks to good folks.
also with many more updates.

edit:
main thread updated with links and some clean up,
 
Last edited:
Hello, I've just a thought reading your ranged attack stuff : shouldn't be more simple (and realistic) to have only one attack, ranged, without retaliation, and capable of making collateral damage and reduce defense of the plot (if it has any) ? in civ 4 , I have always asking myself why there is two sort of attack because in reality, how can we decide, with a bunch of artillery, you want strike only the bunker but not the defenders ? And vice versa : how can we make a whole bombardment, injured all defenders and... don't make a scratch on any defense building ? again with aerial attack : you can destroy an improvement like a town but... your bombs avoid all ennemies troops in that town ? so weird.

I have already think of this some years ago when I worked on dunewars, and don't found a solution (with xml only), but if you are working on this, I suggest my thought : combine all the attacks of bombardment units (terrestrial or aerial, it's no relevant at this point, it's just a matter of range, no ? ) in one which make both collateral damage, and reduce defense of the plot if it has. So in open ground/forts it will do only collateral damage + destruction of the plot improvement (if any), and in city, it add defense reduction. And terrestrial siege unit lost the capability of making their so weird close combat suicidal charge.
Obviously, thoses bombardments should be influenced by the defense of the target, but if siege units can't attack differently than ranged, then all defenses against this which be take in acount should be the air defense. stats units age scaling should make modern units nearly immune to primitves bombardments like catapult/trebuchet.
What do you think of this ?

ps : siege unit/aerial should gain experience when they do their ranged attack
 
hi friend,
glad you have thought on the issue.

only one attack
i tend to agree, one attack, that will do both, bombard and range strike units

ranged, without retaliation
fortunately,
this option - was made optional by vincentz, so its controllable via globaldefinesalt (later ill make it form the custom game screen).


combine all the attacks of bombardment units
as the above i do agree with this view.
vincetntz ranged strike, first target city defense and only after its lowered, it can attack units.
so thats is similar to the view you suggest .
for now i disabled this feature, so only units on ranged if its got city defense.
i also plan on making it optional.

having the ranged attack to reduce city defenses, and taking its number as a reduction from the damage will also make do -
city with 100% will block all ranged to units + collateral
city with 80% will make the ranged strike + collateral to be maximum of 20% of its potential.

i have decided for first installment of the ranged, to be separated, since
there needs to be added code that cancels out the bombard option and leaved only the ranged one.
i just went for now with the existing code while adding my own stuff.
actually its the first time for ever to actually manipulate code and making new.
so my goal, is indeed, as you view it,
one mission for all of that.

another thing that need to be taken considerations is the ai ability,
these missions has ai to them pretty nice , but i guess, that also needs tweaks, that for now i dont know what is needed or how to. hopefully my skill there will grow.

this siege ranged thing really got me going, ill invest in it until i am happy and i know this works excellent it all terms .
if later i could harness the airstrike mission,
to be for all unit types domain + have it do bombard damage,
it would be optional, since the ai code for it, exists fully.
so might take time, im not a c++ programmer, but im starting to pick up stuff with the help of f1rpo.

i remember you did some wonderful stuff with dune wars,
in fact my next game with my friend on MP will be dune wars.

anyway LeBashar,
if your wish and willing, i would be happy to have some help from you,
as you can see, im very much open minded and accepting new ideas.


ps : siege unit/aerial should gain experience when they do their ranged attack
yes absolutely.
vincentz used bombard exp, which i will also use later on.
 
Last edited:
another thing that need to be taken considerations is the ai ability,

Yes, it need to combine also the AI choice but it should be more simple because there's no more choice between bombard or strike if both are done together. But maybe there will be more stuff to do with the AI choice of how many and when to produce siege/bombard units.

I just though to anything else : there should be some kind of retaliation if the bombardment hit something capable of shoot to the same distance. For example : frigate should take fire in return if they bombard a coastal city where there is canons in garrison. Maybe this could use the same game mecanics than fighter air interception against bombers (?). Likewise, if catapults bombard a city where there is catapults, attacker should take a return fire of some kind.

The thing make me think of that is in my own mod I have use a ranged attack of one tile for cruisers (dreadnought-like, new naval unit before destroyer and battleships) and battleship, and it have some weird side effects :
- if you use the ranged attack, you do damage without take in return, which is nice but stupid if you shoot some other cruiser/battleship with the same range
- if the target is already wounded, you need to finish it at point blank range but in doing that you often take serious damage which is absurd
- I have made also a special promotion for naval unit called "torpedoes" which gave +50% attack against naval units, and -1 range. or this thing reduce also the range of the ranged attack, so down it to 0, and cruisers with torpedoes can't use their main artillery xD (and in my mod, there is no information for the player this promotion would have this side effect, so it's a bad surprise)
Still, I was very happy with my modern naval units : cruisers and battlehips shot to long range, and destroyers/submarines shot to point blank if they manage to going so close. Theses long range shot make big stacks of naval units a bad ideas, and fleets do best with a large scale spread in every directions. Don't know if the AI manage this very well (in my mod the AI is the BtS vanilla's, so, not very smart anyway).

if your wish and willing, i would be happy to have some help from you,
as you can see, im very much open minded and accepting new ideas.

It will be always a pleasure to participate.
 
[ QUOTE] just though to anything else : there should be some kind of retaliation if the bombardment hit something capable of shoot to the same distance. For example : frigate should take fire in return if they bombard a coastal city where there is canons in garrison. Maybe this could use the same game mecanics than fighter air interception against bombers (?). Likewise, if catapults bombard a city where there is catapults, attacker should take a return fire of some kind.[/QUOTE]
Thats sounds realy nice, i guess its also not so difficult to add to the code.

Ill refer to the rest later as im not home.


Very nice,
So what are you skilled with,
C++/pyhton/xml?
I could use some c++ help now, as F1rpo is helping but he has plenty on his table's mod, and I rather bother him as less as possible.

Anyway, anything you wish to change or do, id welcome it.
 
I can do stuff with xml, and some graphicals things. I have notice your gamefont.tga is broken, bad compression make police character seem blur, I certainly could arrange that.
I have no knowledge in c++/python
 
Top Bottom