Jump to content

Messing with iMonth


xcommiebastard

Recommended Posts

I've just started trying my hand at some modding, and now that I've done some research I could use some advice. I've enjoyed playing X-com, but I've always felt like the pacing of the original was more my play style. It's been a long time since I played UFO Defense, so this may be more feeling than fact, but it seemed like the game was stretched over a longer period, and there were more opportunities for UFO encounters, either landed or crashed. I was looking into how I could recreate this, and thought my best option was to run a Marathon Mode game, but after reading some more I thought that I could try to mod the imonth variable in the fillalienpool and getpossiblealien functions in XGstrategyAI. In my theory, this could lengthen the time over which the game can take place, and then I could alter the defaultgamecore file so that UFO's would appear more often.

 

The advice I am looking for is if this will work at all. I don't know a lot about programming, but I'm assuming that since imonth is a local variable in both functions, I could change it there and it would not affect the rest of the game. I think I would have to change it to (imonth+1)/2 since that is how they implement it in the Marathon Mode, but I'm not sure what syntax to use, let alone what hex editing would need to be done. I was already able to make the changes I wanted in the defaultgamecore file with enabling the UFO's.

 

Any help would be appreciated, Thanks!

Link to comment
Share on other sites

Dang. I'd hoped one of the mod creators would see this, but apparently they are all over in the "XCOM 2" forum these days so I guess I'll have to do what I can to point you in the right direction. (I'm just the "wiki librarian", not a creator.)

 

Forgive me if I am pointing out the obvious, but as you say you are "just starting to mod" it's safer to not assume anything.

 

Your basic goal is pretty much identical to what the "Long War" (LW) mod team started out to do. As you have figured out, it is all in the "Strategy" side of the game. The problem is that various plot elements are directly tied to the timeline. It's not so simple as changing a single variable such as "imonth". The LW team found it necessary to modify or rewrite entire functions. There is some limited passing of data between the Strategic and Tactical systems, primarily related to missions.

 

I point this out so you will understand you have chosen to work on something that is much more complicated than it appears for a novice XCOM modder. You might want to consider honing your skills on something less complex. If you don't care for LW, you might consider looking into porting some of the mods for LW back into EU/EW. There is still some occasional demand for that. Even if they turn out not to be feasible in their entirety due to the heavy use of LW specific features, simply examining their code should be an education.

 

You have made a good start on your initial goal in focusing on the XGStrategyAI class. What we have on it is here. There are only two wiki articles touching on the XcomStrategyGame.UPK: one of that name, and "XComStrategyGame.UPK.Catalog". Other than what is in the first of those two articles and the XGStrategyAI class article, there is not really anything else speaking to your purpose.

 

In general modding terms (such as the re-use of "local variables"), that information is in several articles. First and foremost in the "Hex editing UPK files" and other articles in the "H" pages of the wiki "Modding" category. But you also need to look into the "UPK File Format" article. "Enum Expansion" and "Native Tables" are some more that may not be obvious. Each of the wiki articles have links back to the forum threads where the discoveries were made and discussed, which may prove helpful in putting things into context.

 

Good luck with your endeavors.

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

  • 5 months later...

Hello,

 

I was interested in changing the "iMonth" value and I did it last week now I am testing the game.

Here is the hex editing file for PatcherGUI

MOD_NAME=AlienProgressRateForLongWar
AUTHOR=eXquiSiT69
DESCRIPTION=Set Alien progression rate
UPK_FILE=XComStrategyGame.upk
OBJECT=XGStrategyAI.GetPossibleAliens
// Aliens Progression Rate: change 84 to whatever value you like between 28 and 250 should be fine.
// The greater number makes slower the alien progression!
// Do not change anything except the number!
// You can use only integer values between 28 and 250 , no floating-point values are allowed!
ALIAS=AliensProgressionRate:<%b 84> // The original value is 28
// modded code - do not change anything below this comment!
REL_OFFSET=0x3A
[MODDED_CODE]
//local int iMonth;
//iMonth = (STAT_GetStat(1)) / 28;
0F 00 93 52 00 00 91 1B 99 2E 00 00 00 00 00 00 24 01 16 2C <!AliensProgressionRate> 16
Edited by eXquiSiT69
Link to comment
Share on other sites

  • 1 month later...

Hi Again,

Mod works fine, i have been testing with the last version of the Long War EW mod

It should be compatible with all Long War compatible mods.

What is "iMonth" and how does it work you can check this article

 

Here is short explanation how this mod works.

iMonth = (AR) / YourValue;

AR stands for Alien Research which represents how advanced are the aliens to certain date (for example at "April 6" AR should be around AR~=36).

YourValue is the value that you can set with this mod by your taste, by default original value of YourValue = 28;

In this case AR~=36 and YourValue = 28; => iMonth = 36 / 28; => iMonth = 1 (decimals are not allowed).

The greater is the iMonth value, the more advanced become the aliens that you have to fight (mutons, cyberdiscs ets. )

During the game AR value gets bigger.

Setting YourValue = 56; makes alien progression twice slower, Setting YourValue = 84; triples the same effect.

 

The goal of this mini Mod is easier and longer than normal game, with relaxed not rushed still challenging gameplay.

Edited by eXquiSiT69
Link to comment
Share on other sites

1. Good to know that at least some of the discoveries in XCOM2 still apply to the original version. Thanks for the link and the explanation.

 

2. Do you know if this applies to both EU and EW, or just the latter?

 

3. Do you have a link to the mod, or is it short enough to post here, so I can post it to somewhere on the wiki?

 

-Dubious-

Link to comment
Share on other sites

Hello

 

2.) The mod makes a little change in

"TheGame\XEW\XComGame\CookedPCConsole\XComStrategyGame.upk"  

which is EW file modded by LongWarMod.

I'am almost sure the mod working only for LongWar Enemy Within (LW EW)

 

 

3.) Here is the link with the .txt file compatible for the "PatcherGUI", feel free to post it wherever you like.

There is no other place I have been posted about this tweak, my initial idea was just to improve my personal experience with the game, but sharing with the community is always welcome .

 

I'am not experienced programmer, did that tweak after reading the wiki, I hope it is going to work fine for everyone like it worked for me.

 

:)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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