Modding ITB: R&D And Current Findings

Discuss and distribute tools and methods for modding.
rannl
Posts: 335
Joined: Sun Nov 25, 2012 11:13 pm

Re: Modding ITB: R&D And Current Findings

Postby rannl » Mon Mar 05, 2018 4:30 am

@KartoFlane : I reckon modding will require a dat file serializer/deserializer in order to get access to the asset files and edit them.
As for the lua scripts - are they precompiled and loaded as dynamic libraries, or are they open code files which are evaluated/executed during the game runtime?
If precompilation is involved, I suspect the dat file cracker will also require compilation support prior to repacking modded content.
Both cases are feasible and should require a lot of work IMHO.
What about Vhati :) ? Wouldn't he like to join in, being the author of the FTL Slipstream mod manager?
Sleepy
Posts: 3
Joined: Mon Mar 05, 2018 3:13 am

Re: Modding ITB: R&D And Current Findings

Postby Sleepy » Mon Mar 05, 2018 8:11 pm

kartoFlane wrote:possibly pre-set spawn points for enemies. No idea how the game will handle non-standard map sizes, though.


There's no camera object, so the possibility of having larger maps seems pretty slim. Maybe something could be done to shrink the map scaling beyond the default settings in order to broaden the view.

The spawner works by compiling a list of possible spawns from what is available on the island: and tries its best to spawn a certain ratio of upgraded mobs vs standard mobs. The initial mobs are random, depending on which island number it is (1-5). Additional spawns are pulled in rolled from a reinforcements list; with each mob type having a limited number that can exist/be rolled on any given map; arriving at a predefined region of the map.

If you want more control over this: you might be able get away with making a custom terrain object and having that pull in a specific mob instead of, say, a mountain.
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: Modding ITB: R&D And Current Findings

Postby kartoFlane » Thu Mar 08, 2018 12:06 am

@rannl
The .dat files use the same format old FTL did, so that's already solved. Scripts are simple text files, loaded at runtime, so there's no need for precompilation of any kind. The only problem currently are the .bank files for music and sound; wcarss has written up a post about that on the previous page. Quick googling did not yield any (stable) java libraries that could be used to mod those files.
I dunno about Vhati, I guess if he hasn't chimed in here yet, then he's not interested :P I thought about extending SMM's functionality to include ITB, but after briefly reviewing its code I figured it would require some major changes to its structure to achieve that... I wasn't sure how to go about that, so instead I started working on a new manager, using SMM as its base. It's going a little slowly, since I'm using this as an opportunity to learn JavaFX.

@Sleepy
I figured it'd be like that. I guess at most we'll be able to have 9x9 or 10x10 maps, anything larger will simply not be visible. Unless the game automatically adjusts the camera to keep everything in view, but I haven't tested that :P
Superluminal2 - a ship editor for FTL
nthroot
Posts: 5
Joined: Sat Jul 01, 2017 3:46 pm

Re: Modding ITB: R&D And Current Findings

Postby nthroot » Thu Mar 08, 2018 5:54 pm

Has anyone figure out what "color_map.lua" does? I've modified all of the values with random values btwn 0 and 150, and all mechs are olive, regardless of squad.
Edited file: https://www.zerobin.net/?a4a7499a512624 ... eJxovpKGc=
leper911
Posts: 3
Joined: Sat Mar 03, 2018 12:25 pm

Re: Modding ITB: R&D And Current Findings

Postby leper911 » Thu Mar 08, 2018 8:20 pm

Convenient tool - the console in the game. When you click on "tilda" you can call the console, and by clicking on TAB it will switch to the straight line to the LUA language.
Thanks for such a gift it will help debug a lot of modules and add-ons.

And also through LUA scripts you can solve the problem with multilanguage.https://www.subsetgames.com/forum/viewtopic.php?f=26&t=32849#p115958
Definition of the current language. Although it would be nice to include rereading a specific folder (/ scripts / lang / de_De / scripts / lang / en_EN / scripts / lang / en_US / scripts / lang / ru_RU) and give the choice of the language settings.

P.S.
Yes, the skills for pilots are fixed. Could not get HealthBonus parameters, MovieBonus somehow to earn. There is an opportunity to make your descriptions for Skill determine the value for the skill (PowerBonus) but the mechanics for Skill are sewn and not described by LUA scripts.
Perhaps the parameter that drives loading more than one Skill Would help make new characters in the future. It looks like it was originally planned to realize it but it was discarded in bulk. So there were only SkillPower, Skill.


It may yet be difficult to sew TTF so tightly into the resources of the game. It is very difficult to make a game multilanguage.
CombatBoots12
Posts: 1
Joined: Wed Mar 07, 2018 5:00 am

Re: Modding ITB: R&D And Current Findings

Postby CombatBoots12 » Thu Mar 08, 2018 8:31 pm

So for anyone who hasn't figured it out and can't deserialize .dat's (me), the FTL unpacker works and extracts all files from the .dats perfectly. This has allowed me to get into the art files and mess with color schemes, I'm not much of a coder but it's fun to replace the pixel art.

https://subsetgames.com/forum/viewtopic.php?t=2788 <-

Now to go back to making tiny pixel art Gundams and MS's
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: Modding ITB: R&D And Current Findings

Postby kartoFlane » Fri Mar 16, 2018 12:00 am

So, the mod manager I've been working on is now somewhat usable. Figured it'd be useful to post a preview version to get some feedback.

It already includes some nifty functionalities, like unpacking/repacking of the game's resource.dat (outside of patching mods), automatic detection of stale backups when the game gets updated, and loading of previously selected mods.

You can download it here: https://www.dropbox.com/s/itx0bvih80lje ... r.zip?dl=0 (you'll need Java 8 to run it. Once you have that, you can start the manager via "java -jar modman.jar" in commandline.)
(github repo here: https://github.com/kartoFlane/ITB-Mod-Manager)

.

Like I mentioned in my post earlier, this program is heavily based on SMM, which is the manager used for FTL. While SMM has .ftl files, this one uses .itb. An .itb file is simply a renamed .zip with a specific file structure. I did include some test mods, though they don't contain any modded content, just metadata to allow me to test the manager's functions. Anyway, they roughly illustrate how .itb files should be structured.

The root of your .zip file should contain one, multiples of, or all of the following folders:
    img
    fonts
    audio
    maps
    scripts
    mod-appendix

Any file in img/ and fonts/ is automatically put into the resource.dat, into the appropriate directory.
Handling of audio/ is not currently implemented, so these files are ignored.
Any file in maps/ is put into the maps/ folder in the game directory.
Any file in scripts/ is put into its own subdirectory named after the mod, inside of scripts/mods/ folder in the game directory. Example: mymod.itb/scripts/myscript.lua goes into scripts/mods/mymod/myscript.lua
All scripts are automatically added to scripts.lua, appended after the game's own scripts, first in the order the mods installed were in, and then in alphabetic order for scripts from the same mod.
The mod-appendix/ is a special folder used to store metadata about the mod. It is not patched into the game.
Superluminal2 - a ship editor for FTL
AUTOMATIC
Posts: 24
Joined: Sun Mar 04, 2018 11:59 am

Re: Modding ITB: R&D And Current Findings

Postby AUTOMATIC » Fri Mar 16, 2018 4:28 am

Two competing mod loaders each with own mod format. We're in for a ride, boys.
User avatar
stickthemantis
Posts: 37
Joined: Wed Jan 29, 2014 4:16 pm

Re: Modding ITB: R&D And Current Findings

Postby stickthemantis » Fri Mar 16, 2018 7:12 am

kartoFlane wrote:So, the mod manager I've been working on is now somewhat usable. Figured it'd be useful to post a preview version to get some feedback.

Well, sorry, a little late for that. My mod loader (viewtopic.php?f=26&t=32833) takes better advantage of the use of lua (imo), and thanks to AUTOMATIC helping me with UI stuff it will soon be possible to configure mods from inside the game, no external programs or moving of files required. Plus we're actually already seeing some mods made with my loader in mind.
We probably should have mentioned this earlier but we have a Discord where we discuss mod development: https://discordapp.com/invite/trrNB6p
I'm Cyberboy2000, known as a modder and community leader of Invisible Inc.
I'm using this old account because I've been unable to get any verification email for a new account. Help with changing my name would be appreciated.
User avatar
Jumbocarrot0
Posts: 422
Joined: Sat Oct 21, 2017 1:18 am

Re: Modding ITB: R&D And Current Findings

Postby Jumbocarrot0 » Fri Mar 16, 2018 8:34 am

stickthemantis wrote:
kartoFlane wrote:So, the mod manager I've been working on is now somewhat usable. Figured it'd be useful to post a preview version to get some feedback.

Thanks to AUTOMATIC helping me with UI stuff it will soon be possible to configure mods from inside the game.

WOW, if that can be functional then that would be amazing!
Image