Adding New Maps

Post everything from general questions, to modding questions, to map WIPs to releases. (SWBF1 only)

Moderator: Moderators

Gametoast Supporter
User avatar
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm

Adding New Maps

Postby eddie » Tue Nov 23, 2004 6:07 pm

Starting new thread for adding user maps or mods as new maps using the knowledge of comparing tat3 map with original folder. First let us start with fred's post:

"As for a guide, if you'll notice you now have an AddOn folder. Inside that AddOn folder is a level folder entitled TAT3. If you want to create maps as add ons they will each need their own folder like TAT3. When the new executable runs it looks for level folders in the add on folder and their addme.script. The addme.script contain information that adds the map name to the bottom of the map list. Inside the lvl_pc folder you'll see a folder structure that mirrors that in the data directory that shipped with the game. The executable supplements data shipped on the disk by looking for it in this supplemental data folder. The whole tat3 folder (or a mod folder) can be zipped and downloaded to be copied into someone elses add on folder. The executable will find all new worlds and add the info in the addme.script to the map list in folder order. So take your map mods, including side mods as far as I know, and all of the data in the addon folder will be used on those maps instead of that which shipped with the game. I haven't tested anything but maps myself."

Also earlier post from Fred:

" work for Pandemic in LA. I can't really say much of anything about tools because Lucasarts needs to make all official announcements. Anything I say now will only open me up to more questions I can't answer at this time. Let me just say that both Lucasarts and Pandemic support the modding community and want mods to flourish, which in part is why I am here and post details about how the game is built. My role in the mod community will ultimately be much larger and you can expect that I will be the primary resource for you to learn everything (yes, everything) you need to know about making mods, but Lucasarts and Pandemic have their priorities (as indicated by all the patches and the upcoming Jabba's Palace add on) so be patient and keep an eye on the Lucasarts forum for their official weekly announcements."

Then my overenthusiastic post which was not that succesfly but partially-maybe true:

"To add maps:
1. Make a folder in AddOn folder (Eddie_DeathStar_v03) or what ever...
2. Copy AddMe.script from tat3 to your folder
3. Hex AddMe.script and change name and folders you will load (eg. TAT, TAT3...)
4. Make Data as _lvl_pc folders like in original game
5. _lvl_pc have mission.lvl and core.lvl as follows
6. Old mission.lvl from original game
7. new core.lvl from tat3
8. Make map folder (in my case (BES1)
9. Have level in map folder bes1.lvl "

Now basiclly we are at point zero but I am sure we will find a way to crack this baby.

Let us start with addme.script:

1. does tat3 refers to the level (tat3.lvl) or main folder(TAT3) or maybe it does not matters at all?
Last edited by eddie on Tue Nov 23, 2004 7:53 pm, edited 1 time in total.


RE: Adding New Maps

Postby dorsai3d » Tue Nov 23, 2004 6:21 pm

can you post addme.script please (I cant update)

Gametoast Supporter
User avatar
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm

Postby eddie » Tue Nov 23, 2004 6:34 pm

Gametoast Supporter
User avatar
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm


Postby eddie » Tue Nov 23, 2004 7:47 pm

Well I managed to work out several things except this "mapluafile" in addme.script. Help (fred..) would be appriciated. Basiclly, I made folder Eddie_DeathStar under AddOn. Script contains side_a i side_c for civil war and clone war. Also names of scripts to be run in mission.lvl This works killing one or the other. Then follwoing the structure of tat3 I copied mission.lvl from original to _lvl_pc of my mod folder changed line for level to dc:ds\ds.lvl (DS folder for my mod, ds.lvl name of lvl file) and it works but when I load bespin1 original map, it also loads death star map. So the key line is in addme.script "mapluafile" which I played with to change to DST1 and change calls inside addme to dst1_a i dst1_c and made changes in mission.lvl but the game chrashes.

Gametoast Supporter
User avatar
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm

Postby eddie » Wed Nov 24, 2004 2:15 am

Good Point. Thank you very much. I will try all of these. I will let SIDE stuff to other people as I am not very interested in models at this point but we will see.

1. Did patch 1.11 change anything else beside exe and addon folder?

psych0fred, stay with me on this please:
- made level folder Eddie_DeathStar
- made file folder structure as in TAT3 with the following changes:
- made level ds.lvl (file stucture is DS\ds.lvl)

You can see this file structure at

All the following is done in Eddie_Deatstar folder (not Tat3)
- in addme.script: changed mapluafile from TAT3 to BES1 (stay with me)
- change showstr to D.STAR eddie0.4
- change tat3c and tat3a to bes1c and bes1a
- in mission (copied old) under scr_ bes1a change path to file from bes\bes1.lvl to dc:ds\ds.lvl

When I load SWBF and choose D.STAR eddie0.4 level loads and everything is fine, death star level work like a swiss watch, BUT then I noticed that when I load BESPIN PLATFORMS (which is also BES1) it loads my deat star levels.

Then I said aha, in addme.script I will change BES1 to DST1 and see what happens. CRASH

Then I said I will also chage (in addme.script) bes1c and bes1a to dst1c and dst1a AND ALSO bes1a and bes1c in mission to dst1a and dst1c . CRASH

What am I doing wrong? I do not want to make replacement maps, I would like to make user level so other people can use it without changing their original levels.

Also, can you tell us if there is a strong syntax to:
- level folers have to be 3 characters long with name that originaly exists or something
- mapluafile has to be the same as level.lvl .....
stuff like that.

Thank you fred, you are great help to us.


Postby Captain_Murphy » Wed Nov 24, 2004 2:12 pm

Not being fred, I can't say for sure, but it seems to me that you shouldn't have copied and edited the main mission.lvl file. ANything in the addon folder overrides the normal data folder, so you've effectivally removed the probrams knowledge of the original besipin map.

You should have copied the new mission.lvl file from tat3 because it adresses the needs of a single map without disturbing the builtin maps. Unfortunately this means that your would have to add in all the vehicle stuff to the jabba mission.lvl

Golly it would be nice for someone to leak a template of what a single map mission.lvl with every single thing in it would look like, then we could just delete what we didn't want. I'm not skilled enough at hex editing to know what all that gobbldy-gook is, so everytime I've tried to add a new map with vehicles I get crashes or stuck in a seemingly infine loading loop.

Gametoast Supporter
User avatar
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm

Postby eddie » Wed Nov 24, 2004 2:38 pm

Well, original mission.lvl has stuff I need for and it works. Tat3 mission is just LUA script for jabba map. It is small because it is just for one level. If you look original mission.lvl you will see all this LUA codes one after the other so jabba's mission is just what it would be in original level if it was released with org game. IT is something to do with mapluafile.... I am still searching and trying different combos...

Gametoast Supporter
User avatar
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm

Postby eddie » Wed Nov 24, 2004 5:33 pm

The original mission.lvl is copied to Eddie_DeathStar folder so I don't mess with the original.. I just use it instead TAT3 massion.lvl because it give my memory allocation I need...

The key is in addme.script and luafile part of it...

thanx for response fred...

EDIT* will try...


Postby Captain_Murphy » Wed Nov 24, 2004 7:22 pm

When you use the original mission.lvl file, even putting it in your deathstar folder, it overrides the other mission.lvl, and thus overriding the bespin level. This is why you must use an edited veriosn of the jabba mission.lvl because it is specifically designed for adding one level without altering the existing levels. This is what Fred is saying.

Doing it the way you do it, yes your map witll load, but the proram has no information on what the original bespin level is because your mission file has overridden it. This has nothing to do with the addme.script.

You will have to add all the vehicles and memory aclocations to the Jabba mission.lvl--along with removing reference to gammora gaurd and such--to make your map function wihtout dsitrubing a builtin map.

My guess is that the position on the in game lists are hard coded, or at least not easily accesable and is based on the header material you can see at the begining of each new level section in the original mission.lvl. Even though the bespin level has all you need, altering a copy of the mision.lvl and then placing that copy in your addon folder replaces the entire original mission.lvl file. When you tell the program to load the bespin level it looks to the mission.lvl file (your altered one) and in the position that bespin is located, info for your deathstar level in there instead. All the program knows is to load the info from that position, so it loads your map for the bespin one.

The Jabba mission.lvl file is a generic one, with generic headers that the program understands as representing a stand alone map. The original mission.lvl file has specific headers that the program understands as representing the original maps.

Back me up here, Fred. My specifics may be off, but I think my general understanding is correct, right?
Last edited by Captain_Murphy on Wed Nov 24, 2004 7:37 pm, edited 1 time in total.

Gametoast Supporter
User avatar
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm

Postby eddie » Wed Nov 24, 2004 7:28 pm

That is what I want. Complety new level (which uses resources of all other levels/original stuff; like it would be if we have SDK.

I tried with tat3 mission (changing some stuff to acomodate my but no luck.

But I guess you guys know your stuff so I will get back to tat3 mission changes instead of original mission.

Thanx for reply tho,


Postby Captain_Murphy » Wed Nov 24, 2004 7:47 pm

Well, eddie I don't know all that much, just the basic concept of how the addon folder works. I've been trying to alter the tat3 mission file too, but all I have done is crash my compter a few dozen times.

I'll again ask Fred in a more direct way, would the powers that be allow you to release a generic mission.lvl file with all vehicles and factions added so we can see exactly how things should be, and then just delete what we don't need for a given map? Trying to compare the jabba mission file with the original mission file to try and add vehcles is just hurting my brain.


Postby Riley75 » Wed Nov 24, 2004 10:48 pm

Not sure if this will help you guys with your efforts to modify the new tat3 mission.lvl file... But here is the disassembly for the first Lua script (Aliiance vs. Imperials):

Captain_Murphy, as I believe you're new to the site here; if you haven't taken a look yet, it might help some to look over my Script Chunk reference page, if you haven't yet. It explains how Lua stores data in binary form.


Postby Captain_Murphy » Wed Nov 24, 2004 11:08 pm

That looks very helpfull actually. My brain is a bit fried right now, so I'm just going to play the game for a while and get at this stuff later.

Gametoast Supporter
User avatar
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm

Postby eddie » Thu Nov 25, 2004 2:44 am

Good stuff, now we are one step closer.
I am glad Riley is back to help ( i was waiting for opcodes). BTW where is luckey?

Another thing Riley, Can you post opcodes for bes1a src_ from original mission.lvl so we can compare... and if possible opcodes for addme.script?

I also like idea of Generic mission with everyting included (EVERYTHING) so we can delete stuff we dont need. Guess this would have some mem issues but it would be easier to go from everyting-to-what-I-need then what-we-do-know

Look at my addme and mission at:

Just woke up, so coffie then, mission....
Last edited by eddie on Thu Nov 25, 2004 7:57 am, edited 1 time in total.


Postby Captain_Murphy » Thu Nov 25, 2004 5:28 am

Now I'm getting frusterated. I'm woking with a modified version of tat1.lvl that i've renamed tat4.lvl and given its own folder. In my addme script in the part that eddie labeled the level marker i've put "TAT4". After repeated ly launching the game, I get crashes trying to load the level. Eventually I went back and changed the marker to "TAT1" just to see what would happen. Now my level entety loads the original tat1.lvl and the Dune Sea entry has my label when you add it to the map list.

My mission.lvl is and edited jabba mission. I pretty much copied and pasted the chunks i needed within the framwork of the jabba file. WHen I put "TAT1" in my addme file the program does not seem to care that my mission file is telling it to load from dc:\TAT\tat4.lvl. I can even change the name of my tat4.lvl file so my mission file points to a non existant file, still the program just goes ahead and loads the tat1.lvl map. SHouldn't my mission file override that?

Anytime I put anything other than "TAT1" in my addme script I get a crash when trying to load the map. I can't seem to get it to let me make a unique marker.

Unrelated (maybe) I decided to change the display name for my map from "Tatooine:Blabba" (laziness) to something more dscriptive. I Chose "Tatooine: Alt Dune Sea". THis change made the program crash on boot. I figured that I exceeded some character length. I changed it back to what it was before, but I still got the crash. Finally I recopied the file from the jabba folder, named the map Blabba. THen it worked again.

I'm using UltraEdit-32. Is there some place in these files, maybe the header, where the total size of the file is reocrded and I somehow screwed it up. If so, could this by my ultimate problem with my mission file, because I just took the jabba mission file and copied the chunks i needed over the ones I didn't. There's more info in the dune sea map, so the file size is bigger. Maybe there's some header info I can change to make it accept the new file size?

Gametoast Supporter
User avatar
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm

Postby eddie » Thu Nov 25, 2004 6:33 am

he he we are facing same problems. I am sticking to my original.lvl because I dont think it matters after you alter it which one you use.

Anyhow, took original mission.lvl copy it to my DS folder. Then I cut rest of the stuff not related to bes1 and it works. So you can change size of mission.lvl but I am not sure about scr_ chunk yet.

See my new mission.lvl and header info. I think I found where size is stored: (DS mission)


Maybe it was just coinsidence. it does not follow in org mission.lvl.

Anyhow my new mission.lvl works when a marker is set to BES1 (same as TAT1 in your case) so it must be somewhere both in addme and mission. I've noticed scr_ chunks and lvl_ chunks start differently for each level.

General observation: we might face name collistion in the future if for example murphy names his marker XXX1 and eddie names his marker XXX1....


Regarding lvl_ and scr_ chunks
for each level 2 bytes just after lvl_ and scr_ are different. What is interesting is that for most levels lvl_ and scr_ chunk are 1000 difference (in hex). For TAT3 this difference is EFFF.

TAT3 - lvl 08 13
scr F8 12
and in addme scr is set to F8 01

I tried to mess with these and if I change this is addme = chrash
but if I change in my new mission (which also has these like TAT3) the game still chrashes but not the same way. Important?

edit* Happy Thanksgiving to people in the States...


Conclusion so far:
So, I have user made Map and user made mission.lvl which
1. work if I, for mapluafile, use one of existing unique names (TAT1, BES1, BES2, TAT2, etc.. except TAT3)
2. do not work if for unique name use not existing level (TAT4, BES3, DST1 etc)

For 1. changing mapluafile to existing unique name you have to change scr_ calls (for example: bes2a bes2c) within addme and local mission
- this technique overrides original level so this is not acceptable
For 2. we are missing something crucial here (maybe people from 2nd shift can find out what?)

It looks like header of mission.lvl has something to do with it.


Postby Riley75 » Thu Nov 25, 2004 12:12 pm

Captain_Murphy, yes there are size markers that have to be updated. Use the link in my sig -- it explains how LVL files are organized in general into chunks. There are also size markers contained within Lua byte-code, which is explained in the link I posted earlier.


The highlighted line in the above image is where I have a question. Specifically the 4 bytes in blue. Before it, there is a "lvl_" (size 0x1308); and after it, there is a "scr_" (size 0x12F8). To use the terminology I've been using... The 4 bytes in blue there look like an embedded 'chunk marker' (size 0x1300), but with characters outside the usual ASCII range. If we try changing any of those four bytes, it crashes the game while loading that map. Which means that this chunk marker means something important, but I don't know what.
I've commented in other threads in the past that I think it's some sort of calculated value, based on the map or planet name. Fred, any help with what that may be? ;) I think it's the reason we've been unable to make size changes to the scripts, and quite possibly one reason you guys have been having trouble making a new addon.

*edit* eddie, I'll post those other scripts at the end of this post in a bit here... I never really left, just had other things to do the past week. I've been working on coding a mod tool of my own. Regarding luck3y, in one of his last posts here he said he was working on a Lua decompiler.

Disassembly for bes1a (Bespin Platforms, Alliance vs. Imperials)
Disassembly for tat3's addme.script


Postby Riley75 » Thu Nov 25, 2004 12:38 pm

I just realized something else you were saying, psych0fred. So we would be able to extract pieces of the LVL files, plunk them into their own LVL file -- and then call ReadDataFile on each.
That would work well for stuff like the Hoth shield generator, Yavin temple, etc etc. That way we could re-use models or textures (or maybe even terrains or skies) without having to embed them in every map file that might use them.


Postby Riley75 » Thu Nov 25, 2004 3:33 pm

Thanks for your help with this, psych0fred. :) I'm sure it's frustrating sometimes if we're not quite understanding everything, but keep in mind we're looking at raw data and you're probably used to seeing things in their pre-compiled state. ;)

And with that, I'm going to ask another question that may or may not make sense, heh. You said there are "requirements files" that basically contain many embedded LVL files, and gave the example of "sound/bes.lvl;bes1gcw". Where bes1gcw is embedded inside sound/bes.lvl. What I can't figure out is how the game is locating bes1gcw inside sound/bes.lvl? I can't seem to find the text "bes1gcw" anywhere in that file.


Postby Captain_Murphy » Thu Nov 25, 2004 4:37 pm

I think eddie's getting farther than me, cause i cannot get the program to load my custom map at all. I always get crashes.

I keep all the sound references to tat1gcw and the like because I want to use all the asset of the original tat1. The only stuff I've been changing are the names of the scripts to tat4i and tat4r (tat uses i and r inctead of a and c for the sides) and that later reference to the actual map TAT\tat1.lvl. I change that to dc:\TAT\tat4.lvl which is how I've set up my directories. I've alto changed my TAT folder containing the map to ALT just to see, but I get the same results.

I've changed the sides refernece in addme to i and r, and I've also gon back and changed everything to a and c, and I've tried every combination in between, but always the same reuslts. As eddie said addmescript does not like unique labels. And when i give it a builtin label, TAT1, it just loads that original map.

Well, I've got family obigations today, so I'll leave and hope you all work miracles while i'm gone. Thanks for the message Reilly, I'll get lau 4 tonight and start to make opcodes.


Return to All things SWBF1

Who is online

Users browsing this forum: No registered users and 1 guest