Forum Announcement, Click Here to Read More From EA_Cade.

@SimGuruModSquad : Sims 4 modding vs Sims 3 modding

jtravers88jtravers88 Posts: 591 Member
edited August 2014 in General Mods Discussion
Hello. I think the best way to ask my question is to give an example of how I modded Sims 3. First the gameplaysystems.dll was extracted from it's package. Then it was disassembled with ildasm. All private variables were changed to public, and the code was then reassembled with ilasm. This dll was then included in Visual Studio instead of the original dll as part of the assembly. However it was ONLY used for the purpose of compiling new code. The gameplaysystems.dll was NOT replaced in the game, thus making all mods non-core. The new game code was then compiled against whatever dlls were needed and then placed in a new package and placed in the mods folder. The fact that the new game code was compiled against public variables had no effect on the game. Any variables referenced worked in game, since the variable states were only checked at compile time, and not at run time.

So my question is, will the process be basically the same for Sims 4, or in a worse case, will the dlls not be interpretable, or in a better case, will all of the code in the gameplayobjects and gameplaysystems dlls (or their corresponding replacements for S4), be modifiable thru python scripts.

Thanks in advance.

Comments

  • IngeJonesIngeJones Posts: 3,247 Member
    edited August 2014
    I always attempted to (and managed all apart from about two mods) use the public methods and properties as offered in the existing game library rather than always starting by altering the access level of them, because I figured that's usually the library coder's way of indicating which methods are likely to remain backward compatible and which are likely to change on the whim of EA coders. In fact the approach paid off nicely since I have rarely had to update any of my mods for any patch or EP. The most memorable exception was the pay buffet table, where I had no choice but to directly access some private members on the food dishes.
  • HenekHenek Posts: 36 Member
    As the scripting is done in python it will be completely different in the approach. I'm assuming here that they are not stupid and that the game will load the scripts placed in the script directory. If we also assume that the scripts do not need to be compiled, then you would not need to have access to the core scripts at all, documentation of the core is enough. Also to note is that there are no private methods or variables in python, so what can be done is fully dependent on how much of the codebase is exposed to scripting (exposing more things is probably not feasible for modders). If the scripts need to be compiled I do not know if the core scripts are needed, but they again do not need to be modified.

    To summarise: There will be no need for core mods, a text editor will probably suffice and what can be done depends on how much is exposed to scripting. In general, scripting for Sims 4 will be MUCH easier then Sims 3.
  • jtravers88jtravers88 Posts: 591 Member
    One of my questions for this thread is will their even be any access, as you refer to as 'public methods and properties as offered'. My concern is that the game will be presented without the ability to interpret / disassemble the code, like many other games. Possibly one of their objectives is to 'say' they will offer more access (thru python scripting), when what they really intend to do is provide access to areas they want, and remove access in areas they don't. Public vs private access to properties / methods is really secondary to my real question. I guess I didn't clarify that to well in the op.
  • jtravers88jtravers88 Posts: 591 Member
    edited August 2014
    None of my mods, nor Twallans, were core mods, in the sense that no code was replaced. And if what you say Henek, is true, they will be significantly reducing our access to the game code base.

    Awesomemod was a core mod, Twallans story progression mod was not.
  • IngeJonesIngeJones Posts: 3,247 Member
    edited August 2014
    Yes we definitely also need a documented API. Well, when I say "need" we've done without in the past (TS1 and TS2 and parts of TS3) but it's limiting and time consuming.
  • SimKureeSimKuree Posts: 39 Member
    edited August 2014
    Oh they said they're using python 3, so there won't be any IL assemblies. Since python does support monkey patching, it's pretty easy to override some variables and function at runtime.

    EDIT: Assume that the script load sequence is: MOD loads after EA's code.
    You can find my S4PE here.
  • IngeJonesIngeJones Posts: 3,247 Member
    But surely calls will be made to the core library from the python? It's the API to the core library we need. I would *hope* the entire core isn't made up of uncompiled python!
  • SimGuruModSquadSimGuruModSquad Posts: 597 Member
    Hello - comments!

    Out of the Mods dir, the game will load Python zips and loose python files. Loose files are meant for iterating while developing and zips are meant for distribution. Zips should contain compiled python for performance. The game itself contains .pyo files.

    As for documentation, we have no immediate plans to release info on all our python APIs since there are a lot of them. So some disassembly is still going to needed, sorry. But we will be looking for feedback on what specific APIs you would like more information on and will do what we can to accommodate information requests. The game also puts a lot more things in tuning than Sims 3 did so it's possible a number of mods you would traditionally do as script will be done via tuning and not code. But that said, we know script mods will be needed for things you want to do and I will be here to help with that.

    As you have discussed, adding code instead of replacing Maxis code is going to be the best way to author mods. Although in the past week we realized that pure additions has a bug, and an upcoming game update will fix that. Can't give a firm time frame right now other than "soon", but it will be fixed quickly so you guys aren't forced to override our code and make potentially brittle mods.

    More details to follow!

Sign In or Register to comment.
Return to top