Replies: 8 comments 28 replies
-
Your API is at least 10x as complicated as |
Beta Was this translation helpful? Give feedback.
-
Let's just go ahead and close this down. This is a hard pass, thanks. |
Beta Was this translation helpful? Give feedback.
-
Implementing an interface that describes a behavior they want anyway wouldn't add any steps and would make it more convenient because IDEs would suggest/generate methods. The linked example doesn't default interface methods where it should maybe, so that's something that could be addressed. A mod dev would be able to query adjacent networks (same as with The only overhead they wouldn't usually do is having to implement FluxType and registering it with Forge which is 10 lines of code or so...
In fact, most of the proposed spec would add 5-10 dead simple lines of code to existing code bases which is why I don't get y'alls "it would complicate things" argument. A class could be provided for unit=int power types which would require only a constructor/method call.
Mods like Tesla and Create don't work with that, so
The conversion interfaces mean that if you're writing a mod that only adds machines (not a power API) need to handle only a select type of energy source and the modpack author or user gets to add convert-ee-to-rf.jar if they want all RF machines to work with EE (balancing always ends up on end-users, not mod authors). The only issue is implicit conversion which isn't a thing and that's why
They don't need to implement any of the transfer interfaces if they don't want interoperability, but those interfaces define a minimal set of functions they'll need to specify on their classes anyway if they want to achieve behavior that's described by those interfaces (except properties which is extra for allowing info like resistance to be shared with impl erasure).
As I've mentioned before,
I've said that conversion isn't implicit. It's far more likely that
It's marginally more work and provides benefits in terms of:
Thank you for reading through the discussion and for your input. |
Beta Was this translation helpful? Give feedback.
-
As a mod dev with their own power system that doesn't use FE, I will be using IEnergyStorage for cross-mod compat and not this |
Beta Was this translation helpful? Give feedback.
-
Not true, I can easily make a power system where solar panels don't use FE at all and only the compat blocks or batteries use FE
Only at the interface between power APIs. You can still use doubles or whatever internally. |
Beta Was this translation helpful? Give feedback.
-
Okey so personal 2 cents:
Personally I'd like to say thanks for contributing to the discussion about improving the power api, but this is just not a good fit of a solution in my opinion for use in an API such as Forge. |
Beta Was this translation helpful? Give feedback.
-
@Caellian I’m going to be a bit frank. You wanting to make a new system that overhauls power api and starting a discussion on that is totally fine. That’s what discussions are for. However, it is also fine for discussions to not actually move to doing actions. Sometimes, the ideas proposed just flops or fails and that’s ok. Just means it is time to close the discussion. Reason I wanted to make that clear is because this discussion had 3 big modders who uses power apis all not liking this proposed power api. If the very target audience this power api was for all do not want to use it and will refuse to use it, then the api failed before it was even made. An api needs to be actually solving a real problem and be desirable to the modders themselves. Making an api and no one using it is a waste of time and effort and solved nothing. Again, it’s totally ok for ideas to fail. In this case, it’s extremely difficult to beat the current IEnergyStorage because of how flexible and useful it is for many modders and doesn’t cause too much issues. There’s probably a better power api that could be made but your proposed system isn’t it. Listen to the actual target audience of the very people that would be actually using power apis as they have the most experience of what works, what doesn’t, what pain points there are, and how it all works |
Beta Was this translation helpful? Give feedback.
-
I suggest It is clear that
I suggest the devs avoid dealing with APIs containing abstractions levels higher than a single isolated interface as it leads to some disadvantages, such as basically making every mod the same, and destroying all semblance of progression in a mod by connecting their gadgets to another mod's overpowered energy generator. |
Beta Was this translation helpful? Give feedback.
-
Hiya,
The idea I'd like to propose is separating out structure of a power API from the implementation details, which formalizes a very common behavior (~2/3rds of mods afaict) and allows different power APIs to talk to each other over a mod loader boundary while avoiding cycles in the dependency graph. It would requiring adding a set of interfaces to the mod loader which provide generic access to power systems. An isolated example of this is here.
So for instance, if we have BuildCraft, IndustrialCraft and Redstone Flux all using such interfaces, their power APIs don't need to depend on each-other to make their respective machinery work together. Each can define their own conversion rules which their machines use or prohibit conversion in case there's balancing issues.
There are mods which add converters, this isn't it. This is basically a foundation for power APIs which allows mods higher up the dependency graph to ignore all lower dependencies (relying only on a few common interfaces instead).
As mods that add "magic machines" also have their own power-like constructs (e.g. mana), this can also be used for those.
Adoption of such a rests on it being provided (expected) by a mod loader which is why this isn't a mod. It also makes no sense for it to slow down the loading process by registering a mod as it's just interfaces that do nothing and don't interact with the game. Bytecode trickery would be much more complicated than a mod loader just defining those things either way.
The result of a mod loader using such a system is:
The API I've linked also supports defining types/groups of energy (mechanical, electrical, magic, ...) and mandating conversion rules (e.g. explicitly stating that magic can't be converted into electricity). It'd be up to forge to define some common power groups.
The thing I've linked is not 100% fleshed out though I think it's very close to what I believe would be useful in mod dev scene - that's why I've made this a discussion instead of a PR. I'd be willing to help out in such efforts once a consensus has been reached.
Beta Was this translation helpful? Give feedback.
All reactions