Skip to content

ECM crime - Don't use your ECM near a station#5916

Merged
impaktor merged 1 commit into
pioneerspacesim:masterfrom
zonkmachine:ecmcrime
May 24, 2025
Merged

ECM crime - Don't use your ECM near a station#5916
impaktor merged 1 commit into
pioneerspacesim:masterfrom
zonkmachine:ecmcrime

Conversation

@zonkmachine

@zonkmachine zonkmachine commented Sep 7, 2024

Copy link
Copy Markdown
Member

I hesitated a bit to submit this because of the overly harsh reaction if you happen to press the ecm button while taking off, but this is the same for all crime, dumping waste or firing a weapon. You will be terminated.

Updated: The effective range of the ban is now the same as the effective range of the ECM, 4 km.

I think there could be some more around this like a couple of the lights going out on the platform or the BBS being out of order the next time you land there. ECM should be used responsibly.

ecmdischarge

@impaktor

impaktor commented Sep 7, 2024

Copy link
Copy Markdown
Member

I hesitated a bit to submit this because of the overly harsh reaction if you happen to press the ecm button while taking off,

Always wise to have some distance in situations of discharge....

I do believe the new equipment system aims to add a arm/disarm for weapons, but I could be wrong. Would be good to have for ECM as well.

@sturnclaw sturnclaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Given that you're hesitant about submitting it, I'd suggest that this PR should probably sit and receive a bit more thought before it's merged. The actual implementation of the ECM event is a bit misleading from the perspective of the LuaAPI - at minimum, I'd like to see the name of the event changed to more clearly indicate which situations it triggers in before I can sign off on the PR.

The ECM equipment / game system itself will also hopefully be receiving some design thought as we move towards Stage 2 / Stage 3 of the EquipSet rework. Feel free to contribute in that respect as well - the implementation of this PR may need to adjust to take into account some of the interactions of the new equipment system as we iteratively implement it.

Comment thread src/Ship.cpp Outdated
@fluffyfreak

Copy link
Copy Markdown
Contributor

I don't mind the naming of onUseECM that seems to match the rest of our scheme 🤷
Don't we have a crime system where we issue a fine and DON'T try to kill the player? 🤔

@sturnclaw

Copy link
Copy Markdown
Member

My specific problem was that the onUseECM event is only ever triggered if the ECM system has been clicked within a specific radius of a space station, which is absolutely not the behavior you'd expect from the event name.

In general, the ECM system really needs a re-think and I'd prefer to avoid hardcoding more behaviors into it until we've had a chance to do a design pass over it.

@zonkmachine

Copy link
Copy Markdown
Member Author

Thanks for the feedback!

DON'T try to kill the player? 🤔

Memo: don't try to kill the player...

I had a vague idea that you could have things break down on the station if it's close enough when you fire the ECM. Such as some of the light's on the pad going out or the BBS being blank after an outage with a message of failure.

@bszlrd

bszlrd commented Mar 29, 2025

Copy link
Copy Markdown
Contributor

Heh, handful of reputation decrease could be apt as well.

@zonkmachine

Copy link
Copy Markdown
Member Author

Rebased and gave it a quick test. I also tested it rebased on #6128 and it works intended with no overaggressive police.

@zonkmachine

Copy link
Copy Markdown
Member Author

I do believe the new equipment system aims to add a arm/disarm for weapons, but I could be wrong. Would be good to have for ECM as well.

One for both i assume.

Don't we have a crime system where we issue a fine and DON'T try to kill the player? 🤔

It's not really fine tuned. The level over which the police will 'open fire until dead' is a fine of 300$. The lowest base fine of any crime is 500$. It's addressed in #6128

Heh, handful of reputation decrease could be apt as well.

That would be appropriate, yes. And a future BBS news flash module will bring it up.

My specific problem was that the onUseECM event is only ever triggered if the ECM system has been clicked within a specific radius of a space station, which is absolutely not the behavior you'd expect from the event name.

OK. Looking into it.

@zonkmachine

Copy link
Copy Markdown
Member Author

My specific problem was that the onUseECM event is only ever triggered if the ECM system has been clicked within a specific radius of a space station, which is absolutely not the behavior you'd expect from the event name.

Would unlawfulUseECM work?

@zonkmachine

Copy link
Copy Markdown
Member Author
  • Rebased on latest master
  • onUseECM changed to unlawfulDischargeECM
  • Radius of ban effect same as effective radius (4 km).

@zonkmachine

Copy link
Copy Markdown
Member Author

Given that you're hesitant about submitting it,

The issue I had with this PR is the sudden execution by the police if you use it in proximity of a space station. This is fixed in #6128

@zonkmachine zonkmachine requested a review from sturnclaw May 12, 2025 17:12
@sturnclaw

Copy link
Copy Markdown
Member

This is acceptable. I'd prefer to eventually move the responsibility for generating the unlawfulDischargeECM event into Lua, as the current implementation hardcodes part of the legal system in C++. That's not an immediate concern right now however, and can be tackled in the future when countermeasures gameplay is looked at in more depth.

@zonkmachine

Copy link
Copy Markdown
Member Author

OK, squashed. The only thing I can think of that's left to do here, is decide on the level of fine and distance of effect. The base fine 500$ is the same as three other offences (illegal jump, weapons discharge, and contract fraud). The distance is the same as the range of effect (4 km) and maybe it could be a multiple of this. I have no preference of either of those values and it can be tweaked later.

@sturnclaw

Copy link
Copy Markdown
Member

A good "fudge" number for enforcement range would be around 15km from the city center, as that prevents any of the buildings for currently-generated cities from being within the effect radius.

The fine being $500 is fine by me, though maybe we make it $750 since it's more difficult to "accidentally" click the ECM button?

@zonkmachine

Copy link
Copy Markdown
Member Author

The fine being $500 is fine by me, though maybe we make it $750 since it's more difficult to "accidentally" click the ECM button?

I changed it to $750 to get some variation.

A good "fudge" number for enforcement range would be around 15km from the city center, as that prevents any of the buildings for currently-generated cities from being within the effect radius.

I thought selecting the legal range would be trivial. It only is if it's within the ECM_RADIUS.
We explicitly test for ECM_RADIUS here:

Space::BodyNearList nearby = Pi::game->GetSpace()->GetBodiesMaybeNear(this, ECM_RADIUS);

If it's larger I think I would have to create an outer test for the legal range and that would kind of look bad. Maybe wait with this until you move it to the LUA side?

@sturnclaw

Copy link
Copy Markdown
Member

If it's larger I think I would have to create an outer test for the legal range and that would kind of look bad. Maybe wait with this until you move it to the LUA side?

That's fine - this illustrates my point about hardcoding the legal system within C++ though... 😉

@zonkmachine

Copy link
Copy Markdown
Member Author

That's fine - this illustrates my point about hardcoding the legal system within C++ though... 😉

Right, got it!

I think this PR is ready.

@impaktor impaktor merged commit 60da4a8 into pioneerspacesim:master May 24, 2025
4 checks passed
@zonkmachine zonkmachine deleted the ecmcrime branch May 24, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants