Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Reversing to Orion - project 1oom

Found a bug in 1oom which concerns tech looting. In my recent game, I captured 3 Alkari Planets in a row, each with about 150 to 200 factories and got no loot tech although the birds still had two (obsolete) techs (range 5 and IIT8). I instrumented the code and verified that it was not due to a bad roll (the chance of which would have been below 0.005%).

game_ground_finish() calls game_spy_esp_sub1(g, s, 0, 0) - obviously to check for available techs unknown to the conqueror. This routine is called quite often in the code. The third parameter (int a4 - great name) is probably meant to restrict the tech to some sort of minimum value, the 4th parameter (int a6) probably to exclude the latest tech(s) for tech trading. Anyway, here both parameters are zero yet this routine returns 0 (no techs found), so no loot is given, even though the spy reprort clearly indicated that 2 unknown techs are available.

Anyone knows the above behaviour form MOO 1.3 or 1.4m. I'm reluctant to hack this routine (and its further subroutines, aptly named game_spy_esp_sub2 to game_spy_esp_sub5) without completely understanding them, as they might affect the diplo code in unpredictable ways. Any ideas?

ignatius


.gz   1oom_save_2469.gz (Size: 3.95 KB / Downloads: 1)

PS:

I've looked further into the code and did some testing. The bug goes deeper: In 1oom, it seem impossible, to loot (via capture) or steal (via espionage) any tech, which is obsolete to you.

This means that you always steal or loot a useful tech if there is any, but you get none at all even if there are obsolete techs available, and so neither get the techlevel increase nor the trade value.

This is not MOO behaviour (or at least not MOO 1.4m, as this is what I tested), where you can steal or loot any available new tech. This needs to be fixed or made into a game option as it considerably alters gameplay.


I also saw code that would prevent the Silicoids from ever stealing or looting waste cleanup tech and special terraforming. Is this also a bug or is this consistent with original MOO 1.3 and/or MOO 1.4m?

Another thing I noticed (and which can be reproduced from the savefile, when converted into MOO-format): In 1oom, the AI first (mistakenly) attacks my cruisers and only targets my bomber stack with the second volley. MOO 1.4m correctly attacks only the bombers.
Reply

(October 20th, 2019, 13:55)ignatius Wrote: Found a bug in 1oom which concerns tech looting. In my recent game, I captured 3 Alkari Planets in a row, each with about 150 to 200 factories and got no loot tech although the birds still had two (obsolete) techs (range 5 and IIT8). I instrumented the code and verified that it was not due to a bad roll (the chance of which would have been below 0.005%).

game_ground_finish() calls game_spy_esp_sub1(g, s, 0, 0) - obviously to check for available techs unknown to the conqueror. This routine is called quite often in the code. The third parameter (int a4 - great name) is probably meant to restrict the tech to some sort of minimum value, the 4th parameter (int a6) probably to exclude the latest tech(s) for tech trading. Anyway, here both parameters are zero yet this routine returns 0 (no techs found), so no loot is given, even though the spy reprort clearly indicated that 2 unknown techs are available.

Anyone knows the above behaviour form MOO 1.3 or 1.4m. I'm reluctant to hack this routine (and there further subroutines, aptly named game_spy_esp_sub2 to game_spy_esp_sub5) without completely understanding them, as they might affect the diplo code in unpredictable ways. Any ideas?

ignatius



PS:

I've looked further into the code and did some testing. The bug goes deeper: In 1oom, it seem impossible, to loot (via capture) or steal (via espionage) any tech, which is obsolete to you.

This means that you always steal or loot a useful tech if there is any, but you get none at all even if there are obsolete techs available, and so neither get the techlevel increase nor the trade value.

This is not MOO behaviour (or at least not MOO 1.4m, as this is what I tested), where you can steal or loot any available new tech. This needs to be fixed or made into a game option as it considerably alters gameplay.


I also saw code that would prevent the Silicoids from ever stealing or looting waste cleanup tech and special terraforming. Is this also a bug or is this consistent with original MOO 1.3 and/or MOO 1.4m?

Another thing I noticed (and which can be reproduced from the savefile, when converted into MOO-format): In 1oom, the AI first (mistakenly) attacks my cruisers and only targets my bomber stack with the second volley. MOO 1.4m correctly attacks only the bombers.



Per the OSG:
 


Quote:If the attacker succeeded in the invasion attempt, for every factory captured on that planet, he has a 2 percent chance to steal on of his opponent’s technologies (if he has any that the attacker doesn’t already possess). These confiscated technologies could come from any of the six areas of research. A d100 roll is made separately for each factory captured but, on average, that means you’ll steal 1 technology per 50 factories captured.


I checked other various FAQs as well which suggest the above. I think that for each successful tech captured roll, the original game just randomly selects a tech that you don't have. I haven't seen any other info suggesting other wise.
Quote:Get the heck out of here, you nerd!

Reply

Looks like the MOO strategy wiki has a little additional info -- including a 6 tech cap per invasion. The way the probability is generated is sounds different that what the OSG claims. However, it does mention the captured techs selected are "completely random":

Quote:If you invade the enemy with ground troops and you win, there is a series of rolls to determine if you capture any techs.

If the enemy has only the exact same techs that you have, you will never get any techs this way.

Capturing techs revolves around the factories present on the planet being conquered. If there are no factories on that planet, there will never be any captured techs. There is a limit of 6 techs being captured from one planet, the attacker can never gain more than this number.

The tech rolls go something like this:

For the first up to 25 factories, add 2% per factory (50% total, if they have all 25) and make a roll (50-50 chance, if they have all 25). If you succeed, you get a completely random tech off the list of what the enemy has that you don't have.

If there are remaining factories, repeat this process.

That means if there are 37 factories, you can get 0, 1, or 2 techs. If there are 96 factories, you can get 0, 1, 2, 3, or 4 techs. These numbers will usually skew towards the middle of the range, so with 96 factories you would be very lucky to get 4 or very unlucky to get 0. In that scenario, the expectation should be two.

The implication here is that you probably want to ideally be aiming at worlds which have somewhere in the range of 300 to 400 factories. Pound for pound, that would get you the highest techs per resource sacrificed.

Obviously, it depends on what enemy ships/bases are defending the planet and the stage of the game you are at and so on, but that range will pretty consistently get all 6 techs and it will allow you to conquer small undeveloped worlds potentially in the late game and still get the same 6 techs as if you had conquered huge well developed worlds.

You should absolutely try to do this, because your chances of winning the game increase greatly if you are able to get 6 whole techs for free. That could move you ahead by 100 years of research, especially if the enemy is technologically superior to you.

So I think the best available information suggests the selected techs are completely random.
Quote:Get the heck out of here, you nerd!

Reply

(October 21st, 2019, 07:40)Bionic Commando Wrote: I checked other various FAQs as well which suggest the above. I think that for each successful tech captured roll, the original game just randomly selects a tech that you don't have. I haven't seen any other info suggesting other wise.

I believe there is an exception: The Silicoids normally do not get techs that the game thinks they can't use. In v1.3, this was bugged, and the Silis could still pick up e.g. Advanced Soil, but I think this was fixed in kyrub's patch and perhaps also in (at least some versions of) 1oom. Is it possible that ignatius found a bug that relates to this?
Reply

(October 21st, 2019, 16:24)RefSteel Wrote:
(October 21st, 2019, 07:40)Bionic Commando Wrote: I checked other various FAQs as well which suggest the above. I think that for each successful tech captured roll, the original game just randomly selects a tech that you don't have. I haven't seen any other info suggesting other wise.

I believe there is an exception:  The Silicoids normally do not get techs that the game thinks they can't use.  In v1.3, this was bugged, and the Silis could still pick up e.g. Advanced Soil, but I think this was fixed in kyrub's patch and perhaps also in (at least some versions of) 1oom.  Is it possible that ignatius found a bug that relates to this?

If this should be the case (I rarely play the coids), then I would consider the original behaviour correct and kyrub's modification a bug. The OSG reads:

Quote:Silicoids cannot research, and neither will they steal or trade for, any Controlled Environment or Reduced Industrial Waste technologies. [...] Note that, although the Silicoids do not benefit from improving environments through soil enrichment technologies, they do get the increase for planetary maximum population limits.

So, no RW?? and *LANDINGS (and probably also no cleanup tech) - but  Atmospheric Terraforming, Soil Enrichment and Adv. Soil Enrichment should be fair game, as all those do increase planet size.

The above are also the only stealing restrictions on the book (it does not mention looting, arguments can be made in both directions here).

As the matter stands, the current code, besides preventing stealing or looting obsolete tech, also prevents the Silicoids from acquiring the research.d0 classes (read from RESEARCH.LBX) 5 (RW80 to RW0), 13 (landings) and 14 (eco restauration). It does NOT prevent them from getting Atmo, Soil and Adv. Soil (those techs don't have classes) - which is in line with the OSG and supports the above argument.

(As a sidenote: due to a bug in the table, it also prevents anyone to get enhanced eco if you happen to have improved eco, but this is another story ...)

Be that as it may, the Silicoid bug is merely a side issue and can easily be fixed (should probably be done via game_num to enable folks to unfix the bug to emulate 1.4m behaviour). The real issue is the filtering of obsolete techs for stealing / looting, which is a serious bug and requires a new version of the sifting routine as game_spy_esp_sub1 is obviously meant to be used in tech-trading and diplo and not for spying and pointy stick research. I would also opt against giving this bug a game_num, as it seems that it got introduced in 1oom, so there is no bug-compatibility issue here.

ignatius
Reply

@RFS

I have a fix for the spying / looting bug ready and pushed to my fork. I will wait with the merge request until you decided on the uifeatures merge.

I did nothing so far on the Silicoid issue. There are at least 5 possibilities on how to handle Atmospheric Terraforming, Soil Enrichment and Adv. Soil Enrichment with the Coids:

  1. they can loot / steal it but neither acquire it by trade, research and use it. This is the current state.
  2. they can loot, steal and use it but neither acquire it by trade nor research it.
  3. they can loot, steal, trade and use it, but not research it.
  4. they can do all of the above
  5. they can do none of the above
I personally tend to option 3 as it fits thematically (they wouldn't come up with the idea, but could use it as yet another terraforming method to enlarge their planets when they see it) and is consistent with the OSG. Maybe an option (via. pbx) to chose between 3 and 5 would be the way to go.

What do you guys think?

ignatius
Reply

Phew, that's a lot to catch up...

Good thing that you seem to have figured out the looting bug! A comment on your UI improvements is coming soon.

About the cryptic variable names in 1oom, I always figured that those where from disassembled code that KilgoreTroutMaskReplicant didn't understand completely. But then why does it behave differently from the original game? I'm starting to think he might just be a sadist lol

For the Silicoid techs, I'm in favor of reverting to the 1.3 behavior, maybe with an optional mode where they can steal it, but not research it. So basically, (4) by default with an option for (3). Didn't we want to get rid of PBX files long term, though?

Meanwhile, I've been working on getting a Windows build and I've made some good progress: I have a binary that works on my machine, but it's without any audio support compiled in. I hope to put one with audio online today, but failing that, I'll put up the silent one.
Reply

(October 21st, 2019, 19:15)ignatius Wrote: If this should be the case (I rarely play the coids), then I would consider the original behaviour correct and kyrub's modification a bug.

Well, you can debate what the modification should have been, but the original behavior was definitely a bug. The 'coids can benefit from the extra size of Fertile and Gaia planets, yes, but they can't build Soil Enrichment or Gaia environments in any version of MoO - and in the original behavior, Advanced Soil can show up in their tech tree - and AI Silicoids would trade an arm and a rocky locomotor appendage for it!

For what it's worth, I think it would be a bad idea to let them build Atmo/Soil/Gaia (especially Atmo, which will allow other races to invade a previously-safe Sili world!) as they're expensive projects that benefit future conquerors more than the 'coids themselves, and take precedence over Terra and pop growth in the game interface. Letting the 'coids pick up the techs via theft or invasion is probably fine too, for the small boost to population productivity and as trade bait. Letting them trade for the techs would be fine only if AI Silis can be taught not to trade anything of value for techs they can't use.
Reply

(October 22nd, 2019, 14:36)RefSteel Wrote:
(October 21st, 2019, 19:15)ignatius Wrote: If this should be the case (I rarely play the coids), then I would consider the original behaviour correct and kyrub's modification a bug.

Well, you can debate what the modification should have been, but the original behavior was definitely a bug.  The 'coids can benefit from the extra size of Fertile and Gaia planets, yes, but they can't build Soil Enrichment or Gaia environments in any version of MoO - and in the original behavior, Advanced Soil can show up in their tech tree - and AI Silicoids would trade an arm and a rocky locomotor appendage for it!

For what it's worth, I think it would be a bad idea to let them build Atmo/Soil/Gaia (especially Atmo, which will allow other races to invade a previously-safe Sili world!) as they're expensive projects that benefit future conquerors more than the 'coids themselves, and take precedence over Terra and pop growth in the game interface.  Letting the 'coids pick up the techs via theft or invasion is probably fine too, for the small boost to population productivity and as trade bait.  Letting them trade for the techs would be fine only if AI Silis can be taught not to trade anything of value for techs they can't use.

Well, if that's the case I'd prefer to go with ignatius's option 5.
Reply

There we go! multidance

I've got a binary that works on my Windows machine, with sound! The important question: does it work on yours? Please test!

To install, unzip the attached archive into your MOO1 folder, and run 1oom_classic_sdl2.exe. It includes the required SDL2 dlls. It also comes with a config file that already has uiextra mode selected. Thanks to Ignatius, you can now select the "fixbugs" mode on the game setup screen. His new UI improvements and the tech looting bugfix are still missing, though.

@Psillicyber: Sorry, I don't understand what you've been trying... or even what OS you're using. You definitely won't need Dosbox to run 1oom. If you're on Windows, please give this binary a try!


Attached Files
.zip   1oom_for_win.zip (Size: 3.03 MB / Downloads: 7)
Reply



Forum Jump: