Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

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.

Messages - dmaiski

Pages: 1 2 [3] 4 5 ... 28
31
Modding / LeadVector
« on: May 08, 2014, 12:35:08 PM »
Derail Moved from
http://fractalsoftworks.com/forum/index.php?topic=7966.30

LeadVector
Code: java
    //find intercept between a missile and a target
    //adapted from code by Jens Seiler
    //http://jaran.de/goodbits/2011/07/17/calculating-an-intercept-course-to-a-target-with-constant-direction-and-velocity-in-a-2-dimensional-plane/
    //have fun if you want to actually understand what going on
    //basicaly gets where T will be by the time M gets to it
    public static Vector2f LeadVector(Vector2f TLoc, Vector2f TVel, Vector2f MLoc, Vector2f MVel)
    {
        //get missiles speed
        float MSpeed = (float)Math.sqrt(MVel.lengthSquared());

        //separate out the vectors
        float Tx = TLoc.getX();
        float Ty = TLoc.getY();
        float Mx = MLoc.getX();
        float My = MLoc.getY();

        float TVx = TVel.getX();
        float TVy = TVel.getY();

        //subtract position vectors
        float x1 = Tx - Mx;
        float y1 = Ty - My;

        //quadratic fun
        float h1 = TVx*TVx + TVy*TVy - MSpeed*MSpeed;
        if (h1==0)
        {
            h1= (float) .0001;
        }

        float minusMHalf = -(x1*TVx + y1*TVy)/h1;  // h2/h1

        float discriminant = minusMHalf * minusMHalf - (x1*x1 + y1*y1)/h1; // (h2/h1)^2-h3/h1 (ie D)

        //can they intersect?
        if (discriminant < 0)
        {
            return new Vector2f(0,0);
        }


        double root = Math.sqrt(discriminant);

        double t1 = minusMHalf + root;
        double t2 = minusMHalf - root;

        double tMin = Math.min(t1, t2);
        double tMax = Math.max(t1, t2);
        //which of the 2 is smaller
        double time = tMin > 0 ? tMin : tMax;

        //can return -ve time (this is less then useful)
        if (time < 0)
        {
            return new Vector2f(0,0);
        }

        //calculate vector
        return new Vector2f((float)(time * TVx), (float)(time * TVy));
    }

this is actualy designed to calculate the intercept of a bullet fired from point Mloc with Mvel speed, at target at Tloc with Tvel velocity
**fixed

for the purposes of this calculation even in cases such as missiles Mvel can be asumed to be the objects maximum speed, as long as object HAS a maximum speed, and IS allways accelerating


IF cases:
Spoiler
1) IF Tvel and Mvel are in the same direction: LeadPoint defaults to Tloc (the objects location)
2) IF Mvel is insufficiet to reach T: LeadPoint defaults to Tloc (the objects location)
3) IF Mvel is still accelerating: by a large this is irelevant as it will default to (2)
4) IF Tvel is changing(trying to djink): LeadPoint will produce the shortest intercept point every time (so as long as it is recalculated say 1/sec it will be on target)
5) IF chasing object has no maximum speed(or very high compared to acceleration): it will produce the best lead it can for its curent speed, not ideal, but accounting for this case is largely irrelevant (error will be insignificant, usualy a few extra % time above the "ideal" time to intercept)
[close]

32
Suggestions / Re: why is it that in starsector Losing != FUN!
« on: May 08, 2014, 12:17:35 PM »
i think i understand what you mean, but in this case it does not actualy mater for the algorithm

:P i make pictures :P

basicly lets asume you fly in circles, and you have an object chasing you
if you used (distance/time)*TargetSpeed
the resultant time till intercept would be longer in practice

using the leadvector produces a concave when the objects are headed into eachother, and a elipsoid pattern when they are not
img (graph of LeadPoint of a object traveling in a circle)
Spoiler
[close]

even if you have the ability to turn your vector of travel 180deg without losing any speed, the chasing object would still intercept you in the minimal amount of time posible (without it being a precog)

33
Suggestions / Re: why is it that in starsector Losing != FUN!
« on: May 08, 2014, 11:33:20 AM »
it doesnt mater, the same logic applies, unless fleets in campaign can teleport...

the rate of deflection requred to dodge that algorighm requires that you have to be faster then the shing chasing you, otherwhise jukeing has absolutley no effect

34
Suggestions / Re: why is it that in starsector Losing != FUN!
« on: May 08, 2014, 11:16:13 AM »
(Re: calculating an intercept: I'm not convinced that'd be good. It could just make them much, much easier to juke.)

not in the least, i used this on the missile ai, and the resultant missiles are next to imposible to dodge... that algorithm is very responsive to changes in vector

when a ship is aiming at the LeadPoint, its allways taking the shortest route to intercept target, drying to juke out of the way would be totaly ineffective since it would just update to the intercept of wherever you juked to, also this would actualy reduce the overall time till intercept, not increase it (unless you are actualy faster then the missile/chasing object, and that algorighm has a case for that as well)

:P evasive manuvers only work due to movie magic, large turn arks, and bad targeting ai :P

35
Suggestions / Re: why is it that in starsector Losing != FUN!
« on: May 08, 2014, 08:13:45 AM »
:P encouraging what @Megas described is pretymuch the definitive reason for this problem :P
(not to say i dont do the same)


curently SS plays like a single player FPS/brawler/bullet hell game rather then anything resembling a strategy/tactics game. Unfortunately in FPS/brawler/bullet hell games, losing isn't be fun... i would really apreciate a rework of the command points system, ship death behaviour, and skill tree to make "a fleet of one" stop happening

im not sure, but leaving "space scrap yards" when massive fleets fight, from wich you(and the AI) can salvage hulks using supplies would go a long way to making losses more intresting, and make a great credit sink into wich you can put all that potential trade income into.

actualy this would also go along way to encouraging players to bring (and buy) more supplies, make the map more intresting, and make loosing alot less punishing, and more intresting (by increasing the "acceptable losses" threshold)

36
Suggestions / Re: why is it that in starsector Losing != FUN!
« on: May 08, 2014, 03:27:41 AM »
@Uomoz

thats a problem with the chase mechanic... curently fleets chase targets, instead they should calculate intercept and head to it
(slightly more expencive, but massively more effective)

my missile AI used this to great effect
Spoiler
Code: java
    //find intercept between a missile and a target  
    //adapted from code by Jens Seiler  
    //http://jaran.de/goodbits/2011/07/17/calculating-an-intercept-course-to-a-target-with-constant-direction-and-velocity-in-a-2-dimensional-plane/  
    //have fun if you want to actually understand what going on  
    //basicaly gets where T will be by the time M gets to it  
    public static Vector2f LeadVector(Vector2f TLoc, Vector2f TVel, Vector2f MLoc, Vector2f MVel)  
    {  
        //get missiles speed  
        float MSpeed = (float)Math.sqrt(MVel.lengthSquared());  
  
        //separate out the vectors  
        float Tx = TLoc.getX();  
        float Ty = TLoc.getY();  
        float Mx = MLoc.getX();  
        float My = MLoc.getY();  
  
        float TVx = TVel.getX();  
        float TVy = TVel.getY();  
        float MVx = MVel.getX();  
        float MVy = MVel.getY();  
  
        //subtract position vectors  
        float x1 = Tx - Mx;  
        float y1 = Ty - My;  
  
        //quadratic fun  
        float h1 = TVx*TVx + TVy*TVy - MSpeed*MSpeed;  
        if (h1==0)  
        {  
            h1= (float) .0001;  
        }  
  
        float minusMHalf = -(x1*TVx + y1*TVy)/h1;  // h2/h1  
  
        float discriminant = minusMHalf * minusMHalf - (x1*x1 + y1*y1)/h1; // (h2/h1)^2-h3/h1 (ie D)  
  
        //can they intersect?  
        if (discriminant < 0)  
        {  
            return TLoc;  
        }  
  
  
        double root = Math.sqrt(discriminant);  
  
        double t1 = minusMHalf + root;  
        double t2 = minusMHalf - root;  
  
        double tMin = Math.min(t1, t2);  
        double tMax = Math.max(t1, t2);  
        //which of the 2 is smaller  
        double time = tMin > 0 ? tMin : tMax;  
  
        //can return -ve time (this is less then useful)  
        if (time < 0)  
        {  
            return TLoc;  
        }  
  
        //calculate vector  
        return new Vector2f((float)(time * TVx), (float)(time * TVy));  
    }
this only calculates the lead point
Tloc +  LeadVector = the actual location
[close]

also removing the "navigation" skill goes a very long way to remidy that problem (nav skill is OP)

37
Suggestions / Re: why is it that in starsector Losing != FUN!
« on: May 07, 2014, 03:06:19 PM »
in DF you can save scumming is so easy its not even worth mentioning...

but generaly in DF people don't save scum, its an elective choice being made by the player to play on, even if they conciously know that what happened will inevitably lead to their demise, or make the later game more dificult

as I said earlier there is an "acceptable losses" threshold that players have, if you pass it, you have rage quit or save scum

in DF the "acceptable losses" constitutes evrything, losing in DF is just as fun as winning,
if you lose, you know why you lost, and can figure out how to prevent losing in the same way next time

in SS there are no "acceptable losses", most people dont even like losing fighters and frigates, let alone capital class ships, many will even savescum if there simply minor hull damage in the battle
SS battle is prettymuch a Random Number Game, unless you are piloting the ship yourself, you have no controll over the outcome, and no real idea why you lose (other then "fleet not tanky nuf")

38
Suggestions / Re: why is it that in starsector Losing != FUN!
« on: May 07, 2014, 08:28:42 AM »
on the subject of "forced" objectives:

"forced" objectives are inherent in all strategy games, but whether they are "FUN" is wholly dependent on how they are set up

take for example a game with episodic battles that you "can't" avoid (i can't actually think of any outside RTS tutorial/early RTS campaigns)
there is no decisions for the player to make, they must attack the enemy head on to win

The great examples (purely in the realm of RTS/civ games), they have multiple paths to solve a problem : you have an army, an enemy army is fortified on a hill, to win you can just as easily walk around the enemy army (totally avoiding them), besiege the base (starve them out), use diplomacy, pound it with artillery, harras, raid, crush them economically without ever firing a single shot, ect...

the "good" examples of this you can use artillery, and draw your enemy out so that they can be sniped, or flank them and destroy the line that way, or you can harass and repair cycle until you win or... you get the picture, there are more ways than one to solve the problem
(in SS this is impossible... the UI and the AI simply do not support tactics)


in the "bad" example you are forced to ram your army head on into the enemy army with no strategy whatsoever (and minimal tactics)
(this is what SS currently is from a strategy point of view)


SS falls heavily into the "bad" side of staged battle, it is why your aim in any battle is to "out-tank" your enemy rather than "out-smart".

The key to making losses “acceptable” is to give the player the tools to decide what losses they want to take, and how they will go about taking them, like the sacrificial pawn trades in chess, you do not want to lose a pawn, but to win you must for the greater good. The death of the “pawn” has meaning.

In SS the death of a “pawn” is usually senseless and out of your control, thus losing the pawn feels like a loss of control for the player, and makes the gameplay experience “bad”


TL:DR -- i am not arguing against the "combat model" of SS, but the strategic value, and the potential meaningfull choices players can make in(and outside) battle
(curently verry little to none can be made, and the AI does not effectively execute the choices that are made)


something to look at would actually be the "Mount & Blade" series
Spoiler
its closer to the strategic premise (or lack there of) that SS uses
but it has several key differences
1) it is purely a 1st person combat simulator, there is no real importance placed on the "fleet"
2) it does not give "detailed" control to the player, only a general attack/retreat
3) units are disposable, if you lose half your army, it won't take you hours to rebuild it, all you need is the nearest town
4) risk is directly proportional to reward, you take on a late game army and win-> you get enough gear to build a new army of that class
5) the AI in warband (generally) does not QWOP, it is limited, but on par with the player character's level of ability with the same gear
[close]

39
Suggestions / why is it that in starsector Losing != FUN!
« on: May 07, 2014, 03:13:06 AM »
[pulls up soapbox]

we all know that in Dwarf Fortress(DF), FTL, and many similar games Losing == FUN!, now in my experience, and from watching others, it starsector(SS) lacks this property. Its symptom is save scumming battles till you win without losing any ships, and a repetitive end game.

to tackle a simpler problem i will discuss the end game first. In the end game, you invariably have a very large fleet, and this fleet is min/maxed to avoid losing ships, the main issue with this leeds on to the first symptom, losing your ships (by any means) does not feel good.

Now the question to ask is simple: "Why does losing ships in starsector not feel fun?"

Counterintuitively the simple answer of "because you lose a ship" is actually incorrect. In dwarf fortress(best example) when you lose your dwarfs, armies rampage through your fortress, or unfortunate accidents leave large parts of it uninhabitable, you still continue playing. You try to eek out an existence on what you have left, and aim for a glorious victory. (and remember DF is MUCH less forgiving than SS)

The more complex answer, and the one i believe to be correct, is "controll". In DF, FTL, and other games where losing == FUN!, you have control over everything that could result in "FUN!" so (in theory) you can prevent it, and when you inevitably lose, you feel that it was entirely your fault. interestingly this is essential to making losing fun, and what SS lacks.

In starsector when you lose, you can't with any confidence say that it was "your" fault that you lost, the causative agent of your loss are obviously AI, engine level problems (such as 1 speed after battle, ect...), and lack of any ability to "influence" the outcome of the battle.

now how do you fix this issue, and is it possible to fix?

the simplest way to do this would be to give the player more control, something like an RTS level command system (to replace "command points" which noone really uses)

the next layer would require variable AI's the ability to tell your ship "play defensively" or "play aggressively" would go a long way to remedy this issue

the final layer of this would be a more predictable AI (not "smarter")
An AI that will consistently do what you expect it to do is vital to making the player feel in "controll" of the action, it does not need to be particularly smart(most unit AI in RTS games are verry stupid), but it needs to be able to follow orders in a reliable manner.
(for example, currently if you tell the vanilla AI to retreat, and it is in combat, it wont... same thing for move orders, and may other actions)

these three changes would go a significant way to giving the player "control" in battle, and hopefully make the game more FUN!

[steps off soapbox]

TL:DR -- make losing FUN! and fix the command point issue

40
3x 2500au AM cannon isnt that short range XD

i have exams in a week so i cant do much atm  >:( but i want to try fiddling with the pathing and logic of your AI at some point, im sure i can make one smart enough that even if the weapon has massive targeting errors, and the autoaim has no "lead" ability to speak of it can still use the weapons it has effectively
Spoiler
mainly give it a decision tree,
track and respond to target states(if(target.isVenting && target.ventTime>(self.closeTime+2)){zerovelocity=true; CQC=MaxValue;}),
and try to zero the reletive velocity between self and target when taking a shot(while staying as mobile as posible at any other time
(and other little stuff it really should do)
[close]
maybe im just weird, but i allways want the enemy AI in the game to be as nasty and devious as posible(without cheating)


weird bug:
attacking hemogeny merchant fleet (40sec into battle)
img:
Spoiler
[close]
note: they are not retreating, they are just sitting on edge

41
also weird thing, when you turn on the sniper AI in the sim battle, and set ship to ai controll it starts QWOPing hard
(crasher witha vulcan vs anything)

looks like a case of the ai trying to hide from the enemy, but not having any allies to hide behind (or its just buggy)


more ai bug in (1v1 case)

fast ships cant aim with forward weapons
(end up playing ring around the rosies...)(standard ai probably needs a case if(weaponX.canfire){engines=false; turn to target; fire;})
img:
Spoiler
[close]


sidenote: firing AI does not take reletive velocities of the target and firing ships into acount for long range shots (they are allways off by miles...)

42
even more bug:

this is 2 seconds into asterid battle (also i dont even have those ships... or any ships other then my trusty lasher : "Mr.Tanky")
img:
Spoiler
[close]

:D rappid bughunting i do for you

43
first bug is find!!!

idk exactly what happened, but me and the whole enemy fleet teleported to the lower left corner of the map
(did you leave some of your test code in or something? :P)


MOAR BUG!!!
(i finaly managed to deplete the enemy missile frig of its emp nukes at this point, and was going in for the kill)
Code
997812 [Thread-5] ERROR com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - java.lang.RuntimeException: Fleet id [AttackFleet] not found for faction [neutral]
java.lang.RuntimeException: Fleet id [AttackFleet] not found for faction [neutral]
at com.fs.starfarer.loading.oOoO.?0000(Unknown Source)
at com.fs.starfarer.campaign.CampaignEngine.createFleet(Unknown Source)
at data.scripts.plugins.AdmiralAI.VacuumBasicAdmiralAI.bossFight(VacuumBasicAdmiralAI.java:49)
at data.scripts.plugins.AdmiralAI.VacuumBasicAdmiralAI.advance(VacuumBasicAdmiralAI.java:288)
at com.fs.starfarer.title.ooOO.K$Oo.o00000(Unknown Source)
at com.fs.starfarer.combat.oOOO.new.super(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.combat.G.??00(Unknown Source)
at com.fs.oOOO.A.?0000(Unknown Source)
at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

44
yay!!!

^^^me^^^

45
burn drive vs armor regen :
aparently armor regen is getting a rework
(@xeno if you have not done this already)
burn drive ai probably needs a fix to prevent it from being on unless it is chasing a target ship

only seeing thrusters : thats intentional
(@xeno you may want to add description of this into front page so people dont ask so much :P)

@xeno
btw do you feel that AI fleets arent agressive enough in campaign map? (ive rarely gotten attacked or chased by them... ever)

also >.< release, i has exams to study for, but im bored, i need your mod to procrastinate effectively!!!

Pages: 1 2 [3] 4 5 ... 28