EarendelDevelopers / EarendelDevelopers/factorio-mods
[SE] Universe's resources API
- Dominant language
- No language data
- Stars
- 17
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I would like to discuss possible features of the universe's generation and resource placement on planets/moons to improve compatibility with other mods which add/modify resources :)
Currently the universe building and placement of resources is handled by SE with many hardcoded values during control stage, making it difficult for other mods to interact with it
_i.e. moving resources outside Nauvis, setting planets/moons to have a different primary resource different from the hardcoded one_
The goal would be to basically expose `Universe/Universe-raw` to other mods, with the possibility to Get/Add/Remove resources (any resource, new ones and even vanilla ones) globally, and tweak planets/moons' resources settings.
Now, I know this is a big feature that would require some refactor of the code, and I don't have a PR ready with the solution to be applied, but I've brainstormed a couple of possible solutions that we can work on together and help each other:
1. SE exposes remote interfaces in control stage for other mods to Get/Add/Remove resources and tweak planets/moons configs (targeting all `universe-raw.lua`, and mainly `universe.lua` L127-207. Has a bit of work on your part to implement the API, but then could be used internally both by SE and by any other mod independently without disrupting too much the flow of control, as the remote calls would be done before `on_init` when SE builds the universe
-or-
2. Have other mods expose their own remote interfaces (in a specific format) with the intended changes, and then handle them on your side. Would not require a big work on the API, but more logic to integrate the requests, especially if there are conflicting requests from different mods. In that case, SE would have the upper hand on how to manage the issues
These are jus 2 possible solutions, might not even be the better ones of course. The end goal is still to make resource handling a bit more dynamic rather than just hardcoded on SE's side :)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.