Page 1 of 1

Reducing file size with legions

Posted: Thu Apr 03, 2008 7:05 pm
by ARC_Commander
Okay, here goes:

I'm still working on Battlefront Extreme. I'm in the latter stages of a huge overhaul, this will be version 2. But I've got a little problem. Are there any ways to reduce the file size of individual lvl's for Republic legions - that use different character models? The legions that use the standard EP3 trooper models are okay, it's the 41st and Marines that get problematic.

What I did before was to load the standard rep.lvl into memory, then to load a legion's level file that only contained skins. For the Marines and the 41st, I had to make entirely new sides, and had to duplicate all the different weapons, models and textures, which not only was very labour-intensive, but took up tons of space.

I was thinking that I could simply merge all the different legions into the REP folder, but this would require different ODF names for the units, therefore removing unit localizations.

If this needs to be clearer, just ask.

Thanks in advance.

Re: Reducing file size with legions

Posted: Thu Apr 03, 2008 11:54 pm
by MasterSaitek009
So you want a way too make the file size smaller? How would you like to do this?
There are few ways.

(A.
Hidden/Spoiler:
With this method you can use textures, models, weapons and more from a preexisting .LVL side. For this example let's use the Default Rep side and the Anakin unit.

[quote="Saitek"]1. Create a new unit ODF and corresponding REQ.

2. Put this code at the top of the new ODF[code][GameObjectClass]
ClassParent = "rep_hero_anakin" [/code] This makes the new unit a hierarchical child of "rep_hero_anakin". As such it inherits all of it's properties (speed, weapons, model, sound etc.)from the anakin unit. You can change any setting in the new odf and it will simply override the parent classes setting.

2. Now, go into your Lua and put [code]ReadDataFile("SIDE\\rep.lvl",
"rep_hero_anakin") [/code] at the bottom of the ReadDataFile section

3. Now put this line,
[code]ReadDataFile("dc:SIDE\\whateveryoursideis.lvl",
"whatever_you_namedyourunit") [/code]
right after the line from step 2.

4. Now, for testing purposes, set the Republic hero to "whatever_you_namedyourunit".
[/quote]

Modified from the Original tut created by MasterSaitek009
(B.
Hidden/Spoiler:
This is for changing skins using default sides.
[quote="Syth"]I notice alot of maps with big huge 200mb sides with not much changed.
This should help you reduce that (if you understand it)

IF YOUR JUST EDITING SKINS (no odfs)

You going to make a 'skin side'. Make a new side and name it. In my example Im makeing 212nd legion skins, so ill call it "212nd". THen make a MSH and REQ folder in your side. In the msh folder, put all the skins you edited.

Next go to the REQ folder and make a new text file for each skin you edited. For example, if i edited the rep_inf_ep3trooper.tga id make a notepad file called "212_inf_ep3trooper" (it doesnt matter what you call it though). No open up the newly made file, and add the below.
[quote]ucft
{
REQN
{
"texture"
"skin name.tga"
}
}[/quote]
You might notice a snins req is different from a unit req
Another example is the clone sniper, which needs to parts in his req because he has 2 texures.

[quote]ucft
{
REQN
{
"texture"
"rep_inf_ep3sniper"
}
REQN
{
"texture"
"rep_inf_ep3sniper_cape"
}
}[/quote]

Do this for each skin you edited.
Next open up the SIDE req file, in my case its called 212nd.req.
In it, add the names of all your req files. My req would look like this-
[quote]
ucft
{
REQN
{
"lvl"
"212_inf_ep3armoredpilot"
"212_inf_ep3trooper"
"212_inf_ep3_jettrooper"
"212_inf_ep3_officer"
"212_inf_ep3_sniper"
}
}[/quote]

Basically you've just made a 'skin' side. Lastly, to over-wright the shipped skins just load your skins in your maps LUA, just like you would units. But make sure you load the skins after all the other sides, or nothing is changed.
THis is what is in my LUA.

ReadDataFile("SIDE\\212nd.lvl",
"212_inf_ep3armoredpilot",
"212_inf_ep3_sniper",
"212_inf_ep3_officer",
"212_inf_ep3_jettrooper",
"212_inf_ep3trooper")

IF YOUR JUST EDITING ODFs

THis was pointed out by another member. Basically you edit the shipped sides just as you normally would. After you do, add this line to any edited odf under [GameObjectClass]
[quote]ClassParent = "name"[/quote]

"name" being the original ODF. So if I edited the jet trooper ODF id put
[quote]ClassParent = "rep_inf_ep3_jettrooper"[/quote]
Just a note though, the edited ODFs name should be one other then the ClassParent = name. You can do this for weapons and vehicles too (unless im mistaken). Basically this gets rid of the need for msh's and tga's because the unit will get them from the class parent.
Then in your LUA load your side AND the side containing the Parent ODFs.

SO if i edited the jettrooper with this technique this is what LUA would look like.
[quote] ReadDataFile("SIDE\\REP.lvl",
"rep_inf_ep3_jettrooper")
ReadDataFile("dc:SIDE\\REP.lvl",
"new_inf_ep3_jettrooper")[/quote]

A HINT on 1st person

In your custom sides you only need FPM of the weapons, unit and vehicle FPM is included the game data so you can delete it from your side.[/quote]

Quoted from the Original tut created by Syth
(C.
Hidden/Spoiler:
As a general rule of thumb, if you aren't using it, get rid of it.
Example
Unless you are using it DELETE THE TURRET SIDE!
For some reason Pandemic left the turret side in the default new-map side folder.
I can't count the number of maps I've downloaded that still have this side in them. It's not there because it's needed. It's just taking up space.
(D.
Hidden/Spoiler:
Use 7-Zip on ultra compression. Also, you you can check the box 'Create SFX archive' and it will make your file an exe file, so that people don't have to download 7-Zip to use your mod.
In addition 7-Zip has compression better than .zip and better than .rar.
(E.
Hidden/Spoiler:
All of the above :P

I have personally tested all of this. I should know, I'm stuck on 56k. So to upload in less than a day, any map that I make has to be less than 30 megabytes.
Use this info. Cherish it. Improve it.

Small files for all!
:wink:

Re: Reducing file size with legions

Posted: Fri Apr 04, 2008 4:04 am
by Teancum
Once the FAQ sticky works again I'll add this to it. It's something every modder should do.

I'd add that when using 7-zip with ultra compression that you can check the box 'Create SFX archive' and it will make it an exe file, meaning anyone who doesn't have 7-Zip or a newer version of WinRAR can extract the files easily.

Re: Reducing file size with legions

Posted: Fri Apr 04, 2008 7:54 am
by MandeRek
Wow, i didn't know this! That is great!

This is great for mappacks with different sides; very good! :D

Re: Reducing file size with legions

Posted: Fri Apr 04, 2008 4:41 pm
by ARC_Commander
Brilliant. Thanks, Saitek! :D