Guide to Using TiTS Source Code

Upcast Drake

Well-Known Member
Moderator
May 27, 2017
2,601
2,061
Southeast USA
I've seen this asked in one way or another a couple times in the 2 weeks I've been a part of this forum, so I figured I'd write a quick-start guide people can refer to.

I'm going to show how to download the TiTS source code, set up FlashDevelop, open the project in FlashDevelop, and compile to .swf. I'm not going to teach you how to program, how AS3 works, or how the TiTS codebase works.

First, a list of everything you will need:
Java SDK 1.6+ - 64 bit
FlashDevelop
Flex SDK
TiTS source code
flash.swc

If you don't have Java SDK 1.6+ already, download it here. You want the x64 version so if you are on Windows get the "Windows x64" one. Once it's downloaded, install it. You can verify that it's installed correctly by pressing Windows key+R, typing "cmd" and hitting enter, and then finally in the new window that pops up type "java" and hit enter. You should be given a list of options if it is set up correctly, or it will say the command isn't recognized if it's not. If it's not working, try this.

Once that's installed, download FlashDevelop. The download links are near the bottom, just pick "FlashDevelop 5.2.0 Setup". Install it, then when you first open it there should be a window called "AppMan" with a bunch of optional stuff to install too. Check "Flex SDK + AIR SDK" and allow it to download.

Now lets get the source code. Create a folder somewhere you'll remember, and within this folder create another folder called "libraries" or something, it doesn't really matter. Go to the official project GitHub. If you know how to use git, you can create a fork and clone your repo that way, but if you don't I'm not going to get into that. The other way is to just click the green "clone or download" button, then click "Download ZIP". Put the ZIP archive into the first folder we made earlier, and then extract the ZIP archive using 7zip or WinRAR or something. You may have to run as administrator if it gives you permissions errors. You should now have 2 folders, the "libraries" one we made earlier and "TiTS-Public" which contains the source code.

The last thing to download/install is flash.swc. This is an ActionScript API that TiTS uses. The normal way to get it is to download Adobe Animate CC, but that's a big download and long install process to get one tiny file. I uploaded it here. Download this and put it in the "libraries" folder.

Time to configure all the things! Where to begin...

To open the project in FlashDevelop, go inside the "TiTS-Public" folder and right-click "TiTSFD", and click "open with". If FlashDevelop doesn't show up, select "more options"/"browse for programs"/whatever until the file explorer pops up. Navigate to wherever you installed FlashDevelop (C:\Program Files (x86)\FlashDevelop by default) and double click the FlashDevelop application. Like magic, the whole project should be open in FlashDevelop.

We need to tell it to use flash.swc though or it won't compile. In FlashDevelop, go to Project->Properties->Compiler Options. Under the "Advanced" section you should see "SWC Libraries", highlight it and then click the "..." button that appears to the right. On a new line paste the full path to flash.swc, something like "C:\Users\{you}\Desktop\TiTS\libraries\flash.swc" if you made your first folder on your desktop and named it "TiTS". If you need help, go to wherever you saved flash.swc, and then click the navigation bar and it should automatically highlight almost the entire path, you'll just need to append "\flash.swc".

In theory, it should be able to compile here, BUT there's one last problem you will probably run into. When compiling, the java process uses a LOT of RAM. By default it's configured to cap out at 300 or so MB, and this can cause the compilation to fail. We need to increase this cap, so navigate to "C:\Users\{you}". Now in the navigation bar add "\AppData" and hit enter (we have to do this because AppData is a hidden folder). Now continue navigating through "Local\FlashDevelop\Apps\flexairsdk\4.6.0+25.0.0\bin" and finally you should see a file called "jvm.config". Open it in a text editor (Notepad or something) and you should see a line that says "java.args=-Xmx384m -Dsun.io.useCanonCaches=false" or something similar. Increase the 384 to 4096 and save.

Go back to FlashDevelop, cross your fingers, and do Project->Build Project. It can take awhile to compile depending on your computer's specs, but once it's done in the "bin" folder within the "TiTS-Public" folder, you should have "TITS.swf" and be able to play it.

I did this primarily based on memory so I could be forgetting something, if anyone has problems feel free to post them.

Good luck.

EDIT: Shit not working? Can't figure out why? Try reading this thread for some potential solutions.
 
Last edited:

Nenawisc

Member
Apr 23, 2017
6
4
doesmt seem to work quite right.

I dont get an error or anything but the (instantly)compiled Tits.swf is empty(0kb)

I am obviously missing a step somewhere, any idea where?
 

Upcast Drake

Well-Known Member
Moderator
May 27, 2017
2,601
2,061
Southeast USA
doesmt seem to work quite right.

I dont get an error or anything but the (instantly)compiled Tits.swf is empty(0kb)

I am obviously missing a step somewhere, any idea where?

When you start compiling, go into task manager and tell me how much memory java.exe peaks at.

One other thing to try, click the start button, then control panel and finally System. On the "Advanced" tab you should see a button "Environment Variables", click it. In the System Variables section, you should see one called "Path", one of the values should be "%JAVA_HOME%\bin". Additionally, you'll need to have a System Variable called "JAVA_HOME". If you don't, hit "New..." and put "JAVA_HOME" for the name, and the path to your JDK for the value. If you installed the x86 version of the JDK earlier, this should be "C:\Program Files (x86)\Java\jdk1.8.0_131". The version number may be different depending on when you installed the JDK.
 
Last edited:

Dormane

Well-Known Member
Sep 2, 2015
96
33
Im having the exact same problem as Nenawisc. I didnt see java.exe showing up in the task manager, but I did edit the Path value to "%Java_HOME%\bin". I was not able to test like you indicated (Everything after "additionally" was a bit confusing), however I did try and compile agian and instead got an error stating that the Java.exe file could not be located and that it could not compile because the "fcsh" proccess could not be started.
 

Upcast Drake

Well-Known Member
Moderator
May 27, 2017
2,601
2,061
Southeast USA
Im having the exact same problem as Nenawisc. I didnt see java.exe showing up in the task manager, but I did edit the Path value to "%Java_HOME%\bin". I was not able to test like you indicated (Everything after "additionally" was a bit confusing), however I did try and compile agian and instead got an error stating that the Java.exe file could not be located and that it could not compile because the "fcsh" proccess could not be started.
Press Windows key+R, type cmd and press enter. In the window that pops up, type "java".
 

Dormane

Well-Known Member
Sep 2, 2015
96
33
Im getting the old "''Java' is not recognized as an internal or external command, operable program or batch file." speech.
 

Dormane

Well-Known Member
Sep 2, 2015
96
33
Did you create the JAVA_HOME variable?
Palmface.
I had interpretted your edit to mean the creation of a new variable wasnt neccesarry. The java on the command line works now, let me test the flashdevelop...
Flashdevelop compiles again, but the original problem remains the same. The file contains no data.
 

Upcast Drake

Well-Known Member
Moderator
May 27, 2017
2,601
2,061
Southeast USA
Palmface.
I had interpretted your edit to mean the creation of a new variable wasnt neccesarry. The java on the command line works now, let me test the flashdevelop...
Flashdevelop compiles again, but the original problem remains the same. The file contains no data.
Yeah I can see how you could interpret it that way. I'll have to go through tomorrow and update the main guide with all these solutions.

Checkout the adventures modding thread. I went through a lot of potential solutions there. The one that ended up working there was lowering the value in jvm.config to 1024 instead of 2048 because his system didn't have 2GB for it to use.
 
Last edited:

Medge

Well-Known Member
Dec 23, 2015
172
149
Hey @Upcast Drake You ever see this error?:

Error: a target file must be specified
Use 'mxmlc -help' for information about using the command line.
Build halted with errors (fcsh).
(fcsh)
Done(1)
 

Upcast Drake

Well-Known Member
Moderator
May 27, 2017
2,601
2,061
Southeast USA
So when you try to compile, in the logs there should be something like "mxmlc -load-config+=obj\TiTSFDConfig.xml -incremental=true -swf-version=22 -o obj\TiTSFD636326238346373233". This is FlashDevelop actually running the Flex compiler. My guess is for some reason yours isn't running that line correctly.
One thing to try is in FlashDevelop, navigate to "classes/TiTS.as", and make sure the icon has a little green arrow instead of a red circle. If it doesn't, right-click it and select "Set Document Class".
 

Medge

Well-Known Member
Dec 23, 2015
172
149
Up and running. Was an incredibly nubbish, unrelated error on my part. Huge thanks for the guide. Was a bit flustered before I happened on it while trolling the forum. Thanks to @noobsaleh in another thread for linking it too.
 

Izic48

New Member
Nov 8, 2016
2
1
39
USA TEXAS
ok i been getting this when i debug or make my own release how can i fix please

C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\UIComponents\SideBarComponents\StatBar.as(205): col: 27 Error: Access of undefined property Color.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\UIComponents\SideBarComponents\StatBar.as(10): col: 18 Error: Definition fl.motion:Color could not be found.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\UIComponents\SideBarComponents\LocationHeader.as(8): col: 23 Error: Definition fl.transitions:Tween could not be found.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\UIComponents\ButtonTray.as(4): col: 18 Error: Definition fl.motion:Color could not be found.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(762): col: 11 Error: Type was not found or was not a compile-time constant: Tween.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(762): col: 23 Error: Call to a possibly undefined method Tween.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(762): col: 47 Error: Access of undefined property None.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(14): col: 23 Error: Definition fl.transitions:Tween could not be found.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(53): col: 30 Error: Definition fl.transitions.easing:None could not be found.
 

Upcast Drake

Well-Known Member
Moderator
May 27, 2017
2,601
2,061
Southeast USA
ok i been getting this when i debug or make my own release how can i fix please

C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\UIComponents\SideBarComponents\StatBar.as(205): col: 27 Error: Access of undefined property Color.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\UIComponents\SideBarComponents\StatBar.as(10): col: 18 Error: Definition fl.motion:Color could not be found.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\UIComponents\SideBarComponents\LocationHeader.as(8): col: 23 Error: Definition fl.transitions:Tween could not be found.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\UIComponents\ButtonTray.as(4): col: 18 Error: Definition fl.motion:Color could not be found.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(762): col: 11 Error: Type was not found or was not a compile-time constant: Tween.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(762): col: 23 Error: Call to a possibly undefined method Tween.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(762): col: 47 Error: Access of undefined property None.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(14): col: 23 Error: Definition fl.transitions:Tween could not be found.
C:\Users\Robinson\Desktop\TITS\TiTS-Public-master\classes\TiTS.as(53): col: 30 Error: Definition fl.transitions.easing:None could not be found.
flash.swc
 
Nov 9, 2015
20
0
@Upcast Drake I read elsewhere on this forum that the information in this thread might be out of date now because of efforts to make the source code less accessible, is that now the case?

If not, any help on why this appears when I follow your instructions and try to build project?
C:\Users\Me\Videos\Flash\TiTS\TiTS-Public-master\obj\TiTSFDConfig.xml(61): Error: unable to open 'C:\Users\Me\Videos\Flash\TiTS\libraries\flash.swc'
</library-path>

Thanks for your time regardless.
 

DrunkZombie

Well-Known Member
Moderator
Apr 12, 2018
1,564
877
Minnesota, USA
Nope, this all still works. It is just a pain.

As mentioned in earlier comments above, you need to add the path for flash.swc

Per op instructions
We need to tell it to use flash.swc though or it won't compile. In FlashDevelop, go to Project->Properties->Compiler Options. Under the "Advanced" section you should see "SWC Libraries", highlight it and then click the "..." button that appears to the right. On a new line paste the full path to flash.swc, something like "C:\Users\{you}\Desktop\TiTS\libraries\flash.swc" if you made your first folder on your desktop and named it "TiTS". If you need help, go to wherever you saved flash.swc, and then click the navigation bar and it shouldautomatically highlight almost the entirepath, you'll just need to append "\flash.swc".

It appears the flash.swc is not in the folder you set it to.
 

Upcast Drake

Well-Known Member
Moderator
May 27, 2017
2,601
2,061
Southeast USA
@Upcast Drake I read elsewhere on this forum that the information in this thread might be out of date now because of efforts to make the source code less accessible, is that now the case?

If not, any help on why this appears when I follow your instructions and try to build project?
C:\Users\Me\Videos\Flash\TiTS\TiTS-Public-master\obj\TiTSFDConfig.xml(61): Error: unable to open 'C:\Users\Me\Videos\Flash\TiTS\libraries\flash.swc'
</library-path>

Thanks for your time regardless.
There have been no efforts to make the TiTS code less accessible. Like Drunk Zombie said that message just means flash.swc isn't where FlashDevelop expects it.
 
Nov 9, 2015
20
0
I deleted the post containing my previous problem because I went through your OP again meticulously and from scratch and (after facing the same problems as earlier posters) finally managed to get the game up and running. I didn't want to just drop off without thanking you both for your help and patience, though. Cheers for making this thread!
 

DrunkZombie

Well-Known Member
Moderator
Apr 12, 2018
1,564
877
Minnesota, USA
I deleted the post containing my previous problem because I went through your OP again meticulously and from scratch and (after facing the same problems as earlier posters) finally managed to get the game up and running. I didn't want to just drop off without thanking you both for your help and patience, though. Cheers for making this thread!
Congrats! Getting the game to compile is a feat in itself.
 

thernn

Well-Known Member
Apr 17, 2018
149
166
Just some comments on this.

Java SDK 1.6+ - 32 bit - Not needed and can actually cause problems with other Java programs. I use Java 10.0.1 64 bit and I compile with no problems.
FlashDevelop
Flex SDK
TiTS source code
flash.swc

says "java.args=-Xmx384m -Dsun.io.useCanonCaches=false" or something similar. Increase the 384 to 1024 and save.

1024 is wayyyyyy to little nowadays. You will run into frequent heap crashes because the JVM ran out of memory. My compiles regularly use between 1400-1700mb.

Use this line instead in jvm.config

java.args= -Xms512m -Xmx4g -Dsun.io.useCanonCaches=false

The JVM will start with 512 megs and can increase as needed up to 4 gigs.
 

thernn

Well-Known Member
Apr 17, 2018
149
166
If you have both 32b and 64b java installed add the -d64 arg to force 64b otherwise Java will default to 32b.

Gonna play around with GC tonight and I'll report back.
-XX:+UseParallelGC -XX: ParallelGCThreads=8

(I have 32 threads so 8 may not not be a good choice for you if you have an i5 for instance.)
 
Nov 9, 2015
20
0
flash.swc
I've been having similar problems to the person in this post (copied and pasted below), but the strange thing here is I successfully compiled and ran the game a few days ago so flash.swc's location must have been accounted for, whereas now it's giving me errors such as:

Building TiTSFD
mxmlc -load-config+=obj\TiTSFDConfig.xml -debug=true -incremental=true -swf-version=22 -keep-as3-metadata+=Serialize -o obj\TiTSFD636653047244310000
Incremental compile of 1
Loading configuration file C:\Users\Me\AppData\Local\FlashDevelop\Apps\flexairsdk\4.6.0+29.0.0\frameworks\flex-config.xml
Loading configuration file C:\Users\Me\Downloads\TITS\TiTS-Public-master\obj\TiTSFDConfig.xml
Initial setup: 396235ms
start loading swcs 0ms Running Total: 1493247ms
Loaded 31 SWCs: 54ms
Updated: C:\Users\Me\Downloads\TITS\TiTS-Public-master\includes\follower\celise.as
(it goes on like this for some time and I didn't want to spam - all fall under C:\Users\Me\Downloads\TITS\TiTS-Public-master\includes\
Files changed: 0 Files affected: 956
precompile: 4069ms
Files: 2418 Time: 22943ms
Total time: 1516245ms
Peak memory usage: 976 MB (Heap: 956, Non-Heap: 20)
Warning: The use of SVG has been deprecated since Flex 4. Please use FXG.
C:\Users\Me\Downloads\TITS\TiTS-Public-master\classes\UIComponents\ContentModules\MainMenuModule.as: Warning: The use of SVG has been deprecated since Flex 4. Please use FXG.
C:\Users\Me\Downloads\TITS\TiTS-Public-master\classes\UIComponents\ButtonTray.as(4): col: 18 Error: Definition fl.motion:Color could not be found.
import fl.motion.Color;
^
C:\Users\Me\Downloads\TITS\TiTS-Public-master\classes\UIComponents\SideBarComponents\StatBar.as(205): col: 27 Error: Access of undefined property Color.
_progressColor.color = Color.interpolateColor(low, high, scaleValue);
^
C:\Users\Me\Downloads\TITS\TiTS-Public-master\classes\UIComponents\SideBarComponents\StatBar.as(10): col: 18 Error: Definition fl.motion:Color could not be found.
import fl.motion.Color;
^
C:\Users\Me\Downloads\TITS\TiTS-Public-master\classes\UIComponents\SideBarComponents\LocationHeader.as(8): col: 23 Error: Definition fl.transitions:Tween could not be found.
import fl.transitions.Tween;
^
Build halted with errors (fcsh).


The strange thing here is that it seems to be a problem with flash.swc but it loaded just fine the other day and I've made zero changes in code whatsoever. Possibly related, when I first changed the SWC Libraries to my own flash.swc location there were extra lines that I left in, should the bottom three be removed?
C:\Users\Me\Downloads\TITS\libraries\flash.swc
style_uiscroll.swc
lib\AndroidFullScreen.ane
lib\adt\AndroidFullScreen.ane

Thanks again, I know how annoying it must be sometimes to explain what must seem to you to be incredibly basic things to people who should know better!
 

thernn

Well-Known Member
Apr 17, 2018
149
166
Are you opening the right project file? Only thing I can think of. I

Those lines are fine. It's definately a flash.swc problem.​
 
Nov 9, 2015
20
0
As expected it was a peabrain error on my part. Technically, at least - my 'libraries' folder where flash.swc was stored decided to rename itself New folder for no reason at all and I didn't check it before complaining. Cheers.
 

hg2026

Active Member
Jul 30, 2016
38
16
United Kingdom
I've been following this guide but keep running into this "Error: GC overhead limit exceeded". The CoC modding guide says this is related to the memory allocation but I've followed thernn's java settings on x64 and I'm still getting this issue even though it maxing out at 1099mb and my setting should cover that if working correctly.
On the rare occasions that it can happen before the previous error I get this one: "D:\games\TiTS\titsfd\TiTS-Public-master\classes\TiTS.as(2): col: 1 Error: Packages cannot be nested." The file it's mentioning has an icon by it that the others don't, no idea if this is related.
There's even an elusive third set of errors which I don't have the logs for or recreate but they all seem to be related to a scroll bar asset.
 

Upcast Drake

Well-Known Member
Moderator
May 27, 2017
2,601
2,061
Southeast USA
I've been following this guide but keep running into this "Error: GC overhead limit exceeded". The CoC modding guide says this is related to the memory allocation but I've followed thernn's java settings on x64 and I'm still getting this issue even though it maxing out at 1099mb and my setting should cover that if working correctly.
On the rare occasions that it can happen before the previous error I get this one: "D:\games\TiTS\titsfd\TiTS-Public-master\classes\TiTS.as(2): col: 1 Error: Packages cannot be nested." The file it's mentioning has an icon by it that the others don't, no idea if this is related.
There's even an elusive third set of errors which I don't have the logs for or recreate but they all seem to be related to a scroll bar asset.
How much RAM does your computer have? If it's 4GB you might be maxing out.
 

hg2026

Active Member
Jul 30, 2016
38
16
United Kingdom
How much RAM does your computer have? If it's 4GB you might be maxing out.
I have 16gb
edit: turns out a number of things were going wrong, the SDK it was using was an older version and I was altering the config for the new one, and the flash.swc path got deleted for some reason first build success!
 
Last edited:

Somebody Else

Well-Known Member
Nov 12, 2018
87
99
30
Thanks for this! Wanted to start trying out some coding, but since I'm a complete novice I never would've been able to figure this out on my own.