-
Notifications
You must be signed in to change notification settings - Fork 91
Power cell-like ammo item framework #1044
Comments
CritiquesOkay, so the critiques on the currently available systems are as follows: resolved
Examples given: Universal plasma power cell
Thus, changes suggested:resolved
To allow for examples:
These issues suggest two courses of action:
StatPart required changes: resolved
Complex Comp/Thing storage:
|
I see the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Nice! I definitely prefer adding to the existing ammo framework, rather than having a separate system that runs in parallel. Looking forward to trying these out myself once the backend is implemented. |
TODO:
|
This comment has been minimized.
This comment has been minimized.
- Remove FT implementation - SpentAmmo having mass costs implemented - Magazine bulk implemented - Set Revolver to ejectsCasings = FALSE - Ported over previous "Fix-for-#1044" to new Development with PRs - ConservedMassFactorWhenFired added - ConfigError checking for Amount without backup - Loaded ammo statPart now includes several discussed things - VerbShootCE ejecting casings checks whether conservedMassFactorWhenFiring is positive
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The issue: as long as 1 ammoDef produces 1 firing event, things go well. However, as more charges are gained and consumed, and those charge changes become disproportional, magazines can become messy and a pain to handle. Mathematically, there are optimal solutions to these issues. Magazines can remain in harmony, while loading, unloading and firing events can be allowed to occur in harmony with one another and with the player, investing resources into the gun system. To prevent fractional charges in the magazineContent
To ensure that only integer values of "charges" are stored, the values [X] and [Y] are calculated as [B/(B/X)] and [B/(B/Y)]. The brackets indicate this is an integer value. This way, no fractional values of "charges" can exist within the gun.
Fireable - Unloadable dilemmaContentCalculate X / Y
Calculate Y / X
Problems are only averted when X = Y Firing backlog (X / Y isn't integer)Content
Examples:
Unloading backlog (Y / X isn't integer)Content
Examples:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Okie doke - I'll touch base with you again once you have a working implementation, so you can walk me through the Xenn cell (and maybe a couple of DOOM batteries) as examples. Apologies again for being obtuse! |
This comment has been minimized.
This comment has been minimized.
Additional structureThe requirements of any "charge holder" are as follows:
Since only very few guns would need to use a much expanded toolset for handling charges, perhaps these functionalities could be added as virtuals in a class, such that if the exact implementation of them has to be changed for a new ThingDef, someone could extend the class. |
Code impacted by changes
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
TODO
|
Just an update, currently figuring out all the issues with the system as programmed |
I think the scope of some of the changes I suggested is too large for the intended use for the feature. Currently, all features as-requested appear to be present. I'd prefer rounding off the rework for now, perhaps revisiting it for further changes if desired, however I'd imagine that the current implementations in the WIP branch are more than enough. |
A short tutorial for the changes. The following XML tags and attributes have been added. Attributes w/ defaults
Examples Multiple charges per ammo
Here, the ammo would add 4 charges per consumed ammo. Each shot would consume 1 charge (by default). RandBacklog indicates that unloading ammo at a less-than-divisible-by-four chargecount will result in a 3/4, 2/4, 1/4 or 0/4 chance of recovering the ammo item. The overflow tag indicates that loading more than magazineSize (=6) charges into the magazine will result in an overflow (e.g 8/6). Charges are otherwise handled as normal, so no charges are wasted when too much ammunition is loaded. Default behaviour without RandBacklog and Overflow is intended to be a wasteful overflow (too much loaded) and a wasteful underflow (no recovery), although currently they are a lack of loading behaviour (not loaded beyond AmmoCharge-intervals) and I'm not sure about the underflow. Multiple charges per shot
Here, ammo adds 1 charge, but each shot consumes 4 charges. Whenever a shot is fired at a chargecount below four, the chargecount will underflow, requiring consumption of additional ammo to recover its value before being able to shoot again. Without the Underflow tag, firing is intended to be possible but will not consume additional charges, as in the original FT implementation. Multiple projectiles
The construct above allows setting multiple types of projectiles to be fired from a single discharge. Trajectories of additional projectiles are very similar to the FIRST projectile in the list. It is allowed to have pelletCount set for each of these projectiles as well, resulting in even more projectiles being fired per shot. The syntax is exactly as for the CompExplosiveCE fragments list, with similar functionality otherwise.
|
While the following changes could technically be added, they were somewhat ignored due to assumed time constraints as a result of a lack of team members working on the 1.1 update:
Code for these things are there, although their implementation may likely take another week. |
At present, CE ammo come in the form of discrete cartridges, shells or rockets, which are suited to various historical and modern projectile firearms, as they account for the wide variety of loading methods and magazine sizes.
I would like to propose an additional, alternative xml/C# framework that would allow modders and patch authors to define power cell-like ammo items, for use with sci-fi and other exotic weapons.
Feature Overview
ammoConsumedPerShot
parameter would use up a fixed amount of energy/fuel per shotmassConsumedPerShot
- if specified, reduces the mass of the ammo item by a fixed amount after each shotUse Cases
Current Placeholder Implementation
Phase I of the FastTrack merger (#1006) contained a crude placeholder implementation of generic Plasma Power Cells. The current stats were conceived by defining the desired overall mass and dimensions of each power cell, then dividing these initial stats by the number of shots/rounds contained in the cell.
While the current faux power cells fits with the existing 1 cartridge = 1 shot framework, they break immersion in that the cells are not supposed to lose bulk as they are being used, especially for batteries; even an empty plasma or flamethrower fuel tank is a rigid container that should retain its bulk until it is discarded.
Misc Thoughts
The text was updated successfully, but these errors were encountered: