• Welcome to SC4 Devotion Forum Archives.

API Section on SC4D Wiki

Started by triepod, February 09, 2016, 11:08:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

triepod

Dear SC4D webmaster,

I know that the DLL modding is developing today, even fix the 'hardcoded' issue, such as TE crash (fixed by SC4Fix). To support this modding method, I suggest you to create API section on SC4D Wiki with some considerations:

1. API Explorer
I know that the SC4 API is complex. So, to help modder, I suggest you to create API Explorer. API Explorer will help the modder find the API.
2. Prefix
To differentiate the normal wiki section with API section, I suggest you to use 'API' namespace.
3. Template
I know the Wiki doesn't have API-related template (such as function template). So, to support it, I suggest you to create API-related template.
4. API Tutorial
To help modder to mod the game with DLL, I suggest you to create API Tutorial. The API Tutorial must be easy-to-understand and high quality.
5. API Glossary
To help modder understanding DLL modding, I suggest you to create API Glossary. The API Glossary must be differentiated because the API is complex.
6. other considerations welcome

I hope you to build the API section in the Wiki.
Sorry if this post there are words that are hurtful to you.
Sorry for bad English.
Critics are welcome.

Regards,
Triepod (Zaydan Naufal)

Triepod is a new account of indovote

APSMS

Hi,

We don't actually have the permission to reverse engineer SC4, and are under contract not to modify the source code, the .exe, or post the modified bits.

The user speeder lives in a location where it is legally OK for him to do so, and simmaster07 was explicitly given pieces of SC4 code to reverse engineer to create your aforementioned DLL. With good faith he published his results, but the actual API he worked with was incomplete at best.

We simply don't have a working copy of the SC4 API, and what we do have is readily available on simmaster07's GitHub. Keep in mind SC4 is mostly bound to our agreement with EA because we host EA/Maxis official files on the site (after they were taken down by EA) for the benefit of future SC4 users, and unfortunately said files are still under copyright. You actually agree to EA's EULA every time you go to view the downloads in that part of the site.

But, as I said before, the API isn't actually known, so providing an API explorer, or an API tutorial isn't possible because only Simmaster07 has cracked it, and all the relevant information is located on his GitHub.
Experience is something you don't get until just after you need it.

My Mayor Diary San Diego: A Reinterpretation

triepod

Quote from: APSMS on February 09, 2016, 11:17:43 PM
Hi,

We don't actually have the permission to reverse engineer SC4, and are under contract not to modify the source code, the .exe, or post the modified bits.

The user speeder lives in a location where it is legally OK for him to do so, and simmaster07 was explicitly given pieces of SC4 code to reverse engineer to create your aforementioned DLL. With good faith he published his results, but the actual API he worked with was incomplete at best.

We simply don't have a working copy of the SC4 API, and what we do have is readily available on simmaster07's GitHub. Keep in mind SC4 is mostly bound to our agreement with EA because we host EA/Maxis official files on the site (after they were taken down by EA) for the benefit of future SC4 users, and unfortunately said files are still under copyright. You actually agree to EA's EULA every time you go to view the downloads in that part of the site.

But, as I said before, the API isn't actually known, so providing an API explorer, or an API tutorial isn't possible because only Simmaster07 has cracked it, and all the relevant information is located on his GitHub.

We can co-operate with EA (maybe) to provide API info.

simmaster07

#3
Hello, figured I'd just drop in to clarify one quick thing:

Quote from: APSMS on February 09, 2016, 11:17:43 PM
simmaster07 was explicitly given pieces of SC4 code to reverse engineer to create your aforementioned DLL. With good faith he published his results, but the actual API he worked with was incomplete at best.

I was given pieces of SC4's code to reverse-engineer the game's DLL framework. This is still an incomplete effort. SC4Fix was made by debugging the assembly, and thankfully the issue was essentially a null pointer error which was easy to fix at the assembly level. However I didn't have permission for researching and creating the TE lot crash.

A lot of the API information (assuming you're talking about the C++ classes comprising the game) are available in the PowerPC Mac version to an extent, and this has been public knowledge in the community for a long time, but these symbols have yet to be fully mapped to the PC version.

Quote from: triepod on February 09, 2016, 11:25:09 PM
We can co-operate with EA (maybe) to provide API info.

When I emailed Paul Pedriana about the DLL framework, he gave me limited code samples and said that to provide anything more would require a formal code release, which is more or less outside the realm of possibility. It isn't likely that we're ever going to get explicit legal permission to reverse-engineer SC4.

Frankly, I'm personally going to anyway, for my own research and largely for educational purposes. However, since this is limited to my own personal and educational purposes, it makes it impossible for me to properly share my findings anyway.

The question of what even constitutes reverse-engineering comes into play as well. For instance, I don't believe Maxis and EA ever made file formats such as DBPF public (though I could be wrong on this), which would necessarily mean that they were engineered as well and integrated into developer tools which are now essential to the modding community.

speeder

Some info from my side:

I have Wiki editing permissions, and don't put that info on the wiki because it ins't "ready" in some senses.


First, I am currently trying to convince EA to give us permission to RE the game, or to give the sources, I am exchanging e-mails with Paul Pedriana (that don't work at EA anymore, and thus can't represent EA) to see if he can assist me with this.

I also exchanged e-mails with some other EA employees, and maybe I had an effect, maybe I didn't and this would happen anyway, but here it is:

https://github.com/electronicarts/EASTL


As for the game sources: I am currently trying to map the OSX symbols to the Windows version, it is a very long and tedious process, I would greatly appreciate if someone helped me, but this is a complex issue. (example: I can't accept help from people in the US... or rather, I can, it is jsut taht would be irresponsible to do so).

I am writing right now, an "API" for SC4, but mostly to make understanding the game easier for me, and maybe finish the GZCOM dll thing, but that will take a while.

Until I (or simmaster, or someone else) figure how to make a GZCOM dll work, publishing an API is useless anyway... Still, I put in a thread of mine a list of almost all "IDs" in the game, the GZCOM dlls work by calling those IDs, thus if you figure how to make GZCOM dll, you can already do some tests.

Also you might be interested in the The Sims Online reimplementation projects, that are based from reverse engineering that game with a "ambiguous" permission from EA (EA don't gave explicit permission, but deliberately left files lying around that could be reverse engineering easily), the NIOTSO repository has some good info, also the official EALAND final version client downloads have nice stuff in it (dlls that are theoretically compatible with SC4, and some more INIs with constant and IDs).

By the way: TSO and SC4 were developed alonside each other, including released almsot at same time (if I remember correctly TSO first release was in december of 2002 and SC4 in january of 2003) thus why they share tech.