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

Fix bugs, expand equipment coverage, add detailed stats for equipment #6032

Merged
merged 9 commits into from
Jan 31, 2025

Conversation

sturnclaw
Copy link
Member

Another catch-all fix/feature PR. Here's the short list:

As part of this PR, I've changed how new "types" of equipment are defined; they now use EquipType:NewType("Equipment.MyTypeName") and I've migrated the definitions for individual EquipTypes to live in the modules/Equipment/Types.lua file rather than in libs/EquipType.lua.

- Add Windows debug preset.
- Enable automatic indentation detection for language files.
- Update launch presets to function in multi-folder environments.
- mission.ship can be unset by a few other codepaths - the mission timer callback should check that the value is non-nil before checking if it's a valid handle.
- Combine inheritance, prototype setup, and serializer registration into a common EquipType:NewType() function.
- Works equally well with EquipType as it does with defined subtypes.
- Can be installed in all ships regardless of slot loadout.
- Scales volume and mass/price costs according to the hull size of the ship and cargo bay size.
- Split atmospheric shielding into a structure slot and a hull slot mod, with varying levels of efficiency.
- Reinforced Structure is now the primary source of atmo_shield_cap, with Atmospheric Shielding being a lighter-weight, less-expensive alternative or addition.
- Heavy Atmospheric Shielding is limited to S2, S3, and S4 ships as smaller ships cannot sustain the power budget and S5 ships are infeasibly large.
- Added descriptions for Heavy Atmospheric Shielding and Reinforced Structure.
- Also expanded Hull Autorepair with versions for S2-S5 ships.
- Move definitions of all EquipType subclasses into modules/Equipment/Types.lua
- EquipType.lua now returns the EquipType class directly.
- Add ShieldType subclass for shield generators.
- Add equipment stats for hyperdrives, thruster upgrades, missiles, and atmospheric shielding
@impaktor
Copy link
Member

Converted the cargo scoop to a slot-less equipment item that scales its costs based on the size of the ship hull.

We have (had?) a combined fuel + cargo scoop that saved that precious 1t. Is fuel scoop still taking a slot? No multiscoop anymore?

As part of this PR, I've changed how new "types" of equipment are defined

@zonkmachine might want to check wiki lua tutorial?

@zonkmachine
Copy link
Member

As part of this PR, I've changed how new "types" of equipment are defined

@zonkmachine might want to check wiki lua tutorial?

The tutorials I've touched doesn't cover this. Closest tutorial I can think of is this one and it's already outdated:
https://wiki.pioneerspacesim.net/wiki/Lua-based_equipment

I think it's better if someone who's into that code looks into this though.

@sturnclaw
Copy link
Member Author

We have (had?) a combined fuel + cargo scoop that saved that precious 1t. Is fuel scoop still taking a slot? No multiscoop anymore?

Correct - we (@bszlrd and I) decided to remove the multiscoop as a fuel scoop and cargo scoop are two completely different things both in-universe and outside of universe. The eventual goal is to expand fuel scooping gameplay to provide some tradeoffs in the kind of equipment you can install in the fuel scoop slot.

Equipment weight and volume is something that will need some balance sooner or later, but for the time being the extra 1m3 volume isn't a particularly big concern now that equipment volume and cargo space are separate concerns.

Closest tutorial I can think of is this one and it's already outdated [...]
I think it's better if someone who's into that code looks into this though.

This tutorial is so hilariously outdated it's not really even worth bothering with - it's about 12 years and two major rewrites of the equipment system out of date.

At some point, I will attempt to make an effort to write a tutorial on the new equipment system for the dev docs, but I cannot promise a timeframe. It will definitely not be before this upcoming release 😄

@impaktor
Copy link
Member

At some point, I will attempt to make an effort to write a tutorial on the new equipment system

My thought is any wiki tutorial will be bound to be updated, and weigh in the back of the minds of the guilty developer, and it is better to just designate a few lua files as "tutorial" with bountiful comments, and link to them from the wiki. Sure, comments will need to be updated when code is, but I deem that much more likely, than someone maintaining the wiki.

E.g. DonateToCranks is very simple interaction with BBS, and DeliverPackage for some deeper mission. I think I have an ancient Donate module with comments, for this purpose.

Those were my two kronor.
(Although öre would be more analogous with cents)

@sturnclaw sturnclaw merged commit 303d73f into pioneerspacesim:master Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants