PDA

View Full Version : Modding? Can we have it?



Xionanx
01-16-2014, 04:56 PM
Are there any plans to release a tool to let players adjust the various units, abilities, and encounters?

From a look over the directory structure/files of the game is seems fairly obvious that almost everything in the game could be easily edited with a mere text editor if not for the encryption on the JSON files preventing it. So I'm just curious is there were any plans to release a tool to decrypt those files to let users makes adjustments to the single player campaign.

Senta
01-16-2014, 11:11 PM
I'd love that, as well. my only complaint with the Banner Saga is that it is on a short side, and mods, additional quests/scenarios, more events, battles and more variety would help prolonging this great, beautiful game.

Aleonymous
01-17-2014, 09:50 AM
I'd like that too. Apart from battles etc, entire dialogues, choices and events could be introduced that way. Very interesting, especially if the community is supporting it! Great idea, Xionanx. It gets me more excited by the moment :p

Dysp
01-17-2014, 01:55 PM
Mods would be wonderful. I've often thought how many frames a unit requires. But beyond the unlikelyhood of adding new units, I imagine small tweaks/customizations to the game could add a lot more content to the game.

raven2134
01-18-2014, 08:12 AM
Hmm I duno about that initial diagnosis Xionax. You'd be surprised how finnicky the game was during testing before launch. One of the main issues with modding is getting that in while making sure the game is robust enough to not bug out.

If it was easy to the point players could provide the content and stick it in themselves, I don't think Stoic would have had a hard time adding more dialogue/scenes/events/battles. One of the main issues with putting anything in, is actually creating blockers (points where the game either does not progress correctly, or cannot be continued due to bugs).

It does sound like something cool, but there's other priorities on the table right now :).

Xionanx
01-18-2014, 08:31 AM
I would have to say that a severe under estimate of the communities abilities as a whole or a general lack of knowledge of the modding community. If I can pull apart XCOM Enemy Unknown and rewrite and re balance the tech trees, turn orders, weapon damages, etc.. all without a mod tool. If I can strip down Eador - Masters of the broken world, again.. rebalancing units, putting in new random events, fixing quests.. and again with an official modding tool.. then this game, with it painfully obvious file structure and using Adobe AIR doesn't seem to present much challenge to me.. that is beyond the encrypted files. (and I am not all that skilled). Imagine what those people who modded all those other games are capable of.

Which leads me to believe that is probably why the files were encrypted in the first place.. because it WOULD be easy to mod. But, just the same, given time I'm sure someone will make a file extractor..

Aleonymous
01-18-2014, 09:05 AM
Xionanx -- I'm sure there's "hackers" out there would could work those miracles, but the point is to bring semi-amateurs (to whom I count myself ;)) in, too. The idea would be to have an officially supplied platform for the modding, that is as stable as possible, so as to avoid that sort of trouble. It all comes down to how well the game is structured, block-wise. I mean, I see these "blocks", each broken down into "assets":

Combat -- Board, Units, Turn-Queue, Stats, etc
Dialogue -- Portraits (face & back), background, text, options
Travel (close-view & long-view) -- Background layers, Caravan sprites, HUD
Events -- Banner-background, square-icon, text, options
Misc (Camp, Heroes) -- ...

So, the most important thing is to "tie" these up in a consistent story, i.e. a series of connected {IF,WHILE,SWITCH}/THEN/ELSE clauses :)

Senta
01-18-2014, 12:38 PM
I've seen people mod completely un-moddable games (new XCOM comes to mind, thanks for the example Xio), so I am confident it could be done. Obviously with dev support it becomes much easier and a possibility of creating an open ended, sand box mod of Banner Saga is making my mouth water! take a game like Mount and Blade, the only reason that it's still around and as popular as it is, is due to its huge modifiability.
it would be next to impossible to come up with art assets since Banner Saga is too beautiful, but everything else but the animations and completely new art should be doable. Like Aleonymous said, dialogue, travel, units, quests, events, etc, adding icons to camp/town menu, certain easier sprites should all be possible.

here's hoping!

raven2134
01-18-2014, 08:03 PM
Keeping an eye on this thread. Will see if it's possibe to get John to chime in.

John
01-19-2014, 04:56 PM
The files aren't really encrypted... they're just compressed to speed up load times.


I would have to say that a severe under estimate of the communities abilities as a whole or a general lack of knowledge of the modding community. If I can pull apart XCOM Enemy Unknown and rewrite and re balance the tech trees, turn orders, weapon damages, etc.. all without a mod tool. If I can strip down Eador - Masters of the broken world, again.. rebalancing units, putting in new random events, fixing quests.. and again with an official modding tool.. then this game, with it painfully obvious file structure and using Adobe AIR doesn't seem to present much challenge to me.. that is beyond the encrypted files. (and I am not all that skilled). Imagine what those people who modded all those other games are capable of.

Which leads me to believe that is probably why the files were encrypted in the first place.. because it WOULD be easy to mod. But, just the same, given time I'm sure someone will make a file extractor..

Rensei
01-19-2014, 05:30 PM
Awww shooot Xionanx - and there You was sounding convincingly cool, mad haxx skillz and all.

Graphic modding might be a bit hard seeing as this time people will actually have to draw something (unless we we're talking about recoloring).

I'd love to see some way to have Your own stories or even just combat scenarios implemented.

Aleonymous
01-19-2014, 05:46 PM
The files aren't really encrypted... they're just compressed to speed up load times.

So, next question is... how do we open them? :D My almighty 7-Zip can't seem to handle them ".z" files. A rough Google search proved that it might a bit more complicated (JavaBinding?).

Rensei
01-19-2014, 05:59 PM
------

Mierko
01-20-2014, 01:34 AM
I ran into issues with the .z files as well. Unable to open any of the .clip or json files..

I tried to recolor Rook's cloak as a test in his (ranged) attack animations, but think the game is reading the .clip files and I don't know how to update those from the pngs I made.

Item art updates just fine.
I did a paint over on the Godscale item and it works. I added some iridescence to the scale and a little more pop to the highlights as well as change the background to a soft gradient with a lighter and more saturated blue. It wasn't that the original art itself wasn't great, but I wanted to test an asset and it just made sense to add features from the item's description. Other than the item art I haven't gotten anything to show up in game.

If anyone is able to update any files let me know!

John
01-20-2014, 03:09 PM
Changing the animation sprite sheet PNGs should work when you start the game -- you should see the changes immediately. If it is not working, I'm not sure why.

Here is some AS3 code that will take one of the .json.z files and decompile it into a JSON object (caveat I just typed this into the forum, did not test the code):

given that you've loaded you data into a ByteArray called 'data':


var data : ByteArray;
data.uncompress();
var jo : Object = data.readObject();
var jsonString : String = JSON.stringify(jo);

Given a json string called 'jsonString', you can create the contents of a .json.z file with this code:


var jsonString : String;
var jo : Object = JSON.parse(jsonString);
var data : ByteArray = new ByteArray;
data.writeObject(jo);
data.compress();



I ran into issues with the .z files as well. Unable to open any of the .clip or json files..

I tried to recolor Rook's cloak as a test in his (ranged) attack animations, but think the game is reading the .clip files and I don't know how to update those from the pngs I made.

Item art updates just fine.
I did a paint over on the Godscale item and it works. I added some iridescence to the scale and a little more pop to the highlights as well as change the background to a soft gradient with a lighter and more saturated blue. It wasn't that the original art itself wasn't great, but I wanted to test an asset and it just made sense to add features from the item's description. Other than the item art I haven't gotten anything to show up in game.

If anyone is able to update any files let me know!

Aleonymous
01-20-2014, 06:30 PM
Here is some AS3 code...

I wish I could use that. Unfortunately, I am illiterate when it comes to these Flash/Web languages :(


Changing the animation sprite sheet PNGs should work when you start the game -- you should see the changes immediately. If it is not working, I'm not sure why.

Interesting... I would have expected the game to "use" the SWF files, not the sprite-sheet-PNGs :confused:

John
01-20-2014, 06:33 PM
For animations, the game only uses the sprite sheets. The .clip file tells it which frames to play when. the .swf is never loaded by the game (in these cases).


I wish I could use that. Unfortunately, I am illiterate when it comes to these Flash/Web languages :(



Interesting... I would have expected the game to "use" the SWF files, not the sprite-sheet-PNGs :confused:

Mierko
01-20-2014, 07:55 PM
John you are the best. Thanks for responding so quickly. Great to know that the sprite sheets are all that we need to update.

I left my tablet pen at work so both my tablet and my cintiq are useless right now, but I will do some crude select by color in PS and change some of the sprite sheets and see what is popping up.


Hah! Massive edit on this post for me.. I just wrote up two paragraphs asking about naming conventions and file locations/directories and realized that I forgot to add '.sheet' to the new png name. I am a doofus.

So just to clarify for everyone, I messed up the naming convention. I saved my sprite sheet as...

"attack_ranged_ne.00.png"

"attack_ranged_ne.00.sheet.png"

Sorry about that everyone!

EDIT: John I was unable to open any of the swf files in Flash cs6. I get an error on import that there were problems reading them. Were these swfs saved with "Protect from import" checked on? Can you verify this? I understand if you guys aren't looking to make your assets public.

The reason I ask is that I am working on a palette swap for Egil after equipping the Godscale tunic. It would be much faster to have access to the vector art rather than masking the pngs in photoshop.

Thanks for the awesome game!

Aleonymous
01-21-2014, 05:07 PM
Thanks for the info, John :) I'll try re-coloring my guys too. My first project will be a "negative-colors" Oddleif, a.k.a. Black-widow skystriker! :eek:


EDIT: John I was unable to open any of the swf files ... I understand if you guys aren't looking to make your assets public.

Mierko, that might just be the case ;)

John
01-21-2014, 05:42 PM
The SWF files are not protected, they just have nothing on the main stage. Everything is in the SWF library. Have you tried using a decompiler like Sothink Decompiler?

That being said, the animations in-game are all sprite sheeted. The SWF is never loaded and is only there for reference.

The only SWFs loaded by the game are the GUIs, the Portraits (heroes details, conversations), and the Snake breathing fire anim.



Thanks for the info, John :) I'll try re-coloring my guys too. My first project will be a "negative-colors" Oddleif, a.k.a. Black-widow skystriker! :eek:



Mierko, that might just be the case ;)

Aleonymous
01-21-2014, 05:49 PM
The SWF files are not protected, they just have nothing on the main stage. Everything is in the SWF library. Have you tried using a decompiler like Sothink Decompiler?

Hmmm, OK. As this doesn't seem to bother Stoic, I might as well offer my experience... I've successfully opened most SWFs using JPEXS Free Flash Decompiler (http://www.free-decompiler.com/flash/). Sothink didn't work (well) for me.

EDIT -- I noticed that version 1.7.4 of JPEXS was able to open many more of the SWF files. Newer versions (2+) failed much more frequently.

Mierko
01-21-2014, 10:05 PM
The SWF files are not protected, they just have nothing on the main stage. Everything is in the SWF library.Is there a swf library directory or are you referring to a master swf with all of the character's animations.
IE: ""...\tbs\assets\common\character\axeman\axeman.anim .swf"?


Have you tried using a decompiler like Sothink Decompiler?I was going to add the Godscale item to the egil.portrait.swf as I have already updated the sprite sheet for battles. If I were to decompile it with sothink I get an error that the file is corrupted. *shrug*

I am just looking to update his tunic in the portrait animation and I would need to import the swf into an fla stage. I am reading up on Flash Pro cs6 and CC and it looks like they disabled this feature. I am going to try it in 5.5. It would make a lot of sense since as you said none of them are encrypted and the swfs I can preview in flash player aren't working when I import them into cs6.

The GUI swf I am trying to open in CS6: "...\tbs\assets\saga1\character\axeman\egil.portrai t.swf"


That being said, the animations in-game are all sprite sheeted. The SWF is never loaded and is only there for reference.I figured the swf was only reference, but I was hoping that they could be opened via flash. I assumed that "egil.anim.swf" has his in-game animations. The name matches the Egil animation folder so I had fingers crossed that it would be a reference swf with all of the battle anims. Something that I could then import into flash and generate clean masks based on the vectors rather than a png sprite sheet in photoshop.

I will give it a try tonight. Worst case scenario I continue to generate the sprite sheet masks based on the png and I have to give up on updating the portrait in the Hero Menu.

Thanks for the help!

Edit: JPEX worked for me. I have only tested two so far but it is the only time I haven't gotten an error. Thanks!

Aleonymous
01-22-2014, 04:04 AM
Mierko -- JPEXS was sometimes unable to load the SWF on first try, but retrying it (e.g. drag-and-dropping the SWF on the program's window once it opened) usually solved that. I think that, what John means with


The SWF files are not protected, they just have nothing on the main stage. Everything is in the SWF library.

is that you can't "see" the SWF's animations/contents by opening them with a simple web browser. You need to open them with a dedicated SWF-handling software, and check the file's "library", where all the assets (frames, sprites, objects, instances etc.) are stored.

John -- Seeing no sprite-sheets in the Factions files, I assume the SWFs are used there. I wonder why did you go a different way with the two games, when it all seems to be the same art? Is it a security, stability or performance issue?

Rensei
01-22-2014, 04:28 AM
John <3 <3 <3

stealing and publishing his own Saga code since 2013

Mierko
01-22-2014, 11:25 PM
Aleonymous I got the error every time I used sothink, but JPEXS was error free. Everything is working fine now and I almost completed masking all of the Egil tunic symbols last night. I had somewhat clean versions I had made in photoshop, but there are a few sheets that are 80-90 frames and I held off on them.

With the .fla I am going to update the monster sprite sheets with the clean green key. I am going to have to update the sheets frame by frame since I don't know if John used a proprietary texture packer or just bought one of the common ones... If I knew I could just generate a sprite sheet from the updated .flas and be done.

So y'know.. it would be nice, but I am not going to complain if he isn't willing to share :D. How could I after all of the support he has given us so far! Seriously...
John. Is. The. Man.

My plan so far is to update the Egil hero portrait with the Godscale tunic and then try to convince my buddy from work to help out on the engineering side to get it to autoswap to the new spritesheets/portrait when the item is equipped. Egil isn't even my favorite character, this is all just driven by curiosity. I figure if I have the art in hand he can't say no. Plus he was like an excited puppy when I brought up the idea of creating custom side quests (he was obsessed with The Organ Trail [the zombie version]). He hasn't even played TBS yet (he is going to buy it this weekend and lock himself in his apt). I figure if I can have some assets ready by monday he will find the time to take a look during the work week.

Aleonymous
01-23-2014, 03:35 AM
John. Is. The. Man.

Indeed ;)


If I knew I could just generate a sprite sheet from the updated .flas and be done.

Mierko, that would be my next question too. How could you "extract/print" the sprites on the sprite-sheet in such a manner so as to be identical to the old ones? Looking it that sheet: (1) There's no fixed "bounding-rectangle" for the sprites and (2) The sprites don't seem to be in any sort of logical order, i.e. column- or row-wise. How are you gonna tackle those problems? Manually replace frame-by-frame seems... ouch! :(

Batch-processing the PNG files, if you just wanted to re-color some garment (e.g. tunic or trousers) or hair, seems easier to do using bitmap image processing. Now, adding textured features (frame-by-frame) on the vector-sprites, and then exporting them... gl hf!

Mierko
01-23-2014, 11:31 PM
Mierko, that would be my next question too. How could you "extract/print" the sprites on the sprite-sheet in such a manner so as to be identical to the old ones?

No clue. I tried TexturePacker and it was a no-go. I gave up after that. I didn't want to spend the whole night fishing.

Looking it that sheet
(1) There's no fixed "bounding-rectangle" for the sprites and
(2) The sprites don't seem to be in any sort of logical order, i.e. column- or row-wise.
(3) How are you gonna tackle those problems? Manually replace frame-by-frame seems... ouch! :(
(4) Batch-processing the PNG files, if you just wanted to re-color some garment (e.g. tunic or trousers) or hair, seems easier to do using bitmap image processing. Now, adding textured features (frame-by-frame) on the vector-sprites, and then exporting them... gl hf!

1 - Nope, no bounding box on the textures.. *Shrug*

2 - Sprite/Atlas sheet generation really never have a logical order. You tend to get clumps of a few frames near one another and then the 'filler' frames that are scattered about.

3 - I manually replaced Egil's tunic with a green mask. Not for every sheet, as some of them were good to go when I keyed them in my original PSD. Luckily. All that said it really wasn't that bad.

You jam through a list of symbols, replacing the base colors with RGB/CMY consistently (took maybe 30m for Egil's Tunic?).
Then (if using CS6) you can just export > sprite sheet (which if that was what John did I will kill myself, since I rolled back to 5.5 since CS6 was being an asshat when it came to swfs)

or

4 - In the case of single frame replacement, export > png image sequence. This worked really well as I just dumped them into a temp folder and dragged all of the key frames into the sprite sheet PSDs that I had started last week. It takes some time, but if you have a good sense of negative space and like puzzles it goes by really quickly. Keep in mind each layer you are dragging in has the frame number on it so at the worst you are looking at 70ish frames but you'll see a decent amount of holds for 3-4 frames.

Finally once I had the green key of the tunic applied to my sprite sheet PSD I did a Color Select > 200 Fuzziness of the green key and applied it as a mask layer to a layer filled with my chosen tunic color. Later I added a gradient to each layer of his tunic just to see if it had any major pops in the animation and overall the gradient held up quite nicely. Not that I am a fan of the look. I intend on doing just a plain palette swap to match the base color of the Godscale, which is close to the darker side of the gradient. This test was mostly to see if I could push it further to include highlights for the scales. We will see. I am hoping to give it a go tonight.

Super bonus points for John as apparently you don't even need to close TBS for the art to update. I had it running on a side monitor while I worked on the other two. I exited the training battle each time, but I am not sure if you even need to do that. I think as long as you are updating the source png you are good to go. Just be diligent about keeping a source folder with your psds and backup the original sprite sheets.

Final note: If you are going to do a palette swap of something like Rook's cloak you don't have to bother with much of anything apart from some Photoshop 'Select > Color Range'.Egil's Tunic was chosen because it was a color that was used throughout the character and if I was to key the color it would pull his shoes, straps and in some cases the sword pommel.

Below I attached an example of the key and blue gradient I was using to test for popping animation.

191

raven2134
01-24-2014, 08:45 AM
Wow that is awesome. If John wasn't so busy fixing the DRM free version he'd be around more here and stuff :p

Come to think of it, wouldn't the standalone version/DRM free version be easier to mod as well?

Aleonymous
01-24-2014, 09:07 AM
Come to think of it, wouldn't the standalone version/DRM free version be easier to mod as well?

Perhaps. But, from what I've seen in the game files and from what John shared with us here, I think Stoic's isn't making any effort whatsoever towards "locking up" (protecting) their content on the client-side. That's very positive for the modding community and, again, thanks for that, Stoic! :)

Senta
01-24-2014, 09:36 AM
yeah, DRM wouldn't really make it harder per se.

great to see Stoic guys respond and try and help out the modding community!

Mierko
01-25-2014, 03:21 PM
1. If John wasn't so busy fixing the DRM free version he'd be around more here and stuff :p

2.Come to think of it, wouldn't the standalone version/DRM free version be easier to mod as well?


1. Totally understandable. He has been awesome with answering questions and it has made things so much easier.

2. From the art side of it I am not seeing where any differences would be. We have open access to all of the art and it updates the files instantly. You don't even have any caching issues.

Want to test a sprite sheet? Open the training tent and activate that skill/movement animation. Done.

Honestly I don't see how it could be any easier to change the art. I have already pulled keys for Egil's tunic and updated his portrait in the hero screen without any hiccups once I started using JPEXS to decompile the .swfs.

Honestly the only problem I have had with my testing is that (Story SPOILERS in white text ahead) canon-wise it really seems like you are supposed to bring Onef/Ekkill along and that means Egil isn't going to be in Part Two. (Same goes for the ending and Rook). So this is a great test in practice, but not really something that I can carry over. That said, the workflow is iron-clad in my opinion. Hell it could even be easier to key out art if we know the texture packing program.

Now on the programming side DRM/free could be a completely different story, but I am pretty clueless about that.

Mod ideas

Originally my plan was that when certain characters equip certain items that their portrait/sprites would change to reflect that change. Thus the Godscale on Egil. Super tank + Super armor item = palette swap!

I think a better route is to go with, character has reached Rank 5 = palette swap. This way nothing is item dependent, but in the case of Egil the art update can insinuate that he is wearing the Godscale.

Other ideas, but I have no idea how to do them:

Toggle grid visibility during or at least before a fight. This would be great when you are initially setting up for battle. Too often am I one space off from where I would like to be in order to line up my tanks. In the case of a low willpower hero that can really suck to waste on a movement exertion.

Get an icon for your ability damage when previewing your movement. It would work exactly as the damage icon pops up when you are in your movement phase. When you are in range of firing off Eyvind's Lightning it would pop up a little purple damage icon. Or in Alette's case a red and purple icon to show her normal attack and ability damage (when in range for both).

Aleonymous
01-25-2014, 03:55 PM
At this moment, I'd be more interested in accessing the Dialogue and all its assets. I know this goes to the "core" of the game (narration, branching story etc) but, hopefully, and if the game is well-structured, one could "plug-and-play" pieces of Dialogue here and there, without breaking the game.

So, what is "dialogue"? I see it as a connected series of "scenes" each one made up of:

Portraits (face & back) of the persons discussing at each scene of the dialogue. Those exist in the form of SWF files in the local data.
Back-plane of the environment where the scene takes place (e.g. forest, mead house, mountains etc). These are also found as PNG files.
Positions of portraits of speakers. This is one tricky part
Actual dialogue text and/or options. This should be found in the core game files.
Mini-icon/portrait to better distinguish speaker etc. That is also found in the form of PNG images.
Camera-panning-position and/or -shift, when moving to the next dialogue scene. This is another tricky part.

So, having the above "assets" as well as the "program" that puts them together & runs*** them, could help make our own dialogue scenes :)

***Battle is made in a similar manner, using as "assets" the map/floor, the tile-grid overlap, the unit-sprites, the stat-banners, the various UI & HUD items etc. Evidently, the "program" that runs the battle is MUCH more complicated a program than dialogue! Tweaking that one is, for me, out of the question. But, dialogue...?

Jawbone78
01-26-2014, 11:34 AM
At this moment, I'd be more interested in accessing the Dialogue and all its assets. I know this goes to the "core" of the game (narration, branching story etc) but, hopefully, and if the game is well-structured, one could "plug-and-play" pieces of Dialogue here and there, without breaking the game.

So, what is "dialogue"? I see it as a connected series of "scenes" each one made up of:

Portraits (face & back) of the persons discussing at each scene of the dialogue. Those exist in the form of SWF files in the local data.
Back-plane of the environment where the scene takes place (e.g. forest, mead house, mountains etc). These are also found as PNG files.
Positions of portraits of speakers. This is one tricky part
Actual dialogue text and/or options. This should be found in the core game files.
Mini-icon/portrait to better distinguish speaker etc. That is also found in the form of PNG images.
Camera-panning-position and/or -shift, when moving to the next dialogue scene. This is another tricky part.

So, having the above "assets" as well as the "program" that puts them together & runs*** them, could help make our own dialogue scenes :)

***Battle is made in a similar manner, using as "assets" the map/floor, the tile-grid overlap, the unit-sprites, the stat-banners, the various UI & HUD items etc. Evidently, the "program" that runs the battle is MUCH more complicated a program than dialogue! Tweaking that one is, for me, out of the question. But, dialogue...?

I have built a simple editor that allows you to open, edit, and save any "*.json.z" file. I've poked around the various bits, and I haven't quite figured out how exactly the scenes work. I think I have an idea, but it winds up being a pretty complicated thing to edit when you're just using that simple JSON editor (because you have to manually hunt in various files for things to change - no "search" or "link to" functionality). I'm thinking about uploading it somewhere, but I'm also thinking about working on a more advanced editor of some kind. Also, I haven't tested what happens in the game (if anything) when you actually edit those files - though I gather that they are the actual files loaded by the game. Also, the editor doesn't allow you at this time to add new properties, so you can really only edit what's already there.

If there's interest, I might upload the editor somewhere "as-is". But I spent most of my free time yesterday working on it (and learning Flex/AS3), so I may not be able to do that soon.

Aleonymous
01-26-2014, 02:17 PM
I have built a simple editor that allows you to open, edit, and save any "*.json.z" file. I've poked around the various bits, and I haven't quite figured out how exactly the scenes work. I think I have an idea, but it winds up being a pretty complicated thing to edit when you're just using that simple JSON editor (because you have to manually hunt in various files for things to change - no "search" or "link to" functionality). I'm thinking about uploading it somewhere, but I'm also thinking about working on a more advanced editor of some kind. Also, I haven't tested what happens in the game (if anything) when you actually edit those files - though I gather that they are the actual files loaded by the game. Also, the editor doesn't allow you at this time to add new properties, so you can really only edit what's already there.

If there's interest, I might upload the editor somewhere "as-is". But I spent most of my free time yesterday working on it (and learning Flex/AS3), so I may not be able to do that soon.

Interesting progress, Jawbone. I'd like to get my paws on that editor! Do you think that it will be usable by an amateur (without access to fancy software) such as myself?

Concerning how dialogue & scenes work, I guess some input from John would be really appreciated here... So, these .JSON.Z files, are like Java-scripts/programs that call-up this-and-that? I fear that a lot of delving will have to be done, unless there is some master script that "rules them all" :)

John
01-26-2014, 04:45 PM
Mierko -- JPEXS was sometimes unable to load the SWF on first try, but retrying it (e.g. drag-and-dropping the SWF on the program's window once it opened) usually solved that. I think that, what John means with



is that you can't "see" the SWF's animations/contents by opening them with a simple web browser. You need to open them with a dedicated SWF-handling software, and check the file's "library", where all the assets (frames, sprites, objects, instances etc.) are stored.

John -- Seeing no sprite-sheets in the Factions files, I assume the SWFs are used there. I wonder why did you go a different way with the two games, when it all seems to be the same art? Is it a security, stability or performance issue?

The Factions engine is almost a year old at this point -- lots of things are different. In Factions it generates the sprite sheets in memory on the fly when you load a battle map. In Saga we pre-generate them as part of the compile process (to improve load times).

Regarding the 'Library' in the SWF. There are a bunch of MovieClip classes that are exported by name for loading in AS3. They are seen at the right of the screenshot attached. The main stage of the SWF is empty. In the FLA you see the main stage layers are both flagged as 'guides' and are not included in the published SWF.

194

Jawbone78
01-26-2014, 04:46 PM
Interesting progress, Jawbone. I'd like to get my paws on that editor! Do you think that it will be usable by an amateur (without access to fancy software) such as myself?

Concerning how dialogue & scenes work, I guess some input from John would be really appreciated here... So, these .JSON.Z files, are like Java-scripts/programs that call-up this-and-that? I fear that a lot of delving will have to be done, unless there is some master script that "rules them all" :)

JSON is "JavaScript Object Notation". It's just a fancy way of saying "data". They aren't programs - they're more like the data that the programs run off of. For example, a (very) stripped down representation of Gunnulf:



{
"entityClass": "warhawk",
"id": "gunnulf",
"stats": [
0: {
"stat": "STRENGTH",
"value": 15
},
1: {
"stat": "ARMOR",
"value": 7
},

etc...

]
}


Theoretically I could use my editor to change all kinds of things about him - his starting stats, his min/max stats, etc. Again, I haven't actually tested what would happen if I edited any of those values.

As for conversations, in assets/saga1/convo/ there are a bunch of what appear to be conversations. Open part1/cnv_chat_meadfight.json.z and you see:



{
"title": "1 chat meadfight",
"url_key": "wbv2",
"data": {
"initial": "skipMarknarrator",
"stitches": {
"eirikNarratorCan": {
"content": [
0: "[eirik narrator] Can I ask one more favor?",
1: {
"ifConditions": ,
"linkPath": "eirikAlrightThen",
"notIfConditions": ,
"option": "No, Eirik, I've done enough already"
},
2: {
"ifConditions": ,
"linkPath": "eirikIfYouHappen",
"notIfConditions": ,
"option": "What is it?"
}
]
},
"eirikAlrightThen": {
"content": [
0: "[eirik] Alright then, do as you please. Time to go, Valgard.",
1: { "divert": "eirikHaveYoulGue" },
2: { "flagName": "1 eirikdissed" },
3: { "ifCondition": "1 strandmeadfight" }
]
},
"eirikIfYouHappen": {
"content": [
0: "[eirik] If you happened to stall our guests down on the docks, I wouldn't object.",
1: { "divert": "narratorMaybeIWi" },
2: { "flagName": "1 eirikdissed=0" }
]
},

etc...

}
}


Each "stitch" appears to be a single line in a conversation, and they're strung (or stitched?) together by following one to the other. I haven't made sense yet of how the ifConditions and flagNames work (though it's obvious what they're for), because a lot of this stuff is spread out among multiple files and right now I can really only look at one at a time.

John
01-26-2014, 04:57 PM
At this moment, I'd be more interested in accessing the Dialogue and all its assets. I know this goes to the "core" of the game (narration, branching story etc) but, hopefully, and if the game is well-structured, one could "plug-and-play" pieces of Dialogue here and there, without breaking the game.

So, what is "dialogue"? I see it as a connected series of "scenes" each one made up of:

Portraits (face & back) of the persons discussing at each scene of the dialogue. Those exist in the form of SWF files in the local data.
Back-plane of the environment where the scene takes place (e.g. forest, mead house, mountains etc). These are also found as PNG files.
Positions of portraits of speakers. This is one tricky part
Actual dialogue text and/or options. This should be found in the core game files.
Mini-icon/portrait to better distinguish speaker etc. That is also found in the form of PNG images.
Camera-panning-position and/or -shift, when moving to the next dialogue scene. This is another tricky part.

So, having the above "assets" as well as the "program" that puts them together & runs*** them, could help make our own dialogue scenes :)

***Battle is made in a similar manner, using as "assets" the map/floor, the tile-grid overlap, the unit-sprites, the stat-banners, the various UI & HUD items etc. Evidently, the "program" that runs the battle is MUCH more complicated a program than dialogue! Tweaking that one is, for me, out of the question. But, dialogue...?

All the conversation dialog (and poppenings dialog in the red window) is driven by a branching story format exported from InkleWriter:

http://writer.inklestudios.com/

For example look at the contents of assets/saga1/convo/part1/cnv_chat_bersi1.json

At the bottom of the json file you see a "url_key", in this case:



"title": "1 chat bersi1",
"updated_at": "2013-10-07T22:29:31Z",
"url_key": "3m5v"


To view that story in Inkle, put the url_key into this url as follows:

http://writer.inklestudios.com/stories/3m5v

When you are finished with your Inkle story, you can get the .json data by adding .json to the url like this:

http://writer.inklestudios.com/stories/3m5v.json

There are lots of tags and markup used in the Inkle story that are specific to TBS. For instance the speaker is indicated in square brackets:

"[Bersi] I robbed well-protected merchants..."

Means Bersi is talking, and we are looking at him.

"[Bersi hakon] Assume I'm looking out for myself a..."

Means Bersi is talking but the camera is looking at hakon

John
01-26-2014, 05:05 PM
The overall logic of the game flow is driven by 'Actions', 'Happenings', 'Triggers', and 'Variables'. You can think of these as a sort of high level scripting language.

Happenings are found in the 'saga1.json' file. These contain the global happenings and triggers that function game-wide.

Happenings are also found in scene files, and those happenings typically only have meaning in the context of the scene.

For example, here is an abridged version of the 'bk_1_start' happening in saga1.json which starts the game from the beginning:



{
"actions": [
{
"id": "narratorcaravan",
"type": "CARAVAN"
},
{
"type": "VARIABLE_SET",
"varname": "camp_music_suppressed",
"varvalue": 1
},
{
"time": 40,
"type": "FLASH_PAGE",
"url": "saga_titles.swf/assets.text_page_startup"
},
{
"subtitle": "common/locale/en/tutorial_intro_video1.sbv.z",
"type": "VIDEO",
"url": "common/video/tutorial_intro_video1.mp4"
},
{
"type": "PARTY_CLEAR"
},
{
"also_party": true,
"id": "shieldbanger_tut",
"type": "ROSTER_ADD"
},
{
"also_party": true,
"id": "warhawk_tut",
"type": "ROSTER_ADD"
},
{
"assemble_heroes": false,
"restore_scene": false,
"scene": "saga1/scene/part1/btl_tut_greathall/btl_tut_greathall.json.z",
"type": "BATTLE"
},
{
"id": "shieldbanger_tut",
"type": "ROSTER_REMOVE"
},
{
"id": "warhawk_tut",
"type": "ROSTER_REMOVE"
},
{
"subtitle": "common/locale/en/tutorial_intro_video2.sbv.z",
"type": "VIDEO",
"url": "common/video/tutorial_intro_video2.mp4"
},
{
"happening": "bk_1_strand",
"prereqs": [
{
"varname": "fa2013",
"varvalue": 0
}
],
"type": "HAPPENING"
}
],
"id": "bk_1_start"
},


In english, what is happening is this:

- Set the active caravan to 'narratorcaravan' defined elsewhere
- suppress the random camp music
- show a flash movieclip for 40 seconds
- show a mp4 video until complete
- clear the party
- add the tutorial shieldbanger and warhawk to the party
- load a battle scene until complete
- remove the tutorial units from the roster (and party)
- play another mp4 video until complete
- execute another happening, called 'bk_1_strand'

Aleonymous
01-26-2014, 06:02 PM
John... Thank you kind sir! :) It's so awesome to see how a game is made, bottom-up!

I'm gonna need time to digest all this new information.

Mierko
01-26-2014, 09:29 PM
@ John:
Is there any chance you would be willing to share how you exported your sprite sheets? I have had some time today to do some test exports with flash and Texture Packer but I haven't been able to match with either.

Adding masks to most cycles are quite easy but then there are beast sheets like a death animation... I cringe at the thought of matching it frame by frame.

@ Jawbone:
Hook us up with that editor!

I have updated the hero portrait swf for Egil and it isn't showing up in the Roster screen. The dialogue png worked fine (rear view), but the portrait swf isn't working for the front view and the roster screen.

I will update the portrait swf and test it in the roster and dialogue sequence after work tonight.

What you laid out and John expanded upon is awesome news. Thanks so much!

livetele
01-30-2014, 11:02 AM
hi if you want extract *.fsb file use fsb extractor ( http://aezay.site11.com/aezay/fsbextractor/ ) or FSB files extractor 0.3.2a ( http://aluigi.altervista.org/papers.htm#fsbext )

livetele
01-30-2014, 02:17 PM
hi, i figure out how uncompress json.z files, but now i encounter a 2nd problem, parsing are not good, any advise ?

http://www.zimagez.com/miniature/tbs.png (http://www.zimagez.com/zimage/tbs.php)

Mierko
01-31-2014, 02:11 AM
Unable to rebuild portrait SWFs
I am able to view the new portrait SWF just fine outside of the game, but once I replace it in the folder Egil is missing from the dialogue and roster screens. The symbols of the library have only had their fill color swapped and it is unchanged apart from the egil png, but I renamed my file to match the original from the library and it replaces it.

I assume that I have to reattach the action scripts to the updated FLA. The original SWF is 331kb and the recolor is only 111kb, so it only makes sense. I don't know how to reattach the actionscript since I don't really know much about flash let alone AS3. I am a 3D artist so this is a bit out of my wheelhouse.

I will do some research into it tomorrow. I assume that I would just make an 'Actions' Layer and link all the actionScripts to frame 1, but that is just a guess. If anyone with Flash experience can chime in it would be appreciated.

Thanks!

John
01-31-2014, 12:04 PM
It looks like the contents are decompressed but not demarshalled from the packed as3 representation.

Check out my post here:

http://stoicstudio.com/forum/showthread.php?2038-Modding-Can-we-have-it&p=27056&viewfull=1#post27056



hi, i figure out how uncompress json.z files, but now i encounter a 2nd problem, parsing are not good, any advise ?

http://www.zimagez.com/miniature/tbs.png (http://www.zimagez.com/zimage/tbs.php)

John
01-31-2014, 12:11 PM
The AS3 in the portraits is very minimal, and auto-generated. There should be no AS3 on the timelines.

The important thing is that the library symbol to be rendered in-game must be exported as a class called "portrait" which derives from MovieClip. This may be getting stripped out in your processing.
196
The attached screenshot shows how it is setup in Flash.


Unable to rebuild portrait SWFs
I am able to view the new portrait SWF just fine outside of the game, but once I replace it in the folder Egil is missing from the dialogue and roster screens. The symbols of the library have only had their fill color swapped and it is unchanged apart from the egil png, but I renamed my file to match the original from the library and it replaces it.

I assume that I have to reattach the action scripts to the updated FLA. The original SWF is 331kb and the recolor is only 111kb, so it only makes sense. I don't know how to reattach the actionscript since I don't really know much about flash let alone AS3. I am a 3D artist so this is a bit out of my wheelhouse.

I will do some research into it tomorrow. I assume that I would just make an 'Actions' Layer and link all the actionScripts to frame 1, but that is just a guess. If anyone with Flash experience can chime in it would be appreciated.

Thanks!

Mierko
02-01-2014, 01:00 AM
The AS3 in the portraits is very minimal, and auto-generated. There should be no AS3 on the timelines.

The important thing is that the library symbol to be rendered in-game must be exported as a class called "portrait" which derives from MovieClip. This may be getting stripped out in your processing.
196
The attached screenshot shows how it is setup in Flash.
I double checked it and the class is unchanged, but the base class is blank. I have tried resetting it to "flash.display.MovieClip", leaving it blank and changing it to "portrait" to match the class and in all three cases it still doesn't load in game. Really odd. I am sure I am missing something obvious. I will try again either tomorrow or Sunday.

Any chance you could tell me how you generated the animation sprite sheets? I have tried Texture Packer and Flash itself but neither match the sheets in game. Thanks!

John
02-01-2014, 12:23 PM
The sprite sheets are generated with custom code... and it is too much code to paste in any meaningful way. I am working on prepping some of our tools so that they can be used externally, which will allow you to compile and test sprite sheet animations. I don't know when that will be ready, though.


I double checked it and the class is unchanged, but the base class is blank. I have tried resetting it to "flash.display.MovieClip", leaving it blank and changing it to "portrait" to match the class and in all three cases it still doesn't load in game. Really odd. I am sure I am missing something obvious. I will try again either tomorrow or Sunday.

Any chance you could tell me how you generated the animation sprite sheets? I have tried Texture Packer and Flash itself but neither match the sheets in game. Thanks!

Aleonymous
02-01-2014, 02:07 PM
I am working on prepping some of our tools so that they can be used externally, which will allow you to compile and test sprite sheet animations. I don't know when that will be ready, though.

That is fantastic news, John! :)

I do hope those "tools" will be handle-able by rank-1 users (i.e., of low tech skill, like myself), and will not demand that $oftware ...

Mierko
02-01-2014, 09:27 PM
The sprite sheets are generated with custom code... and it is too much code to paste in any meaningful way. I am working on prepping some of our tools so that they can be used externally, which will allow you to compile and test sprite sheet animations. I don't know when that will be ready, though.
Wow, that would be amazing! We all know how busy you guys have been so it is incredible that you have any time to support tools for the community. I had a feeling it that your sprite sheets were generated by your own code.

This is wonderful news thanks for sharing!

livetele
02-02-2014, 05:50 AM
Mierko > perphas you can use this for help to understand : http://labs.adobe.com/downloads/swfinvestigator.html
John > "not demarshalled from the packed as3 representation" So complexe ( i am not big fan of as3 ), any other solution ?

cleerxer
02-02-2014, 09:25 AM
It looks like the contents are decompressed but not demarshalled from the packed as3 representation.

Check out my post here:

http://stoicstudio.com/forum/showthread.php?2038-Modding-Can-we-have-it&p=27056&viewfull=1#post27056

Can you give us a little tutorial or something, how can we use that code to decompile the json files?

John
02-03-2014, 01:46 PM
Can you give us a little tutorial or something, how can we use that code to decompile the json files?

I've written an app that allows you to open and edit the compressed json files. It's called "TBS Decompiler". The install file is here: https://github.com/jwatson000/tbsdec/raw/master/TBS_Decompiler.air

When you launch the app, it will automatically look in the default locations for your Steam TBS install. If it can't find your TBS install, it will ask you to locate it's assets folder.

Whenever you first save a modified file, the tool will save a "*.orig" copy of the unmodified file. You can copy these back over the modified files if you want. You can also open the "*.orig" files in the tool, and hit "Save" to restore the original file.

The source code is on github if anyone would like to inspect, modify, or contribute:

https://github.com/jwatson000/tbsdec

Aleonymous
02-03-2014, 03:12 PM
I've written an app that allows you to open and edit the compressed json files. It's called "TBS Decompiler".

Wiztastic :) Thanks a million John!

So, if I get this right all those JSON files are mostly data, like "text registers". Arg... Pointers within pointers within pointers... That's were it all boils down in game design, it seems! :) I was wondering if we could tweak the core combat-mechanics through editing those files, e.g. how Battering Ram or miss-chance works. I presume that's much more complicated, so there's other type of code/files/binaries for that.

Interestingly, seems like all your localization data is stored in one big file, at: \SteamLibrary\SteamApps\common\tbs\assets\common\l ocale\en\en.json.z. That file holds descriptions of items, map locations, tool-tip info and so an and so forth. That makes it so much easier for user-based translations. The file is about 7,800 lines long containing about 1,500 entries that would require translation, right? And that excludes the actual dialogue lines...

John
02-03-2014, 04:04 PM
Wiztastic :) Thanks a million John!

So, if I get this right all those JSON files are mostly data, like "text registers". Arg... Pointers within pointers within pointers... That's were it all boils down in game design, it seems! :) I was wondering if we could tweak the core combat-mechanics through editing those files, e.g. how Battering Ram or miss-chance works. I presume that's much more complicated, so there's other type of code/files/binaries for that.

Interestingly, seems like all your localization data is stored in one big file, at: \SteamLibrary\SteamApps\common\tbs\assets\common\l ocale\en\en.json.z. That file holds descriptions of items, map locations, tool-tip info and so an and so forth. That makes it so much easier for user-based translations. The file is about 7,800 lines long containing about 1,500 entries that would require translation, right? And that excludes the actual dialogue lines...

Yes, all strings are stored in en.json. I'm modifying that arrangement a bit though, before sending it off to be translated. en.json plus the dialog lines comes to about 100,000 words of text.

If you want to modify the abilities, you can do so in the various ability json files, e.g. abl_batteringram.json.z

However it is data driven so you can only tweak parameters or add new operations that are defined in code. The ability system is quite robust, but the ability json files might be a little confusing without documentation.

Kuba
02-03-2014, 04:46 PM
As Aleo said, thanks a lot John. It is fantastic, I have already learned lot about game just by browsing the files. It is very useful for wiki too :).

Aleonymous
02-03-2014, 05:25 PM
If you want to modify the abilities, you can do so in the various ability json files, e.g. abl_batteringram.json.z

However it is data driven so you can only tweak parameters or add new operations that are defined in code. The ability system is quite robust, but the ability json files might be a little confusing without documentation.

A quick browsing through the files gives the impression that all ability-things are all neatly tidied-up and structured; I expected nothing less! :) A lot of the code seems like it's aimed for synchronizing the sprites and other audiovisual elements related to the abilities. So, I daresay that "simple" modifications (like adjusting BoP range or HI echo damage etc.) would be quite easy to put. What I found to be most troublesome (when working on that crude TBSF-simulator/AI project (http://stoicstudio.com/forum/showthread.php?1863-Towards-a-Factions-AI-Part-A-Simulator-for-Rank-0-units)) was, actually, anything related to positioning and movement!So, Knock-back, Battering-Ram, Arc-Lightning & Tempest should have been the trickiest to implement...

Anyway, thanks again for the support, John. Hope our fiddling with these files proves somehow beneficial for you guys too! (you never know ;)).

Mierko
02-04-2014, 12:31 AM
Kudos John. This is awesome!

So custom items in the shop are available if we did something along the lines of...

"icon": "common/item/icon/itm_custom.png",
"id": "itm_custom",
"rank": X,
"statmods": [
{
"amount": X,
"stat": "STAT_NAME"
},
{
"amount": X,
"stat": "STAT_NAME"
}
]
},
{

cleerxer
02-04-2014, 08:32 AM
Awesome. Thank you very mush.

John
02-04-2014, 12:45 PM
Yep, adding or modifyig items should be very easy.


Kudos John. This is awesome!

So custom items in the shop are available if we did something along the lines of...

"icon": "common/item/icon/itm_custom.png",
"id": "itm_custom",
"rank": X,
"statmods": [
{
"amount": X,
"stat": "STAT_NAME"
},
{
"amount": X,
"stat": "STAT_NAME"
}
]
},
{

Teomus
02-04-2014, 01:42 PM
Dear John,

I'm a huge fan of your game and I'm a hungarian hobby game translator, so I'd like to make a localization for The Banner Saga too.
Thank you very much for your app, it's working perfectly, but I have some problem with the files...
I can't find the files what contain the texts for the intro: "The gods are dead..." and the subtitle "It has been several long months on the road...".
Thank you if you can help me!

Best regards,
Teomus

John
02-04-2014, 01:44 PM
The subtitle localizations are in .sbv.z files. They are located in saga1/locale/en/

Unfortunately, the tool does not support opening those files. I will add a feature for that today.

JW



Dear John,

I'm a huge fan of your game and I'm a hungarian hobby game translator, so I'd like to make a localization for The Banner Saga too.
Thank you very much for your app, it's working perfectly, but I have some problem with the files...
I can't find the files what contain the texts for the intro: "The gods are dead..." and the subtitle "It has been several long months on the road...".
Thank you if you can help me!

Best regards,
Teomus

John
02-04-2014, 02:16 PM
New version is up on github, including SBV support:

https://github.com/jwatson000/tbsdec/raw/master/TBS_Decompiler.air

Aleonymous
02-07-2014, 07:51 AM
I was wondering if there is a simple/straight/clean-through modification of a JSON file that would increase the game difficulty all-over. Like, add more (or higher-statted) enemies at all battles, in a consistent manner.

If you have a dedicated "metric module" that, before each battle, looks at your build and generates a random enemy-build of approximately the desired power (for a given difficulty setting), then, tweaking a parameter of this module would affect the game difficulty globally, right? However, if the enemy-build in each battle is designed and balanced stand-alone/directly, for each of the three difficulty settings, then... forget it! :D

Sin2x
02-07-2014, 10:43 AM
I was wondering if there is a simple/straight/clean-through modification of a JSON file that would increase the game difficulty all-over. Like, add more (or higher-statted) enemies at all battles, in a consistent manner.

If you have a dedicated "metric module" that, before each battle, looks at your build and generates a random enemy-build of approximately the desired power (for a given difficulty setting), then, tweaking a parameter of this module would affect the game difficulty globally, right? However, if the enemy-build in each battle is designed and balanced stand-alone/directly, for each of the three difficulty settings, then... forget it! :D

There is a parameter called war_threat in the gamefiles, might be what you are looking for. Check the files in /convo/war folder.

John
02-07-2014, 02:47 PM
Here's a quick rundown of how battle difficulty works. First of all, there are 2 kinds of combats: BATTLE and WAR. Let's talk about BATTLE.

BATTLE is instigated from a BATTLE action in the script. One of the parameters of the action is "bucket". This "bucket" indicates the bucket of NPC AI enemies to spawn. For instance, the only BATTLE in vlg_strand.json is the one in the Nobleman meadhouse. It's "bucket" is set to "1_thugs". If you look in saga1.json, you see "1_thugs" defined as:



{
"ents": [
"thug_thrasher",
"thug_backbiter",
"thug_raider_a",
"thug_raider_b"
],
"name": "1_thugs"
},

How many units does it spawn from the bucket? That depends on a variable called "danger", which ranges from 1-20. The variable is defined in the "variables" section of saga1.json. The battle spawns a units until the sum of their ranks equals the "danger". So a "danger" of 10 could spawn 2 rank 3s, 1 rank 2 and 2 rank 1s, for example. Danger changes throughout the game based on your location an

Now, before the battle starts, "danger" is modified by a few things. First, there is a difficulty modifier. This is defined in saga1.json:



"difficulties": [
{
"armor": -3,
"danger": -1,
"strength": -2
},
{
"armor": 0,
"danger": 0,
"strength": 0
},
{
"armor": 1,
"danger": 3,
"strength": 1
}
],


They are in order of Easy, Normal, Hard. You see that in Hard mode, danger is increased by 3 under the hood. All AI enemies also have an extra armor, and extra strength point. So a very easy way to change difficulty globally is to adjust the difficulty settings above.

1 additional factor affects battle danger under the hood, and that is the number of combatants in your caravan. If you have lots of fighters and varl, the danger decreases. This is controlled by a variable 'danger_bonus_combatants', which is defined in saga1.json, and ranges from -2 to +2.

It changes based on a happening in saga1.json, apparently whenever morale changes, which is probably a bug. It should recompute when num_combatants changes:



{
"actions": [
{
"prereqs": [
{
"max": 100,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants",
"varvalue": 2
},
{
"prereqs": [
{
"max": 300,
"min": 101,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants",
"varvalue": 1
},
{
"prereqs": [
{
"max": 699,
"min": 301,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants"
},
{
"prereqs": [
{
"max": 899,
"min": 700,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants",
"varvalue": -1
},
{
"prereqs": [
{
"max": 100000000,
"min": 900,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants",
"varvalue": -2
}
],
"id": "danger_bonus_combatants",
"triggers": [
{
"type": "VARIABLE_INCREMENT",
"varname": "morale",
"varvalue": 0
}
]
},


From the above, you can see that:



num_combatants danger_bonus_combatants
0-100 +2
101-300 +1
301-699 +0
700-899 -1
900-inf. -2


The other kind of combat is the WAR, which I will describe elsewhere. In WAR you can modify your danger by your tactical choices before the battle starts. The modifiers of your choices are defined in cnv_war.json

If you choose to "Charge!" for instance, this path gets executed:



"youGatherYourAll": {
"content": [
"You gather your allies and tell them to get ready to lead the attack.",
{
"flagName": "war_battle"
},
{
"flagName": "war_danger+(1,3)"
},
{
"flagName": "war_threat-(2,4)"
},
{
"flagName": "war_renown+(1,3)"
}
]
},


Which means you get a danger bonus of between 1-3, war threat is reduced, and war renown is increased.



There is a parameter called war_threat in the gamefiles, might be what you are looking for. Check the files in /convo/war folder.

John
02-07-2014, 02:52 PM
Long story short, check the "difficulties" area in saga1.json


I was wondering if there is a simple/straight/clean-through modification of a JSON file that would increase the game difficulty all-over. Like, add more (or higher-statted) enemies at all battles, in a consistent manner.

If you have a dedicated "metric module" that, before each battle, looks at your build and generates a random enemy-build of approximately the desired power (for a given difficulty setting), then, tweaking a parameter of this module would affect the game difficulty globally, right? However, if the enemy-build in each battle is designed and balanced stand-alone/directly, for each of the three difficulty settings, then... forget it! :D

Sin2x
02-07-2014, 02:56 PM
You're awesome as always, John. Thanks a lot for this detailed description! Good thing that it helped to uncover a bug, too :)

Aleonymous
02-07-2014, 05:54 PM
Long story short, check the "difficulties" area in saga1.json

Thanks again, John, for taking the time to break this down for us :)

So, you have integrated an over-ruling difficulty-parameter called "danger" that varies from 1-20 and can be related to the team power. What is not clearly stated is how is the number of spawned foes calculated (RNG or look-up?) and how are 1x1 Dredge "weighted" w.r.t. 2x2 ones. This is rather critical because, for example, { three rank-3 Scourge Destroyers , three rank-3 Enraged Grunts , nine rank-1 Slag Slingers } all amount to a dange/power of 9 but barely seem comparable, in view of Turn/Stat advantage.

The preset difficulties {Easy,Normal,Hard} correspond to a danger/power of {9,10,13} respectively; apart from that, STR & ARM bonuses/penalties are applied "horizontally" to all spawned units. Simplest course to globally give some more bite to the game is to increase the danger-modifier for a specific difficulty-setting (e.g. make the Hard's +3 a +5) and/or the bonus stats in the "difficulties" area in saga1.json.

I cannot really see why you modify the danger by the number of the caravan's combatants (fighter- & varl-population). And, I cannot see why you decrease the danger for a lot of combatants. If anything, I would expect an increase to the danger to indirectly increase the renown-gained and the risk casualties to weight heavier on the decision.

Another last thing, about combat difficulty, that I'd like to ask is -- How are the deployment-zone "styles" (opposite, diagonal, surrounded, surrounding, checkers etc) related to difficulty/danger?

Sin2x
02-08-2014, 07:15 AM
John, if you are not too busy, would you mind adding the search functionality to the Decompiler? It's not that convenient to browse through large files like saga1.json.z when you need to find something specific, though you can always select all text and paste it into another textfile, of course.

Aleonymous
02-08-2014, 10:12 AM
John, if you are not too busy, would you mind adding the search functionality to the Decompiler? It's not that convenient to browse through large files like saga1.json.z when you need to find something specific, though you can always select all text and paste it into another textfile, of course.

Indeed: an integrated find/search/replace would help. Copy-pasting to npp is what I'm doing too. Another really useful feature would be "code-folding" (e.g. between curly-braces {.}) to browse through big files.

fall_ark
02-08-2014, 02:47 PM
I cannot really see why you modify the danger by the number of the caravan's combatants (fighter- & varl-population). And, I cannot see why you decrease the danger for a lot of combatants. If anything, I would expect an increase to the danger to indirectly increase the renown-gained and the risk casualties to weight heavier on the decision.

Encouraging you to save more combatants, I assume. Else you could just let everyone die and have an easier time.

Which means that if you charge into every war (as Hakon), you'll have easier battles later on. If you sit out a few battles, then latter battles becomes much harder. The indirect renown gained from killing enemies does drop though....

Aleonymous
02-08-2014, 04:10 PM
I understand the rationale, but in the end this just limits your potential renown-gain from Wars, why doesn't make too much sense. If you got a large army and manage it well, you should be earning more renown not less.

I'd have left the danger (i.e. the enemy force numbers/power) unaffected by combatants, and give some other type of bonus, e.g. more renown if you win or less casualties.

Mierko
02-08-2014, 08:06 PM
John, if you are not too busy, would you mind adding the search functionality to the Decompiler? It's not that convenient to browse through large files like saga1.json.z when you need to find something specific, though you can always select all text and paste it into another textfile, of course.

I have just been copy/pasting it into notepad++, since it has "Find all in current document". Having a separate window with the line numbers makes things much easier to change.

John
02-10-2014, 01:29 PM
FWIW guys you probably want to know about developer mode. Check out this document:

https://docs.google.com/document/d/1xXKMaroP1t18BXEKrl0YpFamg-ZN8wPk-vTt0rAq53M/edit?usp=sharing

Aleonymous
02-10-2014, 02:24 PM
FWIW guys you probably want to know about developer mode. Check out this document:

https://docs.google.com/document/d/1xXKMaroP1t18BXEKrl0YpFamg-ZN8wPk-vTt0rAq53M/edit?usp=sharing

Thanks, once again, John. This developer/console mode will prove very useful in breaking the game :D

ServantRider
02-16-2014, 07:46 AM
I don't mod myself, but I enjoy playing various mods that players come up with in many of the games I own.

You definitely deserve HUGE thank you for taking your personal time to help modders learn, John! <3

joko
02-28-2014, 03:09 AM
Hm, anyone have any idea where to access the audio files?

livetele
03-01-2014, 05:51 PM
joko > looks page 3 my post about audio files ;)

Aleonymous
03-05-2014, 09:05 AM
Hello all. This thread is a little dead ever since John left it, so I figured I might throw some life back into it.

So, I was meaning to see how the entire game is structured, with all the {events, converstation, battles, traveling, cinematics} etc. I believe that I should be looking at the file saga1.json.z, that I will call the "master script", in the sense that it ties everything together. So, what can we find in that master-script:


buckets -- Here are the "pools" of enemy-unit-types from which each random battle enemy build is generated.
caravans -- This defines the ~6 different caravans seen through the game (party members, leaders etc).
difficulties -- This is the overruling parameters for the game's three difficulty settings, related to battles (
happenings -- This is the most important part of the master-script. Here are contained all the various "events" that might come to pass: from random-encounters, to units joining/leaving the caravan, to popups about morale falling etc. This is obviously re-usable code bits, to be invoked whenever needed. Every event has is own "id" tag, and it might change some of the game's variables (see next bullet) and/or direct the game-flow to some other event/conversation/battle etc.
variables -- This is the second most important part of the master-script. It defines ALL the variables used in the game to check events and direct the "flow". For instance, there could be variables for the game overall-difficulty, for the specific difficulty of a battle, for the renown currently owned, "flags" signifying if another event has been triggered (e.g. "Onef Joined" = true or false?) etc etc.

Some other (minor) data are contained in the master-script, for instance the locations of the json.z files where other info is kept, e.g. the stat-costs, the ability-parameter-modifiers, the classes, the characters etc. Why aren't those included in this file too? I mean, this is already so big (~6000 lines) that a couple-thousand-lines more wouldn't hurt! :D

Now, apart from the master-script, there's also many other separate files (mini-programs or -scripts) that hold & drive the code for miscellaneous stuff, like: battles (boards, tiles, deployment zones, enemy spawn locations), conversations (characters participating, backgrounds, sentences spoken, options given etc), caravan pop-up events, camping/village/town interfaces etc. Some of those mini-programs (hereafter called "misc scripts") might contain re-usable code, but most of those are "traversed" only once in the game's course (e.g. particular conversations or battles).

I have not looked into that yet, but I believe that the game-flow is passed to-and-from the master-script and those misc-scripts, while all of them have access to the global game-variables that mainly control the game-flow.

This is just an attempt to understand how the game is executed "as a program". Please correct me where I'm wrong! :cool:

--Aleonymous

Aleonymous
03-08-2014, 06:28 AM
Speaking of Saga modding, my thought logically drifted towards Factions "modding" too... Don't be afraid, no hacking here! :D

So, my question is this: Will meddling with the units' color variations make those changes visible just to me, and not to my opponent? Say, for example, that I haven't bought any Thrasher color-variations, so I always see my TH dressed in the default beige. If I go in the game files and "swap" (i.e. rename) the default beige clothes with the red ones, then, will my TH appear, to me only, as red? For the record, unit colors are simply coded with numbers, e.g. (for Thrasher) 0=Beige, 1=Green, 2=Red.

Aleonymous
03-11-2014, 05:25 AM
For those interested, "modding" can be used to craft your own banner/crest. It seems that all banners are generated ad-hoc from:


The black-and-white crest design. This is locally stored (in the game-client files) in PNG format, and is thus editable/replace-able anytime.
A JSON.Z file that contains all entries of the submitted banners to be generated. Each entry has several parameters like: the type of banner chosen (from the 10-15 predetermined ones -- they can also be edited...), the color of the crest, potential filters (blend/add/overlay/multiply) etc.

So, you can either edit one already existing submission. For instance, if you like the design and colors chosen, you can just edit/replace the BW crest with one of your liking. Or, you can create your own "submission", but in this case you'll have to manually add your entry in the JSON.Z file. It's not so difficult; I'm planning to do mine soon! :)

EDIT -- I will provide more details on this once I complete my "submission" ;)

Mierko
03-12-2014, 01:51 AM
Speaking of Saga modding, my thought logically drifted towards Factions "modding" too... Don't be afraid, no hacking here! :D

So, my question is this: Will meddling with the units' color variations make those changes visible just to me, and not to my opponent? Say, for example, that I haven't bought any Thrasher color-variations, so I always see my TH dressed in the default beige. If I go in the game files and "swap" (i.e. rename) the default beige clothes with the red ones, then, will my TH appear, to me only, as red? For the record, unit colors are simply coded with numbers, e.g. (for Thrasher) 0=Beige, 1=Green, 2=Red.

Changing the unit color wouldn't be very cool. Stoic released Factions for free. If you want the color swap just pay for it. They earned it.

Not saying you have nefarious intentions, but I thought this should be pointed out.

Aleonymous
03-12-2014, 03:02 AM
Changing the unit color wouldn't be very cool. Stoic released Factions for free. If you want the color swap just pay for it. They earned it.

Not saying you have nefarious intentions, but I thought this should be pointed out.

I, personally, have payed for that, as you can see in my Steam Profile (still missing those forum Steam-links, after the hacks, eh mods? :)). Besides, changing the colors the way I describe would mean that: (1) only your local-client will "see" this change, not the opponent, and, what's more, (2) it doesn't allow you to activate multiple colors on your units, i.e. ALL your Thrashers will be red instead of beige from now on.

Aleonymous
03-12-2014, 04:16 AM
Here's a fundamental bit of modding -- http://stoicstudio.com/forum/showthread.php?3160-Unlock-Tryggvi Unlocking Tryggvi! ;)

Mierko
03-23-2014, 12:53 AM
Some of the palette swaps I have used in game. One of them is the Tutorial Raider who we never see after the initial training fight.

I have also attached my item icon template. Just insert your art in the top group and use the HSB Adjustment layer to update the background color.

Egil was made with a change to the .FLAs, but the Thrasher was done in photoshop so he has a little muddier line quality.

Edit: The itm_template.psd won't upload. Sorry about that.

Aleonymous
03-23-2014, 04:59 AM
Some of the palette swaps I have used in game. One of them is the Tutorial Raider who we never see after the initial training fight.

I have also attached my item icon template. Just insert your art in the top group and use the HSB Adjustment layer to update the background color.

Egil was made with a change to the .FLAs, but the Thrasher was done in photoshop so he has a little muddier line quality.

Edit: The itm_template.psd won't upload. Sorry about that.

Awesome, Mierko! You could upload your material-to-share in one of those one-click free-hosting services (mediafire etc, even dropbox does that) and post us a link here. I don't have photoshop, but I will manage!

If would be very cool if we/you could "attach" a certain palette (i.e. a set of 4-5 colors) to each unit that controls his main colors. In this way, anyone could define the color he'd like to use on his units! For example, your Thrashers in that pic you attached, could have the following color-palette {A,B,C}={Hair, Tunic, Shield}

1st thrasher: {A,B,C}={Blonde, White, Yellow}
2nd thrasher: {A,B,C}={Blonde, Grey, Yellow}
3rd thrasher: {A,B,C}={Blond, Blue-Grey, Red}

Mierko
03-23-2014, 08:19 PM
Awesome, Mierko! You could upload your material-to-share in one of those one-click free-hosting services (mediafire etc, even dropbox does that) and post us a link here. I don't have photoshop, but I will manage!

If would be very cool if we/you could "attach" a certain palette (i.e. a set of 4-5 colors) to each unit that controls his main colors. In this way, anyone could define the color he'd like to use on his units! For example, your Thrashers in that pic you attached, could have the following color-palette {A,B,C}={Hair, Tunic, Shield}

1st thrasher: {A,B,C}={Blonde, White, Yellow}
2nd thrasher: {A,B,C}={Blonde, Grey, Yellow}
3rd thrasher: {A,B,C}={Blond, Blue-Grey, Red}


I won't have the time to upload it anytime soon. I am going on vacation starting this Wednesday.

The tunics and shield are the only thing I have keyed out for the Thrashers and Egil is just the tunic and sword blade.

Aleonymous
03-28-2014, 08:55 AM
Hello John (and all),

Could you provide any information on how/if we could access or tweak the AI? I don't seem to find any relevant JSON files. Only, in some of the Dredge abilities (e.g. assets\common\ability\abl_dredge_kindle.json.z) did I find a mention on some AI parameters (e.g. "aiPositionalRule": "HIGHEST_ENEMY_THREAT"). In fact, this parameter would be the answer to the weird Stoneguard behavior that many times hurts more allies than enemies...

Thanks again!

--Aleo

John
03-28-2014, 05:38 PM
At this point all the AI parameters are global, and in code. I can move them out into a data file, which will allow them to be tweaked globally. Beyond that I could also allow overrides on a per-class or per-entity basis:

public static const WEIGHT_KILL : int = 200;
private static const WEIGHT_STAR : int = 10;
private static const WEIGHT_SELF_THREAT : Number = 0.5;
private static const WEIGHT_ENEMY_THREAT : Number = 0.25;
private static const WEIGHT_ABL_DAMAGE_STR : int = 45;
private static const WEIGHT_ABL_DAMAGE_ARM : int = 20;
private static const WEIGHT_ABL_MISSCHANCE : int = 2;
private static const WEIGHT_FRIEND_DISTANCE : int = 15;
private static const WEIGHT_MOVE : int = 2;
private static const WEIGHT_BACK_OFF : int = 60;

BTW HIGHEST_ENEMY_THREAT _should_ mean that the stoneguard tries to stand adjacent to as many of his enemies as possible. Sometimes his best option is going to include hitting his own allies.


Hello John (and all),

Could you provide any information on how/if we could access or tweak the AI? I don't seem to find any relevant JSON files. Only, in some of the Dredge abilities (e.g. assets\common\ability\abl_dredge_kindle.json.z) did I find a mention on some AI parameters (e.g. "aiPositionalRule": "HIGHEST_ENEMY_THREAT"). In fact, this parameter would be the answer to the weird Stoneguard behavior that many times hurts more allies than enemies...

Thanks again!

--Aleo

Aleonymous
03-29-2014, 05:13 AM
At this point all the AI parameters are global, and in code. I can move them out into a data file, which will allow them to be tweaked globally. Beyond that I could also allow overrides on a per-class or per-entity basis.

That would be wonderful, if its not too much of hassle! :) The first part (...move them out into a data file...) is surely the most helpful at this early stage. The second part (...allow overrides...) will be useful for a latter stage, i.e. when one has decided what his AI wants to behave like and wants to nail-it-down or tailor-it. I presume that introduction/definition of new AI parameters, for more intricate matters (e.g. calculate overall ARM-damage ratio caused by Kindle on allies and enemies), is out of question at the moment... That would require a deep understanding of all the battle-mechanics and the way they are coded.

OK, that said, I am gonna try to recap some things. Correct me when/where I am (way) wrong:

There are "action sets" defined and assessed for each unit each time it's its turn to act. An action set is something like: {move to tile W, attack enemy X, use ability Y on tile/unit Z} etc.
The "components" of each action set are separated into different categories (like the ones you listed) having to do with various battle-related aspects, like: how much damage, will an enemy be killed, where will a unit move etc.
These components are properly "weighted" to identify the "optimal" choice among the various action sets.
There are globally defined weights (for any AI-controlled unit), but they can be overridden per-class (e.g. all archers don't mind spending WP on movement) or per-entity (e.g. Stoneguard-Defenders and less likely to favor STR attacks).

You could also let us know your own jargon/lingo for the terms I devised above ("action set", "component", "weight" etc.) so as to better communicate these intricate aspects.

Alright, I re-ordered the weights-list, with higher (more important) actions coming first, while also trying to guess what they measure [and the value-range of the measured quantities].


KILL ---> Number of enemies that can be killed by STR-attack or ability [Range: 0-6]
BACK_OFF ---> (?) Retreat, change "direction" or Rest [Range: ???-???]
ABL_DAMAGE_STR ---> Points of STR-damage from regular attack (subtracting overkill-damage?) [Range: 0-1000]
ABL_DAMAGE_ARM ---> Points of ARM-damage from regular attack (subtracting SW-absorption or shieldwall/item bonus?) [Range: 0-100]
FRIEND_DISTANCE ---> Number of tile from closest ally [Range: 1-16]
STAR ---> (?) Actions: movement & attack/ability, that cost WP [Range: 0-{WP+Horn}]
ABL_MISSCHANCE ---> Percentage of miss-chance [Range:0-80]
MOVE ---> (?) Number of tiles covered in movement [Range:0-6]
SELF_THREAT ---> Exposure to damage from enemy units -- Position rule [measured in incoming STR-damage?]
ENEMY_THREAT ---> (?) How many enemies are threatened -- Position rule [measured in outgoing STR-damage?]
Evidently, killing an enemy is the topmost priority, STR-damage is preferred to ARM-damage while "Miss-chance" and "Self Threat" are not so highly esteemed.

Some last question(s), stemming from the observation that the AI acts almost instantaneously. Elaborate as much (or as little) as you can :D

How many different "action-sets" does it typically evaluate, to come up with the units final actions?
Does the AI module work only at the beginning of the AI-controlled-unit's turn, or does it also "plan ahead" while the human-player is thinking, eliminating some action-sets?
Is there any iteration-logic involved? That would allow the AI to do combos on "marked preys", e.g break with a Stoneguard then kill with a Scourge. This obviously complicates things a LOT, and would consume much more time, so my guessed answer to the initial question is: No.

YaK
03-30-2014, 07:38 AM
Hi :)
I asked before, but it probably goes lost in the discussion, since it was also a bit off-topic, so i ask again here:

John, from your word seems that there isn't any translation to Italian planned, so, would you guys at Stoic mind if me (as a member of a community that have done/revised several fanmade traslations (http://www.oldgamesitalia.net/traduzioni)), hopefully with another two or three mates, will translate the game?

I know that the files are all there, but it's our policy to NEVER translate a game if a translation is planned and to always ask for permission and, when the communication with the team is very open as with you guys, we always try to cooperate, cause we respect your work :)

Just in case, to sum up, the files with text that need to be traslated are:

*/assets/saga1/locale/en/*.sbv.z
*/assets/saga1/convo/*.json.z
*/assets/common/locale/*.*

And they are approximatively 100000 word of text, right?

Regarding this post (http://stoicstudio.com/forum/showthread.php?2038-Modding-Can-we-have-it&p=28433&viewfull=1#post28433), the arrangement of the strings stored in en.json.z?

Thank you guys!

John
03-31-2014, 12:43 AM
Italian is not in the batch of the first 6 languages we are having translated. Adding more later will depend upon the results of releasing the translated game in those 6.

I have changed the format if the conversation strings, as well as added a fair bit more strings to en.json. I have also created a system to output everything into a single CSV file localization kit. Once we get our translations back, iron out any issues, and re-import from CSV, we will update the game. I would recommend waiting until that happens before doing any translation, to prevent having to redo work. We are currently hoping to have the first 6 languages updated into the game by mid-May. In case you missed it, the first 6 languages are:

German, Russian, French, Spanish, Polish, Portuguese

And yes it is about 100k words.


Hi :)
I asked before, but it probably goes lost in the discussion, since it was also a bit off-topic, so i ask again here:

John, from your word seems that there isn't any translation to Italian planned, so, would you guys at Stoic mind if me (as a member of a community that have done/revised several fanmade traslations (http://www.oldgamesitalia.net/traduzioni)), hopefully with another two or three mates, will translate the game?

I know that the files are all there, but it's our policy to NEVER translate a game if a translation is planned and to always ask for permission and, when the communication with the team is very open as with you guys, we always try to cooperate, cause we respect your work :)

Just in case, to sum up, the files with text that need to be traslated are:

*/assets/saga1/locale/en/*.sbv.z
*/assets/saga1/convo/*.json.z
*/assets/common/locale/*.*

And they are approximatively 100000 word of text, right?

Regarding this post (http://stoicstudio.com/forum/showthread.php?2038-Modding-Can-we-have-it&p=28433&viewfull=1#post28433), the arrangement of the strings stored in en.json.z?

Thank you guys!

YaK
03-31-2014, 09:40 AM
Well, thank you for the reply, it seems we should wait and see how sell the first batch of translated game, so you could decide if you want to translate officially in more languages or give your "permission" to fan made translation :)

Aleonymous
04-08-2014, 09:52 AM
John (and modding community),

Trying to figure out how the game is structured, I ran into a small issue where I would require your assistance. Let me first state a couple of things I noticed (correct me if I am wrong):

The game uses a large set of variables (true/false flags) to control the flow and the branching of the story. Some variables are global (e.g. character-X died) while others have a more limited scope.
The "game-flow" is administered firstly by the saga1.json.z "master file", secondly it is handed down to JSON files in the \scene directory (battles, close/world-caravan, village, cinematics etc) and, thirdly, they hand it down to JSON files in the \convo directory (pop-ups options/choices, portrait-dialogues).

Now, it is my understanding that global variables can be changed while the game-flow is any JSON file (saga1, \convo or \scene). This makes it hard --for me-- to track down where is was a global variable modified. This brings me to my issue/plea:


Is there a way to "automatically generate" the full set of JSON-files "decompiled" into simple text-files, while also maintaining the directory-tree?

If we had this "text-file tree" it would easy to search for specific text-strings (e.g. variables) using advanced text-editor software. Of course, this "text-file tree" can be generated manually (1.open with your AIR-tool, 2.copy-paste into a text-file, 3.save, 4.move to next...) but there are about ~750 such files, by my count...!

Thanks again,

--Aleo

John
04-08-2014, 11:01 AM
Your 2 points are correct. The only thing I would add is that the variables are not necessarily true/false, but can also be integer or decimal values. In theory they can also be string values, but we don't use those.

I am working on a global decompiler that will be included with the Zeno tool in the next patch. When we have a build ready for testing I can give you instructions on how to beta-test it if you like. The result of the Zeno decompiler will be to generate an entire tree of decompiled source files that you can then re-compile using Zeno.



John (and modding community),

Trying to figure out how the game is structured, I ran into a small issue where I would require your assistance. Let me first state a couple of things I noticed (correct me if I am wrong):

The game uses a large set of variables (true/false flags) to control the flow and the branching of the story. Some variables are global (e.g. character-X died) while others have a more limited scope.
The "game-flow" is administered firstly by the saga1.json.z "master file", secondly it is handed down to JSON files in the \scene directory (battles, close/world-caravan, village, cinematics etc) and, thirdly, they hand it down to JSON files in the \convo directory (pop-ups options/choices, portrait-dialogues).

Now, it is my understanding that global variables can be changed while the game-flow is any JSON file (saga1, \convo or \scene). This makes it hard --for me-- to track down where is was a global variable modified. This brings me to my issue/plea:


Is there a way to "automatically generate" the full set of JSON-files "decompiled" into simple text-files, while also maintaining the directory-tree?

If we had this "text-file tree" it would easy to search for specific text-strings (e.g. variables) using advanced text-editor software. Of course, this "text-file tree" can be generated manually (1.open with your AIR-tool, 2.copy-paste into a text-file, 3.save, 4.move to next...) but there are about ~750 such files, by my count...!

Thanks again,

--Aleo

Aleonymous
04-08-2014, 11:44 AM
Your 2 points are correct. The only thing I would add is that the variables are not necessarily true/false, but can also be integer or decimal values. In theory they can also be string values, but we don't use those.

Indeed, there are the Renown/Population/Supplies/Days/Danger etc variables that are certainly non-boolean. Nevertheless, I get the impression that the variables that control the main flow are boolean (flags). Small importance! I was mainly interesting in the saga1>>scene>>convo "hierarchy/structure".


I am working on a global decompiler that will be included with the Zeno tool in the next patch. When we have a build ready for testing I can give you instructions on how to beta-test it if you like. The result of the Zeno decompiler will be to generate an entire tree of decompiled source files that you can then re-compile using Zeno.

I'd be more than happy to assist in beta-testing :D Ever since I heard about Zeno, I began wondering if the .Z extension (on .JSON files) stands for a custom Zeno-related compression scheme, or for the generic "Zip".

YaK
04-08-2014, 01:23 PM
Happy to hear that Johm, i'm really excited by the next patch, for several reasons.

Just two maybe stupid questions (i not consider myself a "modder", i just like to "mess" with gamefiles of the game i liked a lot, like The Witcher Series and Planescape:Torment):
1) I had the idea of add more "random event" spot in the game, then figure out they are in fixed location during the gameflow. Is it moddable? I cannot find the realted files.
2) The "CTRL+SHIFT+[" hotkey command, "Jump to previous location" just move my caravan at the FIRST location of the chapter i'm currently in, is it worked like intended or am i missing something?

John
04-08-2014, 01:54 PM
1. Random events are triggered from locations on the world scene travel splines. For instance, files like wld_boersgard.json contain a travel spline with locations (named "rdm_*", I think).

2. Yes, the 'jump to previous location' hotkey doesn't function in a useful way, sorry.


Happy to hear that Johm, i'm really excited by the next patch, for several reasons.

Just two maybe stupid questions (i not consider myself a "modder", i just like to "mess" with gamefiles of the game i liked a lot, like The Witcher Series and Planescape:Torment):
1) I had the idea of add more "random event" spot in the game, then figure out they are in fixed location during the gameflow. Is it moddable? I cannot find the realted files.
2) The "CTRL+SHIFT+[" hotkey command, "Jump to previous location" just move my caravan at the FIRST location of the chapter i'm currently in, is it worked like intended or am i missing something?

YaK
04-08-2014, 06:54 PM
Thanks, it is easier than one would think :)

Aleonymous
04-09-2014, 07:49 AM
I had the idea of add more "random event" spot in the game, then figure out they are in fixed location during the gameflow. Is it moddable? I cannot find the realted files.


Random events are triggered from locations on the world scene travel splines. For instance, files like wld_boersgard.json contain a travel spline with locations (named "rdm_*", I think)

So, John, you're saying that *adding* (not editing) random-events, is as simple as creating a new rdm_<name>.JSON.Z file that "respects the rules", and that's it? From what I've seen, there's at the minimum a global-variable to be defined, for that new rdm event. Do we need to "declare/include" the new rdm event somewhere else?

Now, for the event "file" itself, here's, for example, the contents of the random event saga1\convo\part8\cnv_rdm_overpop.json.z (overpopulation)



{
"created_at": "2013-12-03T00:17:22Z",
"data": {
"allowCheckpoints": false,
"editorData": {}
"initial": "convoyTheCaravan",
"optionMirroring": true,
"stitches": {
"convoyFirewoodCo": {}
"convoyTheCaravan": {}
"convoyYouSelectA": {}
"rookAnimalsAreNo": {}
"rookOurSizeCause": {}
"rookYouIgnoreThe": {}
}
},
"title": "rdm_overpop",
"updated_at": "2013-12-15T23:48:22Z",
"url_key": "xc2r"
}

The "stitches" (identified y a unique [locally?] 16-char string) seem to be the place where we'd put the new stuff (text with the event description, branching choices, "flagName"s for the events outcomes, e.g. changes in Renown/Supplies/Population etc). The starting-point of the [I]flow of this random-event is the stitch marked in the field "initial". All other fields (title, url_key, date, mirroring, checkpoints) seem trivial. Except maybe, the "editorData\playPoint" (not displayed in the code, above), that directs to another stitch; I don't understand what that does/serves/denotes...

John
04-09-2014, 03:29 PM
I mis-spoke a little about the random quest triggers. Looking at wld_boersgard.json, you see these locations:


{
"id": "random_quests",
"position": 25926
},

This refers to a trigger in saga1.json:


{
"actions": [
{
"happening": "random_refugees",
"prereqs": [
{
"varname": "rdm_refugees",
"varvalue": 0
}
],
"type": "HAPPENING"
},
...
{
"happening": "random_familyfeud2",
"prereqs": [
{
"varname": "rdm_familyfeud2",
"varvalue": 1
}
],
"type": "HAPPENING"
}
],
"id": "random_quests",
"random": true,
"triggers": [
{
"location": "random_quests",
"type": "LOCATION"
}
]
},

It's truncated but you see that there are 2 actions (and more represented by ...), and this happening spawns one of the actions randomly.

So to add a random event, you would add a new happening to saga1.json, with a trigger on a location that you add in one of the wld_*.json travel files.

Note above, that the actions being triggered are of type "HAPPENING". This means it calls another happening, in the 2nd case "random_familyfeud2". The contents of that happening is here, which spawns a popup that renders a conversation?


{
"actions": [
{
"type": "POPUP",
"url": "saga1/convo/part8/cnv_rdm_familyfeud2.json.z"
},
{
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "rdm_familyfeud2"
}
],
"id": "random_familyfeud2"
},

Aleonymous
04-15-2014, 07:27 AM
I mis-spoke a little about the random quest triggers. Looking at wld_boersgard.json, you see these locations:
...
This refers to a trigger in saga1.json:
...
It's truncated but you see that there are 2 actions (and more represented by ...), and this happening spawns one of the actions randomly.

So to add a random event, you would add a new happening to saga1.json, with a trigger on a location that you add in one of the wld_*.json travel files.
...
Note above, that the actions being triggered are of type "HAPPENING". This means it calls another happening, in the 2nd case "random_familyfeud2". The contents of that happening is here, which spawns a popup that renders a conversation

Hmmm, I didn't get something here: To add new random-events, do we also need to add dedicated triggers for them, in some locations of the wld_*.json travel files or are they randomly selected for the pool of eligible ones? Eligible means that (a) they haven't been encountered before, (b) they pass event-specific condition-checks. Before this last message of yours, I thought that to add a new random-event we just (i) properly "append" a new happening in the saga1.json\happenings\random_quests\actions and (ii) create, of course, the json file with that new happening/random-quest.

Also, how does this "positioning" system work? It seems that the entries in scene\wld_*.json\landscape\travel\locations contain an "id" and a scalar/integer "position" identifier. Is there a look-up table, or a fuction/formula that maps those "position" identifiers to map-locations (e.g. in xy/pixel-coordinates)? I am guessing it should relate to the scene\wld_*.json\landscape\travel\splinex entries (a long 2-column array), but I can't see how... I am also guessing that there must be a hard-set and over-ruling "caravan route", along whose way do the various events --random and scripted-- pop up (when the locations/triggers are met).

Finally, is there a way to "force" a random event to appear somewhere, in order to debug it? Or would we need to "plant" it, somewhere, as a new scripted-event? Is the procedure required for adding scripted events any different than the one we follow to add random ones? I am guessing that it will be a bit easier, e.g. bypassing the "declaration" in saga1.json if its scope is local, i.e. it applies only during/inside a specific scene\wld_*.json...

I mean to get into creating/adding new battle-scenes, but lets leave that for later, after we get the hang of adding "simple" caravan pop-up events (random or scripted).

John
04-15-2014, 02:05 PM
To add a new random event that occurs whenever any other random event occurs, yes, just add an action to the happening saga1.json\happenings\random_quests.

All the existing actions in saga1.json\happenings\random_quests\actions are actions that call other happenings, also defined in saga1.json\happenings. The aforementioned actions have prerequisites on them.

In the example below, the action executes the happening called "random_refugees" if the variable "rdm_refugees" == 0 (in other words, is unset, or false):


{
"happening": "random_refugees",
"prereqs": [
{
"varname": "rdm_refugees",
"varvalue": 0
}
],
"type": "HAPPENING"
},

The positioning system specifies a scalar "position" which is the number of pixels along the spline, from its beginning. You can see the spline and its locations by hitting control-shift-T in the client (with --developer). You should see something like this:

201

http://stoicstudio.com/forum/attachment.php?attachmentid=201&d=1397588376

By looking at what the numbers are for 2 given locations, you should be able to mentally extrapolate the position for a new location in between them.

You can 'execute' a happening at any time with the command:


saga exec <happening_id>

I believe it looks first in the happening list for the current scene, and failing that, in the global happening list defined in saga1.json.z

And yes, if a travel scene contains a location, it can also contain the happening that listens for the location trigger on that location. I don't think the location triggered happenings all need to be in saga1.json.z

JW


Hmmm, I didn't get something here: To add new random-events, do we also need to add dedicated triggers for them, in some locations of the wld_*.json travel files or are they randomly selected for the pool of eligible ones? Eligible means that (a) they haven't been encountered before, (b) they pass event-specific condition-checks. Before this last message of yours, I thought that to add a new random-event we just (i) properly "append" a new happening in the saga1.json\happenings\random_quests\actions and (ii) create, of course, the json file with that new happening/random-quest.

Also, how does this "positioning" system work? It seems that the entries in scene\wld_*.json\landscape\travel\locations contain an "id" and a scalar/integer "position" identifier. Is there a look-up table, or a fuction/formula that maps those "position" identifiers to map-locations (e.g. in xy/pixel-coordinates)? I am guessing it should relate to the scene\wld_*.json\landscape\travel\splinex entries (a long 2-column array), but I can't see how... I am also guessing that there must be a hard-set and over-ruling "caravan route", along whose way do the various events --random and scripted-- pop up (when the locations/triggers are met).

Finally, is there a way to "force" a random event to appear somewhere, in order to debug it? Or would we need to "plant" it, somewhere, as a new scripted-event? Is the procedure required for adding scripted events any different than the one we follow to add random ones? I am guessing that it will be a bit easier, e.g. bypassing the "declaration" in saga1.json if its scope is local, i.e. it applies only during/inside a specific scene\wld_*.json...

I mean to get into creating/adding new battle-scenes, but lets leave that for later, after we get the hang of adding "simple" caravan pop-up events (random or scripted).

Aleonymous
04-27-2014, 11:27 AM
EDIT -- OK, I've sorted this out! My reasoning-out of this was correct, and it seems like the problem was caused --as always-- by a typo (a missing comma, an extra } where there shouldn't be etc :o). I've found this quite cool online JSON editor ( http://www.jsoneditoronline.org/ ) who revealed that one my "stitches" (yes, the last one :rolleyes:) was out-of-line!


John,

Mayday, mayday. I have a hard time structuring the "story-flow" inside the \convo\...\cvn_pop events, using "divert", "linkPath" and "if-/notIf-Condition" as well as the global variables (battle_victory and others) :( Can you explain some things? Here's my understanding:

The first "stitch" to be visited is the one given by the "initial" entry of the JSON file.
The initial stitch is usually called "skip" and points to the next stitch via the "linkPath"
The "content" of a stitch is displayed (and any flagName operations are executed, e.g. morale/supplies/renown or global-var sets/resets) when the "ifCondition"- and "notIfCondition"-clauses, following the "content" of a stitch, are satisfied.
If there is a "divert" entry after the "content", then the flow is directed to that stitch
The JSON file is exited when the flow runs out of "divert" re-directs.

Is my understanding correct? Or do the ifCondition- and nonIfCondition-clauses apply to whether or not to "divert"?

Basically, I am trying to do a VERY simple thing, assuming we have a dependence from two boolean variables (e.g. A & B):

if {A}AND{B} then... <outcome#1> end;
if {A}AND{NOT{B}} then... <outcome#2> end;
<outcome#3>

where, <outcome#3> happens regardless of A&B (always), but comes after <outcome#1,2> (if applicable, depending on A & B). So, I had 1+3 stitches like that:



"skip": {
"content": [
"{skip}",
{
"ifConditions": null,
"linkPath": "stitch_no1",
"notIfConditions": null,
"option": "{skip}"
},
{
"pageNum": 1
}
]
},
"stitch_no1": {
"content": [
"[char] blabla",
{
"divert": "stitch_no2"
},
{
if{A}
},
{
if{B}
},
{
"flagName": "foobar1"
}
]
},
"stitch_no2": {
"content": [
"[char2] blabla2",
{
"divert": "stitch_no3"
},
{
if{A}
},
{
notIf{B}
},
{
"flagName": "foobar2"
}
]
},
"stitch_no3": {
"content": [
"[char3] blabla3",
{
"flagName": "foobar3"
}
]
}

My problem is that the <outcome#3> (e.g. display the blabla-content & execute the foobar-operation) of "stitch_no3" NEVER happens, whereas the <outcomes> for "stitch_no1" & "_no2" happen as planned... Can you see my mistake? :(

Thanks for your help!

Aleo

John
04-27-2014, 03:08 PM
Yes, having a dedicated JSON editor or validator is crucial.

For editing conversations, I highly recommend editing them in the Inkle tool itself, if possible.

Here are the instructions we received from Inkle concerning importing a conversation JSON into a new story so you can edit it in the tool:


To load up JSON into a new account is possible, but a bit fiddly. Here's how you do it.

1) Sign into the account you want to write the new story into
2) Go to http://writer.inklestudios.com/stories/new
3) Fill in the title box
4) Paste in only the section of the story JSON contained within the "data" object. This is 99% of the data, but misses out the URL key, the title (since that'd be repeated), and other extra-stuff.
5) Hit go; and the story will open (in share mode, I think, but it'll now exist in your account).

Aleonymous
04-27-2014, 04:13 PM
For editing conversations, I highly recommend editing them in the Inkle tool itself, if possible.

Hmmm, this Inkle takes a little getting used to, but I think it's the right tool for the job! It did feel a little too painstakingly difficult to create branching stories in the "text-editor" environment of the JSONs! :) Did you use Inkle right from the beginning of the design the game, or migrated to it at some later point? It seems like some of the earlier parts (e.g. Chapters 1-3) are written in a slightly different manner compared to later parts (e.g. Chapters 4-7)... or is it just me? Also, it's quite evident how Ch1&3 were meant to be one chapter, while the same holds true for Ch.2&4 and for Ch.5-7. Well, just curious... :o



Since we were discussing conversation, do you mind explaining a bit about how the "mark" markup works? So, lets take an example, in a three person conversation, we usually find the following markup on the very first "stitch":


{skip} mark1=iver mark2=rook mark3=alette

that loads the portraits of the characters that take part in the chat. In each piece of conversation, when the camera is looking at the person talking the markup is usually something like:


[rook] Blah, blah, blah

Is there any particular rule to who-is-opposite-who, or whose back we're seeing while camera is on [rook] (e.g. mark2's back when we're looking at mark1)? Also, how do you make that: when the camera is on one character but the text appearing is said by another (possibly with a name-banner next to the text and/or a mini-portrait)? Some times the camera looks at two persons, so, the markup is like:


[rook alette] Blah, blah, blah

Finally, some characters can be hidden/sent-off from a chat, by using:


{
"flagName": "@hide=iver"
}

Is there a similar piece of code to make-appear a new person to the conversation?

Thanks for the help :D Understanding all this through trial-and-error is many times a pain...

Aleo

Aleonymous
04-28-2014, 07:19 AM
A small twitch-recording introducing my mods so far: http://www.twitch.tv/aleonymous/b/523905484 , here's what I've added/modded:


A new hero-character. She's a Siege-Archer, using the 2nd color variation from Factions (also available in the Saga), and her name is... Stoicmom! :) She appears at the beginning of Chapter 2, joining Rook & Alette while they are attacked in the forest by the Dredge. For all gameplay purposes, this new character is just like Tryggvi: she just helps in the battles and has no story events tied to her (yet!).
Some new conversation lines. After you meet Stoicmom, she interferes a bit in the Rook-Alette discussion. Her SWF-portrait, the siege_archer_v1 one, already existed in the game files. So, I just had to "create" the back of her portrait, which I did with recoloring Yrsa's back.
A new battle. While in the forest, if Rook chooses to try to save the ox-wagon, the heroes are attacked again by a three Dredge Grunts. The battle map is the same as previously (dead deer), but the deployment zones are reversed.
A new enemy unit. It's a red-hued Grunt, called "Lava Grunt", having much higher stats but "regular" otherwise. I just added a 4th grunt type, and did some image-editing to create its sprite from the other grunts. This Lava Grunt can be added in the "buckets" and be used as a "captain" of Grunt...
Some new popup event/outcomes. After the wagon is set en route to Skogr, you have a small narrative scene having to do with Stoicmom. If you won the 2nd battle, you get +15 Supplies. If you lost, Stoicmom manages to saves you & the wagon, and you only get +5 supplies. Finally, just by Stoicmom's joining, your "mini-caravan" gets a +30 Morale ;)


That said, here are the files I had to edit to introduce these stuff:

\assets\saga1\cast1 (here's where I added the character types for the new hero & enemy unit, Stoicmom and Lava Grunt)
\assets\saga1\caravan\caravan\hero_stoicmom.* (the caravan sprite clipfile+PNG)
\assets\saga1\convo\part2\cnv_chat_alettedredge1 (popup, after 2nd battle)
\assets\saga1\convo\part2\cnv_chat_alettedredge2 (dialogue, after 1st battle)
\assets\saga1\scene\part1\cin_rook_alette\cin_rook _alette (both battles are actions of the "rook_chat" happening of this scene)
\assets\saga1\scene\part2\btl_rook_alette_round2\b tl_rook_alette_round2 (the 2nd battle, basically a copy of the first!)
\assets\saga1\scene\part2\wld_einartoft_1\wld_eina rtoft_1(the previous scene is invoked by this "higher" world/caravan-scene, I didn't actually change anything here)
\assets\common\locale\en (here is where the names [Stoicmom, Lava Grunt, Stoicmom's Lore description] were added)
\assets\common\character\character_classes (here is where I "defined" the fourth Grunt type/variation, the Lava Grunt)
\assets\common\character\archer\siegearcher_v1.por trait_back.png (stoicmom's back portrait, from Yrsa's)
\assets\common\character\dredge\dredge_grunt_v3.an im\*.* (the sprite files of the 4th Grunt type)
\assets\common\character\dredge\drege_grunt_v3.* (the turn-queue portrait and other misc files for the 4th Grunt type)

I might be forgetting something, but that's the most important ones.

Fell free to comment/correct/discuss! :)

Aleo

raven2134
04-28-2014, 12:45 PM
Hey Aleo, seems your jumping in all the way. I'd actually be interested in being part of the modding outfit, just that it seemed John still has to get the tool/s fully fleshed out. I'll send you an email so I can see how I can help out :)

Aleonymous
04-30-2014, 01:57 PM
John,

It seems that the JSON files of the game are all (?) loaded upon launching the client. Consequently, making any change to them while the game is running requires the closing-and-reloading of the client, which is time consuming... Is there anyway to skip this, and "reload" only a particular JSON? That would considerably facilitate debugging, especially for stuff like abilities***. Taking it even further, is it possible to save/load at the start of a battle, with the board and all units loaded and waiting at deployment?

Thanks

*** Speaking of abilities, I've started some more serious tests on modding them, with a small ground-breaking triumph: Now, resting a unit grants +1WP and +1STR! ;)

For those interested, you'll just need to edit assets\common\ability\_ability_index.json.z\ and, at the effects of the id:abl_rest ability-entry, just add one more CHANGE_STAT operation, as follows:


{
"effects": [
{
"name": "change",
"ops": [
{
"id": "CHANGE_STAT",
"name": "change",
"params": {
"amount": 1,
"amount_stat_bonus": "REST_WILLPOWER",
"stat": "WILLPOWER"
}
},
{
"id": "CHANGE_STAT",
"name": "change",
"params": {
"amount": 1,
"stat": "STRENGTH"
}
},
{
"id": "CHANGE_STAT",
"name": "change",
"params": {
"amount": 0,
"amount_stat_bonus": "REST_ARMOR",
"stat": "ARMOR"
}
}
],
"phantasms": [
{
"applyTime": 0,
"endTime": 0,
"results": [
"OK"
]
}
]
}
],
"id": "abl_rest",
"maxMove": 0,
"rangeMax": 0,
"rangeMin": 0,
"rangeType": "NONE",
"tag": "END",
"targetCount": 1,
"targetRule": "SELF"
},

Aleonymous
05-01-2014, 05:00 PM
Here's my latest mod video description -- http://www.twitch.tv/aleonymous/c/5040209 (with voice-over; sorry! :o)

http://cloud-4.steamusercontent.com/ugc/3296943472292105937/887120319B950E3A4C8D1FDE6160FB8808C47DDD/

What I did there is make the tutorial-battle (saving the Governor of Strand form the Skalfing chieftain's attack) fully-playable, without the annoying click-to-continue stops all the time :) Now, the Skalfing chieftain is equipped with a dedicated portrait, rank-3 Bloody-Flail, 15STR and a tendency to walk the length of the firepit! :D He also got four lackeys with full raider-like stats. They are pitted against a consistently statted Gunnulf (15STR/7ARM and 0EX!) and the now-named rank-0 Shieldbanger called "Sven" (no inspiration there; who wants to be him?). Ubin, lounging against the great-pillar, will have a much more interesting spectacle ;)

Most of my edits where on the \assets\saga1\scene\part1\btl_tut_greathall\btl_tu t_greathall.json date-file (actually just removing the line "tutorial": "game.saga.TutorialBattleStrandGreatHall" for the end, does the battle normally playable!), where, interestingly, the firepit-damage triggers were missing and had to be added. I also added two new character-classes (at \assets\common\character\character_classes.json), two cast-characters (at \assets\saga1\cast1.json) and localization-entries (Sven etc) along with fresh new portrait PNGs for the Chieftain and his backbiter-like henchmen.

John
06-10-2014, 09:44 PM
I'm working on making modding a little easier. Documentation in progress, and Zeno update incoming:

https://docs.google.com/document/d/1As8UPxaFrLvHqVms_EjYxuOSVxdbOc8ylNktwWqXEfI/edit?usp=sharing

Aleonymous
06-11-2014, 08:42 AM
I'm working on making modding a little easier. Documentation in progress, and Zeno update incoming:

https://docs.google.com/document/d/1As8UPxaFrLvHqVms_EjYxuOSVxdbOc8ylNktwWqXEfI/edit?usp=sharing

Awesome! Thanks, John :) So, the operations you are describing on the google-doc above are not yet available? If so, is there an ETA? Will they come with the official release of patch#2, or with an update to the localization-beta build?

EDIT: I see that Zeno doesn't allow for ability tweaking. That makes sense, as it's far more complicated than adding "content" like dialogue, characters, battles etc (that are based on existing "entities"). Thankfully, I've started drafting a walk-through to ability modifiers and parameters, that I stopped when Zeno was announced... It seems that it might come in handy after all :)

EDIT#2: Hmmm, OK. It seems that this "Mod Content" free-DLC is not yet become available to download/install. That must be the key-component you said was still missing. So, I guess we'll have to wait for that...

Aleonymous
01-12-2015, 11:17 AM
@John -- I have a modding related question, in case you're still watching this thread :) Here goes: Do we have access at the 'formula' by which the game translates the 'danger' parameter of a battle into the number & rank of enemy units, as well as the deployment zone chosen? I understand that the types/classes of the units are determined by the 'buckets', so that shouldn't be part of that the 'formula'. Specifically, I would be interested to see if the number of heroes fielded, and/or their classes and stats, are taken into account here. For example, does the game spawn the same enemy team (putting the RNG aside for now) if the player chooses to bring six heroes or if he brings just two? It would be cool if the control-parameters of that formula were 'brought out' to an editable JSON file, to experiment with... :rolleyes:

As you suspect the reason I'm asking is the persistent remarks (appearing at each sales at the Steam forums) about the abuse of the 'Maim; Don't Kill' (MDK) strategy allowed by the turn-system. I keep arguing that this turn-system is fine in its core, and it just requires other tweaks/additions to mitigate its problems. Such additions could be, for example, (a) more battle-ending objectives, (b) more STR-independent damaging abilities for enemies, (c) smarter AI that maybe uses MDK itself.

John
01-12-2015, 01:17 PM
The Danger formula is in code and there aren't any parameters to affect it from scripting.

The number and composition of the player's hero party does not affect battlefield bucket spawning. It simply spawns enemies from the bucket such that the sum of the enemy Ranks equals the Danger.

Note that if the battlefield has any valid spawners, then these spawners are activated first and the ranks of the spawned enemies included in the total count of ranks.

Note that in the camp training tent, the player's team composition _is_ considered, as it tries to give you a matchup that is relative to your party.

Aleonymous
01-12-2015, 04:49 PM
Thanks for your prompt response!


The Danger formula is in code and there aren't any parameters to affect it from scripting.

The number and composition of the player's hero party does not affect battlefield bucket spawning. It simply spawns enemies from the bucket such that the sum of the enemy Ranks equals the Danger.

Hmm, I see. However, I think that the game's balance would profit from a Factions-like approach, where (a) the two teams have the same number of units and approximately the same classes and (b) 'danger' acts as a modifier to the power of the enemy team, i.e. the ranks of the units, like the Underdog mechanic in Factions matchmaking. Hero ranks {1,2,3,4,5} map to enemy ranks {a,a,b,b,c}, respectively. Hero classes can be directly mapped to Dredge classes; when the bucket doesn't contain 2x2 units, then two grunts map to one Varl etc. For example, if the enemy fields three male-humans, two archers and one Varl then the Dredge team is made up of three Grunts, two Slingers and one Stoneguard/Scourge. You get the idea. Anyway, I guess it's just another way to do it... :)


Note that in the camp training tent, the player's team composition _is_ considered, as it tries to give you a matchup that is relative to your party.

I see how this is much easier to do, building on the Factions experience and the fact that you match units from the same classes. Human+Varl vs. Dredge is a bit more tricky, indeed. Now, coming back to modding, I guess the only way to try to implement the above mechanic for vs. Dredge fights is by massaging the 'danger' parameter :) Nevertheless, we'd also need access to variables that measure the player's team composition: (a) number of units, (b) classes, (c) ranks... And even if that was in hand, how would we massage 'danger'? Oh, it sounds un-do-able :o

shigad
01-17-2015, 08:19 AM
can someone make an endless camp (hero tent and training tent) that will use a save game with all characters without making impact on the current save games on the user computer (so you could do some kind of fun training [in the training tent] with classes not in TBS:F and maybe make a team composed of both a level 5 egil and a level 5 onef or 2 alettes or etc)?

Aleonymous
01-17-2015, 08:39 AM
can someone make an endless camp (hero tent and training tent) that will use a save game with all characters without making impact on the current save games on the user computer (so you could do some kind of fun training [in the training tent] with classes not in TBS:F and maybe make a team composed of both a level 5 egil and a level 5 onef or 2 alettes or etc)?

What you ask can be done quite easily, simply by editing a "Resume" type save-game, that was saved while in a camp so that the training tent is available. What you'd need to do is: go to that save-game JSON-file, find the respective caravan section (e.g. Rook's caravan, if the save was in Ch. 2, 4 or 6) and add the desired heroes and possibly new ones (e.g. for rank-0 units). You should also edit the hero stats, to promote them to higher-ranks or change their attributes.

shigad
02-01-2015, 02:09 PM
ok, thanks

soldtoscience
02-27-2015, 01:36 PM
testing!

hackspeedok
04-20-2015, 04:54 AM
Can you help me modding font ?
http://stoicstudio.com/forum/showthread.php?3513-Font-modding
I'm translating this game to Vietnamese language. Thanks

folkemon1977
07-20-2015, 02:54 PM
Hi there,
i'm translating TBS to the czech language. All works perfect (thanks John for TBS Compiler). You are awesome, indeed!
But i cannot find battle text banners - PILLAGE!; BATTLE!; + RENOWN; Last one standing etc.
Where are these texts located? And is it possible edit these using TBS Compiler?
Many thanks for your answer.
Regards

Aleonymous
08-07-2015, 08:47 AM
Hi John,

I was wondering if there is an easy way (via modding) to force the game's turn-queuing into Pillage-mode, right from the start of the battle, for all battles. In this way, those that dislike the "I-move-one/you-move-one" fundamental mechanic will find an alternative in the XCOM-like approach which is Pillage-mode. I am sure it will greatly unbalance the game, ranging from ridiculously easy to impossibly difficult, but it might also prove a fun playground for new strategies :)

Thanks for any insight!

EDIT -- I ended up emailing this question to John and he said: Nay :(

YaK
08-16-2015, 08:13 AM
Hi Aleo,

Are you fine? It's a bit since i joined a discussion on this forum!

I have a question! (I ALWAYS have a question :D!)

Have the developer mode access and the console commands changed?

Aleonymous
08-16-2015, 10:24 AM
Have the developer mode access and the console commands changed?

I am not sure, are you having problems? I think the way to access the console is the same (CTRL SHIFT ~), but maybe they tweaked the console commands a bit...

YaK
08-16-2015, 10:27 AM
Don't know if they tweaked console commands, it was just the damned steam overlay that prevent me from the developer mode :/

John
08-16-2015, 10:54 AM
Our most recent update changed the format of the command line options. Please see this document for the most up to date information:

https://docs.google.com/document/d/1xXKMaroP1t18BXEKrl0YpFamg-ZN8wPk-vTt0rAq53M/edit?usp=sharing

YaK
08-16-2015, 11:17 AM
Sir, a huge thank you :)

Adolfok3
04-26-2016, 04:32 PM
Hi! I open some archiev of json.z files with the TBS Decompiler, and when I'll save it it shows a message of Error. Can any one help me? I'm trying to translate this game to my language. :)

http://i1135.photobucket.com/albums/m623/Adolfok3/Sem%20tiacutetulo_zpsmr38xnxf.png

Aleonymous
05-01-2016, 01:50 PM
Hi Adolfok3 :) Does this happen with all sbv.z files? Can you open & save json.z files normally? Maybe you inserted some unsupported character? What is your language, by the way?

Drake713
05-28-2016, 08:20 PM
Question, if I wanted to hard code the order of random events occurring would it be as easy as replacing
"id": "random_quests",
with eg.
"id": "random_farmstead",
inside wld_boersgard.json.z ?

Aleonymous
05-29-2016, 12:08 PM
Question, if I wanted to hard code the order of random events occurring would it be as easy as replacing
"id": "random_quests",
with eg.
"id": "random_farmstead",
inside wld_boersgard.json.z ?

Hey Drake. I haven't tried it to be sure, but it sounds like it should work, in principle... Do report if it works as intended!

Drake713
05-29-2016, 02:41 PM
It almost works as easy as that. If you only make that change then the event never fires off like you'd expect it to, what I had to do was add in triggers to each of the 27 random events like so:
{
"actions": [
{
"type": "POPUP",
"url": "saga1/convo/part8/cnv_rdm_farmstead.json.z"
},
{
"type": "VARIABLE_SET",
"varname": "rdm_farmstead",
"varvalue": 1
}
],
"id": "random_farmstead",
"triggers": [
{
"location": "random_farmstead",
"type": "LOCATION"
}
]
},

Where this is the new part I added in:
"triggers": [
{
"location": "random_farmstead",
"type": "LOCATION"
}
]

Aleonymous
05-29-2016, 03:28 PM
Hmmm, so the random-event triggers are "tied" to the random events pool, so that you can't use a random-event trigger to fire a fixed event? I kinda forgot how the events are handed to and from the various JSON datafiles... :o

Drake713
05-29-2016, 09:01 PM
The random_quests pool has one trigger tied to it, which then searches the pool for an event that passes it's per-requisites and fires off that event.

By short-circuiting the process in the way that I have, I can fire off a specific event at a specific point where normally one would be pulled from the pool randomly. But it will bypass the per-requisite check, so it is up to me to make sure I do not eg. call the same event twice.

Having to add in those lines to each of the 27 (normally) random events, is a bit extra work, and might not be the optimal solution, but it works.

Now I just have to design my ideal order in which to fire off events; so far I have the Farmstead firing off just after leaving Frostvellr with the LowMoral and Overpopulation events firing off on the way to Wyrmtoe... after that... I'm still working on it :P I kinda wanted Overpopulation to be the first off the stack, cause from a roleplaying perspective that first random event would be the one most likely to have the greatest number of people in the caravan, but you really need that Farmstead to fire off first to avoid anyone starving (assuming you did not take Onef)

I also like putting the Outlaws as the very last random event before Boersgard since with it being there you can take the 10 extra fighters without them ever leaving :P

YaK
05-30-2016, 07:54 AM
Could you possibly just mess with the prerequisites? You could put, for example That Overpopulation has Farmsted as a prerequisite, the one you want after Overpop should have it as prerequisite and so on, so, the only one "random" would be just the first, but since it will be just one, no randomness. Anyway it's will be just a couple of line of code less.

Aleonymous
05-30-2016, 08:50 AM
I always thought it was only 20 random events (some coming in 2-3 parts) of which about 16-17 could be "pulled" in a given play-through. I recorded them in the wiki, here: https://bannersaga.gamepedia.com/Events

As YaK says, maybe toying with the pre-reqs is the easiest way to go. However, I think that the cleanest way would be to entirely dissociate the events from the random pool, i.e. to trigger them with "fixed location bookmarks" (or how they're called) along the caravan trail just like other events (e.g. godstones etc) are handled.

Drake713
05-30-2016, 03:46 PM
I considered doing it Yak's way, and it should be perfected doable BUT I have a bad tendency to change my mind and reorder things on the fly. So doing it his way would be a bit more confusing to change once one set path was established.

My way actually is as you described in your 2nd half Aleon, on the caravan path I simply change the bookmark or w/e from “random_quests” to “random_x” where "x" is the same name as the individual events I edited to have triggers the same as their in file names.

Oh and there are exactly 27 random events (you can count them in the saga1.json file), of which 21 are called in any one playthrough, this includes multi-parters as individual events though.

Huh, I found an error in cnv_rdm_wildfruit.json.z two nodes point to "Discourage others from eating the fruit" instead of one pointing to "Gather as much as you can" after feeding a piece to a goat

YaK
05-31-2016, 01:26 AM
Nice catch! I'll fix that in the next version of my mod.

Drake713
05-31-2016, 03:33 AM
So after a lot of fiddling and testing I have my hard coded random event order.
The general strategy was to minimize morale gains in Chapter 4 so as to bottom out and stop losing morale then comes a series of hard coded events that give you free moral so win-win.
Then in Chapter 6 we pile on all the morale gains possible to keep willpower high for all the fights.

Frostvellr →
1 – Farmstead(a must have here) →
2,3 - Missingsup1+Wildfruit(just events that fill slots, but are the best possible option for filling slots, and makes RP sense here) →
4,5 - Woundedvarl+Outlaws1(Gives you some extra fighters for the coming war) →
6 - Lowmoral(Gives all characters +1 willpower in the coming war) →
7 - Lostchild1(either force a day to pass to heal up from the war, or push on after a short search)
*Rest to top off morale for the coming fights
Einarloft →
8,9 - Overpop+Varlfidget(tops off moral before the coming war, and makes RP sense here) →
10 - Baby(forces a day of rest to heal up from the war, plus big morale boost before the next fight) →
11 - Corneredvarl(some morale, and makes RP sense here) →
12 - Poetry(big morale boost before another fight) →
13 - Quirky1(some morale) →
14 - Familyfeud1(some morale, and makes RP sense here) →
15 - Missingsup2(filling empty space, and makes RP sense here) →
16 - Missingsup3(some morale, and makes RP sense here) →
*Rest to top off morale for the coming fights
17 - Humanambush(a fight for renown with max willpower) →
18 - Bribery(a fight for renown with max willpower, plus some extra civilians put in here where they will use the least amount of supplies) →
19 - Lostchild2(filling a slot and some morale) →
20 - Lostchild3(A fight that lowers the danger of all other fights by 1 so placed last here to impact fewest fights) →
21 - Quirky2(supplies, but really just a reminder to camp and max out morale before entering the city)

Unused Events:
22 - refugees(trade 10 supplies for 10 morale, same as the missing supplies chain but fills less slots, you could use it in place of one of the +5 morale events but seems like a waste)
23 - familyfeud2(best case you lose one civilian and gain nothing, I'm not a fan)
24 - abandoned(best case you lose nothing and gain nothing, useful if you want to replace the missing supplies chain with refugees instead)
25 - blizzard(every option is bad)
26 - fireincamp(every option is bad)
27 - outlaws2(just plane bad)

So in the end it is still an order theoreticaly possible in the unmoded game, but I feel I get the most out of it this way, what do you guys think?

Aleonymous
06-01-2016, 10:54 AM
Thanks for the clarifications, Drake :)

The order seems fund, kinda favoring Chapter 6 (and penalizing Chapter 4). So, you left-out the last bits of some multi-part events, eh? No harm done, as there's usually no indication that there's gonna be a follow-up event, when they first trigger...

My prime concern with the Random Events is that all of them have an obvious "best answer", so there's little to them in terms of providing a wholly different experience, strategically or role-play wise. I'd like to have balanced outcomes from the various choices in each event, so that, for example, you might sacrifice some Renown for some Supplies or vice-versa and so on. The "core problem" here, IMHO, is that the caravan parameters (Renown, Morale, Supplies, Population) are not equal in terms of their effect on the gameplay: The Population is especially troublesome to uphold, whereas Renown/Morale/Supplies are pretty important in the order listed. Needless to say that no amount of (small-scale, content) modding can fix this problem. Steps to improve this situation were take in Saga2, but the results are not yet "good", in my opinion, of course.

Drake713
06-06-2016, 08:08 PM
I actually discovered quite a few bugs in the course of writing my "Decisions and Consequence" guide - I tagged them all with "bug" if anyone wants to add their fixes to a mod. (can just ctrl-f "bug," I will add in the random event bug mentioned earlier when I finish that section)
Additionally, there is ALOT of unused event branches in saga1\convo\part1\cnv_pop_abandoned.json.z where you can see that the devs wanted to do more with this event if someone wants to add them back in.

http://steamcommunity.com/sharedfiles/filedetails/?id=698507714

Aleonymous
06-07-2016, 06:43 AM
Awesome guide, Drake! How long did it take you to compose it? :eek: Browsing through those Inkle files to find out how events & consequences roll out is surely more than a bit tedious...

Drake713
06-07-2016, 02:16 PM
All told it took about 4 days, Notepad++ makes it alot easier. I can just copy/paste all the text over to it, search for "pageNum": 1 which marks each conversation file's starting point, then just highlight each subsequent "linkPath": and Notepad++ automatically highlights all other matching tags. If the file is too big to scroll through looking for the next highlighted "linkPath": tag I can just ctrl-f with the tag highlighted and it will automatically fill in the search field with the tag. Then it is just a matter of following each tag until I get to a decision point. Doing this while playing through the game also lets me only search for conversation files once I hit a decision point in game, cutting out all the ones that have no decisions in them(and keeping them in proper order).

Honestly the most tedious part was all those parts that say "All options lead to the same result" cause I still had to trace through the conversations to make sure I wasn't missing anything and in the end it didn't even matter :P

Aleonymous
06-07-2016, 02:29 PM
Yes, I've been using npp like that myself. But it was mostly for checking for a particular event. I guess that once you're on the entire undertaking, then you become more and more efficient with mouse clicks etc. Did you cross-check anything with the online-stored Inkle files? Are they up-to-date? That browser interface would have made the whole task much easier if it had some way of displaying the control & the auxiliary game-variables.


Honestly the most tedious part was all those parts that say "All options lead to the same result" cause I still had to trace through the conversations to make sure I wasn't missing anything and in the end it didn't even matter :P

I know what you mean. I was honestly a bit disappointed to find out that many dialogue options don't really lead to different outcomes, just some more text often without adding more to the story/character-depth. I suspect that Saga2 will be even more tedious as you there have two protagonists (Alette or Rook) to follow. For example, in many cases all that changes between the two is a "him/he" or "her/she" :rolleyes:

Drake713
06-07-2016, 03:04 PM
I suspect that Saga2 will be even more tedious as you there have two protagonists (Alette or Rook) to follow.

Ugh >.>

But, no I didn't know about online stored copies of the files, I did compare it to what had already been done, but that was about it.
Pulling straight from the game files should provide the best possible result.

Some of the bugs I noted were from playing through the game, specifically the battles that triggered when I was trying to leave a conversation without starting up battle yet - I'm not sure why those bugs exsit since the game files would not indicate a battle should start up at those points... my guess would be it has something to do with the "playPoint": tag at the top of the file not indicating that the conversation should exit at that point - or something.

I also forgot to mention one other bug; if you ambush the onef cart, the Ekkill died flag is never set so when you have a conversation with Nid later on, she acts like he is traveling in the caravan when he is not.

YaK
06-07-2016, 03:19 PM
Well done Drake, really impressive!

I already started reading the guide, but i have a question, are you sure Hakon's renown didn't carry over? I remember that items and renown come back when hakon's caravan joins rook's, the ones "lost" are just supplies.


Anyway, i would gladly fix the bugs you mentioned as soon i have a proper PC again, just to keep track of them, we're talking if ten issue, the nine that are in the guide plus the "ekkildied" not set one, right?

Drake713
06-07-2016, 03:25 PM
Dang, looks like you are right, I don't know how it is handled cause it is not listed in saga1\convo\part7\cnv_pop_junoarrives2.json.z but it does seem like Hakon's renown gets added at the start of that popup conversation, guess I'm gonna have to edit my save to "refund" some renown, cause I don't want to re-play the whole game again :P

Yes, I noted 10 bugs, but going back I'm not able to re-create the battle bugs... dunno what is going on there cause it definitely happened the first go through :S

And if you could restore the unused branches in saga1\convo\part1\cnv_pop_abandoned.json.z that'd be great too :)
There looks to be at least three unused branches in there; 1) you take them with you (but we do not know how many people that was supposed to be) 2) you leave them behind but it causes a morale loss 3) you leave them there with extra supplies (I think the "send them to strand" option wasn't meant to cost you supplies. but they just combined the unused option with it)

Oh, something else! When Onef strikes the text says you run off all of his fighters, but I do not see anywhere in that chain of events a loss of fighters, just a loss of clansmen... I haven't actually played that event out in game, do his 35 fighters actually leave?

YaK
06-08-2016, 04:19 AM
I'll to check too, honestley i don't remember.

Drake713
06-09-2016, 05:27 AM
Just started in on TBS2 and already I am finding a lot more bugs :S

YaK
06-09-2016, 05:36 AM
Check Aleo's thread in the Steam forums, he's logging all the bug issues!

Aleonymous
06-09-2016, 11:01 AM
@Drake and @YaK --

I've been trying to log all the Saga2 bugs reported, yes. It's mostly battle-related issues though (which are hard/impossible to fix with mods) but there's plenty that re content-related, like missing events/convos, wrong variable-handling etc. I think those are the ones Drake refers to, and they are most certainly fixable with our mod tools, in their majority. I suggest you keep a master-list of your own, with details on each of the problems, so that we (or Stoic!) can eventually fix 'em all! :)

Keeping a well-organized bug-tracker list (with links to details in different webpages, i.e. not having "inflating" your list) is very important for the persons who are gonna implement those fixes!

EDIT -- This is Steam-forum bug thread I am maintaining: http://steamcommunity.com/app/281640/discussions/2/364040166680060167/ Not sure if the ones I crossed-out have been actually fixed; I rely mostly on patch-notes and other players' feedback.

YaK
06-09-2016, 01:18 PM
I kept an eye on BS2 content errors too (The Fasolt one was similar to the Nid's one Drake is talking about on the forum and then there is the Rugga/Caravan issue we already talked and of which i send details to Stoic), but i think it's better to wait before trying to address them, since in every patch they may change the logic of some events and, if we have to check just a couple it will be ok, if there are more, it will be a mess to update, so logging it's the right think to do, right now, imho.

For BS1 there could be a different approach, it will probably receive a patch, someday, but not too soon.

Also, there is the problem that TBS Decompiler have some limits (it could not recompile properly the files of villages/camp) and for BS2 we have no Zeno yet. Probably we could just properly rename the files and let Zeno1 and let it recompile them, but it could be a waste of time, for the moment, so i will focus mainly on BS1.

I dream of having the morale Improved/Decresed of BS2 to BS1, but it seems hardcoded in BS2, so, looking at the way in BS1 you get "Morale has become poor", probably it's doable but require a bit of thinking.

Drake713
06-09-2016, 06:08 PM
My guides should serve as a "master list" of the bugs I have found as I keep each one tag'd, but I'll make a post listing only the bugs in TBS2 once I finish the guide. That waterfall one was just such a tangled mess I felt it needed it's own post asap.

As for keeping up with patches Stoic releases, I would suggest WinMerge. If you have never used it, what it does is ittakes two files and highlights all the differences between the two. So what you could do is: keep a private and separate copy of all the files you have changed in your mod, and if Stoic releases a patch, let steam "fix" all the modified files and apply the patch, then compare all your saved files to the patched files. If Stoic changed anything you will see it immediately, and if they did not, then you know to keep those files in your unofficial patch.

YaK
06-09-2016, 06:44 PM
Yeah, i use Winmerge, great tool (so sad its developing is still :( ), nonetheless, i'd wait another couple of patch for BS2.

Drake713
06-09-2016, 08:31 PM
Is it possible to make the renown rewards for achievement pop each time you complete the requirements and not just the first time per steam account?

Oh and I took my own advice and backed up all the files I have altered, I'll include a link to them here in case you are curious what I've changed in my own game. I included a log file that details what I changed and why.
https://dl.dropboxusercontent.com/u/14918337/TBS1%20Changes%20Backup.zip

YaK
06-09-2016, 09:02 PM
It should be possible, you just need how to figure out how, i believe, once unlocked, they're copied in every new game, first thing you should check if deleting from a savegame unlock them in game.

Looked at your files, i would have liked to do something similar, fortunately now the work is done.

Anyway i would add a change in "danger_bonus_combatants" in saga1.json, 'causa i hate the mechanic that more fighters you have, less dredge you encounter in battles :/

Have you tried altering "war_continue_item=25" ? It should be the % of getting an item after the secondwave in war, but never tried yet!

Drake713
06-09-2016, 10:09 PM
I considered altering "war_continue_item=25" to 100, but in the end decided against it, since I just add in missing items that could have dropped in battles at the end of the game (aka cheating)
And I don't know if putting it at 100 would cause duplicates I'd just have to remove later.

Altering "danger_bonus_combatants" sounds like a good idea, how exactly would I alter it?

YaK
06-09-2016, 10:15 PM
I considered altering "war_continue_item=25" to 100, but in the end decided against it, since I just add in missing items that could have dropped in battles at the end of the game (aka cheating)
And I don't know if putting it at 100 would cause duplicates I'd just have to remove later.

Good point!

For the danger, you should change theese lines:


{
"actions": [
{
"prereqs": [
{
"max": 100,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants",
"varvalue": 2
},
{
"prereqs": [
{
"max": 300,
"min": 101,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants",
"varvalue": 1
},
{
"prereqs": [
{
"max": 699,
"min": 301,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants"
},
{
"prereqs": [
{
"max": 899,
"min": 700,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants",
"varvalue": -1
},
{
"prereqs": [
{
"max": 100000000,
"min": 900,
"varname": "num_combatants"
}
],
"suppress_flytext": true,
"type": "VARIABLE_SET",
"varname": "danger_bonus_combatants",
"varvalue": -2
}
],
"id": "danger_bonus_combatants",
"triggers": [
{
"type": "VARIABLE_INCREMENT",
"varname": "morale",
"varvalue": 0
}
]
},

The varvalue should be always the same, i set it to "2", so it behave always as if i have num_varl+num_fighter <= 100

Of course, you could also erase everything and have just one condition with "max=10000" :), i just prefer to preserve the structure to remember the way it was implemented, if .json would allow, i'd just commented them out.

Drake713
06-09-2016, 10:55 PM
Good to know, thanks :)

As for the restoration of the abandoned village event... I did some thinking about it

According to another guy's guide...

Chapter One: The Sun Has Stopped
Strand to Vedrfell ~3 days
Chapter Three: Little Did They Sleep
Vedrfell to village~5 days

1 supply is supposed to be enough for 100 people for 1 day
Hakon gave them 30 supplies for an 8 day journey thus...
There should be 363 to 375 people in that town if you want to use supplies to estimate population

This does seem like a high number to take with you, what do you think?

number8
08-06-2016, 02:07 AM
New Banner Saga player here. I am wondering how the game determines the item drop rate (and which item drops) when you fight the optional second wave in a War. I know nothing about coding myself, so I was wondering if someone here could shed some light since you're poking around in the game files. Thanks.

Aleonymous
08-08-2016, 01:08 PM
New Banner Saga player here. I am wondering how the game determines the item drop rate (and which item drops) when you fight the optional second wave in a War. I know nothing about coding myself, so I was wondering if someone here could shed some light since you're poking around in the game files. Thanks.

Hey there. I am not sure about the exact mechanics, but there is an RNG roll sometime in the game (when you enter the chapter? when you start the first battle? when you pick the second wave?) that determines IF you're gonna get an item on Victory. I don't know the percentage, but from my experience it should be something like 25%. Now, if you do get a "go" for item drop, then there's another RNG roll that picks one item from the valid ones, from a list... You might get duplicated items with that.

number8
08-11-2016, 01:06 AM
Hey there. I am not sure about the exact mechanics, but there is an RNG roll sometime in the game (when you enter the chapter? when you start the first battle? when you pick the second wave?) that determines IF you're gonna get an item on Victory. I don't know the percentage, but from my experience it should be something like 25%. Now, if you do get a "go" for item drop, then there's another RNG roll that picks one item from the valid ones, from a list... You might get duplicated items with that.

Awesome, thanks.

One more question. I am trying to do a renown optimizing playthrough. I am trying to figure out how renown is rewarded for battles across difficulty levels. I know that increasing the difficulty increases the stats and danger, and danger increases the number and rank of enemies. But I've noticed that renown rewards are different even on battles with set numbers of enemies between easy and hard. For example, the first battle with Rook and Alette vs the starving dredge awards 5 renown on easy mode, but only 3 renown on hard mode. Do the different difficulty modes use different formulas to calculate renown rewards from battle?

Aleonymous
08-11-2016, 08:54 AM
I think that Easy battles get a fixed +bonus to Renown earned (e.g. +2 or +3), to balance the lower number of spawned enemies (compared to Normal & Hard). On Normal and Hard, I think you get +2 for a Victory and then +1 for each enemy felled. Hard typically spawns more enemies than Normal (that "Danger" hidden parameter/variable is increased), and that is why you can earn more Renown there...

number8
08-12-2016, 06:17 PM
I think that Easy battles get a fixed +bonus to Renown earned (e.g. +2 or +3), to balance the lower number of spawned enemies (compared to Normal & Hard). On Normal and Hard, I think you get +2 for a Victory and then +1 for each enemy felled. Hard typically spawns more enemies than Normal (that "Danger" hidden parameter/variable is increased), and that is why you can earn more Renown there...

I figured it was something like that, I'm just wondering if it's more complicated or if you had the exact formula on hand pulled from the game files.

I ask because it appears that renown isn't calculated until you actually finish a battle, so you can actually boost your renown by having the game set to HARD difficulty, starting a battle, switching the difficulty to EASY mid-battle, which (assuming you win the battle against HARD enemies) gives you an extra renown boost as calculated through the EASY formula.

If I knew the exact calculations for renown rewards, I could tell if this would be true under all circumstances (that swapping a hard battle to easy would give a higher amount of renown at the end).

Of course, the other challenge is trying to win a bunch of HARD encounters with just level 1 characters, since I'm trying not to level anyone so they get the maximum boost once I finish and import to BS2.

Thanks again for your help, Aleo. I realize I'm a little late to the party on the BS1 theorycrafting.


I think that Easy battles get a fixed +bonus to Renown earned (e.g. +2 or +3), to balance the lower number of spawned enemies (compared to Normal & Hard). On Normal and Hard, I think you get +2 for a Victory and then +1 for each enemy felled. Hard typically spawns more enemies than Normal (that "Danger" hidden parameter/variable is increased), and that is why you can earn more Renown there...

I figured this was the case. I was just wondering if anyone had the exact formulas used to calculate battle renown from the game files. Because right now it looks like you can actually maximize renown by having the game set to HARD, getting into a battle, then changing the difficulty to EASY mid-battle. Assuming you win, you get a boosted renown calculation.

If I had the formulas, I would know whether or not this was true for every battle, or if it's more complicated based on the types/ranks of units you face, for example.

Aleonymous
08-16-2016, 02:32 AM
Hey there. Sorry for the late response; I was offline for a few days! I merged your two posts (first two posts by new members must be "approved" by mods/admins to publicly show-up on the boards), so feel free to edit out the duplication.

To your main question: I think this "exploit" might actually work: starting a battle on Hard to get more enemies (so +Renown from Kills) and then switch to Easy mid-battle to get the +2 Renown at the Battle Resolution screen :) Do test it and report back if you find the definite answer.

Fighting lots of Enemies on Hard (w buffed stats and all) using Rank 1 Heroes can be... challenging, but not impossible. Several people have done that; do a search for "Lerajie" (or Leraje) power-save in Steam forums.

number8
08-22-2016, 07:42 PM
Hey there. Sorry for the late response; I was offline for a few days! I merged your two posts (first two posts by new members must be "approved" by mods/admins to publicly show-up on the boards), so feel free to edit out the duplication.

To your main question: I think this "exploit" might actually work: starting a battle on Hard to get more enemies (so +Renown from Kills) and then switch to Easy mid-battle to get the +2 Renown at the Battle Resolution screen :) Do test it and report back if you find the definite answer.

Fighting lots of Enemies on Hard (w buffed stats and all) using Rank 1 Heroes can be... challenging, but not impossible. Several people have done that; do a search for "Lerajie" (or Leraje) power-save in Steam forums.

So, I tested it on the meadhall fight, then again in the battle vs the solo "starving dredge." You can start with the difficulty on hard, switch to easy difficulty mid fight, and you get boosted renown at the end. The meadhall fight starting on easy normally gets you 5-6 enemies, while hard gets you 9-12 enemies. I got 9 enemies and completed the battle on hard, reloaded and swapped to easy during the battle and got more renown at the end (forgot the exact numbers).

For the starving dredge fight, on easy it awards 5 renown, on hard it awards 3 renown. You can start it on hard, change to easy during the battle, and you get 5 renown.

My question is this: are you able to find the formula for the renown calculation in the source code? I am really curious if the rank/tier of the enemy unit, or big vs. small units, makes any difference at all to how renown is calculated. That is the only other thing that would potentially make it possible to earn more renown from a true hard-hard playthrough, rather than a hard-switch-to-easy "exploit."

Aleonymous
08-23-2016, 04:04 AM
My question is this: are you able to find the formula for the renown calculation in the source code? I am really curious if the rank/tier of the enemy unit, or big vs. small units, makes any difference at all to how renown is calculated. That is the only other thing that would potentially make it possible to earn more renown from a true hard-hard playthrough, rather than a hard-switch-to-easy "exploit."

We don't have access to that part of the code, so we got only "black-box experiments" there. I think that it's +1 for all enemies except the highest tier of each class (e.g. Stoneguard Colossus [purple], Scourge Destroyer [blue]) that gives +2. Or at least that's the intended design, even though the Renown-banners that pop-up on-kill all say +1. There was actually a bug here, corrected in Saga2. In any case, once the enemy units are spawned, their "Renown value" is fixed, and is not affected by difficulty. So, all taken into account, I believe the hard-switch-to-easy "exploit" is the optimal way to go.

sawsearcey61
09-18-2016, 05:44 PM
I don't know if anyone mentioned this before but one thing that always bothered me about Saga1 was that Ludin's bodyguards and the human mercenaries from Strand just dropped out of the game after Chapter 3.

When Ludin joins the caravan in Chapter 1, he has 85 fighters with him and latter in Chapter 3, 100 fighters from Strand show up. But in Chapter 5 no mention of any humans other than Rooks caravan is given. I think that it's very unlikely that 185 fighters with hundreds of varl would all die between Chapter 3 and 5. Ludin's bodyguards would have stayed with him and since you have the chance to keep Eirik then the fighters from Strand would also stay with the caravan too.

From a story perspective this has always bugged me. I don't know if there is a way to change this, but Id like to hear other people's opinion on this.

Aleonymous
09-19-2016, 02:10 AM
Our forum members working on Saga1 patches (YaK, Drake713) would be interested in this little detail. It seems that caravan arithmetics don't work very well between chapters, with suspicious fluctuations in population, supplies, renown.

The 'story reason' is most likely that Hakon's caravan goes off-radar after Ridgehorn, so anything could happen to them on their way to Grofheim (up to the Two Spears) and then back south to Einartoft; maybe they suffered heavy casualties? Moreover, the caravan is kinda disbanded in Einartoft, with the majority of those varl staying to defend the city, and a new caravan (under Hakon, again) is dispatched by Jorundr before the fortress falls. Then, that new caravan has to march all the way to Boersgard (meeting Juno midway) and that's another place where all the numbers can be screwed up. In any case, you are right: It's highly unlikely that all 185 of Arberrang and Strand human fighters died between Ridgehorn and Boersgard...

YaK
09-28-2016, 06:02 PM
I don't know if anyone mentioned this before but one thing that always bothered me about Saga1 was that Ludin's bodyguards and the human mercenaries from Strand just dropped out of the game after Chapter 3.

When Ludin joins the caravan in Chapter 1, he has 85 fighters with him and latter in Chapter 3, 100 fighters from Strand show up. But in Chapter 5 no mention of any humans other than Rooks caravan is given. I think that it's very unlikely that 185 fighters with hundreds of varl would all die between Chapter 3 and 5. Ludin's bodyguards would have stayed with him and since you have the chance to keep Eirik then the fighters from Strand would also stay with the caravan too.

From a story perspective this has always bugged me. I don't know if there is a way to change this, but Id like to hear other people's opinion on this.

Yeah, i know and it pisses me off too.

I have an idea hidden in a corner of my mind, that i explained in a thread of my other mod, the fixpack SSLTBS1, in which after restoring an event in the abandoned village, i also take care of thi inconsistency, giving Hakon's caravan in Boersgard a little different composition based on the choices done in the other chapters (if you send Ludin to Grofheim, if you let him depart alone from Ridgehorn or if you keep it with you and he'll come with Hakon in Boersgard).

Unfortunately, i have not the time nor the desire to do something like this at the moment, since there is not a such interest by players in Banner Saga mods.

YaK
12-17-2016, 04:02 AM
@John
@Aleo
@whoknows



How does the localization files actually work?

Strings.json and voiceovers are standalone files, no problem there.


Convos (in "locale" folder) have just text data, that i assume is "patched" on the fly in the proper speaker tags in the "real" conversation files, but why is there also a "en" localized convo folder? What is its purpose?

My fear is that if i switch to, let's say, "italian" and then back to "english" without restarting, i am not loading "../tbs/assets/saga1/convos" but just "patching" the loaded version with localized "en" text, so, if i change texts in the saga1/convos i should apply the changes also to the localized one (otherwise i need to restart every time i change language).

Am I right or are my fear unfounded and they're there just a reference?

Aleonymous
12-18-2016, 05:10 AM
otherwise i need to restart every time i change language.

That sounds... wrong. Unless you mean that you're editing the locale files while the game is running, and switching back-and-forth between the languages as you move on? I'm not sure how that works, so, in this case, I think that only trial-and-error will avail you. :p

YaK
12-18-2016, 06:49 AM
That sounds... wrong.

I hope you're right. Just don't understand why there is a [EN] localized folder with just convo's text, if convos are already full in english. I could try messing a bit with them, but a plain answer would have been better than trial & error :D

Aleonymous
12-18-2016, 09:58 AM
I can't tell if the [EN] localization is "special", compared to the others, in the sense that it shows the text "as is" in the saga1/convo/xyz.json.z file, without referencing back to the respective localization file in saga1/locale/en/convo/xyz.json.z... Gonna ask John on this.

YaK
02-02-2017, 10:36 PM
Done a bit of testing switching between Spanish and English localization. I tested one of the change in my mod: Folka Referring to Gudmundr also if he's dead. The fix consisted in adding a new dialogue triggered when Gudmundr_state=0.

In English it works fine, also if the change i just made in ../saga2/convo/dontremember.json.z and not in ../saga2/locale/en/convo/dontremember.json.z. So i assume that ../locale/en/convo folder is just a much more readable reference for translators, with no effect in game.

On the contrary, in Spanish the mechanic is there, but it point out a console error and a [NO TEXT ERROR fro etc.] in the text box. So, any mod that "adds" new dialogue strings it's not language compatible. It would have been great if when the game can't found a localized entry it would have loaded the base english one, but, hey, life it's not all candies and ice creams, right? :D

Aleonymous
02-04-2017, 03:53 PM
Thanks for testing and clarifying that, YaK. Not _all_ candies and ice creams indeed :rolleyes:

number8
08-11-2018, 05:43 PM
Have you tried altering "war_continue_item=25" ? It should be the % of getting an item after the second wave in war, but never tried yet!

Short version: Has anyone managed to mod (read: improve) the item drop rate from BS1 war extra battles?


Long version:
So I backed BS3 on kickstarter, and recently played through the new BS3 on steam with the default start (no game imported), and now I am inclined to go back to my optimized replay of BS1 -> BS2 to set up a continuous play through (my old BS 1&2s were on XBOX, so not portable).

I downloaded and now have the classic Lerajie save game from BS1, but I am interested in trying my own playthrough as well based on something I posted a long time ago in this thread wherein you boost renown by starting every battle in hard mode then swap to easy mid battle for a bonus. The thing is I want to do all the war second waves, but I do not want be as patient as Lerajie had to be when it comes to replaying fights over and over to get a 25% item drop that could be a crap item or an unwanted duplicate.

I looked for the above text (quoted earlier in this thread from Yak and Drake) in the saga1.json file thinking I could just change 25 to 100 to make second waves at least guarantee an item drop, to make a BS1 playthrough less of a chore in that aspect. But now I cannot find such a line in the file. Has it been moved or removed with a more recent update?

If any of the thread/forum MVPs could shed some light I would appreciate it.

YaK
08-11-2018, 07:39 PM
If i remember correctly, now you're granted an item EVERYTIME you do a second wave battle in S1. At least this was the situation before the last patch, but i don't think it changed this aspect.

Aleonymous
08-16-2018, 01:28 PM
If i remember correctly, now you're granted an item EVERYTIME you do a second wave battle in S1. At least this was the situation before the last patch, but i don't think it changed this aspect.

I can confirm that, but, haven't tested it myself either. Actually, there was a "positive bug" that granted you an item every time you picked a second wave, even if you were defeated!

klimbo123
01-15-2019, 08:17 AM
I don't know if anyone mentioned this before but one thing that always bothered me about Saga1 was that Ludin's bodyguards and the human mercenaries from Strand just dropped out of the game after Chapter 3.

When Ludin joins the caravan in Chapter 1, he has 85 fighters with him and latter in Chapter 3, 100 fighters from Strand show up. But in Chapter 5 no mention of any humans other than Rooks caravan is given. I think that it's very unlikely that 185 fighters with hundreds of varl would all die between Chapter 3 and 5. Ludin's bodyguards would have stayed with him and since you have the chance to keep Eirik then the fighters from Bluestacks (https://bluestacks.vip/) Kodi (https://kodi.software/) Lucky Patcher (https://luckypatcher.pro/) Strand would also stay with the caravan too.

From a story perspective this has always bugged me. I don't know if there is a way to change this, but Id like to hear other people's opinion on this.

I have a thought covered up in an edge of my brain, that I clarified in a string of my other mod, the fixpack SSLTBS1, in which subsequent to reestablishing an occasion in the deserted town, I likewise deal with thi irregularity, giving Hakon's train in Boersgard a little extraordinary creation dependent on the decisions done in alternate sections (on the off chance that you send Ludin to Grofheim, on the off chance that you let him withdraw alone from Ridgehorn or in the event that you keep it with you and he'll accompany Hakon in Boersgard).

Mattinc
05-30-2019, 09:48 AM
Generic Progesterone Menopause Mastercard Accepted Price Online Acheter Cialis 20mg Ligne Side Effects Long Term Propecia Finasteride tadalafil cialis from india (http://cialiprice.com) Cialis And Levitra Kamagra 200mg Oral Jelly

Mattinc
05-30-2019, 09:48 AM
Trouver Levitra Sans Ordonnance Time Interval In Taking Amoxicillin viagra (http://gaprap.com) Most Reliable Canadian Pharmacies Keflex W Insurance

Mattinc
05-30-2019, 09:49 AM
Viagra Lichtschalter Kaufen Kamagra Online Sildenafil 120 Di Mgachat viagra online prescription (http://gaprap.com) Buy Van Tin Without Prescription Metoclopramide Buy From Canida

Mattinc
05-31-2019, 11:19 AM
Amoxil 20mg Duree Buy Tamoxifen Citrate Research Chemicals Mail Order Doxycycline cheap cialis online (http://bpdrugs.com) Usonline Viagra Viagra Suisse Generique

Mattinc
05-31-2019, 11:20 AM
Healthy Man Reviews Dapoxetina Sp Pharmacy Rx One 60 Mg Cialis viagra (http://sildenafbuy.com) Soft Cialis Tabs 60 Mg.

Mattinc
05-31-2019, 11:20 AM
Cheap Lavitra Prix Cialis 20mg cialis generic (http://cialgeneric.com) Keflex And Alchole Viagra Inyectable Cialis Generico Pagamento In Contrassegno