file vEoCUtilities and Enhancements to "Unleashed Mod"

More
6 years 10 months ago #19195 by SRC
Hello All,

The original impetus to what has become a prospective "code mod for EoC modders (if there remain any)" was my enjoyment of Bineshi's excellent "Unleashed" mod and my desire to add some playability features that would complement my play style (which involved an extensive Act 0 anti-Maas campaign using the Pinguin Armed Merchant Cruiser and a hunting style in Act 1 of lurking near remote L-points waiting for hostiles to show up).

I'm at a place in vEoCUtilities where I have some tools that are almost working right regarding .ini file defined arbitrary turret-ship configurations and I have begun to fiddle with Unleashed Mod's turret-ship combat management code to test new turreted-ship configurations. This is leading me toward the need for some additional .pog packages with threat assessment and target assignment functions which should be useful not only for turret control but more generally for wing-men and potentially for fleet management (conceiving of a fleet as a set of squadrons assigned various tasks analogously to the way that, in Unstable Space, the player can create multiple wings with complex compositions and diverse assignments).

At the moment, I'm working on two simple turret test-beds, the Pinguin armed cruiser, which has two point defense turrets, and a modified old-style gunstar equipped with 4 Unleashed-style twin light assault cannon turrets (identical to the two anti-ship turrets on the Pinguin) and two Unleashed-style point defense turrets. I'm working on the targeting code for the point defense turrets first as that is simpler than targeting spacecraft that can maneuver and flee if badly damaged.

The original Unleashed missile targeting code was very "quick and dirty", but effective. It also, at times, would shoot friendly missiles, as in the Act 0 Scene 2 episode when some Carva Cartel ships intervene to defend Cal from an onslaught of hostile Independent tugs.

In its present revised but still incomplete state, the missile targeting code accumulates the factions of all ships that have become hostile during the current flight session and selects only missiles whose faction is in the set of hostile factions. These are then sorted by range. It would be straightforward to further filter only hostile faction missiles which are approaching the turret, or the turret parent (or another sim, such as a station, that the turret is assigned to protect). I will probably need to implement this additional filter soon. In a dense fight, there may be many missiles fired by a hostile faction that are in range but not approaching the sim protected by a point defense turret, and it would be helpful to filter these out to make the defense algorithm more effective.

The less complex current procedure works really well for the Pinguin when individual missiles come within range of the pd turrets. But the revised code is still very quick and dirty and I am confident that it will perform poorly in situations in which multiple missiles come within range within a time period short compared to the schedule on which the turret targeting is updated.

What is needed is a set of independent schedules that simultaneously perform the following:

1) periodically examine the missile threat environment and construct lists of missile threats to each friendly sim, ranked by the severity of the threat

2) update the assigned target lists (lists of missiles to be targetted) for each point-defense turret. Pd turrets can be
assigned the defense of their parent sim or the defense of a nearby
sim (for example gunstar pd turrets could be assigned to protect a nearby station if the gunstar itself is not under attack).

3) control the firing of the point defense turrets on their respective current targets

4) for each pd turret, "damage assessment" of fired-on missile threats, removal of destroyed missiles from the assigned target lists and assignment of the next missile target in the list.

I'll try to build these concepts into the MonitorShips main ship control loop of Unleashed mod, and then when they are working split them off into separate package functions.


If this could be got working, ships equipped with point defenses would become much harder to damage with missiles. This seems reasonable to me. The Seeker missile does about 20% damage to a Devastator Corvette hull, and it is quite easy for the Pinguin (which has 4 launcher mountpoints) to overwhelm a powerful ship with a barrage of missiles fired in rapid succession. One could make the missile warheads less destructive as a way of balancing this, but it is plausible that a heavy weapon detonated in contact with the ship hull would do grievous damage (as a contemporary analogy, recall that a single Exocet missile sank the UK Destroyer HMS Sheffield in the '80s Falklands Crisis).

A highly effective pd algorithm coupled with preserving the powerful efficacy of Seeker and better missiles would strongly incentivize the mounting of point defenses on all valuable ships. Such ships could still be destroyed with mass missile strikes, but these would be much more costly to the attacker in terms of the damage done per missile fired, since few missiles would typically get through a good point defense.

When this is working well for the player ship Pinguin, I'll generalize it to track and counter missile threats to non-player faction ships, starting with the above-mentioned gunstar. Gunstars are way too fragile at present in Unleashed Mod. For example, the Mod assigns a pair of old-style gunstars to the Junkyard station, but these are routinely wiped out by 3-4 ship patrols of interceptors and corvettes. IIRC, in the old IWar-1, gunstars were designed to be able to withstand small Indie fleets. They presumably would have kept pace with ship developments into the EoC era. If they are given good AI-pilot-controlled turrets and smart target priority code to maximize the effectiveness of the turrets, they would become very tough again and would be a stronger deterrent to Marauder attacks, which is one of their purposes.

Better anti-ship turret (including independent targetting of different turrets on multi-turret ships) and pd function on Destroyers and Cruisers would also make these powerful ships even more powerful, as befits their function as the cores of combat fleets.

I'll try, within a few weeks, to put up some videos of the Pinguin fending off a missile barrage and a gunstar defending itself from a squadron of strafing fighters.

Please Log in or Create an account to join the conversation.

More
6 years 10 months ago #17265 by SRC
Some further illustrations of possible enhancements to Unleashed mod using new functions available in the (I hope soon to be posted) vEoCUtilities mod.

In the main Unleashed.pog package, there is a large function called MonitorShips that has a 2-second schedule which loops over every ship within a large radius of the player ship and tells the non-player ships how to react to the environment. It also generates pirate raids on merchant ships, competing loose cargo scavengers which interfere with your and Jafs' efforts to collect cargo abandoned by freighters you have attacked, military and government patrols, and corporate recovery teams which attempt to retrieve cargo ejected from merchant ships under attack. It is these features which add a great deal of interest to the Unleashed mod, as the star systems are a lot "busier" than in vanilla EoC.

There are several large "if-tests" in Monitor ships that filter out factions that Bineshi made ineligible for certain mod features. For example, smaller factions are ineligible to have "capital ships" (destroyer, cruiser, carrier) generated as parts of their patrols. The black/white if-test works fine, but if you wanted to add a little more texture or nuance to the faction properties, you might want to assign different reduced probabilities of instantiating a capital ship as part of a small faction patrol. Rather than 0%, a positive but much less than 100% probability could be assigned.

This could readily be done with new template files that specify the fleet compositions of the various factions, either as probabilities per type of ship, or even perhaps as absolute ship numbers (though to actually define the absolute numbers of ships in fleets and then keep track of this as ships are destroyed in combat would merit a revision of the EoC damage model as ships are destroyed so easily that Cal alone could, over the course of the three Acts, deplete the entire Badlands cluster of all its fleets).

This could also be tied into the AI pilot properties of the various factions. Small, poor factions would have fleets much more heavily weighted toward older style ships and would tend to break off combat sooner in order to avoid losing ships. Their strongest ships, being nearly irreplaceable due to their cost, would be rarely risked in combat and would only be risked if "odds" were strongly in their favor. An effect of this is that the weaker factions would tend to avoid tangling with stronger factions. The $*%@ would flow downhill, as it does in real life, which would add further flavor to the mod. At the bottom would be the transient and independents, who would basically run away from everything, if they could.

This is all highly notional, since at present Unleashed includes the "fragile ship" damage model of EoC and non-player ships die so quickly that one cannot have defined fleet sizes. But it's fun to think about how a more realistic game-world might be created. One of my aims in the vEoCUtilities mod is to create tools that would help modders to move in this direction.

So, in "blue-sky" think-out-loud mode, a faction that had a defined roster of ships would also have a defined roster of ship crews. These crews would have different levels of skill, experience, morale and courage (and other properties that I have not considered. How about "contentment with current pay" :) Not sure I want to contemplate labor actions :) Though the predatory corporation aspect of the game seems a lot more plausible today than it did in the late '90s.

Back to crews: you could envision modelling the crew as a single thing or even, at a greater level of detail, modelling the individual members of each ship crew with their individual attributes which change over time, get better with successful missions, decay if not sent on missions for a long period of time, etc.

How to keep track of all this? Globals will be necessary, since they can persist between game sessions. Here, vEoCUtilities may be helpful. The iArrayUtil.pog and iStringUtil.pog packages contain many functions for manipulating string format data, and tools that represent arrays, lists, sets, and vectors as strings. These tools permit the construction and interpretation of data structures of essentially arbitrary complexity, which can be preserved between game sessions as string globals.

As a further blue-sky idea, which I hope will stimulate the interest of modders and story-tellers who read this (or stimulate players who would like to become modders), imagine a "Lucretia's War" mod in which the back-story of EoC is told. The bio-bomber base is still part of the game (or maybe the story starts before the base is discovered, including the story of how Lucretia became a pirate) and there is a fleet of ships operating out of it. There would be mod systems for recruiting crews, training them, and adjusting their attributes through time as they perform missions. Crew members or entire crews would occasionally be lost due to combat or accident, or desertion.

One could design crew attribute data structures which would control the specifics of the AI pilots installed into the respective Lucretia fleet ships when they are sent out on missions. The crew attributes would change over time, or due to events. For example, the loss of a ship in combat would adversely affect the morale of the entire fleet, and it might take several successful missions before the morale was substantially recovered. Poor morale, in turn, would affect crew performance, for example by causing them to break off from combat sooner, thus imperiling the success of missions or requiring Lucretia to send larger squadrons on each mission (which would reduce the number of missions that could be planned in each game period, and therefore the income earned in that period). The player, acting in the role of Lucretia, might be forced to expand resources to pay bonuses to incentivize risk-taking by demoralized crews in order to restore the "profitability" of the fleet.

All of this would require careful code design to implement the dynamics of how game events influence crew or crew-member attributes, and how the attributes would influence the details of the AI pilot properties. This is complex, but it is doable, and I hope that new tools such as the String and Array utilities of vEoCUtilities Mod, will make it easier to do things like this.

Please Log in or Create an account to join the conversation.

More
6 years 10 months ago #17266 by SRC
This thread is evolving into a report on my attempts to revise Bineshi's excellent
"Unleashed" mod. with the iEoCUtilities aspects somewhat secondary.

I'm currently working on the main MonitorShips function of the Unleashed.pog package,
trying to implement a better missile target selection function for all "ship-style"
point defense turrets in the game. I believe that in the original Unleashed mod, ship-style
(ie, [Class]name=icShip) point-defense turrets were only assigned to the player ship.

I like having the ship-style pd turrets because they can be assigned targets other than
missiles. It seems plausible to me that weapons that are not otherwise engaged would be
deployed against whatever targets were available, even if these targets were not the weapons'
designed-for targets. Thus, a pd turret with no missile targets would sensibly be assigned
to shoot at nearby light-ship hostiles, such as fighters or drones.

It would be nice to have this feature on non-player ships too in the interest of play balance.
Ideally, we would have access to the EoC code and could modify how subsystem-style pd turrets work,
but in the absence of that privilege, one must make do with what one can accomplish with modded
code overlays. Bineshi's approach to turrets and turret fighters looks like a good way to deal with
this specific issue.

In order to know which missiles to target, the ship-style pd turret needs to know which factions
are currently shooting at its faction. So I need to track, for each faction present in a flight session, what factions have shot at it.

To do this, I'm adding code to the Monitor ships schedule loop that does the following:

0) define a global set for each faction "F" that is the set of all factions that have attacked
faction "F". At the beginning of a flight session, none of these globals exist, but as ships
are created and dealt with in the Monitor ships loop, the appropriate global for that ship
faction is created as, initially, an empty set. As hostilities take place, the globals will
be modified to reflect that there are factions present in the flight session that are hostile
to faction "F". This is done for each faction "F".

1) Within the ship orders part of the Monitor ships loop, each time a ship is ordered to attack another ship, the attacking ship and its faction handle are added to a list property on the target ship.

2) at the beginning of each new scheduled execution of the monitor ships instructions,
a preliminary loop over all ships is performed to deal with the new hostile factions information
that was accumulated in the prior execution. The hostile-factions data for each faction is
appropriately adjusted.

3) in the point-defense turret targeting step, the hostile-factions global is consulted to filter out missiles whose faction is not yet shooting at the faction to which the pd turret belongs.


A final detail is that I will try to implement a default targeting priority feature for both point-defense turrets and anti-ship auto-turrets (and eventually turret fighters) so that point defense turrets have a default target priority of

a) missiles
b) fighters and drones
c) light combat ships
d) heavy combat ships

and auto-turrets have a default target priority of

a) ships
b) missiles

At present in Unleashed, anti-ship turrets with no target in range are idle even under
a heavy missile barrage. It would make sense for these to be used for anti-missile
protection when they are not otherwise occupied with anti-ship duties.

Eventually, the player would be given tools to modify the targeting priority, and perhaps ultimately there could be AI ship caption functions that made such decisions for non-player ships. So, for example, you could imagine a "panic all turrets anti-missile" keybind that would switch anti-ship turrets to anti-missile duty when under heavy missile attack.

If I can get the basic missile threat assessment functions to work, I should be able to put up that example video of a Unleashed-style ship-turret equipped gunstar under attack by a Group of hostile fighters.

Please Log in or Create an account to join the conversation.

More
6 years 10 months ago #17267 by SoupDragon
Looking good SRC. Responded to your email. Hope it makes sense. Get in touch when you're ready to move.

Soup'

Please Log in or Create an account to join the conversation.