Source Code Access

dragontamer8740

Well-Known Member
Nov 9, 2015
53
55
Bad quality mods with questionable contents, mostly.
I don't know if that's the whole story or not.

I do specifically remember "piracy" being mentioned as a major reason at one point in time, but that no longer is a valid one since they'd switched to only pushing at public release times. Maybe paywalling image packs might have something to do with it? Disclaimer: I haven't payed attention in a while and I know at the very least that image packs are very much in a state of flux right now due to additional rehauls.

I only remember ever seeing one mod of TiTS (which I never cared for or even bothered trying because it sounded unappetizing). IMO that shouldn't be enough reason to sabotage (intentionally or not) wiki/documentation efforts. The move to electron has just made it even harder.

BTW, the issue isn't corrupted/broken map files, as some have suggested. It's that source map files do not exist/have been omitted from the releases. It reads like a decompiled (but not de-obfuscated) Minecraft client. Which is pretty unfortunate. I hope they at least decide to bundle map files in future. But I have a feeling they have been omitted on purpose ("to prevent derivative works" or whatever...).

As a side note, I'd be quite interested in trying to redesign the UI to better match the flash version, myself. I never can get used to this new one, and it feels like something that could be made as an option. But as of now I am too tired to care about it anymore. I really liked deep diving in the sources, and would love to do so again, but this lack of communication has left me a little bitter.
 

Gedan

BUTTS BUTTS BUTTS
Staff member
Aug 26, 2015
8,008,907
8,008,325
I'm tired and cranky, so I'm gonna be blunt and explain exactly how we got here:

Initially I wrote some shit into the buildjob for flash TiTS that would push the current commit to a secondary remote when executing a public build. This worked for a while, and then it broke and I was too busy to get my hands into sorting out why it broke, because at the time we were straddling a self-hosted git instance for our private repo, and then just using a public github repo for the public stuff. It was probably github moving to access tokens or something, whatever, I never got around to sorting it out because it would mean going 3 layers deep into how the build process actually runs to update the login details.

When I started on the JS port there were a few things I wanted to do, and one of the main ones was moving away from 1x a month public builds - mostly as a consequence of how buggy everything was going to be by trying to rewrite huge portions of critical parts of the game (like the map and the UI). Initially we did this by segmenting the content into seperate modules that could be omitted at build time, and thus wouldn't be a part of the webpack bundling so backers got whatever planet we were currently working through, and public got everything already "done", but both got fixes at the same time.

Now that all the old content is long ported, we're using feature flags that statically omit portions of files during bundling and optimization. If the flags false, the entire block gets optimized out of the bundles - but the codes still there in the "public" branch. The entire build process is also orders of magnitude less bullshit than getting flash to cooperate ever was too, which leaves us in a predicament. We would need a means of removing the feature flagged code entirely from the source before shoving it to a public repo. Which I'm not averse to potentially doing, but that means probably writing some shit to manage doing it - but I have five hundred other things to do, so that's "at some point in the distant future".

Sourcemaps simply don't get uploaded because it doubles how much shit needs to get uploaded, and how much traffic we're burning to people opening the console and triggering automatic acquisition of those files. It'd be great if ya'll could stop attributing decisions to malice that have far more basic - and benign - explanations.
 

katz

Member
Aug 29, 2015
5
0
So, I have a quick question. Now that it's no longer ActionScript, is the game written in JavaScript or TypeScript?
 

Gedan

BUTTS BUTTS BUTTS
Staff member
Aug 26, 2015
8,008,907
8,008,325
99% Javascript, with a few experimental bits of Typescript. I initially tried mainly switching to TS up front but it was insanely difficult to filter through the veritable forest of errors between TS, Webpack, transpilation and trying to butcher the code at the same time. Once I got everything working to the point we could actually make it public I started doing some experimentation with writing new components in TS to test hybridizing gradually over time - the achievement system is written in TS for example.
 

katz

Member
Aug 29, 2015
5
0
I ask, because I feel like the new wave of "x is not a function" errors that don't come from the text parser would have been prevented at compile time if you were using TS. But then again, I don't know how massive of an effort it would be to port it.
 

Gedan

BUTTS BUTTS BUTTS
Staff member
Aug 26, 2015
8,008,907
8,008,325
Some yes, others no. A lot of bad shit went into finding some middleground between literally restructuring everything coming from AS3 and getting things working at a basic level whilst dodging a lot of mines around limitations in the tool pipeline needed to make this work.
 

pikdum

New Member
May 14, 2023
1
0
30
We would need a means of removing the feature flagged code entirely from the source before shoving it to a public repo. Which I'm not averse to potentially doing, but that means probably writing some shit to manage doing it - but I have five hundred other things to do, so that's "at some point in the distant future".

Sounds like a solid approach, but definitely could be tricky.
I played around a bit and had some luck using https://github.com/benjamn/recast, with an incredibly basic feature flag implementation:

Hopefully that's a bit helpful, and feel free to reach out if you ever want somebody else to help implement it.
 
Last edited:

Martin Stain

New Member
Jun 11, 2024
4
0
23
Hello I wanted to read the full Nastyzia story but I cant find it in the source code, and I'm to lazy to redo that event to see every variation. Can someone help me find it cuz I really want to read it.
 

Skunkupine

Well-Known Member
Jun 17, 2023
377
118
The Javascript for the event is in the game release - it's been minified, so it's hard to follow from a code standpoint, but all the text is there and readable.