Page 1 of 2

[Mod]Flowerpot[flowerpot]

Posted: Thu Feb 02, 2017 23:01
by sofar
This minetest mod adds a simple, single-node (meaning, plant and pot are one node together) non-entity flowerpot that can contain `plantlike` and `normal` drawtype nodes.

The player can place these pots as normal nodes, and then right-click the pot with a plant or plantlike node, and the pot then will contain a slightly smaller version of the plant. If punched, the plant that was put in the pot will be returned to the puncher.

The concept works through the use of object materials. The empty flowerpot node has the same model, but part of the mesh is transparent and therefore not visible. If a plant is inserted, the transparent textures are replaced with the texture of the plant node, and thus it looks like the plant is inserted, while effectively the pot is a single node without metadata.

There are no crafting recipes for each variant. The player can craft pots and potentially use `/giveme` to give filled versions of the
flowerpot, but the creative inventory does not contain them as they are easily filled already.

The model was made in blender from scratch by the author.

The texture of the flowerpot itself was created from the flowerpot texture of the excellent Isabella II texture pack, which is Public
Domain. The texture has been reworked to allow for a more detailed texturing of the flowerpot model.

The flowerpot mod has an API that can be used by other mods to create new plant-flowerpot combinations. See api.md for usage information.

Recipe to craft a flower pot:

Image

Image

Download: https://github.com/minetest-mods/flower ... master.zip
Code: https://github.com/minetest-mods/flowerpot
License(s): LGPL-2.1+, CC-BY-SA-3.0, Public-Domain

Re: [MOD]Flowerpot[flower|pot|flowerpot]

Posted: Thu Feb 02, 2017 23:15
by octacian
Nice! Someone actually made a good flowerpot mod! Thanks sofar.

Re: [Mod]Flowerpot[flowerpot]

Posted: Thu Feb 02, 2017 23:32
by GreenXenith
ooooooh purty :3

Re: [Mod]Flowerpot[flowerpot]

Posted: Thu Feb 02, 2017 23:35
by sofar
I must say I hadn't seen DOOMed's version until just now. I knew about Pithy's version. However, I decided to make a simple one for 2 main reasons: style, and implementation. DOOMed's version uses many custom textures and models, and this implementation doesn't. I also find pithy's API unwieldly and overly complex (confusing even).

I also didn't see protection bits in place, and things like missing node sounds.

Please test :)

Re: [Mod]Flowerpot[flowerpot]

Posted: Fri Feb 03, 2017 00:19
by GreenXenith
I have tested.
1: Cracking animation "hovers" above the pot when breaking
2: The inventory image is a bit small
3: Maybe allow to plant cacti?
4: Papyrus in the pot is a bit big. Maybe a tad bit smaller?
5: White dandelions and violets stick out of the pot (similar to papyrus).
6: Grass also sticks out, and why even bother potting it?
Other than that, great :D
Any chance this being added to MT game? Or any flower pots for that matter?

Re: [Mod]Flowerpot[flowerpot]

Posted: Fri Feb 03, 2017 00:30
by D00Med
Lol, nice mod xD and good timing too.
Still, can't have too much of a good thing, and yours is a lot more efficient with texturing.

Re: [Mod]Flowerpot[flowerpot]

Posted: Fri Feb 03, 2017 05:19
by sofar
GreenDimond wrote:I have tested.
1: Cracking animation "hovers" above the pot when breaking
2: The inventory image is a bit small
3: Maybe allow to plant cacti?
4: Papyrus in the pot is a bit big. Maybe a tad bit smaller?
5: White dandelions and violets stick out of the pot (similar to papyrus).
6: Grass also sticks out, and why even bother potting it?
Other than that, great :D
Any chance this being added to MT game? Or any flower pots for that matter?
The simplicity of the code here is what causes some of these effects - they're mostly tradeoffs to assure that the smaller plants aren't too tiny, but still allow almost everything to be planted.

The pot itself is only 6 pixels width, yet we allow 16 pixel wide plants to go in there. I can't just shrink it to make it fit perfectly - something has to give somewhere.

Same for the tile cracking - that's something I can't prevent, the engine just does that on all node faces. It doesn't know anything about the model. Unfixable, and a minor visual problem anyway. I don't want to add mesh duplicates just for that.

Why potting grass? You mean, why not? I don't see a reason to prevent people's creativity, If they like it, they can use it.

Re: [Mod]Flowerpot[flowerpot]

Posted: Fri Feb 03, 2017 15:09
by Desour
Looks nice, I'll test.
Edit: I tested it, it's super!
But:
Image
sofar wrote:Unfixable, and a minor visual problem anyway. I don't want to add mesh duplicates just for that.
What about a nodebox?

Image
Well, stuff for creativity is nice, but these oversized plants are a bit meh. In real life you don't plant wheat into a flower pot.

Re: [Mod]Flowerpot[flowerpot]

Posted: Fri Feb 03, 2017 19:43
by sofar
DS-minetest wrote:What about a nodebox?
Same problem, besides, that wouldn't allow you to put plant textures on it, so you'd just have an empty pot.

Do you really care that much? I mean, you see it for what, 1 second?
DS-minetest wrote:But these oversized plants are a bit meh. In real life you don't plant wheat into a flower pot.
Don't like em? Don't use em.

Re: [Mod]Flowerpot[flowerpot]

Posted: Fri Feb 03, 2017 20:11
by D00Med
Could you use a mask to stop plants being oversized?

Re: [Mod]Flowerpot[flowerpot]

Posted: Sat Feb 04, 2017 05:15
by sofar
D00Med wrote:Could you use a mask to stop plants being oversized?
lol, so I can actually fix this in the model, and just have (pushed a new commit).

What I did was omit the bottom 2x2 pixels from each bottom corner from the UV map. It adds a few more triangles but isn't that expensive to do, and this doesn't mean any more weird tricks like texture modifiers, which are expensive.

Image

Even if you don't like wheat in a pot, this still looks reasonable, and it will make almost all plants fit good enough.

Re: [Mod]Flowerpot[flowerpot]

Posted: Sat Feb 04, 2017 08:59
by burli
good job. Well done. Now this flower pot can move to minetest game

Re: [Mod]Flowerpot[flowerpot]

Posted: Sat Feb 04, 2017 12:14
by Desour
sofar wrote:
DS-minetest wrote:What about a nodebox?
Same problem, besides, that wouldn't allow you to put plant textures on it, so you'd just have an empty pot.
I mean only for the empty pot a nodebox.

Re: [Mod]Flowerpot[flowerpot]

Posted: Sat Feb 04, 2017 18:44
by sofar
DS-minetest wrote:
sofar wrote:
DS-minetest wrote:What about a nodebox?
Same problem, besides, that wouldn't allow you to put plant textures on it, so you'd just have an empty pot.
I mean only for the empty pot a nodebox.
You can't UV map a nodebox, so it wouldn't look anywhere nearly as good as the current model, and it would force me to create 2 textures, not one, and it would look different when empty?

But why not just make a second model? That would solve ALL those problems!

Answer: that would be the least worst solution. But I just don't care enough about the digging cracks. sorry - I'm already doing a different mod:

viewtopic.php?f=9&t=16585

:)

Re: [Mod]Flowerpot[flowerpot]

Posted: Sun Feb 05, 2017 08:25
by paramat
Indeed the digging cracks are not a problem.
I don't find this fundamental enough to be in MTGame, it's more of a specialist decor mod thing.

Re: [Mod]Flowerpot[flowerpot]

Posted: Sun Feb 05, 2017 09:31
by TenPlus1
Since it's a flowerpot you could use the 'dig_immediate = 3' group to pick up the node without cracks appearing.

Re: [Mod]Flowerpot[flowerpot]

Posted: Sun Feb 05, 2017 09:50
by burli
TenPlus1 wrote:Since it's a flowerpot you could use the 'dig_immediate = 3' group to pick up the node without cracks appearing.
+1

I guess you don't need a pickaxe to dig a flowerpot ;-)

Re: [Mod]Flowerpot[flowerpot]

Posted: Sun Feb 05, 2017 22:35
by sofar
TenPlus1 wrote:Since it's a flowerpot you could use the 'dig_immediate = 3' group to pick up the node without cracks appearing.
I have indeed considered, and will likely do just that.

Aaaand I just did. Pushed.

Re: [Mod]Flowerpot[flowerpot]

Posted: Sun Feb 05, 2017 22:39
by sofar
paramat wrote:Indeed the digging cracks are not a problem.
I don't find this fundamental enough to be in MTGame, it's more of a specialist decor mod thing.
Well, considering that it contains an API that may be desirable to subgame and other mod makers, it's not just "a decor thing" anymore. Plus it's an alternate storage for certain plants :).

Re: [Mod]Flowerpot[flowerpot]

Posted: Fri Feb 10, 2017 22:50
by Wuzzy
Good:
- Dry shrub and bush stems looks great
- All 5 grass/dry grass sizes, with random size like for the actual plants
- Grass and dry grass and jungle grass look good
- API, plus it is ultra simple
- Nice-looking flower pot mesh
- Protection support
- Native support for many Minetest Game plants
- More or less sane selection boxes
- Code looks clean, no obvious beginner mistakes can be found

Bad:
- Mod does not actually register only a single node. Lies! >:-O Actually, it is one node for the empty pot and one additional node per plant, just like in [flowerpots]
- Ugly inventory icon
- Punching for retrieving flower, although it is breakable by hand
- Almost impossible to get flower in creative without breaking the flower pot
- No potted cactus :-(
- Flower pot can float / it does not drop when blow below is removed
- Flowers look too small
- Ugly flower pot color, does not look like clay bricks at all. It looks a bit too colorless
- Flowers appear darker in flower pot than on ground. Makes flowers sad. :-(

Overall, this mod is OK, but I think it needs some work on the graphical appearance. The darkness problem really bothers me.
I think both [flowerpot] and [flowerpots] are legitimate mods.

EDIT: Bug:
You can obtain the 5 different grass/dry grass sizes by getting the flower pot, but those are normally unobtainable in Minetest Game.

EDIT 2: I just noticed the darkness bug also applies to [flowerpots]. :-( Must be an engine bug, then.

Re: [Mod]Flowerpot[flowerpot]

Posted: Sat Feb 11, 2017 02:09
by sofar

Re: [Mod]Flowerpot[flowerpot]

Posted: Sat Feb 11, 2017 02:33
by sofar
Ok let's see if we can fix some of these (excellent) review issues found:

Bad:
- Mod does not actually register only a single node. Lies! >:-O Actually, it is one node for the empty pot and one additional node per plant, just like in [flowerpots]
Can't and Won't, because entity-based pots that avoid this issue are unreliable and prone to entity issues. Trust me on that one, using entities would really make them suck.

I do however not mark them visible for the creative inventory, of course.
- Ugly inventory icon
This one is harder, because the pot is only 6px. it would still be tiny. I'm not a fan of the current look either, so I'll look for a better inventory icon. For your subgame though, don't you just want to grab the texture from an MC-like texture pack? (yes you can't do that now since it has no inventory icon, and I'll fix that).
- Punching for retrieving flower, although it is breakable by hand
not sure what you want? you want the pot to be dug instead?
- Almost impossible to get flower in creative without breaking the flower pot
oh, I see, yeah, you just get both almost instantly. Hmmm, that is indeed something I should address.
- No potted cactus :-(
fixed and pushed.
- Flower pot can float / it does not drop when blow below is removed
Fixing, I'll also make it drop 2 items if there's a plant in it.
- Flowers look too small
Will look at this, sizing is important.
- Ugly flower pot color, does not look like clay bricks at all. It looks a bit too colorless
you're going to theme it anyway. Don't push your luck :P
- Flowers appear darker in flower pot than on ground. Makes flowers sad. :-(
engine issue causing all mesh nodes to be rendered darker.
Overall, this mod is OK, but I think it needs some work on the graphical appearance. The darkness problem really bothers me.
I think both [flowerpot] and [flowerpots] are legitimate mods.
Any specifics - please do tell (textures welcome, but if you're gonna skin it for mineclone 2, then please don't suggest mineclone 2 textures ... ;))
EDIT: Bug:
You can obtain the 5 different grass/dry grass sizes by getting the flower pot, but those are normally unobtainable in Minetest Game.
Not sure what you want. Do you want that grass randomly chooses a length in the pot? what about wheat / cotton?

Re: [Mod]Flowerpot[flowerpot]

Posted: Sat Feb 11, 2017 03:56
by sofar
- Mod does not actually register only a single node. Lies! >:-O Actually, it is one node for the empty pot and one additional node per plant, just like in [flowerpots]
Ohhh now I understand what you mean here.

"Single node" in this mod means "a pot with a plant is one node". I'm stating this because there is another mod that has a "pot" node that is 1m high and you can put another node on top of it.

It's not lying, it's just that I wasn't specific enough and you assumed too much :)

Re: [Mod]Flowerpot[flowerpot]

Posted: Sat Feb 11, 2017 04:05
by sofar
- Flowers look too small
Will look at this, sizing is important.
So, in reality, the pot is 15px high (or 15/16 in nodes) with the plant. That leaves 1px (at 16px) of space underneath another node. The MC pot is only barely larger, I mean, it's 6.25cm difference. I'm not so sure it's worth changing, but I'll try.

Re: [Mod]Flowerpot[flowerpot]

Posted: Sat Feb 11, 2017 04:07
by Wuzzy
About the bug:
Normally, when you dig grass in Minetest Game, you only get grass of ONE size (default:grass_5 if I recall correctly), the other grass sizes all drop the same. The other 4 grass sizes are unobtainable (not in game, not in Creative Mode), probably to avoid inventory clutter. Which is GOOD.

Now just dig some flower pots with different grasses inside and your inventory is quickly cluttered with different-sized grasses, item the player should never legally obtain, apparently. The fix is that they only drop default:grass_5.
what about wheat / cotton?
Sounds interesting, but how? You can not put these into pots because you can't obtain them, at least not in normal gameplay. You can only obtain these plants with /giveme, because they don't drop themselves.

Yay for cactus!

PS: If you place a wooden door into a flowerpot, the game crashes. xD