PDmod update

A place to discuss mods in development and concepts for new mods.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

2016 05 24 PDmod screen shot EDITED.jpg
2016 05 24 PDmod screen shot EDITED.jpg (100.25 KiB) Viewed 11155 times
UPDATE:

Here's a link to the current alpha of the PDmod update:
0.10 alpha

(EDITED 2016 May 25 to add the download link and image above)

ORIGINAL POST:

After watching George's stream last week, I've been thinking that PDmod needs an update to regain its audience and to fix some minor bugs and UI issues.

I've contacted TVR to see if it's okay with him to have someone else update his mod. In the meantime, I'd be interested in hearing suggestions about what needs to be changed, what needs to be kept the same, and (please say yes) if someone more experienced than I am is willing to do the update.

Here's what I'm thinking, in order of most important to least:

1. Get rid of the muzzle flash when the PD weapon isn't firing.

2. Fix the UI. The settings ROMs need to be moved to a dockscreen, probably accessible using a link from the ship interior screen. This will free up the 'U' menu and the misc. devices installation screen and make the mod more convenient to use.

3. Rebalance the PD weapons using 1.7 alpha balance criteria. I'm thinking of point-defense weapons as linked-fire omni weapons with short range and interaction="100" and that they should be balanced accordingly. powerUse, in particular, stands out as being too low for weapons of their level.

4. PDmod overwrites some vanilla weapons, such as the omni x-ray laser, so that they target missiles as well as enemy ships. A quick solution would be to update those weapons for 1.7 alpha balance and effects. A better solution would be to find a way to overwrite those weapons using typCreate. Unfortunately, I've been having trouble overwriting existing entities that way; the game throws an error. A possible alternative is to create a virtual station that changes the targeting characteristics of any omni weapons it detects, although I'm not sure how to implement that.

5. Add some settings that would allow the player to choose which PD weapons are able to target beams instead of hard-coding those abilities into individual devices.

6. Add a larger variety of and/or change the existing PD weapons to demonstrate the new visual effects in 1.7 alpha.

Does anything above need to be added, deleted, or changed?
Last edited by gunship256 on Wed May 25, 2016 4:23 pm, edited 2 times in total.
User avatar
Song
Fleet Admiral
Fleet Admiral
Posts: 2801
Joined: Mon Aug 17, 2009 4:27 am

I'd previously tried contacting TVR to no avail.


PDmod itself is in the public domain (TVR put his licensing in the download), so the code inside is fair game.

One thing to keep in mind as an...annoyance, for now......is that weapon HP isn't balanced at all right now. So balancing PD weapons by the numbers will not necessarily make them balanced...at least, in terms of shooting down projectiles.

Apart from that, I think it's a useful endeavor. TVR worked hard on that mod, and while I would ultimately like to see a lot of its more streamlined functionality make it into vanilla, the code itself is gonna be good for a long time yet with a bit of maintenance.
Mischievous local moderator. She/Her pronouns.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

Shrike wrote:PDmod itself is in the public domain (TVR put his licensing in the download), so the code inside is fair game.

One thing to keep in mind as an...annoyance, for now......is that weapon HP isn't balanced at all right now. So balancing PD weapons by the numbers will not necessarily make them balanced...at least, in terms of shooting down projectiles.

Apart from that, I think it's a useful endeavor. TVR worked hard on that mod, and while I would ultimately like to see a lot of its more streamlined functionality make it into vanilla, the code itself is gonna be good for a long time yet with a bit of maintenance.
It sounds like we're fine legally, but I still feel a bit strange publishing someone else's work using my own UNID without permission, and the Xelerus rules prevent me from republishing using TVR's UNID for obvious code conflict reasons. I'll probably do the update regardless of whether TVR gets our messages.

I'm still trying to figure out how the game calculates shot HP, especially where it isn't explicitly written in the XML of a weapon. For example, what determines the shot HP of a beam? What about a weapon where the shot HP isn't declared but the weapon damage is? Any help would be appreciated.

What are the chances George will integrate the PDmod code into vanilla?
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1452
Joined: Tue Aug 19, 2014 10:17 pm

I'm not certain, but I believe beams simply die upon hitting anything other than another beam and apply their damage to whatever they hit.
User avatar
Song
Fleet Admiral
Fleet Admiral
Posts: 2801
Joined: Mon Aug 17, 2009 4:27 am

Shot HP defaults to 0 (any hit will destroy the projectile). There is a ticket I put up a while back about this, but it's going to be a long-term one.

Beams have an "interaction" value of 0 by default. This means they can hit things, but not get hit by things. Practically speaking it means you can't hit a beam with another beam, unless one of them has an interaction value (0-100) set. The interaction value is the percentage chance to hit.


So by default a beam will have 0 interaction, so it will only interact with 'missiles' and a few other things (shockwave fragments seem to block beams sometimes, I think? Been a while since I checked so don't count on that being true). It will have 0 shot HP, so anything it does hit and interact with will destroy it. FInally, when it hits something it does a damage roll and inflicts standard damage. For fragments, I think damage type and WMD don't matter at all.

EDIT: In terms of stock implementation...I personally would not expect PDmod code to end up in vanilla. It's a clunky (in terms of the environment it works in, not in terms of how it works) workaround to what is, ultimately, a faulty part of the game engine. I'd expect George to look at how PDmod does what it does, and then work on his own in-engine solution to try to improve the stock performance.

.....whether that works or not, or indeed what version that might occur in, is a whole other matter of course. :P
Mischievous local moderator. She/Her pronouns.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

Thanks! That's helpful to know. It also explains why the Nandao bolt is so good at stopping beams when it's used as a point-defense weapon.

(EDIT: What's the default shot HP of matter weapons, which are coded like missiles?)

Do you have a link to that Ministry ticket? I'd be interested in reading it.
I personally would not expect PDmod code to end up in vanilla. It's a clunky (in terms of the environment it works in, not in terms of how it works) workaround to what is, ultimately, a faulty part of the game engine. I'd expect George to look at how PDmod does what it does, and then work on his own in-engine solution to try to improve the stock performance.

.....whether that works or not, or indeed what version that might occur in, is a whole other matter of course. :P
I suspected that it might take a while. I'd prefer not to have to slog through updating PDmod, as it'd be a bear that wouldn't be necessary if George were going to update vanilla anyway. It sounds like it needs to be done, though, so we have something that works while we're waiting for George to do his thing.
User avatar
Song
Fleet Admiral
Fleet Admiral
Posts: 2801
Joined: Mon Aug 17, 2009 4:27 am

Missile shotHP also defaults to 0. Or at least, it should do. The Nandao has a combination of quite a large shot, high damage, and 15 shot HP (which is pretty dang high).

The ticket where I suggested changing this is here.
Mischievous local moderator. She/Her pronouns.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

UPDATE

The random muzzle flash George saw in the stream is gone now. I set fireEffect to null in the XML of each weapon, which unfortunately means that the muzzle flash is also gone when the weapon is actually firing.

I've updated the mod to api 29. So far, it looks like everything is working the way it did in the original mod.


TO-DO LIST

Add the muzzle flash back in using sysCreateWeaponFire at AssumedPseudonym's suggestion. (EDIT: Done. I fixed this in sysCreateWeaponFire by changing [options] from Nil to 'fireEffect. The game automatically generates a muzzle flash based on the characteristics of the shot that sysCreateWeaponFire creates.)

Replace the settings ROMs with a dockscreen that is accessed from the ship interior screen.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

UPDATE

I've moved the basic settings over to a dockscreen and removed the code that installs the old PDmod settings ROMs.

I've left the anti-beam device settings on the ROMs for now until I can verify that the basic settings are working properly. I need to do a playthrough from Eridani to Sanctuary to make sure nothing's broken. (That will also give me a chance to try out the new SM&M++. I don't think Shrike has overwritten the ICX or Longreach yet, so there shouldn't be a problem testing both mods at the same time.)

After the playthrough, I need to put the anti-beam settings into a dockscreen and remove those ROMs. The next task will be to streamline the settings so that friendly-fire becomes a toggle instead of integrated into the rest of the settings. That will cut the number of settings the player has to worry about in half.
User avatar
Song
Fleet Admiral
Fleet Admiral
Posts: 2801
Joined: Mon Aug 17, 2009 4:27 am

I did add a couple of point defense systems (which obviously use vanilla code), but didn't alter any of the vanilla ones
Mischievous local moderator. She/Her pronouns.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

2016 05 08 PDmod update settings.PNG
2016 05 08 PDmod update settings.PNG (36.16 KiB) Viewed 11287 times
UPDATE

The UI for settings has been an interesting philosophical question. For now, I've decided to make friendly-fire avoidance a toggle and make the rest of the settings selectable using the number keys.

There's now a new setting that lets the player escort the previous target. This is helpful in case the player leaves an escorted ship alone for a while, comes back to it, and wants to switch back to defending it right away.

I'm thinking about letting the "Escort New Target" setting open an itemPicker that lets the player choose which ship to escort. There will be a disadvantage to this, though: currently, the player can choose to "escort" a station, which could be useful in defending agricultural stations (EDIT: and defend stations from those Dwarg attacks in Corporate Command). An itemPicker list can only display ships, not stations - at least, as far as I've tried, I can't make an itemPicker show stations. [EDIT: Now that I think of it, I'm not sure I was successful in getting an itemPicker to show a list of ships, either. I was helping someone else at the time, and I think we ended up going with a custom list screen instead.] Depending on feedback, I may leave things the way they are.

I also need to decide how to implement settings screens for the less common devices, such as the anti-beam attenuator and the Longreach Duo. I will probably make those devices pull up their own settings screens when the devices are invoked.

The UI is still a bit buggy, but I thought I'd put these questions out there to see if anyone has feedback on these preliminary decisions.
Last edited by gunship256 on Mon May 09, 2016 1:13 am, edited 2 times in total.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

I've eliminated most of the UI bugs now, but there's still one I can't figure out. The code below should save settings so that they can be retrieved later.

It works most of the time, but NOT if a game is saved and then re-opened. For some reason, if I save and re-open a game, it forgets the data I stored using objSetData.

I'm using the code inside of a dockscreen pane. Do I need to use gPlayership instead of gSource? What else might I be doing wrong?

Code: Select all

(objSetData gSource "pds_mode" 1)
EDIT: I've eliminated the settings ROMs for the Longreach Duo and Interceptor devices. The settings for those devices are now accessed by invoking the devices directly. I've held off on moving the settings ROMs for the anti-beam attenuator onto a dockscreen because that dockscreen will have the same bug I'm trying to figure out above. Once the bug is fixed and the UI problems are streamlined, the mod will be 50% finished. The remaining work will involve rebalancing devices and updating images for 1.7 alpha as well as adding new devices with prettier effects.

EDIT #2: I've determined that there's most likely a problem in my code somewhere and that the problem is NOT with calling objSetData from inside a dockscreen. The game remembers all of my settings EXCEPT the ones that involve saving a currently escorted or previously escorted ship using objSetData. Everything is fine until I save the game and re-open the saved game. I'll work on figuring out what's causing the problem.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

I've started looking at rebalancing the devices in the mod and adding new ones.

In general, powerUse for each device (as well as the vanilla ICX and Longreach) is too low for its level.

Noticeable gaps in the series of original PDmod devices:
  • There are no level 1 and 2 ICX-type devices. The level 3 device is crippled and only suitable for use by stations.

    The mod has no level 8 or 9 devices. There is a level 10 device that is an Iocrym repeller re-made as a point-defense device and another level 10 item that shows up as an unknown alien device which I've never tried.

    The only device for defense against beams and which can spawn in the game is the level 7 anti-beam attenuator.
The anti-beam attenuator doesn't actually target beams, though. It creates a plasma shield around that ship that absorbs beams and missiles - unfortunately, absorbing the playership's outgoing shots at the same time. The plasma is also not very pretty and isn't consistent with the way plasma clouds look in 1.7 alpha.

Would anyone have any objections to my making the anti-beam attenuator notrandom and replacing it with devices that actually target beams? The attenuator could still be ordered through a Corporate Trading Post but would never spawn otherwise. Speak now if you actually like this device and want it to live!

---
EDIT: PDmod is capable of making devices that can target beams, but targetCriteria and the criteria defined in transLisp have to match exactly.

From Shrike's post last year:
Currently ingame, the way the game handles projectiles hitting other projectiles is.....mixed.

Beams can be blocked by any solid thing.

Solid things can be blocked by beams or solid things that have higher damage than their shot HP.

Particles cannot be blocked by anything except shockwaves, and can block incoming missiles (not sure how damage is calculated for particles, but it's probably similar to how beams do it)

Shockwaves block *everything* and cannot be blocked.

Radius fragments cannot be blocked, and have really weird effects on the solid stuff that they block. They do not block beams.
As far as I can tell through testing, the above assertions still apply to 1.7 alpha.

Small shots DO seem to stack to take out missiles. For example, if the DK Arbalest cannon is used as a point-defense device, the individual shots (1d6+1) are not strong enough to take out a Longbow (10 hitpoints). However, the series of four Arbalest shots is sometimes, but not always, enough to do it. (The combined HP for four shots can range anywhere from 8 to 28. Sometimes all four shots hit the missile, and sometimes they don't.)

This suggests that rapid-fire matter shots work best for devices that target both beams and missiles. Matter shots tend to have hitpoints, while beams seem to default to one hitpoint per beam, so one matter shot can stop multiple beams.

Larger, slower shots with lots of damage would work better for devices meant as a defense against hardened missiles. Those high-damage shots could be energy beams (which are stopped easily with kinetic weapons) or matter shots with lots of hitpoints (which can be stopped by dense screens of beams OR enemy matter shots that have high damage). At the moment, I'm leaning toward using matter shots with the highest damage and shot HP available.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

UPDATE

I've added a function that makes it possible to add new point-defense devices without having to copy and paste hundreds of lines of code. The transLisp inside of <onFireWeapon> is now simply a one-line call to the new function.

The original PDmod had three devices similar to the vanilla Longreach that are meant to target hardened missiles. They were a little weak for their level and had powerUse that was much too low. To balance these devices, I raised powerUse to a number somewhat lower than a weapon at the same level as each device. I also added a level 4 Ballista autoturret (0.7 shots/sec, range 20) so there'd be one Longreach-type device that can spawn in the New Beyond.

I've kept the ammo-using devices, including the Interceptor launcher and SmartCannon autoturret, the way they are. They still need to be balanced and updated with new graphics, but we have bigger fish to fry for the moment.

I moved the rest of the devices to a separate module and set them to notRandom so they wouldn't spawn. Reason: they can't target beams, and the more advanced devices really need to have tougher shots with hitpoints>1 anyway. I'm working on replacing these devices with new ones: mostly laser-based with interaction="100" until level 4 and mostly matter-based for levels 5-10.

I'm starting to question my earlier statement (quoted below):
Small shots DO seem to stack to take out missiles. For example, if the DK Arbalest cannon is used as a point-defense device, the individual shots (1d6+1) are not strong enough to take out a Longbow (10 hitpoints). However, the series of four Arbalest shots is sometimes, but not always, enough to do it. (The combined HP for four shots can range anywhere from 8 to 28. Sometimes all four shots hit the missile, and sometimes they don't.)
When a kinetic shot hits a missile, are they treated like two matter shots that hit each other? In that case, hitpoints shouldn't matter, and the shot with the most raw damage should survive, though weakened by its interaction with the weaker shot.

Now that I think about it, the game doesn't have a way to distinguish between a Longbow missile and any other blast shot other than the fact that the Longbow uses ammo. In that case, raw damage seems to be the most important factor in stopping a missile.

Ramifications: Shots with lots of hitpoints (slam cannon, Nandao bolt) should be used with devices intended to target beams. Shots with lots of raw damage (kinetic and laser damage types) should be used to take out hardened missiles.

EDIT: I've added the remaining new ICX devices. They now range from level 1 to level 10. The next step is to do a playthrough to evaluate balance and look for bugs.

EDIT #2: I'm at Rigel now and have done enough Korolov missions to get the Class V but haven't done the arena yet. So far, I have two level 2 and two level 3 ICX devices installed at the same time. (I made them uncommon instead of rare to facilitate testing.) The devices work very well. There are almost no friendly fire incidents, and when the devices are instructed to defend freighters, they do as they're told. The bug I described in an earlier post is still there, though: when a saved game is opened, I have to re-select the freighter I'm escorting.

The PD mod update does balance ICX devices as actual linked-fire weapons with higher damage and powerUse than the old devices (and the vanilla devices) had. With the linked-fire bonus calculated in, their range and DPS are inferior to weapons of their level, but having four ICX devices still forms a pretty effective screen against missiles and beams. It also makes pretty short work of anything within 20 ls that doesn't have internal HP.

Things are looking pretty good, so I'm shooting for an alpha release this weekend.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

UPDATE

Did some testing on the new level 1-10 general-purpose ICX devices. They're powerful, but they also have a high powerUse and will overload your reactor if you install too many. They now target ships, missiles, and beams.

Vanilla ICX: Level 4 (34 DPS) laser:1d8+4, 4 shots/sec, range 60, zero interaction, 1 MW
PDmod old ICX: Level 4 (15 DPS) laser:1d4, 6 shots/sec, range 60, zero interaction, 1 MW
PDmod update ICX: Level 4 (32 DPS) laser:3d4, 4.3 shots/sec, range 20, interaction="100", 12 MW

The severe range nerf and powerUse increase were necessary to get the devices to balance using George's weapon balance algorithm. They're omni and linked-fire, which compensates for their low range and below-level DPS. I haven't run the weapons through TransData yet, so it may turn out that I've nerfed them too much.

(EDIT: I'm not sure how to run them through TransData, since they're omni and linked-fire, but the auto-defense device gives the weapon those properties. I may have to edit them weapons themselves so they display as omni and linked-fire and then use TransData.)

Rebalanced the Longreach-type devices (high level, high kinetic-type DPS). Increased DPS slightly and increased powerUse significantly.

Rebalanced the SmartCannon anti-missile turret. It was at level 5, and it wasn't spawning where SmartCannon ammo is actually useful. Changed it to level 3 and reduced speed to 2.1 shots/second, a third that of the level 3 Smartcannon gun.

Fixed a bug where friendly-fire avoidance wasn't working with the new devices I added. The sample code TVR provided for making a custom ICX device didn't include code to check settings to see whether friendly-fire avoidance was enabled. I added friendly-fire avoidance back into the code and streamlined it. When you go to create your own ICX, all you'll see is this:

Code: Select all

			<OnFireWeapon>
				; Be absolutely sure the criteria string below matches the targetCriteria string in &itYourICXHere;
				(gsPDFireWeapon "bsmE N:20" &itYourWeaponHere;)
			</OnFireWeapon>
The disadvantage of doing this is that all ICX devices now draw from the same settings dockscreen. To make one that's different, you'll have to create your own function based on the code in gsPDFireWeapon.

Changed the UNID prefix from TVR's to gunship256's.

I'm doing some final testing and plan to release an alpha tomorrow.
Post Reply