Author Topic: SMAC within SMAX  (Read 19735 times)

0 Members and 2 Guests are viewing this topic.

Offline Ford_Prefect

Re: SMAC within SMAX
« Reply #90 on: April 27, 2014, 03:48:40 AM »
My mod manager is now out in alpha form.
http://alphacentauri2.info/index.php?topic=8433.0

Currently requires python to run.  I plan to work on fixing some of its rough edges before release an exe for it.  Please report any bugs or issues you find with it.

Offline DrazharLn

Re: SMAC within SMAX
« Reply #91 on: April 27, 2014, 01:21:23 PM »
Fixed my mod manager up (making it much safer) and made it slightly friendlier. I've tested it much more thoroughly this time, but you should still consider this beta software and treat it with care (i.e. make a backup of your save files, don't blame me if your computer explodes).

Install files attached.  Read modman_readme.txt for more information including the easy install steps.

If you do use it, I'd appreciate it if you left a post or PMd me just to let me know.

Features:
* No dependencies
* Pretty fast
* Uses links rather than copy, so saves disk space and I/O calls
* Compatible with Windows XP or later (Tested on win7 only, but written with older systems in mind)
* Easy to install
* Easy to configure (edit a text file and run manage.bat)
* Implements a recursive depth-first directory tree pruning algorithm in batch
* Documents a few arcane batch tricks

Anti-features:
* Won't work on GNU/Linux or Mac OSX (maybe under WINE?)
* No GUI
* Source code is in batch, so it's slightly cryptic (commented quite thoroughly, though).

This manager is not intended to compete with Ford_Prefect's. It's just an alternative that was moderately enjoyable to write. Please use whichever you prefer, but bear in mind that Ford's is prettier and probably more maintainable and extensible (python is a much better language than batch).

The structure of the mod folders look mostly the same, too. Only difference is Ford uses ..\backup and I use _original. To switch between the two mod managers, all you'd need to do is move a few folders around.

As someone publishing mods, you can publish the same mod folder for both managers and for people patching manually.

Total size of my code is ~9KB. Download is larger because it includes the latest versions of kyrub and yitzi's patches for example purposes.

@Ford,
Will you be using something like pyinstaller to make a self contained binary? I'm interested to know how small it would be.

Also, how are you detecting changes in the mod directories/backup directory? I was considering either hashing the whole folder and using that or maintaining a hash per file (would allow only updating the changed files), but batch doesn't have a builtin hash function (and making and deleting links is pretty cheap anyway).

If you want to use links, by the way, I think you have to use hardlinks. SMAC doesn't seem to like symlinks.

edit: Removed attachment. Going to push v1.4 in a short while.
« Last Edit: April 27, 2014, 04:36:20 PM by DrazharLn »

Offline Ford_Prefect

Re: SMAC within SMAX
« Reply #92 on: April 27, 2014, 03:50:20 PM »
My mod manger is a little stupid.  Here is the basic process of it applying the mods.

Create a dictionary of the file locations in ./backup
Replace any definitions in the dictionary with the location files in the ./mods/* folders
Replace any file in the SMAC/X folder whose modified time does not equal the files listed in the dictionary.

Should work pretty well unless someone modifies a file and somehow doesn't effect its modified time.  That should hopefully be rare.
If there is a mod that has that problem, then I have a "Force" update button which copies all the files listed in the dictionary.

Offline DrazharLn

Re: SMAC within SMAX
« Reply #93 on: April 27, 2014, 07:55:08 PM »
> Replace any file in the SMAC/X folder whose modified time does not equal the files listed in the dictionary.

Surely this means save files and so on that the user makes that are also in the backup dir will be clobbered?

My method is to move everything in the game directory into $gamedir/modman/_original at install time. I also install manage.bat and order.txt into modman/.

Each time manage.bat is called it:
* deletes every link in the game directory that matches a known link in an enabled mod
* prunes the directory tree so that any directory that is empty or only contains empty directories is deleted (this preserves the user's non-mod files while removing empty directories)
* builds the directory structure for each enabled mod in $gamedir
* links in every file for each enabled mod

If it encounters a non-link file in the first step that it wants to delete (if the user has replaced the alphax.txt link with a real file or smac overwrites a map file included in from a mod, for example), the program exits and tells the user to move the file into a (new) mod directory, rename it, delete it or delete or move the copy in the mod directory.

To avoid problems with the user running the installer on a smac directory with saves present, I move the saves directory back up to the game directory (out of _original).

SMAC also writes to Alpha Centauri.Ini and log.txt each time it's run. With my manager that's ok as it writes to the existing file and that feeds through to the mod*, but with yours you'll be overwriting them each time you run your launcher (because the timestamps will be different).

* Arguably not the best behaviour?

Anyway, I'm off for the evening. Uploaded is the latest version. Actually quite pleased with it.

Offline Ford_Prefect

Re: SMAC within SMAX
« Reply #94 on: April 27, 2014, 08:25:47 PM »
> Replace any file in the SMAC/X folder whose modified time does not equal the files listed in the dictionary.

Surely this means save files and so on that the user makes that are also in the backup dir will be clobbered?

Nope.  I have an exclude list that excludes the settings, saves, dlls, tmp, etc.

Offline diessa

Re: SMAC within SMAX
« Reply #95 on: April 28, 2014, 02:59:27 PM »
Thanks for your posting on your respective launchers, DrazharLn and Ford_Perfect.

Sea bunkers and sensor buoys plus a few others can be enabled by alphax editing in both games.

Should those options be enabled in the "original" version or just the "hybrid" version?

Offline ete

Re: SMAC within SMAX
« Reply #96 on: April 28, 2014, 03:56:28 PM »
Neither by default, they are not meant to be part of the game. Players of both can enable them if they wish.

Offline diessa

Re: SMAC within SMAX
« Reply #97 on: April 28, 2014, 08:52:04 PM »
I agree. I think that we have enough of a baseline to establish the pattern for how we deal with things that are part of the game, such as the landmarks added through patches and code added in alpha.txt, but aren't necessarily part of the original.

Offline Impaler

Re: SMAC within SMAX
« Reply #98 on: May 01, 2014, 02:11:12 AM »
I also dislike the atmosphere of SMACX (Aliens and silly human factions distract or are redundant with the Magnificent 7 Originals).  I largely strip these factions out of my SMACX games while keeping most of the new facility/SP goodies, and I have a heavily edited Tech Tree that removes all reference to Progenitors or Resonance.

Offline Kilkakon

  • Likes cute things but is
  • Mostly Harmless
  • *
  • Posts: 1155
  • €695
  • View Inventory
  • Send /Gift
  • It does something (It's free and yet priceless)  
  • Creator of Lost Eden and C&C: Dawn of Tomorrow
  • Scenario Creator Custom Faction Modder AC2 Hall Of Fame AC2 Wiki contributor Downloads Contributor Author of at least one AAR Planet tales writer author of the Lost Eden mod for Alien Crossfire
    • View Profile
    • My website!
    • Awards
Re: SMAC within SMAX
« Reply #99 on: May 01, 2014, 03:02:24 PM »
Be aware that "sensor bouys" only benefit nearby land units.

Offline Ford_Prefect

Re: SMAC within SMAX
« Reply #100 on: May 03, 2014, 02:15:10 PM »
I just released a new version of my mod manager.  Now it handles administrator privileges better and will remember which mods you had applied the last time you used it.

http://alphacentauri2.info/index.php?topic=8433.0

Offline Ford_Prefect

Re: SMAC within SMAX
« Reply #101 on: May 04, 2014, 03:42:41 AM »
Ok.  Newer version of the mod manger is now out.  There is an exe version of it included now and I fixed the bug of it crashing for first time users.

Offline Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49279
  • €532
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: SMAC within SMAX
« Reply #102 on: May 04, 2014, 03:43:57 AM »
Nothing for Downloads? :(

Offline Ford_Prefect

Re: SMAC within SMAX
« Reply #103 on: May 04, 2014, 03:51:04 AM »
I'm willing to put it up on the downloads page (currently its attached to my post http://alphacentauri2.info/index.php?topic=8433.0) once I know it is relatively bug free.  So I'm hoping someone else will try it out and provide feedback.  Also, I just noticed the python to exe converter included tkinter's demo folder ??? ....   so I can make the final download smaller.

Offline Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49279
  • €532
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: SMAC within SMAX
« Reply #104 on: May 04, 2014, 03:53:02 AM »
Okay.  I'm just concerned that offsite storage isn't going to draw people to the community.  A README mentioning here w/ URL would be nice.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

And so we return again to the holy void. Some say this is simply our destiny, but I would have you remember always that the void EXISTS, just as surely as you or I. Is nothingness any less a miracle than substance?
~Sister Miriam Godwinson 'We must Dissent'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 42.

[Show Queries]