Modding Resources, tips and tricks!

Ole Marius Myrvold

JWB 96-13
Club Staff
Premium
Hi all! :)

As it is a new game, and a slightly different genre and build that most of the games on this site, there might be some newfound tricks to make modding faster, easier and/or better.
Personally I have more than enough to even try to understand how I might be able to mod the game, but I know that many of you guys are well underway with some cracking mods!
Anyway, sharing is caring, and making each other better is only positive in the long term, who knows what me might be able to achieve with this game! It is also easier to find for new modders, or old modders finding a new game if we are able to gather the brilliant research from you guys on one place :)

Keep up the magnificent work!

@thrashersfreak @Panamera4 @Colin O Callaghan @NemanjaSipka @TheFlamingRed @Mojojo999
 
Still trying to understand where you derived the line "FreeRoamCamera camera = app.cameraManager.gameCamera.freeRoamCamera;" from.

I came across the FreeRoamCamera in ILSpy, then right-clicked its name in the source code view and clicked Analyze. This will give you a small tree of what reads or writes to something like a class or one of its fields. I followed the chain all the way back to something I could actually get a reference to, which is App.instance (it is a static field). I added a handy field for Game.instance and App.instance and named them app and game for convenience.

It's interesting that altering the free roam camera's zoom crashes the game, do you have a field named "game"?
 
I came across the FreeRoamCamera in ILSpy, then right-clicked its name in the source code view and clicked Analyze. This will give you a small tree of what reads or writes to something like a class or one of its fields. I followed the chain all the way back to something I could actually get a reference to, which is App.instance (it is a static field). I added a handy field for Game.instance and App.instance and named them app and game for convenience.

It's interesting that altering the free roam camera's zoom crashes the game, do you have a field named "game"?

Ah, I have been using the "Analyze" function a lot, though it often gives lots of Used Bys... I wasn't sure how you came to determine the link from min-Zoom to App. I'll try and re-trace your steps - npw knowing I am looking for something that is a 'static' field to end up in (public static instance - are the three keywords it seems... Not many of them. App, Game, DesignDataManager, Simulation2D - thats about it)...

The Zoom feature is fine... it's the SpeedMultipliers function that causes the crash.
got 'Game game' in the head and 'game = Game.instance;' in the Awake/[/code]

Edit: I am surprised my determinism hasn't wavered yet.

So as a first go proof of concept, i decided 'I'm gonna change the backstory bonus moral from 0.3f to 0.5f' The original line is in PlayerBackstories. "private readonly float mDriverMoraleModifier = 0.3f;" so not overly disimilar to your MaxZoom code I have working.

Code:
  if (state == GameState.Type.FrontendState)
        {
            PlayerBackStory pbs = game.player.
             pbs.GetType()
             .GetField("mDriverMoraleModifier", BindingFlags.NonPublic | BindingFlags.Instance)
               .SetValue(pbs, 0.5f);
        }
Is what I have so far... but the "game.player.<missing>" - and in missing, I'd love to put playerBackStory, it doesn't appear thats a valid option.

The process was a little more complex then I thought :p Where on earth did you learn all this? :p This is a lot of work to just change a few numbers to make the game harder for the player then the AI!

At least the public variables are easy to adjust... but unfortunatly, a lot of those begin their life as private - so I am determined to master this. I'm kinda hoping Crashed isn't too fed up of me already... I am not a very good apprentice.

Wishlist

1/ be able to modify a variety of numbers. (I am not too interested in changing how the game is played, its quite solid - I just want to insert some balance and difficulty)
// Mostly the player only buffs/debuffs. I mostly want to adjust the 'days off bonus' for part creation, and change it to 'days added debuff' - this will let me (elsewhere) shorten the time it takes to make the parts for the AI - so that the player doesn't notice any change in speed of making a part - but the AI will. I want to adjust a x% extra race costs (opposite of financial back story) for harder money management when compared with the AI. A lot of the other AI tweaks, I can do in the Assets.

Other sections I would like to do, are actually not too hard to get to variables... e.g., increase the Red Zome % globally, and part strain.Prevent going into the red by more then $1M instead of $5. etc etc.,Already done the one's I've found.

2/ Be able to modify my modified numbers (with random seeds or difficulty levels - should be easy to do given there's code for a working toggle key, I just have to modify my own modifications with a variable)
 
Last edited:
The Zoom feature is fine... it's the SpeedMultipliers function that causes the crash.
got 'Game game' in the head and 'game = Game.instance;' in the Awake/[/code]

That's interesting, and it seems that any raised exception for example Game.instance being null, will just crash the game because of how I load the assembly... this is not optimal. I'm fighting with Unity's ancient version of mono which has fixed many issues and would make all this tremendously easier but Unity for whatever reason has decided on a 6 year-old version of mono that has plenty of bugs.

Is what I have so far... but the "game.player.<missing>" - and in missing, I'd love to put playerBackStory, it doesn't appear thats a valid option.
mPlayerBackStory is private, so you can do game.player.GetType().GetField("mPlayerBackstory", binding flags). Yep it's terse and annoying but that's how the devs wrote it, which makes sense for them (they can design the API for their needs), but makes it a little more difficult for us.

The process was a little more complex then I thought :p Where on earth did you learn all this? :p This is a lot of work to just change a few numbers to make the game harder for the player then the AI!
Well I learned this CSharp stuff and some Unity stuff about a day or two after MM released. But I've been programming in some capacity since I was 9 years old so I've been around the block a bit.

I'm kinda hoping Crashed isn't too fed up of me already... I am not a very good apprentice.
Not at all! I'm impressed you were able to get by with so little instruction, this stuff isn't exactly easy. I've got some years under my belt so I know where and how to look for how to do something, but for someone who's green it's got to be a little overwhelming. Keep up the good work!

I'm a little sad that I cannot tame the beast that is Unity's ancient and bastardized version of mono, which would make your life and my own quite a bit easier. I think what I need to explore next is to just straight up replace mono.dll in MManager/mono to a newer version and hope that doesn't break things.
 
That's interesting, and it seems that any raised exception for example Game.instance being null, will just crash the game because of how I load the assembly... this is not optimal. I'm fighting with Unity's ancient version of mono which has fixed many issues and would make all this tremendously easier but Unity for whatever reason has decided on a 6 year-old version of mono that has plenty of bugs.

I assume it works on your newer iteration of the injector though.

I can see some real advantages for having the x3 speed be a lot faster (especially with you using the drivers AI taking over). It balances the race aspect of the game a lot, by putting your cars in a level playing field with the others. I am now 93 steam hours into the game, and especailly with the 16 races of the Not-F1 season, the 'race' aspect of it is becoming tedius a little, because my race strategy is mostly the same - so the appeal of the AI taking over races has increased a lot - just so that it's balanced! (its odd to remove what should be a key gameplay aspect for the sake of balance - but it is the best balance method)

I am hoping to get over that by heavily modding the AI strategy in the asset files, which is in my list of things to experiment with (first being the injector - second being dilemmas and if the AI gets them randomly or it's just the player - and then the AI strategy).

What I've notice the AI doing though, is completely filling up on pitstops! :O which is costing them pitstop time and then time carrying heavy fuel.

mPlayerBackStory is private, so you can do game.player.GetType().GetField("mPlayerBackstory", binding flags). Yep it's terse and annoying but that's how the devs wrote it, which makes sense for them (they can design the API for their needs), but makes it a little more difficult for us.

Oh my... mPlayerBackstory wasn't a varianble so I discounted it... .How on earth would I setup the Set function? I initially thought .GetField("mPlayerBackStory.driverMoraleModifier" would be the variable edit, but encoding that gives me System.Type to PlayerBackStory convert errors. mPlayerBackstory alone doesn't even seem to have a value in which to set.

Well I learned this CSharp stuff and some Unity stuff about a day or two after MM released. But I've been programming in some capacity since I was 9 years old so I've been around the block a bit.

I cheated. My first programming experience came when after my math degree while I was doing simultations regarding animal behaviour. Was using [R] originally, so I skipped on by all the 'infustructure' code and just got on with dealing with variables, loops, functions and conditionals - all logic arguments which matched will with the math background. So handling the infastructure of all this within an already existing framework for me to navigate, isn't familiar.

Not at all! I'm impressed you were able to get by with so little instruction, this stuff isn't exactly easy. I've got some years under my belt so I know where and how to look for how to do something, but for someone who's green it's got to be a little overwhelming. Keep up the good work!

Thank you. I am currently feeling like I did in my early A-level Math days... the class was all onto algebraic long devision - while I was there, trying to follow the methods but had never actually known how to do normal long devision. (To this day, I still can't do numeric long division... can do the algrebaric version though - for some reason that's easier). I am sure I'll get there in the end - just got to understand the various process and various examples.

ILSpy gives me lots of different coloured diamonds, shapes and other icons in the class definitions. Maybe I should actually go back and learn what on earth the differences are between them all.
my mDriverMorealeModifer I want to alter is a 'Type' while your minZoom is a 'locked field' which I assume is why I am not able to just follow your working formulea from the camera example.

I'm a little sad that I cannot tame the beast that is Unity's ancient and bastardized version of mono, which would make your life and my own quite a bit easier. I think what I need to explore next is to just straight up replace mono.dll in MManager/mono to a newer version and hope that doesn't break things.

I wish you luck!
 
Here's how I would try to modify mDriverMoraleModifier, code untested:
Code:
Player player = Game.instance.player;
PlayerBackStory player_backstory = player.GetType().GetField("mPlayerBackStory", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(player);
player_backstory.GetType().GetField("mDriverMoraleModifier", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(player_backstory, -1f);
 
Hello guys i just want to ask someone to help me rename my current drivers, i dont need every driver just mine drivers. I downloaded ILSpy and i tried to find them but i cant.. Please someone can help me with this? I dont know where i can find the names etc.
Thank you.
 
Here's how I would try to modify mDriverMoraleModifier, code untested:
Code:
Player player = Game.instance.player;
PlayerBackStory player_backstory = player.GetType().GetField("mPlayerBackStory", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(player);
player_backstory.GetType().GetField("mDriverMoraleModifier", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(player_backstory, -1f);

Ooooh, just got babygirl to bed. It was her birthday today so there's been parities and presents.... I'm more exhausted then here. I think I am going to finish taking Not Farrari to the title after switching from Archer to complete the first challenge - then sit down and work out what they've changed in today's patch and then spend the early hours modding

This for this... Looking at the code, I am getting the urge to watch that 'Inception' movie again.



Hello guys i just want to ask someone to help me rename my current drivers, i dont need every driver just mine drivers. I downloaded ILSpy and i tried to find them but i cant.. Please someone can help me with this? I dont know where i can find the names etc.
Thank you.

You're looking in the wrong place. Get the Unity Asset Bundle editor (name may not be exactly that but it's good enough for Google). What you want to change is in the main 'Asset' file - which is basically a database. 95% of the cosmetic data and stats are in there.
 
Last edited:
Nice to see the patch and new mm.exe doesn't concern the Injector at all. Gave ithe above a go, final line causes a compile error - Cannot convert typre object to PlayerBackStory. At least its a error code thats taken me to read the differences between objects and class.

On a separate note, my balance changes contain (or I desire to contain)

Injector Plans (done)

//Set Redzone to be bigger(0.2f) - I like the idea of having less predictable wear. 40% redzone offers a better desision to 'repair part at pitstop to be safe' vs 'try to survive 10 last laps'
GameStatsConstants.initialRedZone = 0.4f;

//Reduce the amount of the race management stat(0.5f). - I have done 5 seasons, and this personal stat is already 20 while the others are far less.
Player.raceManagementStatMaxChange = 0.2f;

//Reduce scrutineering chance (15f) - At the moment, I feel risk parts are not worth using at all. A less chance of getting caught may let me better invest in risky parts
GameStatsConstants.scrutineeringChance = 6f;

//Remove lower bound(-5000000) - More risk being in the negative
GameStatsConstants.fundsLowerBound = -1000000L;

//Pit Stop Errors (0f,0.1f) - I have noticed that 99% of fast pitstops, even if something is bad, only adds 0.3s... but as it's -2 seconds from standard... you're still 1.7s better! So I stopped using standard. This will make the risk mean something again.
Mechanic.minPitStopAddedError = 0f;
Mechanic.maxPitStopAddedError = 1f;

//I believe this stat lets you not be fired (Joined Protection) - maybe AI only - but if not, is useful if you ever want to make your own team.
TeamPrincipal.daysUntilCanRejoinTeam = 365;
TeamPrincipal.daysJoinedTeamRecently = 60;
TeamPrincipal.daysJoinedProtection = 90;

Injector Plans to modify

Mechanic - I feel that mechanic-driver relationships are gained too fast. Easily within 1 season. I'd like to see relationships matter more (and also, to hire the same mecahnic / driver combo)
private readonly float weeklyRelationshipIncreaseRate = 2f;
private readonly float weeklyRelationshipDecreaseRate = 2f;
private readonly float endRaceRelationshipIncreaseRate = 15f;
private readonly float endRaceRelationshipDecreaseRate = 15f;

PlayerBackStory - create boons in backstories - make moral be more important (most my drivers are too happy), make part design take longer (allows AI to potentially create better performance parts) and make finance expenses be greater by x%
mDriverMoraleModifier = 0.3f;
TimeSpan mPartDesignTimeModifier = new TimeSpan(1, 0, 0, 0);
mPaymentsModifier = 5;

Anyone got any other idea's or changes they'd like to see - I may as well add options now so if I get stuck doing 1 thing, I can always move on and experiment with others

Edit: Chaiman Payments! Anyone know where these are located. Not seen them in ilspy, nor in the assetts! .
 
Last edited:
Another separate thing...

I was sorting out the TextAssets from the Asset folder, and as you know, they're a little bit of a pain to edit, even in Notoad++ because of how string some of the strings are.

Realised, that after you export them to text (I use via plugin), I can just change the .txt to ..csv and open it in excel! Everything is nice and organised into columns for you here, so if you were only interested in editing one column of values, it's all now in a straight little line.

You can also start using formulae if you want to rebalance a bunch of stats, though it's good practice to copy and 'paste values' once you've got the numbers you want.

Once you are done, ensure you've not added any new columns, and save as .csv, and then change the .csv to .txt manually again, so it can be read by the Asset Bundle Extractor.

(Also, this just works for most the Asset Texts - some are encoded as xml's, so this method wouldn't work)
 
Ooooh, just got babygirl to bed. It was her birthday today so there's been parities and presents.... I'm more exhausted then here. I think I am going to finish taking Not Farrari to the title after switching from Archer to complete the first challenge - then sit down and work out what they've changed in today's patch and then spend the early hours modding

This for this... Looking at the code, I am getting the urge to watch that 'Inception' movie again.





You're looking in the wrong place. Get the Unity Asset Bundle editor (name may not be exactly that but it's good enough for Google). What you want to change is in the main 'Asset' file - which is basically a database. 95% of the cosmetic data and stats are in there.

Thank you for help, i know im a noob but a cant find a link for that program. I used google to fint Unity Asset Bundle editor and it show me this page :https://unity3d.com/learn/tutorials/topics/scripting/assetbundles-and-assetbundle-manager and i cant download it from there. Sorry for my noob questions guys. And thank you.
 
Thank you for help, i know im a noob but a cant find a link for that program. I used google to fint Unity Asset Bundle editor and it show me this page :https://unity3d.com/learn/tutorials/topics/scripting/assetbundles-and-assetbundle-manager and i cant download it from there. Sorry for my noob questions guys. And thank you.

My bad. Got the name wrong in my head

Asset Bundle Extractor!

https://7daystodie.com/forums/showthread.php?22675-Unity-Assets-Bundle-Extractor

2.0 Api I think is the one I am using

It's the resource.asset file you want. Text asset driver.
 
Last edited:
Another separate thing...

I was sorting out the TextAssets from the Asset folder, and as you know, they're a little bit of a pain to edit, even in Notoad++ because of how string some of the strings are.

Realised, that after you export them to text (I use via plugin), I can just change the .txt to ..csv and open it in excel! Everything is nice and organised into columns for you here, so if you were only interested in editing one column of values, it's all now in a straight little line.

You can also start using formulae if you want to rebalance a bunch of stats, though it's good practice to copy and 'paste values' once you've got the numbers you want.

Once you are done, ensure you've not added any new columns, and save as .csv, and then change the .csv to .txt manually again, so it can be read by the Asset Bundle Extractor.

(Also, this just works for most the Asset Texts - some are encoded as xml's, so this method wouldn't work)

After my balance tweeks, I am thinking about having a 'randomised universe' mod. As I can now edit lots of values quickly as csv files, I can basically add random variables to 'car parts' , team values and driver, mechanic and lead designer stats.

I can basically set lots of items to random (within reason) and make a half dozen or so 'starting situations' . Maybe in one, predator is awesome. In another, Rodrigues is a 1 star driver, etc etc.

Would make things less predictable in the starting seasons - when starting a new game
 
Yep, its make me new asset file. I deleted the old one and i place the new its about 520 MB. If i open it with extractor and it show me the new names but if i start game i got the original names. Maybe i need to make new game?

I made a picture, maybe i done something wrong..
 

Attachments

  • mod.jpg
    mod.jpg
    291.1 KB · Views: 341
Last edited:
Yeah you have to make a new game. An alternative would be modifying the savefiles which wouldn't affect new games but will affect that savefile. And to be clear the process is Export file, modify it to your liking, then Import it back into the database. And if there's a save or commit button do that, if not then importing should be saving.
 
How do you edit the save files?

And has there been any progress with adding a team?

Given the workshop will probably be more or less useless, i will definetely continue to attempt things. Editing driver names and stats can be done with notepad++. I also managed to swap Kvyat with Verstappen, and extend his contract.
 
Some changes i'd like to see;

-Adding a team to the WMC.
-Scouting should take far less time.
-Altering driver stats and stars.
-Changing some livery colours. (Red Bull, Sauber and Manor, mainly)
-Decrease the "oddness" of driver transfers. ie: Vettel joining a GP2 team after becoming F1 champion is highly unrealistic and annoying.
 

Latest News

Do you prefer licensed hardware?

  • Yes for me it is vital

  • Yes, but only if it's a manufacturer I like

  • Yes, but only if the price is right

  • No, a generic wheel is fine

  • No, I would be ok with a replica


Results are only viewable after voting.
Back
Top