Operation: Clonebay

Discuss and distribute tools and methods for modding. Moderator - Grognak
preflex
Posts: 20
Joined: Sun Mar 01, 2015 2:19 pm

Re: Operation: Clonebay

Postby preflex » Fri Mar 20, 2015 9:35 pm

TheFallenAngel359 wrote:I've always wanted to add new systems to the game, such as a "Cargo Bay" system that could be used to transport goods for trading purposes (a la CE). Would this be possible through Clonebay? I don't see why not, but it may be a programming limit.


I have my own plans for some optional enhancements to the cargo system.

Anything that is already possible with FTL mods, should still be possible in clonebay.

Regarding programming limits:
I'll be calling scripts at various times, on_load, pre-tick, post-tick, on_equip, etc ... things of that nature. These scripts will have access to all loaded game data, and the entire game state.
Since the scripting language is Python, and Clonebay is in Python, and since I have no interest in sandboxing it, scripts could coneivably, without a whole lot of effort, even override the game's tick() method (or anything else, for that matter), with their own versions of those methods. The only limit will be your imagination. Mods could override the whole game, download updates for themselves, or even do dangerous things, like attempt to "rm -rf /", etc.

I was thinking of a mod that would show the sector map, beacon map, and ship upgrades pricing in all times in a separate window, that would be launched by a game script.

Maybe a cheat script mod, that opens up a separate window that allows you to edit some aspects of the game state, in real time, like scrap, missles, hull health, etc. No need to piddle around editing save games, just install it, and if you're about to die, add more hull, you evil, filthy cheater! Don't like it? Don't enable the mod.

But that's not what I'm working on today. Today, I'm working on events and choices!
User avatar
Sleeper Service
Posts: 2305
Joined: Sun Mar 24, 2013 8:49 pm

Re: Operation: Clonebay

Postby Sleeper Service » Sat Mar 21, 2015 1:28 am

preflex wrote:Because, If I do that, I still won't be able to play FTL on my Raspberry Pi, or my n900, or my Archlinux tablet, or (a looooong time from now) Android. This is some pretty niche stuff. Support for stuff like Windows and MacOS, where FTL already runs just fine, is mostly an afterthought: merely a result of Python's wide compatibility. I'm scratching my own itch, but in the process may also soothe some of yours.


preflex wrote:Of course, one of the reasons I am rewriting FTL is to gain insight for building my own game. FTL is clearly-defined, and already has lots of great assets, so for now, I can just focus on the programming and watch a great game take shape right before my eyes. It has already been, and will continue to be a valuable learning experience. Hopefully, my work on Clonebay will gain me a good enough reputation with the FTL community, that some of you would consider supporting me in my own endeavours.

Yeah I can see where you going. Don't want to discourage you there, I feel like I learned a lot from modding the game even though I have no idea about actual programming. I believe I got a pretty good grasp of the event system and how FTL handles graphics. I doubt I'd be much help for the stuff you do but feel free to ask anyway. :D

Right, but if "Open FTL" eventually is the goal that you have close to zero assets available. I mean CE is at your disposal, but that barely scratches the surface. Some of its ships are color-only reskins, they would be already iffy from a copy right perspective. And all its other designs are spliced from vanilla. Creating an open FTL would mean creating whole new designs for ships, crew, factions, the UI as well as rewriting hundreds of events with new texts, recoding or finding new soundeffects... the list goes on.
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: Operation: Clonebay

Postby Vhati » Mon Mar 23, 2015 12:32 am

preflex wrote:Note for me: file = open(filename, encoding="utf8")

Footnote: FTL's assets lie.

They're not really UTF8.
They're ANSI (windows-1252 aka cp1252 encoding, yes even on OSX/Linux).

It's identical to UTF8... except for a handful of characters like accents, slanty quotes, and such.

Or rather, FTL reads the XML as ANSI.
Some of the files have a legit UTF8 BOM header.
Wheee.



Edit: cp1252
User avatar
TheFallenAngel359
Posts: 111
Joined: Fri Feb 13, 2015 8:22 pm

Re: Operation: Clonebay

Postby TheFallenAngel359 » Wed Mar 25, 2015 5:39 am

Just a question - why Python? FTL: Overdrive was going to do the same thing, but with Lua scripting, making it easier to code. Plus, Overdrive has its files as open source, meaning that you could use the (albeit small) head start as a jumping point. It just seems like you're making more work for yourself, unless you are proficient in Python.
Image
preflex
Posts: 20
Joined: Sun Mar 01, 2015 2:19 pm

Re: Operation: Clonebay

Postby preflex » Fri Mar 27, 2015 9:29 am

Instead of a steady stream of commits, I have just pushed one big one.

Lots of progress on events, and I cleaned up some ugly stuff. Also started some work on building layouts, and figured out a good way to generate them (but haven't implemented it yet).



Vhati wrote:
preflex wrote:Note for me: file = open(filename, encoding="utf8")

Footnote: FTL's assets lie.

They're not really UTF8.
They're ANSI (windows-1252 aka cp1252 encoding, yes even on OSX/Linux).

It's identical to UTF8... except for a handful of characters like accents, slanty quotes, and such.

Or rather, FTL reads the XML as ANSI.
Some of the files have a legit UTF8 BOM header.
Wheee.


Thanks! That helps a lot. Those xml files are so bonkers, I'm amazed FTL actually runs. I'll be hacking the related chunk of code again in the next few days. There's a lot of stuff I need to do in that file.

TheFallenAngel359 wrote:Just a question - why Python? FTL: Overdrive was going to do the same thing, but with Lua scripting, making it easier to code. Plus, Overdrive has its files as open source, meaning that you could use the (albeit small) head start as a jumping point. It just seems like you're making more work for yourself, unless you are proficient in Python.


Why Python? Because it's like having a weapon pre-igniter for my code.

Why not build upon an existing project? (The short version)
1. Java support is poor on one of my target platforms (Maemo5). C# support is even worse.
2. Clonebay has different goals, and therefore, a different overall design. I have peeked at the code for the other projects, but since the design is so different, it really hasn't been of much use to me. Some of the commentary in their related threads, however, has been enormously helpful.
preflex
Posts: 20
Joined: Sun Mar 01, 2015 2:19 pm

Re: Operation: Clonebay

Postby preflex » Sun Mar 29, 2015 8:03 pm

Some new screenshots.

Image
Image
Image
English Narwhal
Posts: 402
Joined: Tue Dec 03, 2013 9:12 pm
Location: High Orbit

Re: Operation: Clonebay

Postby English Narwhal » Tue Mar 31, 2015 12:39 pm

Amazing. Good to know people are still going strong with these massive projects.
Image
preflex
Posts: 20
Joined: Sun Mar 01, 2015 2:19 pm

Re: Operation: Clonebay

Postby preflex » Fri Apr 03, 2015 1:23 am

I've been working on crew-related stuff the last few days.

I'm a bit confused on how to place them.
For some systems, the entry in the systemlist looks like this:

Code: Select all

     <pilot power="1" room="11" start="true" img="room_pilot">
         <slot>
            <direction>right</direction>
            <number>0</number>
         </slot>
      </pilot>

I assume the 'direction' is the direction the crew member manning the system should be facing, and the 'number' is the tile he should be standing on when doing it.

But some others look like this:

Code: Select all

<engines power="2" room="5" start="true" img="room_engines"/>

They don't have a slot. I tried to think of some sort of sane default, but it seems too inconsistent.

Am I inferring the wrong meaning from the 'slot'? Medbays have slots, I assume that defines the tile that crewmembers cannot occupy. Is the information i'm looking for somewhere else? Maybe I'm numbering the tiles incorrectly? I noticed that the sprite sheets start at the bottom ...

EDIT: I fixed the numbering. If the system has a <slot>, the crew members show up in the right place.

Is it related to the image files? If it's using 'room_engines' image should I know then to make the slot 0, down?
I really don't like that idea. It makes me want to edit all the xml files to include a <slot> for each mannable system, and include that in the patch set.
User avatar
NarnKar
Posts: 778
Joined: Thu Jun 19, 2014 4:24 pm
Location: this forum
Contact:

Re: Operation: Clonebay

Postby NarnKar » Fri Apr 03, 2015 2:34 am

Engines should have a slot, I think. That's been my experience when using Superluminal, at least. I think if no slot is specified it just goes with a default, and the default can be seen on the Kestrel A.
preflex
Posts: 20
Joined: Sun Mar 01, 2015 2:19 pm

Re: Operation: Clonebay

Postby preflex » Fri Apr 03, 2015 9:18 am

NarnKar wrote:Engines should have a slot, I think. That's been my experience when using Superluminal, at least.


The specific XML mentioned was quoted directly from the Kestrel C (PLAYER_SHIP_HARD_3). It's the first ship that loads on my system (Python is weird, YMMV).

Code: Select all

<systemList>
      <pilot power="1" room="11" start="true" img="room_pilot">
         <slot>
            <direction>right</direction>
            <number>0</number>
         </slot>
      </pilot>
      <doors power="1" room="10" start="true" img="room_doors">
         <slot>
            <direction>up</direction>
            <number>1</number>
         </slot>
      </doors>
      <sensors power="2" room="13" start="true" img="room_sensors">
         <slot>
            <direction>down</direction>
            <number>1</number>
         </slot>
      </sensors>   
      <medbay power="1" room="9" start="false" img="room_medbay_8">   
         <slot>
            <number>1</number>
         </slot>
      </medbay>
      <clonebay power="1" room="9" start="true">
         <slot>
            <number>1</number>
         </slot>
      </clonebay>
      <oxygen power="1"  room="7" start="true" img="room_oxygen_10"/>
      <shields power="2" room="12" start="true" img="room_shields_3">
         <slot>
            <direction>left</direction>
            <number>2</number>
         </slot>
      </shields>
      <engines power="2" room="5" start="true" img="room_engines"/>
      <weapons power="2" room="2" start="true" img="room_weapons_2"/>
      <drones power="2" room="6" start="false" img="room_drones_13"/>   
      <teleporter power="1" room="4"   start="false"/>   
      <cloaking power="1" room="1" start="false" img="room_cloaking_3"/>   
      <battery power="1" room="8" start="false" img="room_battery_6"/>     
      <mind power="1" room="16" start="false" img="room_mind_1"/>   
      <hacking power="1" room="14" start="false" img="room_hacking"> 
         <slot>
            <direction>down</direction>
            <number>0</number>
         </slot>
      </hacking>
   </systemList>


I guessed '0, down' as a default. It turns out, that is never right. However, I can't see one default that always is.
Image


I think if no slot is specified it just goes with a default, and the default can be seen on the Kestrel A.


Yes, but the defaults seem to be different if the system is guns, engines, or shields, etc...

In the example of the Kestrel C, above, for weapon systems, the default appears to be '1, up', but for engines, it should be '2, down'.


Bonus: Often, specified locations are identical to the default ones. For example, in Lanius B, the specified slot for the engineer is identical to what appears to be the default location. (The specficied location for the gunner, however, is not default)

Image
EDIT: For a room that shape, I suppose the pilot would also be in the default. However, the gunner's position is not default. All three are specified.

Code: Select all

   <systemList>
      <pilot power="1" room="9" start="true">
         <slot>
            <direction>right</direction>
            <number>0</number>
         </slot>
      </pilot> 
      <doors power="1" room="16" start="true" img="room_doors_2"> 
         <slot>
            <direction>down</direction>
            <number>0</number>
         </slot>
      </doors>
      <sensors power="1" room="0" start="false" img="room_sensors_2"> 
         <slot>
            <direction>up</direction>
            <number>0</number>
         </slot>
      </sensors>
      <oxygen power="1" room="5" start="true"/>
      <engines power="1" room="8" start="true" img="room_engines_2">
         <slot>
            <direction>down</direction>
            <number>2</number>
         </slot>
      </engines>
      <shields power="2" room="4" start="true" img="room_shields_3">
         <slot>
            <direction>left</direction>
            <number>2</number>
         </slot>
      </shields>
      <weapons power="1" room="13" start="true" img="room_weapons_10">
         <slot>
            <direction>up</direction>
            <number>0</number>
         </slot>
      </weapons>
      <drones power="2" room="2" start="false" img="room_drones_7"/> 
      <clonebay power="1" room="11" start="true">
         <slot>
            <number>2</number>
         </slot>
      </clonebay>
      <medbay power="1" room="11" start="false" img="room_medbay_7"> 
         <slot>
            <number>2</number>
         </slot>
      </medbay>
      <teleporter power="1" room="12" start="true"/> 
      <cloaking power="1" room="1" start="false" img="room_cloaking_3"/> 
      <mind power="1" room="17" start="true" img="room_mind_3"/>
      <battery power="1" room="15" start="false" img="room_battery_12"/>   
      <hacking power="1" room="3" start="false" img="room_hacking_4">   
         <slot>
            <direction>up</direction>
            <number>0</number>
         </slot>
      </hacking>
   </systemList>


I really don't want to modify this. I also don't want it hardcoded into the engine in that way. Too messy. Perhaps I could add an extra xml file to spefcify stuff. That doesn't sound so bad. Maybe I'm missing one that's already there?

EDIT2: I think there might have been some comments in the XML regardging this stuff that I had to remove because they choked my parser :( . I suppose I should take a peek at the originals...

Who is online

Users browsing this forum: No registered users and 35 guests