Jump to content
Sign in to follow this  
Duki

The Mystery of the Plugin Reshuffle that Crashed a Sim World

11 posts in this topic Last Reply

Recommended Posts

Hello Simtropolis,
 
Sadly, this is my first post on this amazing site...
 
I am fairly new to the world of modding and plugins, but have a good idea of what's what and what's supposed to happen in theory...obviously not in practice.
 
I've basically been spending the last week researching and reading up on all the wonderful customizations that I can enjoy, how to install them, how to run them...and all the wonderful potential of what can be done beyond just playing Sim City 4, and in anticipation of downloading tons of plugins and mods, I thought I would first clean up my plugins folder of the few downloads I did try...there weren't many at all, a few megabytes.

This basically meant rearranging, creating a few folders within the plugins folder in a way that I can track what is going where, as I expected that not long from now I might have hundreds of new plugins. I arranged things by the type of category and lot/mod and sometimes by the person who made it. I had quite a few files land up in an "Unknown Files" folder I made within my plugins folder.
 
Before I did all this I played the game for a few minutes to try and see what was and wasn't showing up and working in the game from what I already had, a few lots weren't showing up, so I shut the game down, rearranged the folders, removed 1 or 2 files I didn't want any longer and downloaded one or two dependencies that were missing...and tried the game again, except it doesn't work! I get the splash screen...then nothing. The icon in the task bar shows up while the splash is on screen and disappears when the splash disappears. I haven't changed my targets for the shortcut, I haven't modified or moved any mods (only mods I have running is NAM and the God Mode Terrain tools in Mayor Mode Mod...that's a lot of M's).

Here is where it gets even stranger..."cautious me" decided to back up my plugins folder BEFORE I rearranged it, just in case something funny like this happens...so I pasted it back, and cut the newly arranged plugin folder somewhere else...and it still didn't work! So I have NO idea where to start fixing this problem. I would be very grateful for any help or suggestions as I am totally lost as to what to do. I have some technical details below...in case it's needed, but I am 99% certain that this isn't a hardware issue.

Game Version: Sim City 4 Deluxe, Version 1.1.640.0
System: Running Windows 7 Premium, on an HP Pavilion DV6, 6GB of RAM, 64-bit system, Intel Core i5, CPU @ 2.50 Ghz.
My sim city folders are based in a My Documents folder, it's always been that way, nothing has been mistakenly transferred to any of the Program Files.

Thank you and looking forward to your feedback!
Duki

Share this post


Link to post
Share on other sites

Plugins are loaded in alphabetic order.  The folder name (if any) seems to be used as a prefix in the sort (or maybe the complete path name).  By rearranging your stuff, you may have changed the loading order so that some earlier load was overridden by a later one which did not happen in the older version of the folder (the order was reversed).  You'll notice, for example, when the NAM installs it creates two folders: Network Addon Mod and z__NAM.  The latter is hopefully the last of the transportation stuff to load, overriding any old stuff that may be around.

 

I hope this gives you a clue as to where to start checking.  Look for similar mods and make sure the order is correct.  You might want to look at the creation dates of the files.  The later one should generally load last.  Upper case letters seem to be the highest usually used in the collating order, since I notice my folders beginning with 'z' are earlier than the ones beginning with 'Z'.  For example, here is the tail of my plugins structure:

 

├── z___IndustrialTextures
├── z___NAM
├── z__Reskins
├── ZZZ-MTP
├── ZZZ PEG Facelift Mods
├── zzz_SAMTransitions
├── zzz_terrainmod
└── ZZZZ_PEG SEAPORTS
 

I keep my several overrides separate.

Share this post


Link to post
Share on other sites

├── z___IndustrialTextures

├── z___NAM

├── z__Reskins

├── ZZZ-MTP

├── ZZZ PEG Facelift Mods

├── zzz_SAMTransitions

├── zzz_terrainmod

└── ZZZZ_PEG SEAPORTS

 

Although this is the way the folders look in your file manager, this is not the loading order.  The difference is due to the fact that the file manager considers upper and lower case letters to be equivalent, when of course they're not.  In general, special characters and numbers come after letters.  In the above example, z___NAM would load after everything else (which is a big reason we named it that).

Share this post


Link to post
Share on other sites

I don't really care provided all the (zZ) folders load last.  I have my doubts about the actual loading order of z__NAM among them mostly because there are other z__ type folders there as well, particularly z__Reskins.  This works, and that's the main point, I guess. 

 

However, now that I have you on the line: what is the sort key?  I know it is lower-cased, but is it the full pathname?  And what kind of a sort are they using?  I'll bet this is a big chunk of the initial loading time.

Share this post


Link to post
Share on other sites

If you have the AC airports and the peg seaports in your plugins folder and have not deleted the seaport file folder in the x-ports file folder this will crash your game as you described.  You cannot have two different airport controllers or two seaport controllers active at once.  That is the only thing I know of that will crash a game upon loading the region, most everything else that will crash the game will do so upon loading the city tile.

 

You know what I do to maintain control of my Plugins folder?  I create a folder for each author's name, I have 109 different author's content, and nearly 9000 files in 2500 folders, if I was to categorize in any other way than what I do now, my Plugins folder would be a mess if I arranged it in any other way.  This also makes it easy to hunt down problem plugins, I can just cut and paste to another location all of one author's content to another folder one at a time and start the game and if it works(or doesn't in some cases) then I have found the culprit, I will then put back a number of the plugins from that author until I have found the actual plugin itself that is the problem.

 

It took two years to create this Plugins folder and it is perfect for all intents and purposes.  I even have a system in place to update my Plugins folder at the end of each month, to either put in and/or remove plugins.  Haha, I update my game more frequently than EA/Maxis ever did, they fail so hard.

Share this post


Link to post
Share on other sites

A reinstall should not be necessary.  This is the most up-to-date CD version with all patches.  Unless you've been messing with the game residency files in C:\Program Files ...  It should be fine.

 

Here is something to try:

 

Rename the folder C:\<you>\Documents\SimCity 4 to SimCity 4.old.  Start the game.  If the game is OK, it will create a new SimCity 4 folder in the default with all the default cities and default set up.  If it doesn't do this, then consider a reinstall.

Share this post


Link to post
Share on other sites

I don't really care provided all the (zZ) folders load last.

 

But they don't.  A file beginning with a tilde ('~') or an underscore will show up first in the directory listing, but load after any file starting with 'z' or 'Z'.  Most, if not all, special characters have a loading order after 'z' or 'Z'.  And digits will load after underscores.  I have personally verified all of this.

 

However, now that I have you on the line: what is the sort key?  I know it is lower-cased, but is it the full pathname?

 

Yes.  Although in SC4, files ending in ".dat" are loaded after all other extensions.

 

And what kind of a sort are they using?

 

Nobody knows.  However, the most accurate picture of the sort order we have found (which I have also personally verified) was found by Jondor:

 

Edit: A little more testing later, it becomes clear that the file loading order is quite complex, but is in fact closer to this:

\plugins\*.*

\plugins\asubfolder\*.*

\plugins\asubfolder\asubsub\*.*

\plugins\asubfolder\bsubsub\*.*

\plugins\bsubfolder\*.*

\plugins\*.dat

\plugins\asubfolder\*.dat

\plugins\asubfolder\asubsub\*.dat

\plugins\asubfolder\bsubsub\*.dat

\plugins\bsubfolder\*.dat

For instance: \plugins\bsubfolder\Red.SC4Lot will load before \plugins\asubfolder\Blue.dat resulting in a blue square in my above test (where Red.SC4Lot is a renamed Red.dat)

However, \plugins\bsubfolder\Red.SC4Lot will load after \plugins\asubfolder\Blue.SC4Desc resulting in a blue square.

".dat" seems to be the only special extension, giving two passes through the directory tree, one for everything except *.dat and a second for all the *.dat files.

 

This is done first for the game's Plugins folders, and then for the user's.

Share this post


Link to post
Share on other sites

Fascinating.  I quite often convert BATs and groups of them to a single .dat using Ilive's Files2DAT.  A lot of my stuff is .dat files (not from DATpacker, so that helps in understanding why my loads are so quick.  So .dat files override any identical IDs.  Very useful to know, thanks.

Share this post


Link to post
Share on other sites
  • Original Poster
  • Hey everyone...

     

    Here's an update.
    The good news...the game works...the bad news, I have no idea how I fixed it.

    It is very likely it might have had something to do with the loading order, I pasted back my newly organized plugin folder, and after a few resets to my computer (yes...I got desperate, and put my trust in the unknown and unseen "maybe-if-I-reset-the-computer-it-will-just-fix-itself" faith)...and it worked.

     

    Metalpuritan: I had no controllers or any of the mods/plugins you mentioned in your post installed, but its very valuable that you mentioned that, will keep it in mind. I actually have organized my plugins by function AND author. The reason I have done that is for brown boxes, from the game I will be able to tell what kind of lot/function it should have, and be able to narrow down which file I need to look at. I have done this because sometimes in game I may not know who authored the plug in/mod that should be working.
     

    Share this post


    Link to post
    Share on other sites

    Hmm.  Something got cleaned up there.  If this happens again, raise a new thread with the technical details of both your game and your machine and we'll have another try.

     

    How often do you clean up and defragment your hard disks?

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Sign in to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Help Keep Simtropolis Online, Open & Free!

    stexcollection-header.png

    Would you be able to help us catch up after a bit of a shortfall?

    We had a small shortfall last month. Your donation today would help us catch up for this month.

    Make a Donation, Get a Gift!

    We need to continue to raise enough money each month to pay for expenses which includes hardware, bandwidth, software licenses, support licenses and other necessary 3rd party costs.

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections