Page 1 of 1

Planetary bombardment question

Posted: Sun Oct 30, 2016 11:23 pm
by Arctodus
Hello all.

Really enjoy the game, reminds me quite a bit of one of my old favorites, Pax Imperia.

Anyway I'd like to mod planetary bombardment so that bombing a colony to destruction doesn't apply negative modifiers to the planet once the colony on it is destroyed.

I found HandleGetBombingResult in invasion.a, which calls UFMakePlanetDestruction in userfunc.a, which in trun passes the call on to the planet like so:

Code: Select all

ThisPlanet->MakeDestruction(0.01f*(float)PercentDestruction, 0.01f*(float)PercentMilitaryDestruction, 0.01f*PercentPopulationKill, Yes_==KeepColonialModuleAndSpaceport);
I modified this call to:

Code: Select all

ThisPlanet->MakeDestruction(0.0f, 0.01f*PercentMilitaryDestruction, 0.01f*PercentPopulationKill, Yes_==KeepColonialModuleAndSpaceport);
I then rebuilt my rtq.* files, and copied the .cht, .gen, .pht, and .rht output into my mod folder. However this has not had the expected result. Colonies i destroy still end up with negative production modifiers. It seems they are less than they were previously (from 2-7% negatvie instead of 15-25%), but they are still there.

Questions:
Did I make the correct change here? in other words my mod works as it should and the smaller negative values I'm seeing are just the result of the minig/extraction that had been done by the previous occupants?

Is my change wrong?

is the change incomplete? Like the military and population overkill are getting applied to produce the negative modifiers I'm seeing?

Something else?


I'd appreciate any information/feedback that those of you more knowledgable about this would care to provide.

Thanks!

Re: Planetary bombardment question

Posted: Mon Oct 31, 2016 9:16 am
by Ufnv
Hi!

There are two problems:

1) invasion.a is a deprecated file and all functions there a commented out and not used. Bombing mechanics is now implemented in the game code.
2) everything inside userfuncs is not changeable, so you can use userfuncs but not modify their content.

So I afraid it is not that easy to modify bombing mechanics, but if you formulate more specific how it should look like, I can think how it can be done.

Re: Planetary bombardment question

Posted: Tue Nov 01, 2016 2:25 am
by Arctodus
Thanks for the reply!

So i just got lucky on some lesser values and attributed it to my change, bummer :(

My only goal is that planetary bombardment should not erode/degrade the resources of a planet. Such that it still kills all the people and destroys all the buildings, but any mineral wealth should be unaffected.

If I bomb a colony to extinction currently, afterwards when i go to colonize I typically see negative modifiers like -25% organics, -20% metals, etc.

My impression (perhaps mistakenly?) is that planetary bombardment causes this degradation of a planet's resources.

Re: Planetary bombardment question

Posted: Tue Nov 01, 2016 9:12 am
by Ufnv
Arctodus wrote:If I bomb a colony to extinction currently, afterwards when i go to colonize I typically see negative modifiers like -25% organics, -20% metals, etc.

My impression (perhaps mistakenly?) is that planetary bombardment causes this degradation of a planet's resources.
Bombing does not cause the degradation, the reason for it is most likely the planet was exploited for quite a long period of time and thus its resources were a bit exhausted. All planets exhaust over time, if this setting is not switched off.

Re: Planetary bombardment question

Posted: Wed Nov 02, 2016 3:21 am
by Arctodus
Ahhhh! I didn't realize that was a setting, but since you mentioned it I went and found it :)

Thank you so much for the replies, I will happily get busy bombing all who oppose me!