SecretLab logic needs a lot of fixing

Bug #895028 reported by DCoder DCoder
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ares
Fix Released
Wishlist
DCoder DCoder

Bug Description

As documented in http://www.modenc.renegadeprojects.com/Secret_Lab_System#Drawbacks , SecretLab logic has multiple flaws:
* Bonuses are assigned at map load instead of building acquisition.
* Bonuses don't check if the new owner can already build this bonus.
* Bonuses don't change between consequent captures.
* Bonuses are defined globally.
* Bonuses only work if there are more possible bonuses than labs on the map.
* Bonus probabilities are skewed and inversely proportional to a bonus's index on the bonus list.
* Potential bonuses don't include AircraftTypes.
* SecretHouses don't work.

Fixing all the issues will cause a significant change in how Secret Labs operate. Therefore, it might be worth introducing a parallel Secret Lab system and leaving the original one intact.

##### STEPS TO REPRODUCE #####
1. Create a map with multiple Secret Labs pre-placed.
2. Run map repetitively.

Expected results:
3. All bonuses appear with more or less the same frequency.

Actual results:
3. Bonuses further down the bonus list (especially the Grand Cannon) appear very rarely.
4. Grand Cannon only appears on the very first Lab, if at all.

##### ADDITIONAL INFORMATION #####
A brief discussion about possible fixes:

 could do with having an entirely new system that is separate/in addition to the existing system (i.e. existing system not touched)
 indeed
 so [CASLAB2] has NewSecretInfantry=/NewSecretUnits=/NewSecretBuildings=/NewSecretAircraft=
 AssignNewSecretOnCapture=yes/no
 NewSecretLab=yes/no
 if no, will get assigned on map enumeration or when built
 if yes, will get assigned on every capture
 yeah
 don't think we need NewSecretLab= - CASLAB2 (or 3/4/5/etc) simply have or do not have the NewSecret### flags
 In addition, SecretLab=yes can be used [i]on the same building[/i] if wanted (so a building can be a SecretLab and a NewSecretLAb at the same time
 the only thing I haven't thought of is how we could incoporate SecretHouses=
 SecretForbidden and SecretRequired seem necessary
 Well, obviously that would only be used in conjunction with AssignNewSecretOnCapture=yes
 Yeah, good idea
 SecretForbidden=YuriCountry means when Yuri player captures a NewSecretLab with AssignNewSecretOnCapture=yes, that particular unit will not be considered
 question is how to handle interaction between Forbidden and Required

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Additional improvement idea:
 edit the game to make spy infiltration show which unit plans are in a secret lab, RA1 style XD
(The hard part would be drawing the cameo on the battlefield, the rest is already doable with Syringe.)

Revision history for this message
MRMIdAS (mrmidas) wrote :

That would negate the "assign on capture" method though, unless the game would assign a secret unit based on the technology of the capturing side.

So say a Russian Player captures a Lab, and gets a Grand Cannon, THEN a French player steals the lab from the russian, they would get a demo truck, HOWEVER, if the russian then steals it back, he would get the grand cannon again.

This may need an addition to the countries section, like:

[Americans]
SecretLab=GTGCAN,TTANK,SNIPE.......

Defining what each country can get from the lab, without the need to edit the existing logic, and giving the modder more power to define what goes on.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

I believe a separate system is just unnecessary work. Current implementation plan:

[lab]
SecretLab.Boons= a,b,c,d,e,f,g,h ; a list of things you might get from the lab, inf, veh, air, bld alike. defaults to the [General] SecretInfantry + SecretUnits + SecretBuildings, list limited to 1024 characters
SecretLab.GenerateOnCapture= y/n ; pick item at random when placed/captured, as opposed to at map generation time

[goodie]
SecretLab.RequiredHouses = x,y,z ;
SecretLab.ForbiddenHouses = q,w,r ; obvious

When a lab is left to pick a goodie at map generation time, it will consider only its current owner (most likely, house neutral) for req/forb houses .

Revision history for this message
Bug Importer (bug-importer) wrote :

What if SecretLab.GenerateOnCapture=no and the lab gets built by a player?

Revision history for this message
MRMIdAS (mrmidas) wrote :

then it generates a secret unit/structure there and then.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Another question: Should the lab make sure you have the right factory to produce this unit before trying to grant it? I.e. should giving a DRED as a boon require you to have a shipyard?

Revision history for this message
MRMIdAS (mrmidas) wrote :

no, if you don't build the prerequisite factory, then you don't get the bonus unit.

If you sold the factory that granted you the unit, should the game assign you a new one? no. same with this, just because you've not got the factory yet, doesn't mean you won't.

Although this could cause problems on inland maps.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Playtesting shows that granting a DRED with no shipyard invokes the NCO bug. Which sort of makes sense... Fixing the factory navalness aspect of the NCO bug will stop that.

Revision history for this message
Bug Importer (bug-importer) wrote :

Modders can always avoid that scenario by not offering naval units as boons, although for other factories I agree with Midas.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Apparently I forgot to mark this fixed when it was...

Revision history for this message
Renegade (renegade) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.