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)

Pages: 1 ... 240 241 [242] 243 244 ... 706

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1700351 times)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3615 on: October 03, 2017, 11:30:32 AM »

Yeah, if the projectiles last a long time, then we're hitting issues with collision detection, drawing of the projectiles, etc. 

This can be dealt with by various means, though; a custom projectile system could take a localized snapshot of nearby objects at creation, for example, and only search them for collisions each frame (I used that approach for Vacuum for a few things and it worked well; yes, it'll miss things that spawn during the lifetime, but it's less-significant gameplay-wise than you'd think, tbh, because those projectiles usually aren't aimed at those new things anyhow).

IIRC, the costs to draw projectiles that aren't Missiles are somewhat significant when we're talking thousands (and even then, isn't as cheap as it could be, because it's calling glTexture() a lot); I'd really like a tag that told them not to draw at all (rather than not being seen, which doesn't get rid of the small load of building the glow around the projectiles, etc., unfortunately).
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3616 on: October 04, 2017, 12:13:48 AM »

Trying to get an illustration to load with the .setInteractionImage("illustrations", "illustration_name"); method for a planetAPI entity.

Gives me an error that the texture can't be found. If the issue is it needs to be loaded into memory first through a file, which one references those illustrations? An example would be: urban03

That works.

But the one I'm passing in (my own from the mod directory) doesn't.

I've quadruple checked name inconsistencies and even tried setting a new file path to see if having the same one was the issue for some reason.

I've also removed just that method from the SectorGeneratorPlugin script and everything else works fine, as a control.
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3617 on: October 04, 2017, 01:21:04 AM »

Good question:

I have a energy homing missile who change trajectory each 30 frame.
If i want than he become a energy homing projectile where they cannot be targeted per pd laser: I need to:
-Create a missile when the weapon shoot who is removed instantly for add the projectile of a static list on a everyframe script.
-For the target of the projectile, for be more simple, i put also the target of the missile and if null,  the projectile become not homing.
-We put a intervalUtils of 30 frame, all of these energy projectile will change on each interval same if they have be launched  there are  1 frame.  (So, maybe a strange effect, but wathever)

My question is:
This is good for the computer to made a energy homing projectile like that?  (Always more than check all projectile of the combat and check if correspond to the type of the homing projectile.)
Or we have better? Or i keep missile, but who have each missile, 1 interval.

Because  create 10 missile/remove 10 missile, create 10 projectile and put that on a static Map(contain also target) cost maybe less than create 10 missile, then launch each frame, their advance()    or check on all projectile, if the type is equal, launch the homing script. (I remove also the projectile of the map when he died)

The number of projectile on the combat can be to 100 on same time.


One of my weapon use that, but this is a large mount who spawn 1 missile transformed to 9 projectile who have for target, the target of the owner ship, so i never call a function for search a target.
« Last Edit: October 04, 2017, 05:27:23 AM by Snrasha »
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3618 on: October 04, 2017, 06:03:47 AM »

The best answer, if you wish to create a guided projectile that won't get engaged by PD, is not to create a MissileAPI at all, but rather, to take an ordinary DamagingProjectileAPI and set its angle and velocity every frame (i.e., build your own guidance system).  The Vanilla PD AI won't aim at DamagingProjectileAPI's that aren't MissileAPIs.

Using game-frames for guidance (which isn't IntervalUtil, btw; that handles raw time) is a bad idea; 30 frames between updates means that the projectile's going to miss more often than not unless it's pretty fast (in which case, why bother guiding it).

Some guidance systems are available in the Radioactive Code Dump thread and some pretty clean ones are in my AI project.  

Essentially, this kind of code involves doing a quadratic equation every time you need specific guidance data (what vector to aim at), so updates every few frames are inherently expensive; spawning dozens of them will involve a fairly heavy CPU load.
« Last Edit: October 04, 2017, 06:06:14 AM by xenoargh »
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3619 on: October 04, 2017, 08:11:52 AM »

Is there any way to make the ship without shield(short-time phase or none) more aggressive?
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3620 on: October 04, 2017, 09:01:30 AM »

Something quick and dirty:
ship.getCaptain().setPersonality(Personalities.RECKLESS);

(Note that this may affect the personality of the officer in the campaign - in fact, I think it would. So maybe not the best idea.)

Also, possibly:
ship.getAIFlags().setFlag(AIFlags.DO_NOT_BACK_OFF, 1f);

This would ... let's say "strongly advise" the ship to not back off for a second. This might cause it to keep closing the distance while venting or overloaded, though.


Also, take a look at CoreLifecyclePluginImpl.pickShipAI() - it sets up a very aggressive AI for automated ships. You could do the same sort of thing for the ship you want - by implementing your own pickShipAI() method - and then hanging on to the ShipAIConfig object so that you can adjust the values in it during combat, as needed.

Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3621 on: October 04, 2017, 11:48:27 AM »

Trying to get an illustration to load with the .setInteractionImage("illustrations", "illustration_name"); method for a planetAPI entity.

Gives me an error that the texture can't be found. If the issue is it needs to be loaded into memory first through a file, which one references those illustrations? An example would be: urban03

That works.

But the one I'm passing in (my own from the mod directory) doesn't.

I've quadruple checked name inconsistencies and even tried setting a new file path to see if having the same one was the issue for some reason.

I've also removed just that method from the SectorGeneratorPlugin script and everything else works fine, as a control.

**solved** Got it, just needed a day to think on it. Settings file is where its referenced. The tag the method is referring to is the category in that file and the key is the string that points to the image file's location, wherever that may be.
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3622 on: October 04, 2017, 07:57:52 PM »

Something quick and dirty:
ship.getCaptain().setPersonality(Personalities.RECKLESS);

(Note that this may affect the personality of the officer in the campaign - in fact, I think it would. So maybe not the best idea.)

Also, possibly:
ship.getAIFlags().setFlag(AIFlags.DO_NOT_BACK_OFF, 1f);

This would ... let's say "strongly advise" the ship to not back off for a second. This might cause it to keep closing the distance while venting or overloaded, though.


Also, take a look at CoreLifecyclePluginImpl.pickShipAI() - it sets up a very aggressive AI for automated ships. You could do the same sort of thing for the ship you want - by implementing your own pickShipAI() method - and then hanging on to the ShipAIConfig object so that you can adjust the values in it during combat, as needed.



Oh thx! It does help me a lot!
Logged
My mods


Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3623 on: October 05, 2017, 12:57:54 AM »

I have a energy homing missile who change trajectory each 30 frame.
If i want than he become a energy homing projectile where they cannot be targeted per pd laser: I need to:
...create a missile with collision class NONE with an AI that change it back to MISSILE_FF when inside the bounds of a ship, a bit like ORA's Invocation.
Logged
 

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3624 on: October 05, 2017, 01:06:37 AM »

I have a energy homing missile who change trajectory each 30 frame.
If i want than he become a energy homing projectile where they cannot be targeted per pd laser: I need to:
...create a missile with collision class NONE with an AI that change it back to MISSILE_FF when inside the bounds of a ship, a bit like ORA's Invocation.
Thank ^^
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3625 on: October 15, 2017, 12:24:51 AM »

Does autoresolve not work with stations?



The station and the fleet facing it have been in battle for several days. The station took some hull damage near the start and got its CR worn down, but otherwise nothing is happening. The fleet isn't taking any damage either.

EDIT: Should note that battles do get resolved if the station also has normal fleets on its side.
« Last Edit: October 15, 2017, 01:06:52 AM by Histidine »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3626 on: October 15, 2017, 08:15:16 AM »

Yeah, it's borked - never came up in vanilla playtesting and if we're being honest, it didn't occur to me to test it. Planning to fix it for the next release.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3627 on: October 17, 2017, 11:15:50 PM »

Is the problem fixable modside in 0.8.1?
I'm trying to modify the autoresolve plugin to handle stations correctly. Do modules exist as FleetMemberAPIs on the campaign layer, and if so, how do I get them?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3628 on: October 18, 2017, 10:12:03 AM »

You can do this:
FleetMemberAPI.getModuleVariant(String slotId)

Might just be easier to add a tag to a station and work up a reasonable "autoresolve strength" off that - probably not much point to being super-detailed here.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3629 on: October 19, 2017, 04:45:10 AM »

Thanks, that lets me get the stats using temporary fleet members. But what I really need to do is to damage/destroy the modules.
Currently member.getStatus().applyHullFractionDamage() applied to the station fleet member only works on the central hull, and (as implemented in the vanilla autoresolve plugin) doesn't reduce the hull integrity bar below 85% or so (even when FleetMemberBattleOutcome is DISABLED).

I guess that's not possible and stations have to be left as a player-only encounter for now?
Logged
Pages: 1 ... 240 241 [242] 243 244 ... 706