Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - {AR}MetalKiller

SWBF1 Modding / lua4dec - Lua 4.0 Decompiler
February 09, 2024, 12:33:57 PM

I have been working on a Lua 4.0 decompiler for some time and I think it's ready enough to be shown.
What was originally planned to be a weekend project turned out to take almost half a year of off/on development.
lua4dec was initiated by my interested in SleepKillers unmunge tool which extracts lua bytecode (among other formats).
This lua bytecode can be fed into lua4dec which converts it back to human-readable lua scripts.

The project is around 90% done.
Some uncommon instructions are not implemented, and 3 or 4 instructions are missing some more attention.
But overall I am pleased with the results.
The decompiler even spawned a little side project that shows the AST of a converted script.
In the long run, I could imagine it being used to modify the bytecode and recompiling it back into the SWBF files.

Here is the link to the project:

I will still continue to work on it and finish it someday.
Maybe you want to test it, leave some feedback, or improve it yourself.

Feel free to reach out.

SWBF1 Modding / Tutorial and Documentation Resources
January 02, 2024, 06:53:19 AM
Howdy and happy new year, everyone  :cheers:

I've been modding SWBF for well over 10 years now, admittedly less frequent and with less ambition than other modders on this forum.
In the beginning, I started having conversation with people who already knew how to mod.
There was no tutorial to follow along, and I had to figure out a lot of stuff on my own.
The classic learning by doing experience.
Although there are plenty of tutorials and documentation resources available, it always bugged me that they were spread across multiple different platforms and presented in forms that may not be appealing to beginners.
Some documents even skipped the most interesting parts because they were trivial in the eyes of the writer or just too cumbersome to explain.
Further problems were dead links, incompatible software, .... you name it.
I understand that the community is a bit smaller these days than back in the day, and the demand for a unified resource collection might be close to zero.

However, I am wondering if there has never been made an effort to collect all the information that is out there about SWBF1 and SWBF2 in one place?
I am thinking about something similar to the Blender-MSH-IO reference manual from Sleepkiller or a Wiki page in general.
Having Screenshots, cross-references, TL:DR;, ... really lowers the initial threshold for new people to get started.

I am not really trying to convince anybody of something, but just want to hear your opinions on it.

I am trying to create a wall that surrounds a town with several kinks and edges with angles between 15 and 45 degrees (something like Picture 1).
Preferably with the grid alignment in ZE enabled.
For arguments sake, let's say a wall segment is a cube with dimensions of (1, 1, 1).
Aligning wall objects without rotation is straight forward, as they are aligned along the x or z axes (Picture 2).
However, rotating the object breaks the alignment as the model coordinates are not a multiple of 1 anymore but rather something like (0.85, 1, 0.35).
As shown in Picture 3 there will always be a gap or the objects have to overlap, which causes Z-fighting (flickering) issues.

Side note: I created connector objects that solve the transition from no-rotated objects to rotated objects.

I know that most SWBF maps get around this problem by having just 90 degree edges or using a model that has the kinks already in them.
I really would like to keep the assets generic and reusable and not create one big model.
Any ideas how to get around this problem?
Or do I have to manually align the objects with the grid alignment disabled?

Picture 1:
You cannot view this attachment.

Picture 2:
You cannot view this attachment.

Picture 3:
You cannot view this attachment.

Note: I am using blender and SK exporter to create the models.

Thanks for any help  ;)

The AR clan tries to host a server for Steam.
Since we host on Linux we use wine.
Starting the Battlefront executable (from GOG) with the following options causes a page fault:
wine Battlefront.exe /win /norender /autonet dedicated /noaim /resolution 200 200 /nosound /gamename "..." rhn2a 200 200

The interesting thing here is that the server starts without the /norender option.
wine Battlefront.exe /win /autonet dedicated /noaim /resolution 200 200 /nosound /gamename "..." rhn2a 200 200
But as we use wine, the server takes >5min and 100% CPU usage over the whole time period (granted we don't have such a powerful machine).

Attached you find a crash log, but I doubt that it will help.

Any idea why the /norender option might cause a crash?

Note: Wine was the only thing running on the server.


EDIT: Remove misleading text.
SWBF1 Modding / Hoth Caves Assets
February 28, 2023, 08:54:56 AM
Hi folks,

I am looking for a certain asset on HOTH: CAVES. The accessible bacta tank.

You cannot view this attachment.

Does anyone have this asset or a similar one?
Haven't found anything in the downloads section.

SWBF1 Modding / Sound Regions and Streams
February 11, 2023, 07:15:55 AM

recently, I added sound streams to my map and used multiple sound regions to play those on the map.
However, I am noticing some strange issues when stepping into the region.
It seems that the sound streams need to buffer before they can be played.

1. Stepping into 1st sound region.
2. Sound stream of the region plays (as expected so far).
3. Stepping outside the 1st sound region
4. Stepping into 2nd sound region.
5. Sound stream of region 1 plays for a couple of seconds.
6. Sound stream of the 2nd region plays.

This issue repeats for every region the player steps into.
Event for the sound that already should have been loaded.
Is the game loading the sound files from disk every time?!

Most of the sound files are ~30 seconds and have ~1-3 MB.

Any ideas what is causing this, or how I could solve this?
SWBF1 Modding / BFBuilder Script Error
January 28, 2023, 05:28:44 AM
Hi folks,

I just ran into a problem in the BFBuilderPro (same in BFBuilderPro2.0).
The error message can be found in only one unrelated post here in the forum.

Here is the error:
An error has occured in the script on this page
Line: 1
Char: 1
Error: Subscript out of range: '[number 19]'
Code: 0

DO you want to continue running scripts on this page?

You cannot view this attachment.

Does anyone have an idea what is causing the error or where I should start searching for?

The subscript index was 18 before (after editing the wld file), so I assume it has something to do with the wld file.
I can still edit the file by opening the zeroeditor separately and opening the wld file.
Munging also works via the batch file.
However, I don't know if it is possible to create a custom SIDE without the BFFuilder UI.
Can I just copy the SIDE folder into my mod map?

Thanks for any help.
SWBF1 Modding / SWBF Tools
October 08, 2022, 05:23:48 AM
Hello there,

I want to share with you an idea that I had for a long time now (probably even when I first started modding).

There are quite a few modding tools for non-static data such as a resolution-fix launcher, ingame console launcher, name changers, ... .
Most of these tools probably use the same mechanics, and their creators reinvent the wheel all over again (I am guilty as well).
Not that there is something wrong with that, but we could use our time more effectively and be more productive developing more tools for this great game.
Maybe even lowering the barriers for new modders.

For a couple of months (when I had some time left) I worked on yet another launcher ::) and some tooling around it, that is able to render things on top of battlefront and interact with the game.
I am not going into details since it will take some more time until it is finished.
The working project title is SWBF Tools.
Here is a screenshot (with mocked data).

You cannot view this attachment.

The menus can be enabled/disabled with a key press.
Separate windows (widgets) can be enabled for certain topics.
In the future, I want to make the interface scriptable using SWBF's Lua API.

I imagine that there are quite a few use cases:
  • Editing the username between switching servers
  • Showing the list of players when playing
  • Show some general information
  • Ingame console
  • Private chat between 2 players
  • Trigger script functions
  • (Anti-cheat)
  • ...

What is your take on it?
Do we even need such a thing?
What are some other use cases?

Cheers, see you around.  :wave:
Released Maps and Mods / ALDERAAN: CASTLE
August 25, 2022, 03:34:44 AM
Hello there,

I would like to present my first and last mod map. The map is called "ALDERAAN: CASTLE". It was initially planned as a TDM map for close combat, but soon got too big. So it became a conquest map (which is also playable with AI).

I wanted to plant more trees to fit the theme of Alderaan, but there are too many props placed already  :confused: .
So it is only a little castle in the mountain regions.

The minimap is not pixel-perfect, but I think it is acceptable.
There are 2 areas with multiple layers, which are highlighted orange and yellow on the minimap, I hope that it is not too confusing. Also, I added some topology to the minimap. What's your opinion on that?

I hid away 10 gargoyles, so you might have some motivation to explore the map beyond the playable areas ;). Who can find them all?

The map is quite large with ~30MB. It is probably the amount of objects used on the map.
Download Link: You cannot view this attachment.


Some notable issues:
  • Flickering objects from a far distance.
  • Clipping errors on the stairs with the two gargoyles
  • AI might have problems in the area of the tomb and the barracks, since they overlap. However, they should not get stuck permanently.

Find some impressions attached.

SWBF1 Modding / Flickering objects on mod map
August 23, 2022, 10:09:50 AM
Hey folks,

I am on the finishing touches of my new mod map and have a problem with distant objects.

The only related post I found was from wsa30h:
However, I don't believe that my map is that detail-heavy.

I hid away quite a few objects under the map that I didn't need. I put them -200 under the surface (does it even matter how far they are donw?).
Could this be the source of my problems?

Video showing the flickering:

As always, thanks for any suggestions.
See you.
SWBF1 Modding / Missing foliage
June 30, 2022, 09:47:47 AM
Hey guys,

since it is 2022, I thought it would be a good time to create my first mod map in swbf  :rofl: .
I am on my finishing touches, but ran into some issues with the foliage.
Below you find the .prp file of the map, which is pretty standard.
The foliage shows in the zero editor but not in the game after munging.
I already tried to reduce the spread of the foliage and the number of used layers, with the same result.
Do you have any ideas what might be the problem?

GrassPatch("end_prop_grass.odf", 80);
File("editor_grasspatch.msh", 80);

File("end_prop_fern2.msh", 30);


File("end_prop_foliage7.msh", 180);


File("end_prop_foliage6.msh", 180);


I am trying to start a swbf server on a Linux machine with wine and the in-game "admin console".

Using wine with the Server Manager UI works fine:
wine "battlefront server.exe"
Running it from the command line also works:
wine battlefront.exe /norender /resolution 320 240 /autonet dedicated /gamename test kam1c 1 1
However, when I add the "adminpw" command I get a segfault:
wine battlefront.exe /norender /resolution 320 240 /autonet dedicated /adminpw blub /gamename test kam1c 1 1
Does anyone have an idea what might be the problem?
Is it even possible to use the adminpw command?

since the SWBF1 Steam/GOG versions require to change you account name we created a SWBF Name Changer that bypasses this problem.
It should be similar to the one that BattleBelk developed for the original version.

Follow the link on the bottom to 'releases'. You should use the latest version for smaller fixes and improvements.

Any feedback/suggestions/improvements are welcome. Either here, in Discord, on Steam, or GitHub.

See you on the battlefield.

we (21st clan) got back into SWBF with the new Steam release and are quite active at the moment with ~5 Members.
Feel free to join us on public servers.
Or if we get a 'real' server running, to have some clan wars.  ;)

SWBF1 Modding / LevelPack
May 08, 2020, 10:05:00 AM

can anyone explain me how to use the "LevelPack" executable in the BFBuilder?
I want to build files from a directory (common) into a common.lvl file.

There seems to be no documentation on how to use the tool and what input files (and types) are required.

$ .\LevelPack.exe -sourcedir .\common\ -inputfile !*.* -debug
Considering [.\common\\.\effects\file.fx]
Munging file.fx
Opened file .\common\\.\effects\file.lvl for output
Opened file .\common\\.\effects\file.lvl.req for output
Opened file .\common\\.\effects\file.fx for input
Error: Expecting bracket, but none was found.
File : .\common\\.\effects\file.fx(2)...
Error: Expecting bracket, but none was found.
File : .\common\\.\effects\file.fx(2)...


Recently I came across SWBF and wanted to play for some time.
It seems that through a lot of modding in the past years I corrupted the bespin level file.
I can play as usual except I do not have sound and I can not join bespin multiplayer maps (probably some checksum error).

Does anyone of you have an old backup of the bespin.lvl file or might have an idea how I could reset this file?

Thanks in advance.