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

Add support for required slots, validate shipdefs on startup #6013

Merged
merged 15 commits into from
Jan 14, 2025

Conversation

sturnclaw
Copy link
Member

@sturnclaw sturnclaw commented Jan 13, 2025

This PR tackles one of the last outstanding issues with the equipment system, by introducing the concept of a required or "non-empty" equipment slot. Required slots must have a default item, and do not support being left empty.

As part of this work, I've written a front-end and framework to run arbitrary validation passes at game load time, and a set of validation functions for ship JSON definitions.

image

This allows us to have a much higher level of confidence in the data that's being exported from Notion, and significantly reduces the workload required to test individual ships and catch common errors (like missing language strings).

This PR also gives the default field a proper use now; when purchasing a ship, slots will be prefilled with the default items specified in the ship JSON. This is done without regard to station stock or techlevel, as it's assumed that the items are shipped "preinstalled" in the (effectively) factory-new ship you're buying from the ship salesroom.

TODO:

  • Prevent selling items from required slots
  • Fix multiple-count items not correctly calculating price when selling
  • Include the cost of ship default equipment in ship market cost

- Fonts may not be fully loaded upon entering the menu, leading to incorrect calculated notification sizes.
- Fix assertion when hovering a non-expiring notification.
- Hook for various at-startup checks to run, including validity/integrity checks to make errors visible before starting or loading a game.
- Indicates that the slot is a "required" slot and the contents must not be empty
- Implicitly requires the "default" field to be populated with a valid equipment ID
- Fill required slots with specified default items if present.
- Currently no ability to replace default items in required slots via an autofit rule.
- All slots with default items will be populated on ship purchase.
- Item cost is not yet factored into the overall cost of the ship.
- Framework to run a number of at-startup data validation tasks and collate the results into an easily-browsable display for modders/developers
- Checks for most common issues with ship configs.
- Meant to ensure crash bugs with ship configs don't slip through into a release.
- Also applies to modded ship files.
- Equipment in required slots can be replaced, but cannot be sold such that the slot is left empty.
@sturnclaw sturnclaw force-pushed the hull-validation-nonempty branch from 4440763 to de1cb24 Compare January 13, 2025 21:40
- Remove the 'misc' equipment namespace, move thruster equipment into their own namespace.
@sturnclaw sturnclaw linked an issue Jan 13, 2025 that may be closed by this pull request
- Compute ship cost as basePrice + default equipment cost.
- Cache a list of equipment when viewing advertisements and install on purchase.
- Remove manual computation of hyperdrive cost in trade-in value since hyperdrives are included in ship costs.
@sturnclaw sturnclaw merged commit 80c06a3 into pioneerspacesim:master Jan 14, 2025
4 checks passed
@sturnclaw sturnclaw deleted the hull-validation-nonempty branch January 15, 2025 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Ships fly without thrusters
1 participant