Jump to content


Photo

Minimise the number of files in the game-dir!


  • Please log in to reply
4 replies to this topic

#1 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 29 January 2005 - 06:15 PM

Programs needed.
WeiDU
Text editor

Introduction
While downloading and examining mods (modders never get to play), I've noticed a tendency to shove as much stuff as possible into the main game folder. When having a fair number of mods installed, it tends to get pretty confusing with all files, and I can't even imagine how players that doesn't know the basics of modding handles it. Therefore, I decided to write this little simple tutorial on how to cut down the number of files in the main game-directory, and as a bonus, I'm adding a section on how to go even further: Creating invisible .bat-files.

What can be seen in a game directory?
This is a list I made looking on various mods on my computer...
Foo (the folder)
Setup-Foo.exe
Setup-Foo.tp2
AudioInstall.bat
AudioUninstall.bat
tisunpack.bat
Readme in various styles and versions
FAQ's
Various old versions of tp2's, such as Setup-Foo.tp2.orig, etc.
Todo's
(if you have even more than these, I'd recommend to seriously think over how you organise you mods...)

As you can see from this list, there's lot of unnecessary stuff located in the main game folder. Imagine having 20+ of these monsters installed...

Now, what is actually needed?
Actually, only two things:

Foo (the folder)
Setup-Foo.exe

All else is unnecessary.

Um, but why? And what about all the other stuff?
Let's go over it, thing by thing:

Setup-Foo.tp2 - Actually, the tp2 can be stored inside the Foo-folder, if the folder is named the same thing as the .exe (if you remove the Setup-, that is). Note that the .tp2 doesn't need to have the Setup- at all, Foo.tp2 is sufficient.

This_whole_pile_of_bats.bat - Put these anywhere. When weidu calls upon a .bat, as in AT_INTERACTIVE_EXIT or AT_UNINSTALL, the .bat execute at the same folder level as the WeiDU-exe. So there's definitely no need for having this in the game folder. See below as for how to make them invisible, as well.

Readme's - I seriously doubt they'd be more frequently read if located in the game directory. These can be located anywhere.

FAQ's - Same as readme's.

Old tp2's - If these even need to be in the published pack of the mod, you can just stack them into some folder somewhere...

Todo's - Same as old tp2's.

Bonus section - making the .bat's (almost) invisible to the end-user
We've just established the fact that we don't need to have the .bat's in the main game folder. Well, I've taken it another step further - we don't need them in any folder at all. We can have them exist, but never visible. Now, how?

Here's how we do it; we inline the .bat's in the tp2, and then we let them have themselves deleted. Watch this simple audio-installer code somewhere in the tp2:

<<<<<<<< Foo/inlined/more_folders_so_that_no_confusion_occurs_between_this_and_other_files/install.bat
@echo off
cd override
oggdec Foo*.ogg
del Foo*.ogg
del oggdec.exe
cd ..
del install.bat
>>>>>>>>

<<<<<<<< Foo/inlined/more_folders_so_that_no_confusion_occurs_between_this_and_other_files/uninstall.bat
del override\Foo*.wav
@ECHO
@ECHO Audio Uninstalled
@ECHO
del Foo/Backup/uninstall.bat
>>>>>>>>
COPY ~Foo/inlined/more_folders_so_that_no_confusion_occurs_between_this_and_other_files/install.bat~ ~install.bat~
COPY + ~Foo/inlined/more_folders_so_that_no_confusion_occurs_between_this_and_other_files/uninstall.bat~ ~Foo/Backup/uninstall.bat~

AT_INTERACTIVE_EXIT ~install.bat~
AT_UNINSTALL ~Foo/Backup/uninstall.bat~
Not very many complications, perhaps, but I'd like to lift forward the little '+' between COPY and ~uninstall.bat~. This little thing makes sure that weidu won't reverse the action at uninstall, and the copying will not be undone.

Yes, I know that this isn't fully invisible .bat's, since the uninstall actually exists in the Backup-folder, but this was the best way I could do, due to weidu's limitations. See, weidu doesn't read the .tp2 at uninstall, so there will be no inlined files anywhere. I couldn't call another inlined .tp2 either, since weidu doesn't allow inlined files within inlined files. I tried several ways, but with no luck, so I had to settle for this work-around. I won't tell you how many time weidu choked on me. ;)

If anyone else can think of a way, feel free to contact me. :)

Good luck modding!

Last, I want to end with a part of a conversation I had while trying this stuff out:

SConrad: I just had this moment of brilliance and I'm trying to do a new discovery in outrageously absusing WeiDU to do what I want.
Shed: Right... and what would that be? :) Do tell.
SConrad: Invisible bats.
Shed: Right. Are you sure you shouldn't go to bed, now, Seb?


© Copyright Sebastian Conrad 2005.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#2 Seifer

Seifer

    The best Anti-Paladin weapon is a tin opener...!

  • Member
  • 4505 posts

Posted 29 January 2005 - 06:47 PM

Its worth noting that CtB had a good example of file minimisation.

Seif

how come you always look so damn cool in every photo I see you in?!?


Speaking of modding, I listened to IER 3 yesterday, so you can have another quote for your signature: how come you sound so damn cool, as well as look it? It's unfair. Seriously.


Still a cyberjock, still hacking the matrix, still unsure of what that means.

TeamBG member - http://www.teambg.eu

#3 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 29 January 2005 - 07:33 PM

Its worth noting that CtB had a good example of file minimisation.

Seif

CtB's contribution to the game folder:

checkbod (folder)
CtbFinishInstall.bat
CtbUninstall.bat
setup.log
Setup-CheckTheBodies v150.exe
Setup-CheckTheBodies v150.tp2
uninstall.exe

... which is not really my view of having a minimum of files necessary in the game-dir. Uninstall.exe seems... redundant and what setup.log is, well, I can't say for sure. Maybe we're talking about different things here?

And if you're talking about biffing and stuff, I wouldn't really set CtB as the very best example of that, either. The installation process unfortunately has a few flaws, which I cleaned out when I was experimenting with the same thing parallelly - so I'd rather use that as a reference, if we're indeed talking biffing and other issues with packing and structuring mods to take as little space/minimum amounts of files necessary. :)

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#4 Seifer

Seifer

    The best Anti-Paladin weapon is a tin opener...!

  • Member
  • 4505 posts

Posted 29 January 2005 - 07:40 PM

Not biffing as per se but from reference, it called a load of files from the readme thus eliminating the need for a few files.
And remember where I am currently, away from ones tools and all!

how come you always look so damn cool in every photo I see you in?!?


Speaking of modding, I listened to IER 3 yesterday, so you can have another quote for your signature: how come you sound so damn cool, as well as look it? It's unfair. Seriously.


Still a cyberjock, still hacking the matrix, still unsure of what that means.

TeamBG member - http://www.teambg.eu

#5 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 29 January 2005 - 07:44 PM

Well, you'll have to look that up when you get home, because I don't really understand what you're talking about. :)

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner