Jump to content

I'm trying to find a better way to scale research with difficulty?


jgbaxter

Recommended Posts

No.

 

It's Non-Legend / Legend.

 

I've found no way as of yet to get a way to scale DIFF 0-2.

 

At least not without going around the side using a workaround or possible messing deeper in the code.

 

And even the workaround is only a partial solution, and yet still Legend becomes a bit silly for research times, and more to that is Legend doesn't actually scale in a way that I can understand yet.

 

Hybrid Material, modded to 113 days. PTC 2640.

Alien Bio Tech, modded to 59 days. PTC 3080.

Modular Weapons modded to 188 days. PTC 2680.

 

Non-Legend 11-13 days various DIFF.

 

Which is insane, we're talking 1-3 days difference on non-Legend, which creates 59-188 days on Legend.

 

Clearly something is not working in a logical manner. Now I'm all for making an occasional mistake but this seems to be something else. It could be a simple fix when "magical solution" is revealed.

 

All the mods that change research are to the best of my knowledge, completely messing things up, or doing absolutely nothing at all.

 

Or so it seems anyway.

Link to comment
Share on other sites

PointsToComplete is compared with your science score

 

By default, Tygan gives 10 science. Other scientists give 5. You complete this many points per hour. With just the Tyganman, a 240 project takes a day.

 

 

InitialProjectPoints += (TimesResearched * GetMyTemplate().RepeatPointsIncrease);
InitialProjectPoints = Round(float(InitialProjectPoints) * class'X2StrategyGameRulesetDataStructures'.default.ResearchProject_TimeScalar[`DIFFICULTYSETTING]);
InitialProjectPoints -= Round(float(InitialProjectPoints) * TimeReductionScalar);




ResearchProject_TimeScalar[0]=1.0 ;Easy
ResearchProject_TimeScalar[1]=1.0 ;Normal
ResearchProject_TimeScalar[2]=1.0 ;Classic
ResearchProject_TimeScalar[3]=1.0 ;Impossible
TechRushReductionScalar[0]=0.5 ;Easy
TechRushReductionScalar[1]=0.5 ;Normal
TechRushReductionScalar[2]=0.5 ;Classic
TechRushReductionScalar[3]=0.25 ;Impossible
These are probably the things which will help you work it out. I've had quite a hard time trying to track down exactly where the legendary difference is set, though. Like, you'd think it'd be the timescalar.
Oh, and Alien Biotech is a special case. Don't use that for any comparisons.
Edited by zingfharn
Link to comment
Share on other sites

I'm not sure we're communicating. :blush:

 

1) I know how PTC works.

 

2) I Know what the ResearchProject_TimeScaler is. And it has had no effect.

 

3) I know what the TechRushReductionScaler is and it has no bearing on this discussion at all.

 

 

This isn't my first trip to the rodeo, I know they got them there horses things. :smile:

Link to comment
Share on other sites

I mean, then, erm, I'm not exactly sure what you're asking..?

 

You could hook up a screen listener to reassign PTC on the fly based on difficulty with if(`DIFFICULTY == 0/1/2/3) then foreach the templates and do whatever.

You could get it to automatically scale with science score.

 

It's like, erm, yeah. I don't know, dude. You'll have to rephrase the question.

Link to comment
Share on other sites

Well, if there are no settings at all that can be changed to scale research time for seperate DIFF aside from non-Legend/Legend...

 

Then having a way to implement that would be handy.

 

If not, then...

 

In short, I want this to work- since it doesn't;

 

ResearchProject_TimeScalar[0]=1.0 ;Easy
ResearchProject_TimeScalar[1]=1.0 ;Normal
ResearchProject_TimeScalar[2]=1.0 ;Classic
ResearchProject_TimeScalar[3]=1.0 ;Impossible
Failing that something that would do what the above should do or similar.
The solution is beyond me, if someone out there can code it that would help a lot.
Was that clear enough? :)
Link to comment
Share on other sites

Well, I guess the question is clear enough now, but sounds like nobody knows the answer. The question is: we see that ResearchProject_TimeScalar[3] is 1.0. So a project on legendary difficulty should take the same number of days to research as any other difficulty level, but we see it doesn't. What else is affecting research time on legendary? Several people have searched and not found.

Link to comment
Share on other sites

TimeScalar doesn't work, it's not enabled in the code I guess.

 

All research projects have DIFF 3 setting in StrategyTuning.ini, you can adjust the DIFF3 and get DIFF 0-2 to change to the same setting and DIFF 3 to change to a different setting, Adding a DIFF 0-2 and changing them in anyway results in no effect.

 

DIFF 3 tech setting is hidden.

 

DIFF 3 tech setting follows a format that is not logical, for example, doubling the DIFF 3 settings doubles DIFF 0-2 however...

 

DIFF 3 research on ABC tech and XYZ tech will have different results so it doesn't have the same effect.

 

It may be that the hidden DIFF 3 setting adds a percentage based on PTC but that can't be confirmed. This is in fact how I wanted to go, small, medium, and large projects I was going to change the PTC to 210% / 200% / 190%. So, perhaps the DIFF 3 hidden adjustment looks at the PTC and does something similar and scales in categories based on the PTC range that it may fall in to. No idea but it's clearly not a natural progression.

 

No other logical settings to change DIFF seem to work at all.

 

 

I think if someone were to code a UI listener that looks at DIFF and then changes the PTC based on that that would work. It would need a way to also be configurable so if someone adds a new tech to StrategyTuning.ini it would see the PTC line and adjust. There's probably an easier way to do this but I'm not at the coding standard to do it.

 

 

At this point I tink that the way I'm going to go until a solution is found is to adjust StartingScientists, this isn't the best solution obviously but it would be a tolerable if hated workaround.

 

I'd need probably to change the number of starting scientists by having the UI listener look at DIFF and be able to plug in different variables for the scientists based on the DIFF, basically changing this maybe;

 

(although the code below has it give both Sci and Eng the same amount that would need to be separate settings I suppose.)

 

 

class StartingStaff_UIScreenListener extends UIScreenListener config(StartingStaff);
 
var config int NumStartingEngineers;
var config int NumStartingScientists;
 
event OnReceiveFocus(UIScreen Screen)
{
    if(IsModEnabled() && IsStrategyState() && IsNewGame())
    {
        GiveScientistsAndEngineers();
    }
}
 
function bool IsStrategyState()
{
    return `HQGAME != none && `HQPC != None && `HQPRES != none;
}
 
function bool IsModEnabled()
{
    return NumStartingEngineers > 0 || NumStartingScientists > 0;
}
 
function bool IsNewGame()
{
    //Hack: Only When Sci/Eng at 0, redundancy ADD a check for game date as well so no future firing)
    return `XCOMHQ != none && `XCOMHQ.GetNumberOfEngineers() == 0 && `XCOMHQ.GetNumberOfScientists() == 0;
}
 
function GiveScientistsAndEngineers()
{
    local int i;
 
    for(i = 0; i < NumStartingScientists; i++)
    {
        GiveStaff('Scientist');
    }
 
    for(i = 0; i < NumStartingEngineers; i++)
    {
        GiveStaff('Engineer');
    }
}
 
function GiveStaff(name staffType)
{
    //Copied+edited from XComHeadquartersCheatManager:GiveScientist()
    local XComGameState NewGameState;
local XComGameState_HeadquartersXCom XComHQ;
local XComGameStateHistory History;
local XComGameState_Unit UnitState;
local CharacterPoolManager CharMgr;
 
History = `XCOMHISTORY;
XComHQ = XComGameState_HeadquartersXCom(History.GetSingleGameStateObjectForClass(class'XComGameState_HeadquartersXCom'));
NewGameState = class'XComGameStateContext_ChangeContainer'.static.CreateChangeState("Give " $ staffType);
 
CharMgr = `CHARACTERPOOLMGR;
 
UnitState = CharMgr.CreateCharacter(NewGameState, eCPSM_Mixed, staffType);
 
UnitState.SetSkillLevel(5); //Default skill-level, apparently
NewGameState.AddStateObject(UnitState);
 
XComHQ = XComGameState_HeadquartersXCom(NewGameState.CreateStateObject(class'XComGameState_HeadquartersXCom', XComHQ.ObjectID));
NewGameState.AddStateObject(XComHQ);
XComHQ.AddToCrew(NewGameState, UnitState);
XComHQ.HandlePowerOrStaffingChange(NewGameState);
 
if( NewGameState.GetNumGameStateObjects() > 0 )
{
`XCOMGAME.GameRuleset.SubmitGameState(NewGameState);
}
else
{
History.CleanupPendingGameState(NewGameState);
}
}
 
defaultproperties
{
    ScreenClass = class'UIAvengerShortcuts';
}

 

 

Edited by jgbaxter
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...