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

New ECM Visual Effect #494

Merged
merged 21 commits into from
Nov 28, 2024
Merged

New ECM Visual Effect #494

merged 21 commits into from
Nov 28, 2024

Conversation

AnotherCommander
Copy link
Member

This PR implements a visual addition to the ECM effect. Till now ECM blast presence is indicated by a jitter of the scanner lollipops. With the changes from this PR we now also get an EM interference pattern on the ship's view screen, expressed as a burst of static and/or CRT malfunction. The effect is available only when shaders are available, so you will be able to experience it in the Shaders Enabled and Extra Detail detail levels. You will get it at every ECM trigger event, be it from NPCs or the player.

The original shader used as inspiration for this is https://www.shadertoy.com/view/ltV3z1 . Note that it seems to rely on some strange code operations like mod(x, 0.0). However, it seems to perform exactly as advertised so I did not make any substantial changes to it.

Linux maintainers, please confirm that it works also for you if you can. I tried to make sure that this effect will be available and functional on Linux too, but need to be sure.

This video shows what the new effect looks like.

IMAGE ALT TEXT

@Garryck
Copy link

Garryck commented Nov 24, 2024

Nice.. it shuts off very abruptly though.. if the effect could fade out over a half to one second, I suspect it would look even better. Assuming that's even possible, of course.

@AnotherCommander
Copy link
Member Author

@Garryck From my point of view it would be tricky to achieve and I think the result will not be really worth the effort. Note that the effect has a certain randomness built in and if you set it off a few times in a row you will see that the patterns are not the same each time. Sometimes it may appear as fading out somewhat more naturally and some others it will have a more abrupt termination. I hope at least that when it fades out gracefully it will be close enough to what you had in mind.

Following a request on Discord, I have made the effect a user defaults setting. You can use the key "ecm-visual-fx" in .GNUstepDefaults to decide whether you want to enable the effect or not. The default value is YES and you can set it to NO if you decide that you don't really want it after all and you'd rather skip it.

@mwerle
Copy link

mwerle commented Nov 25, 2024

Very Nice! WFM Debian GNU/Linux 12; first time building Oolite in years..

(Btw, not the best developer-experience to include dependencies which break the build for the average user.. would IMHO be better to have instructions asking people to download additional dependencies if their platform doesn't have them instead of asking people to delete included files - png.h - this makes it challenging to contribute and not accidentally include deleting these files in a PR..)

Does it also display when an enemy triggers ECM? If so, is the level of the effect based on distance? (Sorry, I only read the diff, so don't have the context on what the interference triggers are)

@AnotherCommander
Copy link
Member Author

Hey, welcome back Micha!! It's great seeing you again around here!

The Linux build has been left a bit behind and is in need of some love. I have been concentrating on the Windows stuff for quite a while now so anything that can help Linux catch up a bit better would be more than welcome.

Re the effect: Yes, it triggers also when an NPC fires ECM. It is currently not dependent on any external factors like distance and stuff, mainly because such parameters would have to be passed as uniforms in the final shader and I'd rather not clutter it too much. For now the effect is meant to simulate a generic EM pulse disruption that could be coming from anywhere.

I am also considering lowering its intensity a bit. Right now it completely whites out the screen sometimes and that can be quite jarring, especially while trying to maintain situational awareness during combat. Some fine tuning is underway.

@AnotherCommander AnotherCommander merged commit 10e222e into master Nov 28, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants