[Mod]Smoke [WIP]

User avatar
FreeGamers
Member
Posts: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod]Smoke [WIP]

by FreeGamers » Post

Exactly. I use the nether and magma_conduits mods in my game which tends to spawn more lava than is typical in default minetest_game I would imagine. That is likely a part of this. I would love to add it back in the game once this is worked out. It does indeed add a fun natural hazard to the game.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

FaceDeer
Member
Posts: 491
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod]Smoke [WIP]

by FaceDeer » Post

Oh, Astrobe, I don't have a Gitlab account so I figured I'd drop a quick typo correction here and also show something I just tried out locally and think looks nice.

The node definition for smoke:block has the property "amage_per_second = SMOKE_DPS", missing the "d".

And I tried replacing the glasslike drawtype for the smoke block with this:

Code: Select all

	drawtype = "nodebox",
	node_box = {
        type = "fixed",
        fixed = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, {-0.625, -0.25, -0.625, 0.625, 0.25, 0.625}},
    },
And got what I believe the technical term for is "hamburger clouds":
+ Spoiler
It adds rather a lot of "puffiness" to the smoke, IMO, with very little cost. If you wanted to get fancier you could make the hamburger clouds asymmetrical and then randomize the param2 every time a smoke node moves, that'd make the smoke look even more organic. This might not work with transparent textures but seems okay with the opaque one currently in use.

Astrobe
Member
Posts: 328
Joined: Sun Apr 01, 2018 10:46

Re: [Mod]Smoke [WIP]

by Astrobe » Post

Thanks FaceDeer for the report (*) and for the great suggestion.

I went further and implemented the rotation and asymmetrical idea (by "lifting" up the center ring of your model), but it seems less good to me. Applying a random rotation on your model works great already.

I am play-testing it a bit more, it should be pushed on the repo this weekend.

(*) Sorry if you wasted time figuring it out.

FaceDeer
Member
Posts: 491
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod]Smoke [WIP]

by FaceDeer » Post

I actually just noticed the missing "d" in passing while I was putting that nodebox in there, I was playing around with this on a local server without damage enabled. :)

What I was thinking with the asymmetrical nodebox was to have the center ring bulge out a bit farther on the +X and +Z axis (but not -X and -Z) and then rotate it randomly around the Y axis each time. That way a column of smoke would look less like a big ladder, it'd be sort of "wiggly".

I've done a similar rotate-randomly-around-the-Y-axis trick to make the stalactites and stalagmites in DFCaverns appear less regular, the nodebox is a bit displaced away from the center point so rotating it makes it look a little bit displaced from center in a random direction.

Edit: Oh! Another idea for an enhancement just came to mind. The ABM currently doesn't care what the value of the "smokey" group is on a node, it's just a binary has-it/doesn't-have-it indicator. How about making the ABM check the value of the smokey group and then randomize the odds of generating smoke each time as a 1/groupvalue chance? That way a thing that's supposed to smoke a lot would be "smokey = 1", but a thing that's supposed to only emit a puff every once in a while could be "smokey = 4" or something. That way maybe smokey can be added back to nodes that are very common, such as lava in some mapgens, without flooding the place with smoke and lagging the server.

Astrobe
Member
Posts: 328
Joined: Sun Apr 01, 2018 10:46

Re: [Mod]Smoke [WIP]

by Astrobe » Post

Yet another excellent suggestion!

New version 0.5 has landed in the repo (cf. first post):
  • new smoke node model, based on FaceDeer's, with both parts assymetric
  • the model randomly rotates when it moves
  • on the application part, the new function smoke.add_source let the user set the smoke regeneration rate by node type
  • moved the update jitters from creation time to move time. It seems to me that nodes tend to "sync" when leaving/coming back to the area. This makes sure they are "desync'ed"
As those changes are a bit experimental, they only apply to smoke, not fog, for now.

Astrobe
Member
Posts: 328
Joined: Sun Apr 01, 2018 10:46

Re: [Mod]Smoke [WIP]

by Astrobe » Post


Astrobe
Member
Posts: 328
Joined: Sun Apr 01, 2018 10:46

Re: [Mod]Smoke [WIP]

by Astrobe » Post

Following the discussion here and on Reddit, I have removed the altitude effect on smoke persistence. This means that smoke will not persist longer in caves, mainly. Version 0.6 is available in the repo.

I figured out that this feature was not entirely solving the problem it was intended to solve and created problems elsewhere. Rather than going for more complicated calculations, I chose to remove the effect entirely, also making the process a tiny little bit faster.

I also decreased one notch the default Persist value to help with the original issue, which is that smoke nodes could appear "dead" if they live the "player activation bubble" (the space around each player where ABMs and timers are active). They are not actually dead, they'll start to move again when a player gets close enough.

In my game this is more of a problem because players are very mobile, including vertically (one can "jump" on the top of a tree quite easily). It is probably less of an issue in games with normal mobility.

Decreasing the Persist parameter to a value so that the average height of a smoke column (see my earlier post about probabilities) is around half the value of the active block range (a game setting) should make the issue less likely to happen. The new model helps a bit too, because distant smoke looks a bit less like stone now.

FaceDeer
Member
Posts: 491
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod]Smoke [WIP]

by FaceDeer » Post

Nice. Lava caverns are still very smokey, but they don't just instantly fill with smoke in a solid block any more - you can still see through them, to some extent.

Astrobe
Member
Posts: 328
Joined: Sun Apr 01, 2018 10:46

Re: [Mod]Smoke [WIP]

by Astrobe » Post

I came up with a new shape for the smoke nodes. I think I 've been using it for months, I am finally pushing it today. The original shape has been commented out, test and switch back easily if you don't like it.

There are also to minor changes:
- the "persist" value has been slightly decreased,
- lava sources generate smoke instead of flowing lava.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests