Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code(feat): Additional Scan Information and modular access #2

Merged
merged 112 commits into from
Mar 28, 2023

Conversation

Zitchas
Copy link
Member

@Zitchas Zitchas commented Mar 25, 2023

Feature: This PR implements additional strategic information, accessible by having a scanner with "strategic scan power." This works the same way as Tactical Scan, and also provides the range. By request from Amazinite, this PR now also breaks up all the individual data elements into individually callable attributes, so that an outfit can display just one piece of information, or any collection thereof, and at varying distances.

Feature Details

This feature adds:

  • Calculated gun range (uses the hardpoint location & gun range to calculate the longest ranged gun on the target)
  • Calculated turret range (uses the hardpoint location & turret range to calculate the longest ranged turret on the target)
  • Calculates the targets actual turn speed (includes effects of slowing)
  • Dynamically adjusts the display depending on the outfit configuration to display just tactical display, just strategic, or both.
  • If a ship has just a tactical scanner, it will not have any visual changes compared to continuous prior to this PR.
  • Tactical scan and strategic scan are available as before, both individually and together.
  • Range, Weapon ranges, Turning speed, Fuel, Energy, Thermal, and Crew count can each be accessed individually as stand-alone items.
Removed stuff This PR originally included a bunch of useful debug info on what a ship was doing, personalities in use, etc.

Removed all the debug stuff, which includes the parent ship identifier, parent system, hyperjump status, and personality info. This needs to be refined and/or hidden behind a "debug only" restriction. With some modifications it could be used as in-character info. Example, instead of displaying parent ship, call it the flagship. For flagships, display number of ships in fleet instead of "parent of X"

credit:
Thanks to @vitalchip for creating the code that makes this possible. They did the original code, I updated it, expanded on it, added the info repositioning logic/data, and did the artwork.
Thanks to Hurleveur for their help working out some change requests and cleaning it up!

Graphics:

  • the new icons are 100% my own creations, not based on anything. The original .xcf, 2x, and normal png can be found in the attached zip file:

Strategic Scan UI elements.zip

UI Screenshots

This shows the info display of a ship that has both tactical and strategic scan power.

Tactical Info Updated Final_v3

An example of a ship with just a tactical scanner:

Strategic Scan_v4_C(just tactical)

An example of a ship with just a strategic scanner:

Strategic Scan_v4_B(just strategic)

Usage Examples

Someone who prioritizes combat information may want an outfit that just displays range, weapon range, and turning speed.
A faction that has ionizing weapons and enjoys combat might want range, weapon range, turning, and ionization.
A faction that does a lot of boarding might not want anything except the crew count.
The FW, with its preponderance of heat weapons, might be interested in a specialized scanner that just displays range and thermal.
The Navy, fighting against ships wth flamethrowers, might want a scanner that shows range and fuel.
These could also be used to created a cascade of information. For example, in the plug-in I attached to a post farther down, the cascade info scanner will show the player range continuously. At a certain range it'll start showing manouverability info (weapon ranges and turning). Get a bit closer and it'll pick up fuel. Closer yet and it will determine energy, closer still will show thermal, and then when one is practically at the target it will show crew.

Data Usage:

  • "strategic scan power" 10
  • "range finder power" 1 (can be any non-zero value, as range finding is infinite.)
  • "crew scan power" 10
  • "thermal scan power" 10
  • "energy scan power" 10
  • "fuel scan power" 10
  • "weapon scan power" 10
  • "maneuver scan power" 10

This is used as an attribute on any ship or outfit, in the same exact manner as Tactical Scan.

The display position for all these information values and their associated icon is included in interfaces.txt, which means that a player can reposition any of these individually or collectively to anywhere on the screen at their discretion.

Testing Done

Played the game and checked to see if the information appeared.

Automated Tests Added

No idea if this needs a test, but it's displaying info, not an action something can do, so I don't think so?

Performance Impact

I don't think there should be any noticeable impact, but I have no idea how to check.

Artwork Checklist

Zitchas and others added 30 commits January 21, 2023 09:28
Adds icons & code for:
- gun range
- turret range
- turn speed

New icons by Zitchas
Code originally by Vitalchip
This doesn't have any part in panel.cpp, so removing the change there.
And refining the fleet/flagship text to be more in-character.
Flagship and fleet status, personality, target system, hyperspace status...
@Zitchas Zitchas added the enhancement New feature or request label Mar 25, 2023
Copy link
Member

@RisingLeaf RisingLeaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works, style and etc is not perfect but it works so its fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants