simcity 4 Sharing Plugins Folders - Discussion
By
Haljackey, in SC4 - Custom Content
681 posts in this topic Last Reply
Highlighted Posts
CoriBoom™ Approved proposal for a prospective way forward. This is a potential pathway to success!
Recommended by Cyclone Boom
Potential new SC4 package manager idea explained.
Recommended by Cyclone Boom
a) keeps track of all content uploaded to STEX/LEX,
b) keeps track of content of items in a player’s Plugin folder, and
c) is able to bridge the two (downloading content, managing dependencies, etc.) Regardless of how the end system gets implemented (some sort of package manager solution sounds great to me), the system ultimately still needs to know what additional things are required for a given upload. For that, there needs to be something major in place first - some sort of database of information where things are managed and linked. For this database, I think we’d need at least 3 groups of tables. One for the uploads themselves and metadata about them (name, URL, date uploaded, version, date modified, maybe even tags/categories, possibly dependency breakdowns, definitely incompatibilities, and/or other metadata as appropriate). A second for all of the TGIs in each upload (kind of like a much-expanded Prop & Texture Catalog but for all other exemplars too including buildings and other required files). The third is a list of the TGIs currently in the player’s Plugin folder. Exactly whatever the data structure ends up looking like is not important for now, and I am focusing for now on just massing an index of everything I can. Some in the Sharing Plugins Discussion have offered the opinion that such a task would be herculean; I don't necessarily agree with that. It certainly will take a lot of time and investigative work, but from what I have tested quickly so far it seems doable. I think that should maintain even as the scope scales up. I'm making some initial assumptions about the degree of detail this theoretical dependency manager would go to (include to the individual building/prop/texture/LUA/etc exemplars for lots and ignore the FSH/BMP files which are technically dependencies for models). My implementation so far I loved the idea of MODPACCs discussed, and figured bundling all of my B62 content would make a great start. First, I started a C# library to read and parse DBPF files. This was mostly a personal challenge to learn and accomplish, and I believe it will prove invaluable to me as I work towards achieving many of my ideas, from this plugin sharing to reversible datpacking to improved PIMX. This code library allows me to look into a DBPF file to actually read its contents - it won't matter if someone has datpacked or renamed or done anything else - we still should be able to know what a specific file is and what it contains. Additionally, I will need to transition to something actually suited to handle this huge amount of data - my JavaScript filtering in the Prop + Texture Catalog which while pretty neat and something I am proud of will definitely not be up to the task. It’s served its purpose. With assumptions I mentioned above in terms of scope and detail, I'm wildly guessing the end result will be somewhere on the order of tens of millions of records. A proper data management implementation should eat that up just fine considering that we'd only be adding a few thousand more records each month at the most, assuming roughly the current rate of uploads. (Timeout here to send a huge thank you to @memo - your jDBPFX library was invaluable in helping me getting started on my own library - it was a tall task learning C# and how to analyze DBPF at the same time and you were a huge help for the latter). Anyways, using csDBPF, I created a barebones program to use that library to parse through the B62 content and create CSV tables as placeholders for data tables in an actual database I described above. The first table examined all of the LotConfiguration Exemplars and listed all of the IIDs for rep 13 of the LotConfigPropertyLotObjectData properties – this is essentially a list of IIDs of all buildings, props, textures, flora used on the lot. This is the list of all LotConfigPropertyLotObjectData used in the B62 Remastered lots. The second table or set of tables is a list of TGIs and some identifying information about the file they come from, and associated tables detailing metadata about each upload. Here all TGIs uploaded ever are represented. After referencing the first table against the second table, I can have the exact list of dependencies for a given item. If this list is complete, then by definition I also know which packs the IIDs are located in and where to download them. (Tangentially, I would also be fascinated to see a heat map type visual of which dependency packs are most utilized and even which props are most referenced too - tons of minimally useful yet fascinating knowledge is hidden here). A third table could contain all of the TGIs you have in your plugins folder. This can be cross referenced between the first two tables to determine what you already have in plugins, and what needs to be downloaded. I've put together a quick prototype using all of the uploads in my B62 Remastered series. It's located here in Power BI, but the gist is that i can know the required dependency packages for any chosen lot. It's also embedded below for you to play with. Despite my csDBPF library being in its infancy, I am pretty much already able to accomplish putting together table one (IIDs used for a given lot or set of lots) and table three (all TGIs in a plugin folder) listed above. Table two (the list of all TGIs uploaded) is where things get interesting... Indexing all known uploads Looking from the LEX side of things for a moment, @CasperVg has built a fantastic system with API access to LEX file data (example [LEX login required]). This makes it fantastically easy to index and cache information on each upload. I'd be trivial to iteratively look at each item and store relevant information in a database for referencing. The STEX database stores a lot of this same information, but because there's no custom API, it's a little bit more difficult to get to everything. Critically it also does not list the most important thing either: dependencies. On a related side note: A long time ago, CB kindly shared a sample of it with me. Here's a link to what it looks like. Basically there's two main tables: one for each file listing containing the listing information, and one for "attachments" to each listing including screenshots and the uploaded file(s) to download. Circling back to figuring out what is required for each upload, this is where I am currently stuck right now. It's possible to iterate over the STEX database and programmatically download, extract and analyze each file to get a rough idea of what IIDs are used (and thus what dependencies are required), there's no way of knowing if that item is the original prop/texture/building or if it is an override and actually refers to some other upload. Note that this also does not cover other dependencies which may be required like queries, sounds, LUA scripts, or other kinds of resources, though I'm sure that can be figured out in time. All of this might look something like @catty-cb has done with her Catalog, but would be more comprehensive and would include the LEX and possibly other non English language sites as well. This section is still kind of up in the air while I work to improve and simplify and expand my csDBPF library and further build out a draft of the database schema expressed in the Power BI report linked above. I've pretty much taken a break from both of those for the summer, but towards the fall I'll be diving head first again into those projects and ramping up collaboration with others on this and related projects. Conclusion The way I see it there's really three aspects to a sort of "mod manager" that can manage downloads and dependencies: the part the user interacts with, the storage of the files, and the data that is the foundation for the system. Regardless of what the first two parts turn out to look like, I've chosen to get started on the data component because it seems reasonable to accomplish and make significant progress without having to come to some sort of consensus as a community. That was quite a lot, but it basically summarizes most of what I have been thinking and slowly working towards for nearly a year. That's what has been floating around in my head, and I'm super excited to hear what yall might think about it, and curious about any other potential issues or shortcomings I might have missed.
Concept of mod manager and file parsing implementation details.
Recommended by Cyclone Boom
-
Similar Content
-
Recently Browsing 0 members
No registered users viewing this page.


