Adding New Maps

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

Moderator: Moderators

Captain_Murphy

Post by Captain_Murphy »

Here's a thougt. I might try to make a new folder and copy all the jabba stuff into it, then see if I can alter the addme.script with a unique label but still load the jabba map. This way i know that I wouldn't have to mess with the size of the mission file. It it works I should get two entryes (i'll change mine) in the level list that both load jabba. THen I can start alteing mine slighty and see where the conflicts arise.

I'll try this tonight, which i think is the moring for you eddie, judging from when you said you were going to have coffee.
eddie
Gametoast Supporter
Gametoast Supporter
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by eddie »

Captain, sir:: looks like this will be a major chalange for us, but it is important to solve this because the modding community needs a way to ship and make their own mods (from scratch or starting from exisiting level and changing it to something else=new mod/level). I would like to solve this so I can continue with my DS mod as brand new seperate/addon level without interfering with existing ones. So, let as continue...

Riley75 /Fred: This stuff you talk about is great and it will come usefull once we can add user levels to life. I am thinking (after we know how to add user levels) to bring AAT's to my level, bring shield generator.... all good stuff. But, you guys are bit ahead and bit off the subject.

What we need now is a way to add user levels without replacing existing ones!

The whole talk about stuff inside mission (readdatafile) is more-less known (I used bas1 mission as template but I have change it so much it does not look like original anymore and it work until I use unique name known to exe) also my ds.lvl was in the beggining nab2.lvl but it got changed a lot as well. Also, in mission I referenced sound to, let us say, hot1 to get sound of snowspeeder and all of this works. But this is not what this thread is about (even tho information you mention is very important for future development of maps/mods), it is about How to add user map/mod to the game without overriding original maps.

Once we figure this out we will start a new thread "How to use existing resources making your own level" and your info will be copied on the top as a start point.

So please fred, help Captain and me (and all of us traying to get this) to load our user levels the right way.

Captain: "I might try to make a new folder and copy ..." been there - done that - I tried to loas my level as tat3 kinda using tat3 for all user levels and this is what happened: my unique name = TAT3 and if the folder is before TAT3 (Eddie_DeathStar)=chrash, If the folder if after TAT3 (ZEddie_DeathStar)=it still loads Jabba -> it behaves complitely different then when you set your unique name to one of the original names...

Riley75: thanx for posting opcodes, it just might help us solving this ...

"i think it's the reason we've been unable to make size changes to the scripts..." i mentioned that I succesfuly took original mission and cut/paste/whatever and made it my own - it works - looks like you just have to be carefull where to cut the file (think four or five .... before next lvl_)

also, i can not find lvl_ on your site...

also, if you could run my addon through your deassebler to compare stuff, You can find it at

http://www.eline.ba/Default.aspx?tabid=155
eddie
Gametoast Supporter
Gametoast Supporter
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by eddie »

Another experiment:

I just wanted to make copy/replika of TAT3 to TAT4. Copied everithing and changed in TAT4 mission unique to TAT4 and calls to scr to TAT4a and TAT4c and showstr to TATXXXX..... Changed level name to TAT4 and movie to TAT4.mvs and...

When I start SWBF and click on TATXXXX i dont get the movie. Now, at this point we didn't get to mission and w.lvl at all and the movie is not shown????

Did they hard coded addon just for TAT3? or it is mem/address problem?
Captain_Murphy

Post by Captain_Murphy »

The expeiment you just described is what I was talking about. A complete replica of jabba but with all the tat3s changed to tat4. though for movies and music it may have to stay at tat3 because those are references to info within the sound and movie files i think.

Are you saying that you gave the addme the unique label of "TAT4" and it worked? Because this in itself would be a major breakthrough as the first exmpale of a unique label not crashing the game.

Further more, can you put a copy of your working mission.lvl file and addon for deathstar. I cannot make a working one for my dune sea map, so it's probably better if we both try to work on the same map, that way our experiences will directly correlate.

I'm going to try and get up and running with Lua4, then try to opcode some stuff.

I agree with eddie. I'm not really a map maker or modder myself, the whole reason I'm here is to figure out how to easily load maps that others make. Once we can take a custom map, Deathstar or The Alternate Dune Sea, and make it easily loadable from the map list wihtout affecting pre-existing maps, we will have taken a leap forward in the modding of this game.

Fred, can you explain why eddie cannot use a unique label in his deathstar addme.script? Being forced to use the bespin label defeats the whole purpose of what we are trying to do here. We are not trying to create very unisual maps, resource-wise, eddie's would use all the resouces of bes1 and mine would use all of tat1, the only differeence is that we want it to load the new map geometry that we place within our addon folders. If we could solve this, the basic issue of this thread would be satisfied. The community could them move on to make ever more complex mods with the knoweldge that users could esily install and play them.
HowardBusch

Post by HowardBusch »

Captain_Murphy wrote: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.
Their should not be a \ between dc: and TAT\tat4.lvl
eddie
Gametoast Supporter
Gametoast Supporter
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by eddie »

Let me go one more time:

Working

Addme:
mapluafile BES1 (or other unique existing name)
BES1a and BES1c (calls)

Mission (bes1a top scr_)

Not working
Addme:
mapluadfile DST1
DST1a DST1c

Mission (dst1a top src_)

That is it. Nothing has changed exept addme is routing everyting through DST1.

murphy my mission is at:
http://www.eline.ba/Default.aspx?tabid=155

regarding tat4: I did not work murphy.
Murphy:: you will have now my mission, and add me. You can donwload the level from this site too so you have everything to try this on my level. File structure is on the site. I will be off for couple of days, but any chance I get I will check this forum if they have internet access.

Howard:: I thnk it was typo on murphy's side, was it? you can not fit additional \ without chrashing mission. That is why my level folder is DS and level name is ds.lvl so I can replace BES\bes1.lvl to dc:ds\ds.lvl without crashing mission.

Murphy: since we can use are own unique names this is what i recomend.
While working on my level, the only thing remaning to check is header of mission.lvl. We will call header of mission lines from ucfb -> AddMissionObjective. You will notice that header is from old mission. I tried copying header from jabba to my mission (changing only tat3a to dst1a) no luck. Mess only with dst1a (not dst1c) since I will not use Clone War at all.
Then I tried combo of both trying to see waht will happen if I do this and that bla bla so you can try it. Maybe Riley can help deteming those two bytes after scr_ and lvl_ (did not find a link for his lvl_ chunk) and also he might deassebly my addme so you can see if there is somthing there we missed. Good luck I leave everything in your capable hands he he...

edit:
Riley was right about size markers: The first two bytes after his hightlighted area is size of lvl_ (actually scr_ ) reading from right to left and hightlighted area = important.
Last edited by eddie on Fri Nov 26, 2004 3:50 am, edited 2 times in total.
Captain_Murphy

Post by Captain_Murphy »

Yeah that was a typo.... if only it were that easy.....


Rather than tyring to make this work with a new map, I'm going to try and make this work with jabba. Following through on my test idea, I've duplicated tat3 folder, named it tat4 and renamed the map tat4.lvl.

In addme:

mapluafile = TAT4
showstring = Tatooine: Babba

below downloadable content I put

tat4c
tat4a

In mission.lvl:

changed script names to tat4a and tat4c

below setspawndelay, in both areas, i put

dc:TAT\tat4.lvl

When I try to launch the jabba map through my new babba entry I still get the same error that i was getting trying to load my altered dune sea map.

The Instruction at "0x005a1afe" referenced memory at "0x00000004" The memory could not be "written."

There are other "tat3" referenced in mission.lvl. I've tried chaning all of them. There's the objectives references, there the sound tat3gcw and tat3cw, a tat3 reference all by itself surounded by sound references, and one that says tat3_emt.

Fred, do you understand what I trying to do? I'm starting as simple as I can. I want to create another entry in the maplist that will load a renamed version of tat3. I've not altered the size of any file, nor have I had to add or remove vehicles and memory alocations. All of tat3's resources were duplicated and all exist in an identical directory structure in my new folder, yet I still get the same error I've been getting this whole time.

What do I have to change to get my babba entry to load my duplicated, renamed jabba map?
eddie
Gametoast Supporter
Gametoast Supporter
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by eddie »

murphy, try nameing your new stuff TAT0 and see if there is any changes if you put your folder before TAT3. In my experiment it behaved differently depending on order (both times chrashed tho, but different kind of chrash).

And you are right, if we crack this very simple example...

what do you think it happens so game chrashes. I am just affraid they hard coded some stuff, but I hope I am wrong.
Another issue would be if we are succesful doing this and people start making maps the same way and start overriding each other...
Maybe we will have to set up some kind of service for reserving names/address if this becomes an issue... but first things first, how to add replica of tat3 (as tat4 or tat0). Good luck...

To the modding community: please feel free to download my addme, mission and level from my site and do your own experiments or experiment with TAT3->TAT4...
Captain_Murphy

Post by Captain_Murphy »

I tried removing my tat3 folder from addon completely, so my tat4 was the only map in it.

same crash.

I'm going to wait and see if Fred can tell me how to load the jabba map renamed to tat4. If we cannot do the easiest of addons--a simple name change--how can we add any new levels?
eddie
Gametoast Supporter
Gametoast Supporter
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by eddie »

So we are back to point zero. Hmm...Good thinking removing tat3. Stay on TAT4 only as the most simpliest example yet. Just kep bugging fred until you guys works out TAT4 only. He has no escape now he he...

BTW: Is there any other sites addressing this issue at all?
all i know are lucasforums and offical LA
http://forums.lucasarts.com/forum.jspa? ... 36&start=0
and some german that deal with SWBF...
Captain_Murphy

Post by Captain_Murphy »

i was at the lucal forums and someone told me about these, so that's all i know.

Yeah, focusing on tat3->tat4 will force specific answers.
eddie
Gametoast Supporter
Gametoast Supporter
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by eddie »

We know all of that. Didn't you read my posts.

"Let me go one more time:

Working

Addme:
mapluafile BES1 (or other unique existing name)
BES1a and BES1c (calls)

Mission (bes1a top scr_)

Not working
Addme:
mapluadfile DST1
DST1a DST1c

Mission (dst1a top src_)

That is it. Nothing has changed exept addme is routing everyting through DST1."

But foreget bes and my DS level. Let us work out the simpliest exemple murphy came up with. He changed TAT3 to TAT4 folder, inside addme TAT3 to TAT4, TAT3a to TAT4a TAT3c to TAT4c

inside mission lvl he changed TAT3a to TAT4a and TAT3c to TAT4c and calls for sound, level load (dc:TAT4\TAT4.lvl) and other stuff accordingly. In theory this should work but it does not = crash. Why?
nitro

Post by nitro »

cuz lucasarts made something to dun let us add our own maps ? *heh* no,i think u should look again to the jabba map and find out how they did it and maybe u see that u accidentally skipped something ?
Captain_Murphy

Post by Captain_Murphy »

Fred, please only comment on our attempts to turn tat3 into tat4. All we are trying to do is change names wihtout adding vehilces or changing resourses. We cannot get it to work, and until we can, there's really no use in us trying to add our own levels.

Refer back to my post. I explain exacly what I've done to tat3 and axactly what the memory error I get is. All io want to know is what needs to be changed mission.lvl to make this work.

To nitro, yeah I know I missed something which is why I want Fred to look at my post and tell me what it is because so far, acording to evertying he's told us, it should work.
Captain_Murphy

Post by Captain_Murphy »

So you don't have to scroll up, Fred....

Rather than tyring to make this work with a new map, I'm going to try and make this work with jabba. Following through on my test idea, I've duplicated tat3 folder, named it tat4 and renamed the map tat4.lvl.

In addme:

mapluafile = TAT4
showstring = Tatooine: Babba

below downloadable content I put

tat4c
tat4a

In mission.lvl:

changed script names to tat4a and tat4c

below setspawndelay, in both areas, i put

dc:TAT\tat4.lvl

When I try to launch the jabba map through my new babba entry I still get the same error that i was getting trying to load my altered dune sea map.

The Instruction at "0x005a1afe" referenced memory at "0x00000004" The memory could not be "written."

There are other "tat3" referenced in mission.lvl. I've tried chaning all of them. There's the objectives references, there the sound tat3gcw and tat3cw, a tat3 reference all by itself surounded by sound references, and one that says tat3_emt.

Fred, do you understand what I trying to do? I'm starting as simple as I can. I want to create another entry in the maplist that will load a renamed version of tat3. I've not altered the size of any file, nor have I had to add or remove vehicles and memory alocations. All of tat3's resources were duplicated and all exist in an identical directory structure in my new folder, yet I still get the same error I've been getting this whole time.

What do I have to change to get my babba entry to load my duplicated, renamed jabba map?
Captain_Murphy

Post by Captain_Murphy »

I compeltely removed tat3 from my addon folder. My directory stucture is identical to the tat3 structure except that the top level is name tat4 not tat3

and in the script it is specifically told to load from dc:tat\tat4.lvl. I would ge t the same error wether or not tat3 was in the addon folder or not so it does not seem to care that there's another tat folder in the addon folder.

I have not missed a reference. I have changed everthing you said to. Can you try to do what I am doing, because frankly I'm not convinced it is possible. Perhaps if you tried to simply change tat3 to tat4 you'd be able to see what we're missing.

Other than the offical tat3, we have not been able to see the loading of a custom level work. I'm to the point of losing interest in this, because all you ever do is tell us we missed a reference and I am begging you now to tell me what reference I missed. In my post I explained all the changes I made. Was this right? Should it work? Can you please do the tat3 to tat4 test, make it work, and then tell me you made it work. It should only take you a couple of minutes. I need to hear some specifics, or I'm going to move on to another game that actually wants people to mod it.

And "the simplest test" is a test that gives a positive result. A test to produce a crash tells us nothing new, because that's all we've had happen so far. I want to do a very simple test that will load a copy of tat3.lvl renamed tat4.lvl with all the scripts renamed as well. This is the absolute simplest test we can do that should produce a positive result. You have told us to start simple and base our efforts on the tat3 mission file, and that's what i'm doing. So tell me, based on what I said I did, should it have worked? Don't tell me I probably missed a reference, should it have worked?
eddie
Gametoast Supporter
Gametoast Supporter
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by eddie »

After reading these last post a also got dipressed. But then I tried thinking what I can remove from TAT3 folder and the game will still load without chrash. So basiclly I am left with only addme and mission and the level will still load (We not actualy load but the game will not chrash - I get selection screen).So level itself not impotrant, sound, movie, shell, core.lvl all gone and the the level still loads; i left only side folder cos it does charsh without it - but not importnat what we are trying to do here).

root folder is called dssdlfj so the only to things you must have are addme.script and mission.lvl (in respected folders) - I know we now this I just wanted to check it out. So, the patch 1.11 as I know influeced only these two files and exe.

**Maybe they did something with exe? I think nothing else got installed beside exe and tat3 folder with a new patch.

There is a reference to AddMe script in exe file, someting about TAT2 for playstation i think. I hope they did not mess exe to only allow TAT3 unique name to load, but I am not sure. It would suck to supply our maps with patched exe-s.

So let us assume only addme and mission are important - which we knew the first day but now it is kinda confirmed.

**Meybe they have some kind of control number depending on name of unique marker?

I remebmer I had to change header of mission.lvl when I used bes1 missionl.vl, to be similar to tat3 but some stuff I had to leave from bes1 (i dont remeber anymore what exactly).

So I will now concetrate to see what we can do with the header. And since we only changed tat3 to tat4 maybe we have to change just one little thing.

Fred, we would appriciate if you can confirm that adding new levels is possible and that only thing we have to change are addme and mission.

This is just my thinking becase I dont know anymore what to look next.

Riley could maybe help us with those scr_ and lvl_ chunks.
eddie
Gametoast Supporter
Gametoast Supporter
Posts: 366
Joined: Mon Oct 18, 2004 3:27 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by eddie »

Quick response! Thanx.

But, we know all of this. the game still chrashes.

Can you go to:

http://www.eline.ba/Default.aspx?tabid=155

And donwload Eddie_Test (700K) and test it. It is set for TAT3 and it works without asset files/folders -> upto select screen.

Just change TAT3 to TAT4 in addme (and tat3a,tat3c to tat4a,tat4C) and the same in mission.lvl (tat4a tat4c) and you will se it does not work.

Level itself is not important for this experiment, just come to select sreen and we are fine after that.
Captain_Murphy

Post by Captain_Murphy »

So does it have to be named tat3? if so we're screwed
Riley75

Post by Riley75 »

There's a few lines you wrote here earlier that I'd like to focus on, because I believe they are the key to solving the issue that eddie and Murphy have been working on.
All the lvls are just made up of other lvls. There are what are called req files (requirements file) which basically act as an index file of what to include in an lvl. Every req produces an lvl upon compiling. There are tons of them, and in the end they all get wrapped up into the lvls that shipped. Mission.lvl is the one that tells the game what assets to load into memory as well as has some control over memory pools. If you build a world and just change names it may not work because you may have changed links to assets it needs. In theory if you can figure out how to extract or add to the lvls you can access the sub lvls exclusively and load them or supplement them.
I have a fairly good understanding of how the *.lvl files are organized. The terminology I've used to describe things is "chunks" and "sub-chunks" (or "sections". You can see it very easily by looking at the beginning of any *.lvl file. Each chunk consists of an eight-byte header: 4 bytes marking the type of chunk, 4 bytes marking the size of the chunk. "ucfb" is the marker for a full *.lvl file. "scr_" is the marker for a script. And so on. And they're always followed by the 4 byte integer in Little Endian format.

"lvl_" is what marks an embedded *.lvl file. Each one of these "lvl_" chunks is what you referred to as a requirement. mission.lvl, in particular, contains one of these requirements for each mission that can be played.

Each chunk type expects the data in it to be stored in a specific way, which is presumably determined by the way the *.lvl files get compiled by the development tools you've built for the game.
I posted this image earlier and asked about it; I'll do it again because it is vital:
Image

The "lvl_" chunk expects a single sub-chunk. The 4-byte marker for this sub-chunk is some kind of identifier. Presumably, it identifies what you referred to as a requirement. The problem is, when compiling the *.lvl file, it has been converted from a meaningful name into what you see in that image above. 4 bytes of garble that ends up looking like, in hex, BA 96 CC 77. Somehow, the code that loads the mission.lvl file knows to match the string "tat3a" to this 4 bytes.

What we would need, if we're ever going to be able to add new maps, is to know how that specific code works. The code that translates these requirement strings into those 4 bytes; and/or vice versa, that translates the 4 bytes into the meaningful string.

I'm almost positive that this is what's preventing us from a number of things. It's a very specific thing, and it may turn out that we have to get feedback directly from the person who wrote the code that reads / writes out the *.lvl files.
Post Reply