API additions needed for Shield Mods.

Shane Stixrud shared this feedback 2 years ago
Under Consideration

Keen, I am the author of the DefenseShields mod and having spent the better part of a year working on this mod I have learned a lot about the limitations of the API for making a mod like mine. My original request, which received 521 votes (in the top 5) on the old feedback site can be found here: https://feedback.keenswh.com/idea/expose-myprojectiles-bullets-via-modapi-5a7a771402499


I estimate that over 25% of my mod's code is dedicated to working around 3 missing API features (MyMissiles, MyProjectiles and GridResourceDistributor/GridSystems) and many of these workarounds lead to various unexpected behaviors, many of which I simply cannot fully fix without additional access.

Not having access to MyProjectiles is particularly problematic as a whole cascade of issues occur due to bullets hitting the grid vs the shield. This causes visual issues of bullet decals on hull, delayed and missing shield impact indicators, grid shaking and improper sounds on hits, shield taking no damage when projectiles pass through shield but do not hit grid. Players who take damage also taking large physics forces that cannot fully be prevented, entities inside shields trigger a cascade of events that must be dealt with, functional block particle effects kicking off AFTER damage handler and having to be suppressed after they are already visible, plus many many other issues.

A large number of your users and modders would benefit from having these 3 additions added to the API. I hope you can spare the time to add them in the near future.

Thank you for your consideration!

Shane.

Comments (30)

photo
5

Functionality of all shield mods would be greatly improved with these additions, in addition to performance improvements.

You got a like from me.

photo
4

I started to write code for exposing grid systems, but the further I progressed, the less likely it appeared it was going to be accepted. I also ran into a lot of issues.

So I stopped.

photo
4

While there is a lot in gridsystems that would be useful, my main needs are in the power code. In particular access to the computed available and max grid power.

photo
2

yeah noticed the bullet decal, big visibility issue when it hits the glass of the cockpit this has been an issue since the first bubble shield mod "moon prism"

photo
photo
2

Love the mod, can't play without it anymore. Hope this gets approved.

photo
2

this would help to add in all of my "issues" with the mod, knowing it was never yalls fault, i hope it gets added so that this can be the best shield mod out there and one of the best ever. hope keen sees it. good luck in your adventures

photo
1

I support this wholly, this mod is one of genre definers of the SE modding world, doing things in SE I never thought could work without massive effort and janky results.

photo
5

If such an API were to be implemented it would make creating shield mods way easier so we might see more of them. So please implement these APIs

photo
1

Let's do this people this needs to be done asap

photo
1

I hope the SE devs take notice and at least provide a response to this. While I understand why a mod like this would never be vanilla, I love using it despite the issues. If those issues were fixed, modders could do some awesome things and users like myself would have a few less things to get annoyed with. I wish you luck and hope this mod stays alive and active.

photo
1

Yes Please! If it helps with this and other mods - please consider doing this for the mod authors!

photo
2

This. We. Need.


Common, Dont force modders to work around API's Keen.

photo
2

Awesome mod! Hope those changes gets approved and coded by Keen soon.

photo
2

If it makes mods better and more stable, I'm all for it!

photo
1

#MakeShieldsGreat

photo
2

I hope that there would be a vanilla shield mod in space engineers one day. Preferably the one you made!Lore-wise I think in a game that has FTL (Jump Drive) we should have shields as well. Shields should be more easier to invent compared to Jump Drives lol.

photo
1

I do not play without shields, it saves a lot of blocks AKA pcu used for defense and avoid the excessive number of debris. So better shields = less physics calculations = less interference of CLANG.

photo
1

Anything that helps make mods is a good thing.

photo
2

I wish Modding API suggestions had it's own section as I feel this is too easily missed with normal ideas.

photo
1

I agree Kane, it really should be it's own section.

photo
photo
2

Do it Keen SWH.

photo
3

Yes Keen Make the shields great, it is your destiny.

photo
1

Actually I think shields should definitely be in the base game. They're really needed for balancing reasons. Without them it's just so damn easy to access everything and cause insane damages and grief with very little investment.

photo
1

yeah though I've found that with projectors nanite build and repair and the hacking block mods that re appropriating ships is insanely difficult.

photo
1

And to rip a piece off by bumping into something.

photo
photo
19

Hi guys, thank you for the feedback, we are already working on that.

photo
5

"Shane Stixrud shared this idea 2 months ago"


"already"


Well... maybe a different choice of words would be prudent.

photo
2

Awesome! :D

photo
2

That's awesome! Thanks for letting us know.

photo
2

Shane Stixrud shared this feedback 7 months ago, @Petr Minařík pls

photo
1

Any word on this? Also exposing IMyOreDetector to the ingame API would be nice :)

photo
1

Aaand possibly forgotten.

photo
photo
3

Glad to see a Keen response! Hope yall Deliver without taking 69 steps backwards!

photo
1

>-------- Оригинално писмо --------

>От: support@support.keenswh.com

>Относно: New Comment in "API additions needed for Shield Mods."

>До: Станислав Славов <stani83@abv.bg>

>Изпратено на: 02.11.2018 19:28

New Comment in "API additions needed for Shield Mods."

photo
4

Pushing this up with the simple comment: Is there "already" someone working on this?

photo
1

It seems to have been forgotten. Which is sad. Come on Keen, be better than FDerp (Frontier Developments).

photo
1

They are, because honestly it does not require a lot of effort ...They just don't have the manpower, so everything takes quite a lot of time.

photo
1

I think it's streamlining for the Xbox port - it required a lot of work hours to maintain code. But this API addition would be extremely helpful.

photo
photo
5

Hi guys,

sorry to inform you about the stopped work on these API additions. We cooperated with one external coder who is not working on the issue anymore. We hope we can get to this later, but for now, it is not finished.

photo
15

Please consider updating the https://github.com/KeenSoftwareHouse/SpaceEngineers repository with current Space Engineers source code.

It would allow us to contribute PRs for this feature and other fixes/improvements as well.

photo
photo
4

What's the point of this forum if this is the #1 most voted post, and its two years old. I dont think this is something particularly difficult for Keen is it? Whats stopping them from implementing this? Defense shields is an awesome mod that me and all of my friends use in all of our worlds. I'd much rather Keen put in a small amount of work so that the author of defense shields can work on things besides bug fixing since keen hasnt given him sufficient access. I love and support Keen, but I really dont understand why they havent implemented this yet.

photo
6

I agree with you! What's the point in asking the players to vote on issues when the devs still just do what they want? I get and understand its their game, but does that mean the voting is just for show?

I really hope this gets added or someone makes a plugin to workaround.

photo
1

why should KSH open your codes for mods

I think KSH reacts correctly, the game should always be the focus. the modders should live with what they get.

photo
4

well now i want a downvote option like reddit

photo
4

Keen,

I am updating this post with more details on the API additions I requested.


-=MyCubeGridSystems ModAPI Needs=-


Expose the following MyCubeGridSystems objects/systems to modapi:

public Action<long, bool, string> GridPowerStateChanged;

public MyGridResourceDistributorSystem ResourceDistributor { get; private set; }

private Action<MyBlockGroup> m_terminalSystem_GroupAdded;

private Action<MyBlockGroup> m_terminalSystem_GroupRemoved;

Events for OnAddedToGroup and OnRemovedFromGroup

ConveyorSystem Push and Pull Access


-=MyProjectile / MyMissile=-

[OnAdd Event]:

An option to register an OnAdd event for both MyProjectiles and MyMissiles. This event would ideally return the following.

READ ACCESS:

Position, Direction, Velocity, damage/radius values, Owner, Parent entity.

WRITE ACCESS:

Trigger Destroy (Explodes/triggers hit visual/sounds) and Trigger Remove (no detonation, sound/visuals just removes).


[OnBeforeRemove Event]:

An option to register a OnBeforeRemove event for both MyProjectiles and MyMissiles. This event would ideally return the following.

READ ACCESS:

The same values as OnAdd, with the addition of returning the entity hit, if it did hit an entity.

WRITE ACCESS:

Let a mod prevent damage but allow the audio visual effect

Let the mod remove the projectile/missile without any audio visual effects/decals triggering or damage occurring.


[Register a shape to collect Projectile/Missile states in that shape]


Create a ModAPI interface that allows mods to register a shape (ellipsoid, sphere and obb). This shape would create a physicalless entity but with havok phantom e.g. MYIApiGateway.Physics.AddOrUpdatePhantom(Shape, Position, phantomId). The existing MyMissiles and MyProjectiles loop would then check for this Phantom in the same way you already check for safezones. If the projectile/missile detects a mod phantom it would fire the same/similar OnAdd event listed above every frame/tick it is touching or inside the phantom entity. Due to mod profiler overhead it may be better to fire 1 event per tick/frame per mod Phantom, returning a list of projectile events per phantom per frame.

photo
2

it is their game, but we are their community, and we pay for their product, and I also pay for DLC, and I refer friends to buy the game, and sometimes even buy it as a gift. Im suggesting they make this basic change that can help improve their game, which, if they want to prove to their player base that they care, thats one way to do it. Yeah, its their intellectual property, but it doesnt mean they should ignore suggestions from their community, especially if they provide means for suggestions to be made. Its like we are talking to a brick wall, we are ignored a lot, which sucks when youre an active forum member and stand up for their company.

photo
3

It's not about modders whining that they aren't getting acces to more features.

This is about keen letting the community vote on things they'd like to see in the game. What kind of message does it send ot the community if the top voted issue is 2 years old and still unresolved?


Now I can see how people may think that the devs just do whatever they want anyway and don't care about what we vote for anyway.

photo
photo
4

Keen,

I am updating this post with more details on the API additions I requested.


-=MyCubeGridSystems ModAPI Needs=-


Expose the following MyCubeGridSystems objects/systems to modapi:

public Action<long, bool, string> GridPowerStateChanged;

public MyGridResourceDistributorSystem ResourceDistributor { get; private set; }

private Action<MyBlockGroup> m_terminalSystem_GroupAdded;

private Action<MyBlockGroup> m_terminalSystem_GroupRemoved;

Events for OnAddedToGroup and OnRemovedFromGroup

ConveyorSystem Push and Pull Access


-=MyProjectile / MyMissile=-

[OnAdd Event]:

An option to register an OnAdd event for both MyProjectiles and MyMissiles. This event would ideally return the following.

READ ACCESS:

Position, Direction, Velocity, damage/radius values, Owner, Parent entity.

WRITE ACCESS:

Trigger Destroy (Explodes/triggers hit visual/sounds) and Trigger Remove (no detonation, sound/visuals just removes).


[OnBeforeRemove Event]:

An option to register a OnBeforeRemove event for both MyProjectiles and MyMissiles. This event would ideally return the following.

READ ACCESS:

The same values as OnAdd, with the addition of returning the entity hit, if it did hit an entity.

WRITE ACCESS:

Let a mod prevent damage but allow the audio visual effect

Let the mod remove the projectile/missile without any audio visual effects/decals triggering or damage occurring.


[Register a shape to collect Projectile/Missile states in that shape]


Create a ModAPI interface that allows mods to register a shape (ellipsoid, sphere and obb). This shape would create a physicalless entity but with havok phantom e.g. MYIApiGateway.Physics.AddOrUpdatePhantom(Shape, Position, phantomId). The existing MyMissiles and MyProjectiles loop would then check for this Phantom in the same way you already check for safezones. If the projectile/missile detects a mod phantom it would fire the same/similar OnAdd event listed above every frame/tick it is touching or inside the phantom entity. Due to mod profiler overhead it may be better to fire 1 event per tick/frame per mod Phantom, returning a list of projectile events per phantom per frame.

photo
2

I second the guy who mentioned updating the SE Source Code on GitHub, that'd definitely be a step in the right direction 👍Keen, if you're not going to implement the necessary additions, just let the modders fix it like they always do. #OpenSourceSE

photo
1

I have the feeling that SE will be opened again in the future.

But I guess it will be when it won't be developed by keen anymore.

photo
photo
1

I think Keen should just go ahead and add an upgradeable small and large grid shield emitter block to the base game already. Shields don't have to be that overpowered in my opinion, they are super handy for soaking up damage from relatively low velocity fender benders with asteroids and debris, and i like that shields increase the time to kill on a ship, prolonging battles some to give a small crew more time to enjoy the multiplayer experience of running around inside the ship repairing systems, adjusting settings on the fly, and restocking things.

photo
2

Absolutely not. There are quite a few issues with shields, most of them difficult if not impossible to solve.

First, you're proposing them as a solution to "relatively low velocity fender benders", which rarely if ever happen with a halfway decent pilot. The distances involved in SE, and the three-dimensional movement space, allow for easy avoidance of any collision. This is especially true because any well-designed ship should have cargo mass and minimum thruster acceleration factored into the design. Shields in this case simply promote lazy design.

Second, there are much better ways to increase TTK. Giving actual damage reduction to armor would do so much more effectively without breaking every single already-existing combat design, since armor is already a universal installation on ships. A weapon rebalance could also perform this function, has been necessary for years at this point, and would only become more difficult with the introduction of shields due to interactions.

Third, the balance against armor would be horrendous. If it increases TTK significantly, it would necessarily be a much more effective defense than armor. Which makes a ship with additional shields and more power a direct upgrade to one with more armor instead. Without additional complications to the shielding system, this becomes a direct race to power and shield limitations, which in turn transforms ship combat into a statistical resource game consisting of shield strength, power reserves, and weapon power. I believe that this would be even worse than the current state of ship combat.

Even with some sort of diminishing returns on shields, that simply promotes a balance point at which shields are less effective than armor, which in turn leads to "standard" shield packages for capital ships, with a specific loadout being most favored and anything beyond that ignored. Unless ship mass is factored into this diminishing return algorithm, which now is overly complicated and very difficult to balance effectively for ships of all classes on top of finding the "ideal" ratio of TTK on shields compared to armor.

Finally, if shields are less effective than armor, they're relegated to minor collision damage mitigation. Which, again, is unhealthy for ship design and not all that useful.

And, of course, shields break heavily with the SE technology rule, which is "plausible unless necessary for gameplay". Shields aren't necessary for gameplay, as shown by the current state of the game, therefore they should not be in SE.

photo
1

Got to disagree on some of this.

First - what I agree with. Shields shouldn't be the go-to for low velocity bumps. I agree, any good pilot should have the skills to avoid wrecking their ship in low velocity flight, and high velocity comes with risks that the pilot accepts.

Ship builders should still have to account for mass and thrust, angular speed, hardened surfaces etc. to ensure the pilot has the tools to avoid crashes.

However! I do believe shields have a place in the game. In a universe where artificial gravity exists (not necessary for gameplay) it's plausible that energy shields should exist too - energy shields are actually more plausible that A-gravity and jump drives, and a staple in sci-fi culture and games.

They should be powerful enough to make a capital ship battle tough - but not so powerful that a small fighter can survive such a battle solo. I believe the Darkstar defense shields mod has it quite well balanced - where shield strength is capped based on power output and ship mass, with massive power output being required for effective shield regen in battle. The mod pairs well with weapon core, which adds emp and energy weapons - where effectiveness of energy weapons against shields is 5x vs against armor.

Shields are expensive to build - requiring large amounts of platinum, making early game access virtually impossible.

I believe they have a place in the game, but the issue isn't shields / armor - it's the weapons.

With only kinetic weapons available in vanilla, with short ranges, the only form of combat available is close quarters, or using PMW's, which again are just kinetic. (I'm counting explosive as kinetic here). High power consumption energy weapons (weak against armor but strong vs shields) add a dynamic that allows shields to make sense, and allows for a variety of gameplay styles.

The player will be able to choose slow burn, distance combat vs CQ shred and run, they'll have to burn down shields before opening up gattling fire, and defending power systems becomes even more important than ever.

Armor tanking remains relevant for low power combat, with power put into offensive and speed first, while shield tanks take the risk of diminished offensive capacity.

Make shields expensive, and power-hungry, and energy weapons very power hungry, long range, and relatively weak vs armor and we'll have the balance that virtually every other space game has.

photo
2

Gravity generators and jump drives are both necessary gameplay components. Gravity generators haven't been quite as much of a necessity since planets' implementation, but they still are on the level of suit headlights in terms of convenience. Jump drives, on the other hand, became necessary because of planets and the distances between them. While shields have the same level of plausibility, there would need to be a prior update which necessitated shields for them to be comparable to these examples. And a combat update that then requires shields isn't a good combat update at all, because it requires an entirely new, completely unrealistic mechanic for it to be functional.

I looked at the Darkstar shield system. It's balanced, but makes no logical sense on why, exactly, you need to pack a ton of steel into various shapes for a stronger barrier. And considering that the implication of this cap is that shield HP is generally better than normal HP (which is true in almost all cases), we again run into the issue of people maxxing out shield HP for a given size of ship and then ignoring it in favor of additional armor to raise the cap.

Energy weapons are an extremely overused trope, and the "variety" is simplistic at best with few, if any, interesting interactions. At most, it forces everyone to pack a mix of weapons because any sane ship designer will add shield HP (again, direct upgrade to straight armor) until the cap. The related weapon core mostly just adds more fine control on weapon groupings and a basic targeting system. Which precludes an actually interesting interaction for the promise of an extremely common space combat experience. Even allowing some of the compatible weapons packs, it's more like a transplant of some other sci-fi game's mechanics instead of taking advantage of SE's different qualities.

The fact that energy is limited between shields and energy weapons just makes it worse. Instead of some other mechanic, we have the choice between attacking and defending! Which, again, hits the diminishing return like a Red Ship crashing into an asteroid. Once you can't add more HP with more power, it's much weaker and the rest of the energy automatically goes to the weapons. Basic decisions, instead of something that actually matters. I would also note that range is everything without a heavy limitation. Why bother with gatlings and CQC at all when the speed limit is 100 m/s? Why even bother with armor except to allow more shields?

TL;DR: Shields aren't remotely as necessary as the other unrealistic blocks, and never will be. The interactions that they introduce would be very all-or-nothing, resulting in very set balance points and a decrease in design variety. Also, it weakens the unique feel of SE by unnecessarily breaking the hard sci-fi theme.

photo
photo
1

Another use for this could be for the new water mod to make projectiles less effective underwater, so its not necessarily limited to shield mods.