Author Topic: Map editing questions  (Read 3340 times)

Yokai

  • Member
  • Posts: 20
  • Karma: +1/-0
    • View Profile
Map editing questions
« on: February 03, 2014, 07:09:15 AM »
I reach a point in map editing where I got stuck.

Maps are made up of 4 files:

- a .GEN file containing the map music and I think the sky or some pic defined.
- a .I file that seems some kind of script that spawns objects. At this point, the coordinates defined in this file doesn't make any sense because the object spawned in Q1M1 from this file are far outside any playable or accesible area, just in the infinite area of the Doom Builder rid.
- a .MAP file, that is the map itself
- a .LIT file, that I suppose is a compiled script that defines the map sector's lights.

And here I'm stuck again.
I have build up and modified some parts of the map. The map structure works well, texture alignment works well, and everything works well, EXCEPT the sector lighting.
Let me explain: in Doom Builder (DB from now on) I create new sectors to add detail. Those new sectors have a light level of 255. But when testing the map in game, my new sectors have the 255 light level as spected, but the old sectors that I didnt' modified, have a different light level.
Also, some sectors have a glowing effect, but there is not thing marker in the sector.
I can't see any thing marker changing this light level or the behavior of the light in those sectors, so the only explanation is that the sectors' light level is changed through a script, probably in that .LIT file. But again, the sectors with modified light doesn't have any sector tag. And that is bugging me because any Doom game needs a sector tag to change that sector's properties. And the only explanation is that the script in .LIT files uses corrdinates system instead of sector tags, which is in fact a terrible way to do things, IMO.

It never minds, I can manage to do it anyway, but here comes another problem: this .LIT file is compiled, encrypted or something, so I cannot read, nor understand how it works, and of course, modify it.

So basically I need some way to modify those .LIT files with a normal editor. I discard an HEX editor because I don't want to mess with that kind of things.
So I need a compiler/decompiler.

Any help? Thanks.
« Last Edit: February 03, 2014, 07:13:29 AM by Yokai »

peewee_RotA

  • Sr. Member
  • Posts: 268
  • Karma: +8/-0
    • View Profile
Re: Map editing questions
« Reply #1 on: February 03, 2014, 07:25:40 AM »

- a .I file that seems some kind of script that spawns objects. At this point, the coordinates defined in this file doesn't make any sense because the object spawned in Q1M1 from this file are far outside any playable or accesible area, just in the infinite area

They might be listing the 32bit integer values. I know that in hexen you mostly deal with floating point x,y,z, coords but sometimes in scripting you have to convert to an integer, which multiplies the floating point x,y,z coords by 65536 in order to properly shift the bits above.

I'm convinced most coords work the same way in A&A. While looking at movement speeds, a slow crawl is well over 65536 in velocity. You're probably seeing these. Try dividing one set by 65536 and seeing if it matches the coords that you expected.

(Unfortunately I don't know the answer to your real question)

LysleShields

  • Administrator
  • Full Member
  • Posts: 207
  • Karma: +6/-1
  • Is the potion half full or half empty?
    • View Profile
    • Amulets & Armor
Re: Map editing questions
« Reply #2 on: February 03, 2014, 11:40:14 PM »
The .MAP is the map.

The .I file is merely an info file that contains the music and background image for the level.

The .GEN file is the generator file.  It is something we didn't really use that much and probably should be canned.  Only lines that start without a ; are used and we tended to duplicate the same dumb file with wrong coordinates.  In short, leave it blank for now.

The .LIT file is a complex lighting file that is used to allow lighting to spread throughout a level.  For example, the light from outside sectors bleed into nearby sectors.  If a door sector opens up, the light from the other side also bleeds into the room on the other side.  We did this by using another tool that read in all the sectors, determined a weighted average of connecting sectors, and then outputting a mathematical representation of those sectors in the .LIT file.

For now, you can work around the problem by using the .LIT file in the TemplateMap directory that you downloaded with the A&A Doom Builder files.  It is a blank .LIT file that has no math and, thus, will not do any of the light bleeding.  In the future, I plan to get rid of the .LIT file and just have it computed when the level loads.

Yokai

  • Member
  • Posts: 20
  • Karma: +1/-0
    • View Profile
Re: Map editing questions
« Reply #3 on: February 04, 2014, 04:41:22 AM »
The .GEN file is the generator file.  It is something we didn't really use that much and probably should be canned.  Only lines that start without a ; are used and we tended to duplicate the same dumb file with wrong coordinates.  In short, leave it blank for now.

That makes pretty much sense now.

The .LIT file is a complex lighting file that is used to allow lighting to spread throughout a level.  For example, the light from outside sectors bleed into nearby sectors.  If a door sector opens up, the light from the other side also bleeds into the room on the other side.  We did this by using another tool that read in all the sectors, determined a weighted average of connecting sectors, and then outputting a mathematical representation of those sectors in the .LIT file.

For now, you can work around the problem by using the .LIT file in the TemplateMap directory that you downloaded with the A&A Doom Builder files.  It is a blank .LIT file that has no math and, thus, will not do any of the light bleeding.  In the future, I plan to get rid of the .LIT file and just have it computed when the level loads.

Yes, that was what I guessed.
Anyway, without being able to change .LIT files I cannot edit the old maps because some sectors appear with different light level, or when a door opens, my newly created sectors don't get the "light bleeding" effect, and thus, it looks awful.

Isn't there any tool or way to modify those files?

LysleShields

  • Administrator
  • Full Member
  • Posts: 207
  • Karma: +6/-1
  • Is the potion half full or half empty?
    • View Profile
    • Amulets & Armor
Re: Map editing questions
« Reply #4 on: February 06, 2014, 10:21:25 AM »
There is a tool to make .LIT but it's a two step process built into some DOS tools.  I should just go ahead and make a fix to the Classic version that ignores the files and creates them on the fly.  The tool is really not needed.  When first built, I thought there would be some customization of the .LIT files, but in the end, it didn't happen.

Putting it high on the to do list.

Yokai, would you like me to put out 'unstable' version that you can download?

Yokai

  • Member
  • Posts: 20
  • Karma: +1/-0
    • View Profile
Re: Map editing questions
« Reply #5 on: February 06, 2014, 05:10:15 PM »
I have been messing with the AAScriptCompiler and the map scripts (S30.src and S30.srp).
They seem pretty simple to understand without a manual. I managed to compile simple scripts without any error.
But all my attempts to make it work in the game, were unsuccessful. I created a script that upon initializing the map Q1M1 gives 1000 experience to the player.

The script was like this:

Code: [Select]
Initialize:
        0:
                // Script run when the level is loaded
                GivePlayerXP(1000)
                End()

        200: // Script numbers 200 and above ONLY happen for this player.  All other scripts happen for all players.
                End()

        255: // Last possible script number
                End()

The script compiles without errors or warnings, but I don't get any experience when the map loads. I would say that the script is not even run at all and that I'm missing something.

There is a tool to make .LIT but it's a two step process built into some DOS tools.  I should just go ahead and make a fix to the Classic version that ignores the files and creates them on the fly.  The tool is really not needed.  When first built, I thought there would be some customization of the .LIT files, but in the end, it didn't happen.

But when you are talking about the Classic version, you mean the Game Classic Version, or the .LIT tool Classic version?


Yokai, would you like me to put out 'unstable' version that you can download?

That would be nice, unless the unstability means kidnapping my cat or stealing my girlfriend.

LysleShields

  • Administrator
  • Full Member
  • Posts: 207
  • Karma: +6/-1
  • Is the potion half full or half empty?
    • View Profile
    • Amulets & Armor
Re: Map editing questions
« Reply #6 on: February 12, 2014, 12:19:29 AM »
I've created a patch that no longer requires .LIT files.  You can download it from http://www.amuletsandarmor.com/download/AA_Classic_Dev_v1.04a.zip.  Just unzip the single .exe file on top of an existing v1.04 version and delete all the .LIT files.

.LIT files are no longer required!

I tested on several levels and did not see any difference.

LysleShields

  • Administrator
  • Full Member
  • Posts: 207
  • Karma: +6/-1
  • Is the potion half full or half empty?
    • View Profile
    • Amulets & Armor
Re: Map editing questions
« Reply #7 on: February 12, 2014, 12:26:57 AM »
BTW, I confirmed that script 0 is indeed called when the map is loaded.  I'm not sure why you are not seeing any effect on your script.  Perhaps adding a Delay(70) for a one second delay and a a Print("XP granted") for a message.

peewee_RotA

  • Sr. Member
  • Posts: 268
  • Karma: +8/-0
    • View Profile
Re: Map editing questions
« Reply #8 on: February 12, 2014, 07:43:07 AM »
Awesome!  8)