-
Notifications
You must be signed in to change notification settings - Fork 41
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
Procedurally add planets to space dimension #138
Comments
By server fully started I mean all dimensions are loaded and the server is ready for players. |
Dimensions are added dynamically by mods, so you need to define equations to populate those planets coordinates and call it whenever a new dimension is found. |
Ah! genius. Would there be any issue in updating WarpDriveConfig.PLANETS while the server is running? |
I'll give you a code example tonight of what I'm trying to do :) If it is what you'd be happy doing I'll submit a pull request |
If this gets implemented, can the old way of adding planets by hand be kept --Supernova Industries Supreme Chairman Megavolt On Mon, Feb 29, 2016 at 5:52 PM, DraksterAU notifications@github.com
|
@supernovaco The config would remain as an override to the procedural generation. So if you define the location of a planet in config, it will not be dynamically added elsewhere. I'm mainly investigating this as I have 100 worlds (size limited) and this grows with the number of players. |
@supernovaco I'll also see if I can create a command for ops to use at the same time :) |
@LemADEC Would you be keen on that? The command idea that is. I'm just throwing ideas (and hopefully some decent pull requests) in the ring :P |
Gotcha! This whole idea of procedural adding of planets is great! --Supernova Industries Supreme Chairman Megavolt On Mon, Feb 29, 2016 at 8:00 PM, DraksterAU notifications@github.com
|
Remember to keep it in main thread. The PLANETS structure isn't multithread safe. |
any complaints if I register two events; OnDimensionLoad This event will randomly place a planet if it doesn't already exist in the PLANETS list. It assumes that the config is loaded before the dimensions are. OnDimensionUnload This event will remove a planet that is unloaded from the list. This logic will catch static planets too. |
Is there any way to determine if the dimension is 'cavelike' (i.e. like the --Supernova Industries Supreme Chairman Megavolt On Mon, Feb 29, 2016 at 9:34 PM, DraksterAU notifications@github.com
|
Why would we remove them on the OnDimensionUnload, that doesn't make sense to me? |
Will create a static exclude dimension Id list @supernovaco. @LemADEC if we don't remove worlds that are not loaded in PLANETS is going to get out of hand.... And increasing amounts of space within the space dimension will become unusable. Unless you can think of a reason why they should be kept? |
Unusable for new planets* |
actually if we generate two lists on startup that would be easiest. PLANETS _STATIC and PLANETS On dimension unload if the planet is in planets but not static planets, we will remove it. If not, we leave it there. Sound ok? The static list isn't actually used as anything more than a reference point for the unload and load functions. |
Can you take a look at https://github.com/StargateMC/WarpDrive/commit/06ac494a00fde6c8658f9ace52d5777d9e5ca889 This is very rough, but what I'm trying to achieve and I understand the planets will not be very well placed... Any tips? |
All worlds are unloaded by default. Furthermore, if you keep on removing and re-adding them, it'll be a mess for players as they'll keep on moving around. As for your exemple:
|
The idea behind the removing and adding is longer term they will be added based on a formula, which results in a planet with the same dimension id being added back to the same place. This way if we have a planet that is unloaded for some reason, its no longer in space (this happens a lot with Thermos servers using a bukkit world provider). For the "Duplicate" solution... how about an additional field which states whether or not a world is static? Then when dynamic worlds are loaded, we can set the same attribute to 'dynamic' and only load/unload these worlds. What do you think? |
World unloading is normal, in vanilla. Thermos and bukkit have nothing to do with it. |
@LemADEC If you are using a Thermos / bukkit server, multiworld ( and likewise plugins) will use the next available dimension id for new planets. You can literally create/destroy world 'saves' with commands.... which is why I'm keen on doing it this way. Every time a world is loaded it might have a new name etc. |
You're missing the point about plain Forge loading and unloading dimensions dynamically, and the requirement for those planets to always be defined in the mod configuration for WarpDrive to works properly. |
having worlds being added as planets (un/stable mystcraft worlds being accessible through space) would be really awesome. but what if personal worlds (galacticraft Space stations, Dimdoors personal pocket dimensions) aren't supposed to be added? A blacklist would be needed... something like "ive blacklisted "pocketdim*" so everything thats name fits "pocketdim*" is ignored"... |
Fantastic idea. It would likely need to include support for blacklisting any netherworld, underground or space station dimensions. |
Ps lemadec I will give this a go. I've been mia a long time. |
iirc there's a mod that requires you to access nethers "roof" so maybe you shouldn't assume nether to be blacklisted... but yes, nether would be a common candidate for the blacklist. just like the end or some private dims like random things' specte room maybe |
There's no reason for a warp drive ship to land on top of the bedrock roof, but yep, all configurable. |
I think we need 2 forms of blacklists. First one by plain old dimensionIds, second one by world generation class name. Try something simple for a start @Bysokar . |
It would be great for all loaded dimensions in game to be automatically assigned a random position in the space dimension and the config to be used as an override setting.
A new config for world size in space and min distance between planets would be required and that's it.
I've got code that should work, I just don't seem to be able to trigger a serverFullyStarted event... Can't find the equivalent of what I want in the forge events..... Maybe we can chat about this in this issue?
New to modding haha
The text was updated successfully, but these errors were encountered: