Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.98a is out! (03/27/25)

Author Topic: A muddle of questions  (Read 6754 times)

Cosmitz

  • Admiral
  • *****
  • Posts: 759
    • View Profile
A muddle of questions
« on: August 06, 2012, 12:45:53 PM »

I'm starting to make a little mod, initially for myself, but if it turns out nice enough i'll toss it up here to you fine gentlemen to enjoy, and as such, i'm having a few questions about modding and tweaking.

1) Where do i write ship descriptions, nothing in the csv or the .ship file.
2) Does the game automatically compile the .java files in .classes when it runs?
3) If i wanted to modify certain aspects of ship systems besides what's offered in the CSV, would i need to decompile/recompile the scripts, or just introduce values in the .system files? I'm seeing functionality placed all over from the CSV to .system to .class, with graphical options limited to .systems. Technically i would be interested in modding for example the fortress shield to give a speed buff aswell.
4) How much if at all does 'weight' affect handling?
5) I'm seeing some times that the game ignores the boundaries and uses the collision radius, when and why does that happen? I'm having issues with long ships that if i set the radius too small, asteroids sometimes get 'inside' the ship boundaries before rebounding of the collision. Also, if i'm not mistaken, that's also used by fighters, so if i put the collision bigger than the shield coverage, i assume fighters would bypass the shields per se?
6) Could i define a different 'center' of a ship to be used for movement and another for collision? I'd like to get some ships the feeling that they handle more like a  front-wheel-drive car rather than a 4x4.
7) Can i set-up a certain command parameter to automatically load a mission or ideally the simulator? I'm seeing a lot of back and forth in playtesting and balancing my ship/s with me starting up the game, selecting missions, going to my test mission, selecting Refit and then finally 'Simulate'
8) That's it, i'm done for now, but i will continue to use this thread to ask stuff so check back often for absolutely demanding questions to be answered! :D
Logged

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Re: A muddle of questions
« Reply #1 on: August 06, 2012, 01:21:33 PM »

1) Where do i write ship descriptions, nothing in the csv or the .ship file.
You'll need to make a descriptions.csv file in a strings folder in data.

For example: C:\Program Files (x86)\Fractal Softworks\Starfarer\mods\<YOURMOD>\data\strings\descriptions.csv

Easiest thing to do is copy what's in the core files and just remove everything but the title row and work from there with your stuff

2) Does the game automatically compile the .java files in .classes when it runs?

I don't think the classes are needed for custom things, at least I've never had any trouble without them, should be safe with just the .java stuff you've written

3) If i wanted to modify certain aspects of ship systems besides what's offered in the CSV, would i need to decompile/recompile the scripts, or just introduce values in the .system files? I'm seeing functionality placed all over from the CSV to .system to .class, with graphical options limited to .systems. Technically i would be interested in modding for example the fortress shield to give a speed buff aswell.

Not entirely sure on this one, I'll be honest, but I'd guess you would just have to chuck some of the burner lines into your custom fortress shield system, namely these lines
Code
	"accelerationBonusFlat":800,
"accelerationBonusPercent":800,
"decelerationBonusFlat":0,
"decelerationBonusPercent":0,
"turnAccelerationBonusFlat":0,
"turnAccelerationBonusPercent":400,

"speedBonusFlat":50,
"speedBonusPercent":50,
"turnRateBonusFlat":0,
"turnRateBonusPercent":50,

Again, not 100% on this one

4) How much if at all does 'weight' affect handling?
Not sure if it does. I was under the impression that it was more to do with ship to ship collisions as to which one "wins out". Someone else may shed more light on this, I have little-to-no experience with the weight system

5) I'm seeing some times that the game ignores the boundaries and uses the collision radius, when and why does that happen? I'm having issues with long ships that if i set the radius too small, asteroids sometimes get 'inside' the ship boundaries before rebounding of the collision. Also, if i'm not mistaken, that's also used by fighters, so if i put the collision bigger than the shield coverage, i assume fighters would bypass the shields per se?
Can't say I've noticed that happening at all, so I can't help you there I'm afraid

6) Could i define a different 'center' of a ship to be used for movement and another for collision? I'd like to get some ships the feeling that they handle more like a  front-wheel-drive car rather than a 4x4.

The centre variable should be enough for that. As long as the collision covers the entire ship, it doesn't matter how much it goes over one of the sides IIRC

7) Can i set-up a certain command parameter to automatically load a mission or ideally the simulator? I'm seeing a lot of back and forth in playtesting and balancing my ship/s with me starting up the game, selecting missions, going to my test mission, selecting Refit and then finally 'Simulate'
You could use devmode, which means changing the third line of the settings.json in the config folder to true. It adds a simulate thing to use


Hopefully that's helped you slightly, though there are some things that I'm still unsure about, so I apologise if I didn't help there
Logged

Erick Doe

  • Global Moderator
  • Admiral
  • *****
  • Posts: 2489
  • "Pretty cunning, don't you think?"
    • View Profile
Re: A muddle of questions
« Reply #2 on: August 06, 2012, 01:48:10 PM »

1) Where do i write ship descriptions, nothing in the csv or the .ship file.
You'll need to make a descriptions.csv file in a strings folder in data.

For example: C:\Program Files (x86)\Fractal Softworks\Starfarer\mods\<YOURMOD>\data\strings\descriptions.csv

Easiest thing to do is copy what's in the core files and just remove everything but the title row and work from there with your stuff

Correct!

2) Does the game automatically compile the .java files in .classes when it runs?

I don't think the classes are needed for custom things, at least I've never had any trouble without them, should be safe with just the .java stuff you've written

Good answer.  :)

3) If i wanted to modify certain aspects of ship systems besides what's offered in the CSV, would i need to decompile/recompile the scripts, or just introduce values in the .system files? I'm seeing functionality placed all over from the CSV to .system to .class, with graphical options limited to .systems. Technically i would be interested in modding for example the fortress shield to give a speed buff aswell.

Not entirely sure on this one, I'll be honest, but I'd guess you would just have to chuck some of the burner lines into your custom fortress shield system, namely these lines
Code
	"accelerationBonusFlat":800,
"accelerationBonusPercent":800,
"decelerationBonusFlat":0,
"decelerationBonusPercent":0,
"turnAccelerationBonusFlat":0,
"turnAccelerationBonusPercent":400,

"speedBonusFlat":50,
"speedBonusPercent":50,
"turnRateBonusFlat":0,
"turnRateBonusPercent":50,

Again, not 100% on this one

A great tool for modifying ship stats, including Hull, Variant, and .cvs info: http://fractalsoftworks.com/forum/index.php?topic=375.0

4) How much if at all does 'weight' affect handling?
Not sure if it does. I was under the impression that it was more to do with ship to ship collisions as to which one "wins out". Someone else may shed more light on this, I have little-to-no experience with the weight system

Weight affects collision. A ship with a higher weight will be able to push a ship with a lower weight out of the way.

5) I'm seeing some times that the game ignores the boundaries and uses the collision radius, when and why does that happen? I'm having issues with long ships that if i set the radius too small, asteroids sometimes get 'inside' the ship boundaries before rebounding of the collision. Also, if i'm not mistaken, that's also used by fighters, so if i put the collision bigger than the shield coverage, i assume fighters would bypass the shields per se?
Can't say I've noticed that happening at all, so I can't help you there I'm afraid

Starting from the center of mass, make sure that the collision radius engulfs the ENTIRE ship. Then create a boundary along the actual edges of the ship. The game uses the collision radius if the actual boundaries are missing.

6) Could i define a different 'center' of a ship to be used for movement and another for collision? I'd like to get some ships the feeling that they handle more like a  front-wheel-drive car rather than a 4x4.

The centre variable should be enough for that. As long as the collision covers the entire ship, it doesn't matter how much it goes over one of the sides IIRC

This.

7) Can i set-up a certain command parameter to automatically load a mission or ideally the simulator? I'm seeing a lot of back and forth in playtesting and balancing my ship/s with me starting up the game, selecting missions, going to my test mission, selecting Refit and then finally 'Simulate'
You could use devmode, which means changing the third line of the settings.json in the config folder to true. It adds a simulate thing to use

Great answers K-64. It is making me question why I quoted the whole thing.

Hopefully that's helped you slightly, though there are some things that I'm still unsure about, so I apologise if I didn't help there
Logged

Cosmitz

  • Admiral
  • *****
  • Posts: 759
    • View Profile
Re: A muddle of questions
« Reply #3 on: August 06, 2012, 02:44:35 PM »

Thank you for the quick and great answers. :)

Quote
Starting from the center of mass, make sure that the collision radius engulfs the ENTIRE ship. Then create a boundary along the actual edges of the ship. The game uses the collision radius if the actual boundaries are missing.

Technically that's what i understood aswell, but multiple gameplay testings showed that, as said, with too small of a collision radius, sometimes asteroids and such will use the collision circle rather than the boundaries. Maybe CPU optimizations?

Also, as i posted in Trylobot's thread, i'm having an issue with that editor. I'm just working with the Redbulls (i think), Online Editor which is decent and does what i need.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25964
    • View Profile
Re: A muddle of questions
« Reply #4 on: August 06, 2012, 02:47:04 PM »

*Starting from the center of mass, make sure that the collision radius engulfs the ENTIRE ship. Then create a boundary along the actual edges of the ship. The game uses the collision radius if the actual boundaries are missing.*

What that means is it'll use the collision radius to detect an actual collision if the bounds are missing. It'll use the collision radius to prune out the potential collisions in either case (and thus avoid the more costly bounds checks). Basically: make sure both the shields and the bounds fit within the collision radius. Any collisions outside the radius will be missed.
Logged

Cosmitz

  • Admiral
  • *****
  • Posts: 759
    • View Profile
Re: A muddle of questions
« Reply #5 on: August 06, 2012, 05:51:25 PM »

Coming back with a bit of an issue: 

Made the descriptions.csv, put in a newly made 'strings' directory, fallowed the basic myshipid,SHIP,"etcetc",,, formula, but the game does not see any descriptions. Do i have to set them up somewhere or something? I'm mentioning i ONLY did the diescriptions.csv, nothing else.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25964
    • View Profile
Re: A muddle of questions
« Reply #6 on: August 06, 2012, 05:53:57 PM »

It goes in "data/strings", not just "strings". Is that what you meant? If that's not it, I'd suggest posting the file.
Logged

Cosmitz

  • Admiral
  • *****
  • Posts: 759
    • View Profile
Re: A muddle of questions
« Reply #7 on: August 07, 2012, 03:45:06 AM »

I'm sorry, i was *** and tired last night.. data/stringSSSSSS, not data/string -.-.

Returning to my shipsystems modding. I assume we can do all we need within .system files. Aside from what variable we can steal from other systems, can we get a straight variablelist dump that we can toy around with? :)
Logged

Cosmitz

  • Admiral
  • *****
  • Posts: 759
    • View Profile
Re: A muddle of questions
« Reply #8 on: August 09, 2012, 10:22:11 AM »

Hey, me again with questions,

I've recently stumbled into a bit of a design trouble with my mod. Basically, the 'Energy/Ballistic/Missile' trichotomy doesn't exactly mesh with what i want to do. I'd like some ships to be able to fire some types of weapons for example, but not others, to preserve race 'flavour'. I could technically work within the design by ajusting flux needs so some ships are barred by design from firing a type of weapon, but since i want the game to be vanilla-balanced, that'll ruin it.

Basically, question is, has anyone succeeded in defining new types of hardpoints/weapon types? Something along the lines, for example, adding "Sonic" hardpoint/weapontype?

Going further and being even more obnoxious, can dual-type mounts be made? 'Mount Ballistic or Sonic', similar to Universal mounts but not quite?
Logged

Cosmitz

  • Admiral
  • *****
  • Posts: 759
    • View Profile
Re: A muddle of questions
« Reply #9 on: August 09, 2012, 03:45:55 PM »

And sorry to bump this again:

I made a new fighter. Set it up in the CSV, id = string. I then edited wing data, ID = string_wing, variant string_standard which i added. I then introduced string_wing in the missiondescriptor.java file of a test mission i use.

When i enter the mission select screen, it's like any mission that i click over, gets 'selected', and when i click my test mission, it 'refreshes' the last 'selected' mission. If i click just on it, the one above, Random Battle gets selected.

What? I'm sure this is limited to the new fighter additions, and putting in the missiondescriptor.java file string_variant, instead of string_wing, works.
Logged

Cosmitz

  • Admiral
  • *****
  • Posts: 759
    • View Profile
Re: A muddle of questions
« Reply #10 on: August 10, 2012, 07:03:08 AM »

Bump?
Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: A muddle of questions
« Reply #11 on: August 10, 2012, 07:15:42 AM »

Look at mission`s descriptions. If it refreshes - its probably due to the missing variant or wing. It will show you the error in the brakets in middion description text (usually).

You can also look at the log file and check if it has any errors/warnings.

Cosmitz

  • Admiral
  • *****
  • Posts: 759
    • View Profile
Re: A muddle of questions
« Reply #12 on: August 10, 2012, 07:47:16 AM »

Solved it.. It showed: Ship hull variant: string_wing not found.

My line in the missiondescriptor.java was
Code
api.addToFleet(FleetSide.PLAYER, "string_wing", FleetMemberType.SHIP, false);
instead of
Code
api.addToFleet(FleetSide.PLAYER, "string_wing", FleetMemberType.FIGHTER_WING, false);


This issue remains:

Hey, me again with questions,

I've recently stumbled into a bit of a design trouble with my mod. Basically, the 'Energy/Ballistic/Missile' trichotomy doesn't exactly mesh with what i want to do. I'd like some ships to be able to fire some types of weapons for example, but not others, to preserve race 'flavour'. I could technically work within the design by ajusting flux needs so some ships are barred by design from firing a type of weapon, but since i want the game to be vanilla-balanced, that'll ruin it.

Basically, question is, has anyone succeeded in defining new types of hardpoints/weapon types? Something along the lines, for example, adding "Sonic" hardpoint/weapontype?

Going further and being even more obnoxious, can dual-type mounts be made? 'Mount Ballistic or Sonic', similar to Universal mounts but not quite?

« Last Edit: August 10, 2012, 07:49:16 AM by Cosmitz »
Logged