JediArchivist

[WIP] KOTOR II Mobile (K2M) Project - KOTOR II TSL Content Ported to KOTOR 1 Mobile (IOS / Android)

10 posts in this topic

Greetings everyone,

This project is meant to attempt to port all content from Star Wars: KOTOR II TSL into Star Wars KOTOR 1 Mobile (for Android / IOS), resulting into a partially / fully playable mobile version of KOTOR II TSL for IOS / Android.

The game will be installed and ran as a Total Conversion Mod over the mobile KOTOR 1 version.

The mod development will consist in the following stages:

- 1. Converting all files from the PC version of KOTOR II, to work with the older KOTOR 1 engine.

- 2. Adapting these files to be installed as a mod (into the Override folder, etc.) for KOTOR 1

- 3. Downgrading / adapting features from KOTOR II that are inexisting in KOTOR 1 (like Crafting, Lightsaber Forms, Companion Training and Loyalty, etc.)

- 3. Adapting and optimising the mod to work on IOS / Android KOTOR 1.

- 4. Testing, Optimising, Polishing

 

----------

Different approaches (listed here as inspiration for other porting endevours):

- Porting the Xoreos Engine or KotOR JS Engine to Android / IOS (for the developers of the Xoreos Engine / KotOR JS Engine)

- Updating the KOTOR 1 Mobile older version of Odissey Engine to work with features from the newer KOTOR II TSL engine (for modders who experimented with the source code of the engines, etc.) 

----------

 

The mod / port will be released here as it is being worked on, and updated as it is progressed on! This endevour will be completly open and collaborative, all work will be uploaded from the start and updated as it progresses!

Everyone who believes they can contribute or help with this project in any way are invited to!

 

==============================

STATUS:

Project Completition: 5%

Project Status: Phase 1 (KOTOR 1 to KOTOR 2 file conversions)

Progress: Ported unmodified files from KOTOR II TSL PC version to KOTOR 1 IOS version.

Filename adapted to work with IOS File System (all files were renamed in lowercase letters).

Practical Result: Succeded in having partial KOTOR II TSL code execution and asset loading into KOTOR 1 IOS version. Specifically, the game crashes when launchimg a mew game, but loading a savegame works. Loading a savegame will display a black screen, however the background music plays, and the Inventory, Map and Quests screens can be accesed and they display the KOTOR II respective content. Accesing the Character screen crashes the game. I will upload a Youtube video showing the resulting functionality soon!

To do next: Convert the modules, textures and animation files from KOTOR 2 format to the KOTOR 1 format and load them into the KOTOR 1 engine.

==============================

 

UPDATE 1:

So far i managed to port the K2 maps to K1 using @Thor110's brilliant tutorial "01 - [TUTORIAL] - Creating a Module for TSL using a KotOR Map!", found here: https://deadlystream.com/topic/6886-tutorial-kotor-modding-tutorial-series/

Now the maps can be warped to but there are no story elements, most NPC's are present but interaction with them does not work, most containers are empty, some still have the loot inside, area transition works for some arear but fails many times, especially when you want to enter the docked Ebon Hawk. Most levels load fine but some of them crash the game (especially the Peragus levels), and the mini-map does not display at all, strangely when the map section is accessed it always shows the Manaan Hrakert Rift Underwater Station map. The character animations also got "broken" after adding the ported files (that is why the characters look so "stiff" in the pictures)... So i could say i had very partial success so far!

==============================

STATUS UPDATE:

Project Completition: 20%

Project Status: Phase 2 (KOTOR 1 to KOTOR 2 converted files adapting and optimising)

Progress: Ported all KOTOR 2 maps to KOTOR 1 format using Thor110's tutorial. Loaded ported / converted maps into the mobile version of KOTOR 1.

Practical Result: Got partial success, most levels work and have been ported fine, some content / features / characters like story elements and NPC interaction do not work, the minimap does not display at all and the map does not work on the ported levels (it always displays the Hrakert Rift Station level map), some area transitions (Return to the Ebon Hawk) do not work, the text above NPC's / area transitions / story objects in level does not display at all (the field is always blank). The character animations also got broken because of the added ported files.

I copied the ported levels into the mobile version of KOTOR 1 (after renaming all filenames in lowercase characters) and managed to get the game to load the ported levels by making a savegame for each module, them transferring that savegame on the mobile version, and loading that save in KOTOR 1 mobile. I am using an iPad 3 to test the mod.

To do next: Adapt and optimise the files causing the bugs / glitches / problems, like script files, restore all functionality (story elements, characters, scripts, etc.). This will be the hardest part (if possible at all)!

==============================

Some pictures of the mod in action (notice the KOTOR 1 mobile HUD):

image.thumb.png.9d84e2edfdc8ff81024b3f87933b6076.pngimage.thumb.png.84b64194aac30a12d83fe3e525dd3c9a.pngimage.thumb.png.75877e2a811bdeb8247da5530bf1c272.pngimage.thumb.png.e9ee424ba9a0204ea86194b3dac6ea99.pngimage.thumb.png.c1149452d08db897de26e5193d8ff6dc.pngimage.thumb.png.76764bd335a0ffb88d19d9b9f49ba445.pngimage.thumb.png.69e932e422be1e3c40f18fb10f38342f.pngimage.thumb.png.bae084672e58bf006e3addad0ead7cf8.pngimage.thumb.png.f2d69aa64bd651cde7519df9f16f2d07.png

Credit:

Many thanks go @Thor110 for his brilliant tutorial "01 - [TUTORIAL] - Creating a Module for TSL using a KotOR Map!", found here: https://deadlystream.com/topic/688

Without this great tutorial i would have been unable to make any progress at all! He basically made it possible to port the levels from K1 to K2!

 

*Updates will be posted to this thread as they come! This post will also be updated as well.

  • Like 1

Share this post


Link to post
Share on other sites
On 12/14/2018 at 10:45 AM, JediArchivist said:

This project is meant to attempt to port all content from Star Wars: KOTOR II TSL into Star Wars KOTOR 1 Mobile (for Android / IOS), resulting into a partially / fully playable mobile version of KOTOR II TSL for IOS / Android.

IANAL, but from a legal standpoint, you won't be able to distribute these converted data files.

What you can distribute (probably, I guess, but again, IANAL) is a converter that everyone will have to run for themselves, and everybody who does that will need to have legal, bought copies of both KotOR Android/iOS and KotOR2 PC.

On 12/14/2018 at 10:45 AM, JediArchivist said:

- Porting the Xoreos Engine [...] to Android / IOS

This is actually not *that* difficult, at least the Android part.

Primarily, what we need is an OpenGL ES renderer. Currently, the renderer subsystem is being rewritten, so adding an OpenGL ES render path would probably clash, but after the rewrite is finished, that would be a very valid thing to do (in fact, that is already on my TODO list).

Apart from that, all our libraries, including SDL2, would already work on Android. You can look at ScummVM for a proof of concept of sorts. There's certain things we'll have to keep in mind, like input, but it's not magic.

iOS, on the other hand... the problem there is licensing, and the walled garden that is iOS. There's no chance xoreos will be allowed on the official Apple App Store. Not with Apple being Apple, and also because xoreos is GPLv3, a license that's fundamentally at odds with the closed-off nature of an App Store. The GPLv3 grants its users to modify the program, and run the modified program, and you can't do that with App Store things. I don't think there's really any sideloading on iOS, right?

  • Like 2

Share this post


Link to post
Share on other sites

Thank You for Your reply and for showing interest in this project! I am honoured by having Your response here! :D

Since PC KOTOR 1 and Mobile KOTOR 1 use the same files (except the lower letter-casing), converting files from KOTOR II TSL to Mobile KOTOR 1 should be as legal as converting them to PC KOTOR I, which has been mostly done since porting is allowed. Many mods port content from KOTOR 1 to KOTOR II TSL though... I'll try to figure out some way to port the whole game content legally, without uploading a whole game's worth of content...

I have been following progress on Xoreos for about 2 years, it is truly great! This year's update really got me excited, seeing it take shape and come closer to completion is awesome! I really admire Your work!

It is great news to hear that implementing OpenGL ES into Xoreos and a future Android release are already in the works! It would seem that an Android version of Xoreos would come even sooner then I thought.

Imput can be handled relatively easy for KOTOR I & II, as for movement and looking around all that is needed is a Virtual Directional Joystick, and touch controls mapped to all the in-game buttons. I managed to do something of this sorts, in able to get KOTOR II to run on a Tablet running Windows 8, by using a program called Virtual Gamepad. I just needed a Virtual Joystick, to which I configured the UP and DOWN buttons to go Forwards and Backwards, and the LEFT and RIGHT buttons to look around (since in KOTOR you only have partial looking around in running mode)! A company called Beloko Games sucessfully managed to port both Star Wars: Jedi Knight games to Android by using a custom engine, and implemented great, customisable touch controls (two virtual joysticks and several buttons for main actions). You can find more about it here: http://www.beloko.com

2gvtxzd.jpg

Unfortunately IOS will never allow Xoreos on the App Store, but sideloading really is a thing on IOS.

https://ios.gadgethacks.com/how-to/install-modded-unofficial-apps-your-iphone-by-sideloading-with-cydia-impactor-0176467/

https://beebom.com/how-to-sideload-apps-iphone-ios-10-without-jailbreak/

I managed to do surprising things with sideloading on Jailed (Non-Cydia) iDevices, such as developing a method for modding IOS KOTOR 1 and other apps (injecting a custom payload into an .ipa package, sideloading it, and then syncing it with a genuine version of the app in order to be able to use it without a Developer Certificate that lasts only 7 days)! I would be more than happy to help You with testing an IOS build of Xoreos, if You ever need it! ;) Installing Xoreos on a Jailbroken iDevice would not even require sideloading, as it would install easely with a fakesign.

As an example, there is a ported edition of Half-Life for IOS (I have it and it works fine), including touch controls. It uses an alternate engine called Xash 3D. It also used SDL.

https://github.com/FWGS/xash3d/releases/tag/v0.19

I can't wait to try out the Mobile Xoreos version!

Edited by JediArchivist

Share this post


Link to post
Share on other sites
On 12/14/2018 at 9:45 AM, JediArchivist said:

Practical Result: Succeded in having partial KOTOR II TSL code execution and asset loading into KOTOR 1 IOS version. Specifically, the game crashes when launchimg a mew game, but loading a savegame works. Loading a savegame will display a black screen, however the background music plays, and the Inventory, Map and Quests screens can be accesed and they display the KOTOR II respective content. Accesing the Character screen crashes the game. I will upload a Youtube video showing the resulting functionality soon!

To do next: Convert the modules, textures and animation files from KOTOR 2 format to the KOTOR 1 format and load them into the KOTOR 1 engine.

Sounds like you are having success, perhaps you will write a tutorial for this process before me, a tutorial is the best and only legal approach to this.

Don't forget to credit everybody that helped ^^ note : presumably you are having success with the steps I explained would most likely be necessary for porting the entire game, if so let me know, would be good to know that I guessed most of the process, I found getting the menu and either game to load most of the other games content on PC relatively easy, but it wouldn't start a new game ( I did not try loading a game ) and I do not have K1 mobile to test this on, so all I can really do is speculate.

Let me know if you have any more trouble and I will see if I can help any more.

If you do not have success I will pick this back up at some point and write a tutorial for the process.

Thor110

  • Like 1

Share this post


Link to post
Share on other sites

Updated the first post to reflect the progress made! Added some pictures as well.

So far i only managed to port the K2 maps to K1 using Your tutorial. Now the maps can be warped to but there are no story elements, most NPC's are present but interaction with them does not work, most containers are empty, some still have the loot inside, area transition works for some arear but fails many times, especially when you want to enter the docked Ebon Hawk. Most levels load fine but some of them crash the game (especially the Peragus levels), and the mini-map does not display at all, strangely when the map section is accessed it always shows the Manaan Hrakert Rift Underwater Station map. The character animations also got "broken" after adding the ported files... So i could say i had very partial success so far!

On 13 ianuarie 2019 at 4:58 AM, Thor110 said:

I found getting the menu and either game to load most of the other games content on PC relatively easy, but it wouldn't start a new game ( I did not try loading a game ) and I do not have K1 mobile to test this on, so all I can really do is speculate.

How did You get the games to load the other game's menu and content? That would be awesome! Could you please describe what You did in order to male K1 load K2's menu and content please? I have tried copying the content over and porting the modules and content, but only got very limited success.

  • Like 1

Share this post


Link to post
Share on other sites

The game engine of the two games are different and not entirely compatible.

TSL is a derivative of KotOR. Thus, if you were doing this the other direction, you would likely have had almost instant success. As it stands, I do not think this mod will ever work without actual programming. Copying files and renaming them is simply not enough for this job.

Sorry to be that guy.

  • Like 2

Share this post


Link to post
Share on other sites

He already knows this I believe, I may be pursuing the project once my Expanded Galaxy Project K2 to K1 files are completed, it would most likely require re-scripting most of the second game as well as re-creating each and every map / map piece in order to add any Placeable Objects that are not there due to the K1 limit.

I have been slowly coming up with solutions / work around ideas for the limitations that would prevent this.

Though I myself accept it may still be an incredibly difficult task that I may not be able to achieve.

My main focus is the Expanded Galaxy Project - a small storyline for both and the overall ported maps for both games, if my K2 to K1 maps can be fixed to display properly then this could become more feasible, I have already managed to fix Dxun which did not display correctly, I also have a solution for both games ports lacking .vis files.

But beyond the fixing of all the maps, there would be a lot of work to do, effectively and potentially re-building the entire second game in the first games engine.

Thor110

Edited by Thor110
  • Like 2

Share this post


Link to post
Share on other sites

Just to re-iterate: from what I've seen while taking the games apart, the menus are pretty hard-coded. The games in general know what widgets are there for each menu, how they hang together, how they behave and what they do, and they only use the GUI files to read the look.

I.e. there is no way to get fully working menus from one game into the other, just by exchanging data files. You will need to hook into the binary itself

  • Like 2

Share this post


Link to post
Share on other sites

Yeah, I understand this, I would basically need to rewrite the Endar Spire scripts to work for the Peragus level and this is the plan for a potential demo.

ie : Hook the first script of the Endar Spire to the Peragus level instead of the Endar Spire level, then maybe even replace the original maps with the new ones in order to force it to load the correct module / map instead of the existing rim / map.

But who knows, it is no doubt going to be very difficult to achieve and may not happen, but I do believe it is possible, just how much work it might be is the question, my thoughts were to re-purpose as many K1 scripts for K2 maps as possible in order to save on time, then just hook the starting script / endar spire map into skipping over to peragus.

This would allow to leave the K1 menu intact and simply skip over any alterations that would need to be made, creating a new character might need some work in order for the save file to actually work, or add a quick conversation that serves the same purpose.

Edited by Thor110
Creating a new character.
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now