Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95.1a is out! (12/10/21); Blog post: The Pilgrim's Path (07/19/22)

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Kiloman

Pages: [1]
1
Suggestions / Enable caching of classes compiled by Janino
« on: October 27, 2013, 11:25:12 PM »
Some folks have noticed that the startup time (particularly with mods enabled) can be pretty lengthy. Have you considered providing a cache for compiled scripts for use with Janino's CachingJavaSourceClassLoader? Perhaps with a file size/modification time or other heuristic to selectively re-compile classes on demand?

I know, mod authors that have weighty code should probably just use a real IDE and compile their code into JARs instead of relying on Janino, but still - I'm curious what sort of difference it would make on startup time in general.

2
Not sure if this is intentional or not, but it looks kind of like a copy-paste issue:

Code: java
		CrewCompositionAPI defenderCrew = member.getCrewComposition();
float defenderStr = defenderCrew.getGreen() * greenMult +
defenderCrew.getRegular() * regularMult +
defenderCrew.getVeteran() * veteranMult +
defenderCrew.getElite() * eliteMult +
defenderCrew.getMarines() * eliteMult;
defenderStr *= defenderMarineMult;

The defender marine count is multiplied by the elite multiplier, not the marine multiplier... so strength 2 instead of 7. Seems like it would pretty heavily favor the attacker.


Also - looks like the old alg for deployment cost is used to calculate the CR hit for boarding actions? Not sure if that's a bug either.

3
Modding / Fleet assignment behavior question for Alex
« on: October 13, 2013, 12:01:52 AM »
I've been poking at the fleet assignments, and wanted to confirm my understanding of their behavior. I set up a test using code like this:

Code: java
public class AssignmentCompletedScript implements Script {
    private CampaignFleetAPI fleet;
    private String comment;
    private Long creationTime;

    public AssignmentCompletedScript(CampaignFleetAPI fleet, String comment){
        this.fleet = fleet;
        this.comment = comment;
        this.creationTime = Global.getSector().getClock().getTimestamp();
    }
    @Override
    public void run() {
        CampaignFleetAI.FleetAssignmentData currentAssignment = ((CampaignFleet)fleet).getAI().getCurrentAssignment();
        Float daysSinceCreation = Global.getSector().getClock().getElapsedDaysSince(creationTime);
        System.out.println("Assignment '"+comment+
                "' completed after "+daysSinceCreation.toString()+
                " days; current assignment"+
                " "+currentAssignment.assignment.toString()+
                " "+currentAssignment.target.getFullName());
    }
}

Somewhere else I do this:
Code: java
CampaignFleetAPI fleet = sector.createFleet("pirates", "raiders1");
location.spawnFleet(anchor, 1000, 1000, fleet);
fleet.setPreferredResupplyLocation(anchor);
fleet.addAssignment(FleetAssignment.GO_TO_LOCATION, anchor.getOrbit().getFocus(), 3, new AssignmentCompletedScript(fleet, "go to planet"));
fleet.addAssignment(FleetAssignment.DEFEND_LOCATION, anchor, 6, new AssignmentCompletedScript(fleet, "defend station"));
fleet.addAssignment(FleetAssignment.RESUPPLY, anchor, 9, new AssignmentCompletedScript(fleet, "resupply"));
fleet.addAssignment(FleetAssignment.GO_TO_LOCATION_AND_DESPAWN, anchor, 12, new AssignmentCompletedScript(fleet, "despawn"));

Here's what I get in the log:
Code
Assignment 'go to planet' completed after 0.77313656 days; current assignment DEFEND_LOCATION Tri-Tachyon Orbital Station
Assignment 'defend station' completed after 6.7509837 days; current assignment RESUPPLY Tri-Tachyon Orbital Station
Assignment 'resupply' completed after 7.0035534 days; current assignment GO_TO_LOCATION_AND_DESPAWN Tri-Tachyon Orbital Station
Assignment 'despawn' completed after 7.0035534 days; current assignment GO_TO_LOCATION_AND_DESPAWN Tri-Tachyon Orbital Station

I've been trying to figure out how the actual timing of the events corresponds to the durations I requested, and I think I understand it:
1. GO_TO_LOCATION completes when the fleet reaches the planet
2. DEFEND_LOCATION starts when GO_TO_LOCATION finishes
3. DEFEND_LOCATION finishes after running for just under 6 days, and RESUPPLY is activated.
4. RESUPPLY completes when the fleet reaches the station, and GO_TO_LOCATION_AND_DESPAWN is activated
5. GO_TO_LOCATION_AND_DESPAWN completes immediately, since the fleet is still at the station (hasn't moved since resupplying)

Based on that, it looks to me like the assignment system is a simple queue, and items are removed either when they've run for their requested duration, or the goal is achieved. It's unclear to me what happens, though, when a goal expires without being achieved - say the location can't be reached in time, or the target can't be attacked because it's too fast or ceased to exist before we could reach it. Other than checking if the fleet is where we expected it to be, or if the target is dead, etc, does the onCompleted callback have any way to tell if the assignment was successful or not?


On a somewhat unrelated note, what happens if we don't call setPreferredResupplyLocation on the fleet? In that case, are we responsible for telling it to resupply on its own (with a RESUPPLY assignment)? I've been trying to figure out how to work around the "resupplying fleets transfer cargo to the station and create new cargo out of thin air" issue, since it's somewhat unbalancing if you're trying to actually control resources.

It'd be nice if we had some sort of API for AI interaction with SectorEntityTokens that was similar to the battle autoresolver API and could handle the various goals (attack, resupply, despawn, transfer cargo x, etc) but absent that, the onCompleted callback gets us part of the way there, since we can just tell the fleet to move somewhere and then do what we really want in the callback. The mouseover tooltip loses some of its usefulness since everything will just say "going to x" but that's why we need a SectorEntityToken mouseover API too ;)

4
Two questions:

1: Is it possible to create and load a new description on the fly? Obviously I can create a new instance of the class, but doing so and then trying to set an object's customDescriptionId to use it doesn't work. It appears there's an internal cache somewhere that I need to register it with, but I don't see an interface to do that.

2: Given that we can read a SectorEntityToken's customDescriptionId, is there a way we can use that ID to get the Description object? Minus an API for dynamic description add/remove, it'd be nice to be able to change the text fields of a Description on the fly, even if we had to create a 'dummy' description for it in the CSV and switch it out at runtime.


5
Suggestions / Additional Response options beyond just option picker
« on: October 05, 2013, 11:50:03 PM »
Cross-posting from the Exerelin thread. Might also be nice if something like this was available for dialogs in the campaign... but then we're probably talking about redoing both the character creation system and the campaign Panel APIs, and adding additional more generic/portable panel types. Long shot I know.

Oh, and the new expanded list of system count options now overflows off the bottom of the menu. It's too bad Alex can't add some additional controls to the menu system - a simple counter control with an upper and lower bound, or maybe just a generic text box with an input validation callback would go a long way towards simplifying some of these dialogs.




6
Bug Reports & Support / Truncated station names
« on: October 03, 2013, 06:56:46 PM »
Seems like there's a limit on the number of characters on a station name; once you get into the station dialog the whole word is 'Exchange'


7
Bug Reports & Support / Apogee sensor drones
« on: September 22, 2013, 02:56:55 PM »
Not sure if this is a bug or not - what is the intended behavior of the Apogee Sensor Drones? No matter whether I put them on Free Roam or Holding Pattern, they just sit lined up next to me like baby ducks. If I get super close to another ship (like 200 su it feels like), then they will peek their heads out and fire off a few shots... but other than that they are completely inactive.

I guess I don't expect them to fly off and engage in active combat like the reaper drone... but a little action (maybe scouting the map, engaging enemies near me at slightly further than spitting distance, etc) would be nice.

8
Bug Reports & Support / Replacing retreating fighters
« on: September 17, 2013, 03:33:37 AM »
I'm not sure this is new to 0.6, but retreating fighter wings will still get replacements spawned off of carriers as they are heading towards the map border. I spent a while just toasting them as they came out, until the main body of the wing made it off map. Might make more sense to have the wing just make do without their missing members until they can complete their escape?

I also saw another issue which I think has already been reported - lone bomber got stuck in a loop landing and taking off. It was towards the end of a fairly long battle when everyone was very low on CR, if that helps any.

While I'm here, I'll say that I'm digging the new release. I've been reading the forums (I usually just cheat and keep the "latest posts of Alex" page bookmarked) and folks had me worried that it was going to be too difficult or requiring of micro-management, but I haven't found it to be so at all. The CR changes definitely encourage you to get in and get out quicker, and it makes supplies management, repairs, and the post-battle replenishment of ammunition make a lot more sense. Hyperspace is a fun addition even though it still feels like a stub. Can't wait for the economy and ground game to get built out a bit, even if just enough to have an API for the modders!

Pages: [1]