[Mod] Skygen v2 [skygen]

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

[Mod] Skygen v2 [skygen]

by the_raven_262 » Post

Skygen v2

(It generates skies)

Version 2?
A rewrite has been performed. This time, the code should be readable.
Among the most important changes are:
- Skygen now uses mod storage
- No crashes on unknown biomes
- The skyboxes have been moved into a separate git repository, and aren't required
- Many customizable variables have been extracted into a separate file

For more information the repository now has a proper readme, that should cover all the features and options.
Please report bugs or general misbehavior either here or make an issue on github.

Now, for the people who are here for the first time:

Whats SkyGen?
A mod that colors the sky (and changes a couple of other sky-related objects) according to which biome you're in. At least that is the main mode of operation.

Apart from that, skygen can also set a skybox and has a couple more player-specific options.
Mode selection (biome/skybox/inactive) is per-player and is memorized over server restarts.

There is also an "event" system, which tints the sky for a period of time (until one of the admins ends the event).
For the full list of features and for the info on how to make custom colorschemes and register skyboxes/events check out the readme on the git repo.
Some of the following contain custom nodes, as the mod is being tested on (and developed for) a custom subgame.
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image Image
Image
Image Repository Link
Download Link

If you need an example of a skybox, I have a repository here.
Last edited by the_raven_262 on Mon Dec 26, 2022 10:50, edited 2 times in total.

User avatar
Komodo
Member
Posts: 163
Joined: Tue Jan 11, 2022 13:33
GitHub: MeseCraft
In-game: Komodo
Location: God Bless America
Contact:

Re: [Mod] Skygen [skygen]

by Komodo » Post

That looks pretty cool!
🌎 Website | 🌲 MeseCraft Game | 📰 News | 🖌️ ContentDB

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: [Mod] Skygen [skygen]

by ronoaldo » Post

That is pretty cool!
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

User avatar
firefox
Member
Posts: 1709
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: [Mod] Skygen [skygen]

by firefox » Post

awesome!
will bookmark this for later, i'd like to have that in my game.
✨🏳️‍🌈♣️✨

User avatar
dewd
New member
Posts: 4
Joined: Fri Jul 30, 2021 10:21
GitHub: d3wdrxp
IRC: dew
In-game: dew
Contact:

Re: [Mod] Skygen [skygen]

by dewd » Post

Got this error:

Code: Select all

> 2022-05-20 05:32:11: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'skygen' in callback environment_Step(): ...worlds/world/worldmods/minetest-skygen/init.lua:62: attempt to index a nil value
> 2022-05-20 05:32:11: ERROR[Main]: stack traceback:
> 2022-05-20 05:32:11: ERROR[Main]: 	...worlds/world/worldmods/minetest-skygen/init.lua:62: in function 'set_sky'
> 2022-05-20 05:32:11: ERROR[Main]: 	...worlds/world/worldmods/minetest-skygen/init.lua:324: in function <...worlds/world/worldmods/minetest-skygen/init.lua:278>
> 2022-05-20 05:32:11: ERROR[Main]: 	...e/multicraft/bin/../builtin/game/register.lua:441: in function <...e/multicraft/bin/../builtin/game/register.lua:425>
> 2022-05-20 05:32:11: ERROR[Main]: stack traceback:

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen [skygen]

by the_raven_262 » Post

Skygen has been updated with additional functionalities:
- Skybox mode
- Mode selection
- Server events
- Settings saving

These do come at a cost of some performance, and as I did kind of just slam them over the original code (and attached them using some duct tape) they might break. They probably will, actually, um, ITS AN UNSTABLE RELEASE! There, now you can't say that I didn't warn you.

Apart from that, although the response to this mod was very positive (thanks!), I chose to first finish working on some other aspects of the game for the upcoming server (which Skygen is a part of). And that took a while, still ain't completely done in fact. There remain a couple of things that I need to add to Skygen before it is fully complete as well.

It still crashes when it encounters an unknown biome, and it is only MTG compatible for that reason.
(Though one can always add their own biome colors and avoid these crashes)

c56
Member
Posts: 318
Joined: Wed Apr 21, 2021 03:05
GitHub: tigercoding56
In-game: bm5 or bemo5 also sell_her_on55

Re: [Mod] Skygen [skygen]

by c56 » Post

does it work with space_travel ? (without messing with the skyboxes at space_travels planets )
this is a signature not a place to post messages also if i could change my username i would change it to sell_her_on55

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen [skygen]

by the_raven_262 » Post

c56 wrote:
Sat Aug 06, 2022 04:58
does it work with space_travel ? (without messing with the skyboxes at space_travels planets )
It doesn't work with space_travel, or with any other mod that sets its own skyboxes/skies. Currently, you can assume that any mod that has a different sky than vanilla isn't compatible with Skygen.

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen v2 [skygen]

by the_raven_262 » Post

Bumping this thread in order to inform you of Skygen getting a "v2", which is mostly just a code rewrite. More info is in the main post, and much more info is in the git readme. Have fun.

Niden
Member
Posts: 26
Joined: Wed Apr 29, 2020 23:37
GitHub: Niden1
In-game: Niden
Location: Pacific Ocean

Re: [Mod] Skygen v2 [skygen]

by Niden » Post

the_raven_262 wrote:
Fri Apr 08, 2022 17:34

Skygen v2

(It generates skies)

Version 2?
A rewrite has been performed. This time, the code should be readable.
Among the most important changes are:
- Skygen now uses mod storage
- No crashes on unknown biomes
- The skyboxes have been moved into a separate git repository, and aren't required
- Many customizable variables have been extracted into a separate file

For more information the repository now has a proper readme, that should cover all the features and options.
Please report bugs or general misbehavior either here or make an issue on github.

Now, for the people who are here for the first time:

Whats SkyGen?
A mod that colors the sky (and changes a couple of other sky-related objects) according to which biome you're in. At least that is the main mode of operation.

Apart from that, skygen can also set a skybox and has a couple more player-specific options.
Mode selection (biome/skybox/inactive) is per-player and is memorized over server restarts.

There is also an "event" system, which tints the sky for a period of time (until one of the admins ends the event).
For the full list of features and for the info on how to make custom colorschemes and register skyboxes/events check out the readme on the git repo.
Some of the following contain custom nodes, as the mod is being tested on (and developed for) a custom subgame.
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image Image
Image
Image Repository Link
Download Link

If you need an example of a skybox, I have a repository here.
i got error on use /skygen biome/off

Code: Select all

AsyncErr: Lua: Runtime error from mod 'skygen' in callback on_chat_message(): E:\Minetest 5.6.0\bin\..\mods\skygen/functions.lua:6: attempt to concatenate local 'name' (a userdata value)
stack traceback:
	E:\Minetest 5.6.0\bin\..\mods\skygen/functions.lua:6: in function 'write'
	E:\Minetest 5.6.0\bin\..\mods\skygen/chatcommands.lua:59: in function 'deactivate'
	E:\Minetest 5.6.0\bin\..\mods\skygen/chatcommands.lua:13: in function 'func'
	E:\Minetest 5.6.0\bin\..\builtin\game\chat.lua:79: in function <E:\Minetest 5.6.0\bin\..\builtin\game\chat.lua:52>
	E:\Minetest 5.6.0\bin\..\builtin\game\register.lua:429: in function <E:\Minetest 5.6.0\bin\..\builtin\game\register.lua:415>

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen v2 [skygen]

by the_raven_262 » Post

Thanks for reporting the issue! I have fixed the chatcommand and the updated version should now be live on ContentDB as well as on the repo.

Dead monkey 404
Member
Posts: 24
Joined: Tue Apr 13, 2021 11:05
In-game: Deadmonkey404

Re: [Mod] Skygen v2 [skygen]

by Dead monkey 404 » Post

Mod size on contentdb is large(52mb) whereas the original mod (excluding .git folder which is 51mb) is around 700kb. Why don't you exclude it.
Look through a black mirror, darkly... and see your sins unveiled.

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen v2 [skygen]

by the_raven_262 » Post

Dead monkey 404 wrote:
Sun Jan 29, 2023 14:18
Mod size on contentdb is large(52mb) whereas the original mod (excluding .git folder which is 51mb) is around 700kb. Why don't you exclude it.
I see. I didn't check the file size when I uploaded it, sorry. I'll reupload the file without a .git.

This is happening because the skyboxes which are now a separate repo still exist in the git history of this repo. At least thats what I think is the issue, if I knew git this wouldn't have happened in the first place.
But yeah, this is exactly what I was trying to prevent by moving the skyboxes into a new repo.

Dead monkey 404
Member
Posts: 24
Joined: Tue Apr 13, 2021 11:05
In-game: Deadmonkey404

Re: [Mod] Skygen v2 [skygen]

by Dead monkey 404 » Post

When I move from the biome with lichen to snowy taiga biome, sudden skybox changes with no proper transition. And the sun distance changes too(from close to far). These two biomes are closely located but have a huge difference in skyboxes.


___forgive my English...____
Look through a black mirror, darkly... and see your sins unveiled.

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen v2 [skygen]

by the_raven_262 » Post

I don't see anything in my code that could cause the transition not to happen, but the transition could happen very fast if some lag is involved. If you have discovered an error in my algorithm though, I can't find it solely using the info that you've provided. I will see if I can replicate the issue myself.
I am pretty sure that any such transition errors arise from lag though.

The taiga and tundra sky colors are quite different (dark cyan and purple) but the transition should still happen between those regardless. The sun size is calculated from heat and thus is really small in taiga. You can disable that using the "/skygen toggle_scaling" chat command.

Niden
Member
Posts: 26
Joined: Wed Apr 29, 2020 23:37
GitHub: Niden1
In-game: Niden
Location: Pacific Ocean

Re: [Mod] Skygen v2 [skygen]

by Niden » Post

the_raven_262 wrote:
Sun Jan 22, 2023 21:01
Thanks for reporting the issue! I have fixed the chatcommand and the updated version should now be live on ContentDB as well as on the repo.
What is the minimum version for this mod? I'm using it on 5.4.1 for my server and it doesn't work properly

Code: Select all

2023-02-02 16:18:06: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'skygen' in callback on_joinplayer(): /bin/../mods/skygen/init.lua:114: attempt to call method 'set_lighting' (a nil value)
2023-02-02 16:18:06: ERROR[Main]: stack traceback:
2023-02-02 16:18:06: ERROR[Main]: 	/bin/../mods/skygen/init.lua:114: in function 'set_shadows'
2023-02-02 16:18:06: ERROR[Main]: 	/bin/../mods/skygen/init.lua:68: in function '?'
2023-02-02 16:18:06: ERROR[Main]: 	/bin/../builtin/game/register.lua:422: in function </bin/../builtin/game/register.lua:406>

Niden
Member
Posts: 26
Joined: Wed Apr 29, 2020 23:37
GitHub: Niden1
In-game: Niden
Location: Pacific Ocean

Re: [Mod] Skygen v2 [skygen]

by Niden » Post

Niden wrote:
Thu Feb 02, 2023 16:22
the_raven_262 wrote:
Sun Jan 22, 2023 21:01
Thanks for reporting the issue! I have fixed the chatcommand and the updated version should now be live on ContentDB as well as on the repo.
What is the minimum version for this mod? I'm using it on 5.4.1 for my server and it doesn't work properly

Code: Select all

2023-02-02 16:18:06: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'skygen' in callback on_joinplayer(): /bin/../mods/skygen/init.lua:114: attempt to call method 'set_lighting' (a nil value)
2023-02-02 16:18:06: ERROR[Main]: stack traceback:
2023-02-02 16:18:06: ERROR[Main]: 	/bin/../mods/skygen/init.lua:114: in function 'set_shadows'
2023-02-02 16:18:06: ERROR[Main]: 	/bin/../mods/skygen/init.lua:68: in function '?'
2023-02-02 16:18:06: ERROR[Main]: 	/bin/../builtin/game/register.lua:422: in function </bin/../builtin/game/register.lua:406>
I try to run the commands but I don't get a response. There is also another problem, the skygen only works the first time I login with the mod on but after that it only shows me the default minetest sky and I cannot activate it with the /skygen biome command since none of the mod commands work

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen v2 [skygen]

by the_raven_262 » Post

The dynamic shadows require 5.5.0 I think. This is what is causing the first issue. I didn't know that this would crash the game.
I'll see if I can implement a version check that would disable the dynamic shadows feature if the minetest version is too low.

Though before I commit to that, I have to ask if there is any reason to run a server on an older minetest version? There might be more issues that I'm unaware of that are caused by running Skygen on older versions that I would have to look for then as well.

The second one sounds like Skygen isn't loading at all. I have no idea what could be causing that and still letting you into the game. But since you've got no logs I can only guess, sorry.

Niden
Member
Posts: 26
Joined: Wed Apr 29, 2020 23:37
GitHub: Niden1
In-game: Niden
Location: Pacific Ocean

Re: [Mod] Skygen v2 [skygen]

by Niden » Post

the_raven_262 wrote:
Thu Feb 02, 2023 21:00
The dynamic shadows require 5.5.0 I think. This is what is causing the first issue. I didn't know that this would crash the game.
I'll see if I can implement a version check that would disable the dynamic shadows feature if the minetest version is too low.

Though before I commit to that, I have to ask if there is any reason to run a server on an older minetest version? There might be more issues that I'm unaware of that are caused by running Skygen on older versions that I would have to look for then as well.

The second one sounds like Skygen isn't loading at all. I have no idea what could be causing that and still letting you into the game. But since you've got no logs I can only guess, sorry.
Hello

I set the shadow function as a comment and it works.

I use Minetest 5.4.1 because I am using some old mods that are not compatible with Minetest 5.6.1. by the way, the mod works now, but I still can't run the commands like /skygen biome/off

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen v2 [skygen]

by the_raven_262 » Post

It seems that functions that I'm using in Skygen for setting the sky and sky objects have been updated in the versions after yours. I'm not going to add support for the older functions as I don't see that as a priority right now, sorry.

The changes would have to be made to every function which sets the sky parameters, and a check would have to be added to select the right function to call depending on the minetest version every time any sky changes are being made.

User avatar
j0j0n4th4n
Member
Posts: 258
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Skygen v2 [skygen]

by j0j0n4th4n » Post

It appears to have conflicts with mods that change the sun and moon like astral or mods that change the skybox at certain heights like Other Worlds. Would it be possible to make both compatible with one another?
cdb_894a100ddd76

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen v2 [skygen]

by the_raven_262 » Post

j0j0n4th4n wrote:
Mon Jan 29, 2024 20:24
It appears to have conflicts with mods that change the sun and moon like astral or mods that change the skybox at certain heights like Other Worlds. Would it be possible to make both compatible with one another?
If you have a mod that does anything concerning the sky, skygen probably won't work with it. This is because skygen has no compatibility implemented with any other mods.

The first case, astral, would require quite a bit of rewriting. Skygen would have to read Astral's values for sun/moon textures and the sizing. As for the events, having two event systems going on would be at least confusing. At that point, I'd rather remake the whole thing in skygen as a feature (thanks for the idea!).

For the Other Worlds, skygen should be deactivated at a certain height when that mod is active, which seems simple but requires adding a new system which tracks such cases. I'll add this to my to-do list as I think it will add some needed compatibility to skygen, but I won't be working on skygen in the near future due to other projects.

TL;DR: First case pretty much requires a rewrite of the mod in skygen, second case requires adding a new feature which is out of the primary scope for skygen (mod compatibility for skygen is not the focus right now).

User avatar
j0j0n4th4n
Member
Posts: 258
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Skygen v2 [skygen]

by j0j0n4th4n » Post

TL;DR: First case pretty much requires a rewrite of the mod in skygen, second case requires adding a new feature which is out of the primary scope for skygen (mod compatibility for skygen is not the focus right now).
Ngl, I didn't expect it would be so intricate and intertwined. I had thought the skybox, sun, moon and horizon fog color were all independent from each other, isn't that the case?
cdb_894a100ddd76

User avatar
the_raven_262
Member
Posts: 344
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Skygen v2 [skygen]

by the_raven_262 » Post

j0j0n4th4n wrote:
Sat Feb 03, 2024 23:58
TL;DR: First case pretty much requires a rewrite of the mod in skygen, second case requires adding a new feature which is out of the primary scope for skygen (mod compatibility for skygen is not the focus right now).
Ngl, I didn't expect it would be so intricate and intertwined. I had thought the skybox, sun, moon and horizon fog color were all independent from each other, isn't that the case?
The methods for setting the skybox (and sky color + fog) and sun/moon are all separate. It is just the matter of letting skygen know when not to control them (and what to default to when it deactivates etc.) that makes the problem complex.

QBSteve
Member
Posts: 23
Joined: Wed Mar 15, 2023 00:00
In-game: QBSteve

Re: [Mod] Skygen v2 [skygen]

by QBSteve » Post

How would I get this to work with Mineclone 2? Could I just copy the values in colors.lua and add Mineclone 2 biomes? How hard would it be?
Note: It seems like Mineclone's skybox is fighting Skygen's skybox
Hello! I'm just some random person with an ancient 7 year old potato that is my laptop :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest