Page 1 of 1

Just wondering if this is possible...

Posted: October 16th, 2017, 10:45 am
by narukaze
Hello everyone,

I thought of a mod that could be useful, but I figured I'd ask if it's possible. A Core-Mod that A) makes the game do database storage and B) plugs all the memory leaks.

I read in the General Issues FAQ that one of the problems with TS3 is simply that it can't handle super-big towns, because it keeps all data in memory. My idea is to write a Core-Mod that stores some data on disk and retrieves it when it's needed. Like the interiors of buildings.

It sounds like it would fix a lot of problems, so I figured I'd ask if it could be done.

Posted: October 16th, 2017, 5:31 pm
by Consort
I don't know enough to give a definitive "no", but to be honest... consider this hasn't been done in the past 9 years, so probably rather not I guess.

According to my limited knowledge:

The moddable parts of the game are the game logic which is in C# (better: Mono or .NET) but that's not the entire game. There is also an underlying engine which is in binary code. Some assets seem to be inaccessible from the "c# part".

Existing code is only available in .IL bytecode which makes modifying it difficult

The game uses custom mono libraries and you only have limited (say: non existing) access to I/O stuff

Posted: October 17th, 2017, 4:50 am
by Chain_Reaction
What Consort said. We'd need access to the engine to do such things and we don't have that. All we can easily control is script core which is a layer of abstraction that runs on top of the engine controlling the Sims AI. This is in .NET 2.0 which in it's self is rather limited being 15 years old now. The game uses marshal'd calls to talk to the engine of which there is limited calls, mostly for things like the routing engine, world lighting and such.

Existing core mods are just a modification of this script core, editing the original C# core in .IL bytecode form then recompiling it.

I'm not saying some genius with a lot of time couldn't crack the binary and perform a miracle but that wouldn't be me.

Posted: October 17th, 2017, 1:06 pm
by narukaze
Ah, I thought the memory management was in the script core, too. My mistake. Guess it isn't possible.

Posted: October 17th, 2017, 4:46 pm
by Consort
Chain, while you're here :)

Do you know if it's possible to start new threads from the scripting engine?

I had this weird shower thought of hijacking objects in the simulator and re-starting them as tasks that would make the game run better on multicore cpus.

Posted: October 18th, 2017, 3:22 am
by Chain_Reaction
I don't think so. At least I haven't found anything that indicates you can. There is a simulator task execution type of threaded though. This is what things like the RoleManager, TrafficManager and SimUpdate for buffs and such run under. I don't know what EA's definition of threaded is though. I have read people with multicore CPU's seeing very little utilization of their other CPU's but I don't know if that's because of the limited use of the type or because the game is just helpless. However these tasks seem to be some of the most responsive in the game. I've been experimenting with changing the alarm manager to use this threaded method on a quest to improve SP performance but don't have any concrete results yet. Twallan was heading down this road prior to his retirement by changing all alarms to be yielding with Overwatch. Users are getting a big performance boost out of that they probably don't realize but if those were running threaded it might be even more significant.

Posted: October 18th, 2017, 10:58 am
by narukaze
Interesting. On another note, has anyone tried using ildasm.exe on the TS3 executable? Because if Sims 3 itself is written in C, then it stands to reason that it could be disassembled and examined in IL form, unless there is a factor I am unaware of. (Would do it myself, but I'm away from my computer and will most likely forget by the time I return.)

Posted: October 18th, 2017, 2:57 pm
by narukaze
Just tried it, it doesn't work. Which is probably good, honestly. (Also, I meant C# when I said C earlier.)

Posted: October 18th, 2017, 6:44 pm
by Consort
Thanks for the explanation, Chain. So if someone feels overqualified in .net 2.0 and is terribly bored they might experiment with it some day:)