we are all 100% vanilla xcom fanatics here.
Double thumbs up here!!! (not finding the right emo in the forum
). You've all done some crazy magic here that enabled me (and so many other folks) to not only come back to a so much better version of my favorite game, but also to think about ways how I could make it even more interesting. Not only to think - to actually implement these changes. You are all my HEROES!
I hope I will be able to pay it back to the community one day - I am fully aware that until now I am just asking questions all around. The OXC universe is quite big and challenging at the beginning - but slowly I am learning my routes. Maybe soon I will be able to answer some questions on the forum or even help implement some feature requests?
Coming back to the research discussion - I never played the CE version (I am on the GOG version of X-Com - I guess this is the DOS one). What I can tell you though (and I actually tested it again very recently on my vanilla game) is that indeed if you test starting the 3 initially available projects enough times, you will get one of them to immediately show Poor/Good/Average, depending on assigned scientists (so basically immediately jump into the Known state). Maybe you can test it on the CE version too (or whatever version you own) - if you restart the game a few times, you should for sure get at least one immediately known project (the chances are 1 to 6). That's exactly what
https://www.ufopaedia.org/index.php/Research_Technical_Details describes. And this can
never happen in the current OXC implementation - cause it checks for SpentDays - which are always 0 on start.
As for the code you shared: (
I removed the 'dead' lines calculating the v2 and v3, that are never used and added the comments to show which part of the IF represents KNOWN)
if ( p_GS_Project_DAT[v_Base_LocIdx].ProjectScientists[v_Dialog_Processed_Item_Idx__] )
{
v7 = a_GS_Research_Builtin[v_Dialog_Processed_Item_Idx__].time_to_research;
if ( v7 - p_GS_Project_DAT->ProjectDays[v_Dialog_Processed_Item_Idx__ + 144 * v_Base_LocIdx] <= v7 / 3 )
{
v38 = 1; // UNKNOWN
}
else
{ // KNOWN
...
v7 seems to be the Average Days for the project.
p_GS_Project_DAT->ProjectDays[v_Dialog_Processed_Item_Idx__ + 144 * v_Base_LocIdx] is probably the days left for this particular project execution (
which implicitly contains the current roll - only by knowing it you can figure out the time left).
So the condition under
if translates to:
Average_days - Days_left <= Average_days / 3Thus:
Average_days *2/3 <= Days_left And this is
exactly the algorithm I described (that I learned from ufopaedia.org). If the days still left (the effort needed) is more than 66% of of the
Average_days the game shows
Unknown. As soon as you progress so that you have less than 66% of the
Average_days left, the progress becomes known.
Please go through this analysis in peace and correct me if I am wrong - however, it does seem to add up quite nicely and to be aligned with the info from ufopaedia.org.
Just to make sure that I do not come across as Mr. SmartyPants here - the current OXC implementation is also very logical and I can fully understand that many people would like it. It is just that for my use case (where I try to optimize my research time using the info that the game gives me) it felt like a huge handicap compared to vanilla. So I went ahead and changed the implementation (for myself). But while analyzing the algorithm (to implement it properly) I realized that using the info the game gives you, you can actually figure out much more than just Poor or Excellent. So I first started calculating it manually (with the proverbial pencil) and then spent some hours to actually implement it.
And again I am happy to share the code if there should be enough interest. Hey, I could even offer 2 options - getting the Unknown, Poor, Excellent, but according to the algorithm from XC or getting the number ranges from the screenshot. Maybe this would be a way for me to pay back at least a part of my debt to this community :-). Cheers!