Page 1 of 1

[Mod] growing cactus [0.0.5] [growing_cactus]

PostPosted: Thu Sep 06, 2012 23:18
by sapier
A mod growing cacti

License: Do whatever you want! (WTFPL, applies to all parts)

Dependencies: default

It's just finished so expect bugs

Notes:
-Cacti growth can be specified per config file
-if you remove begining of branch or trunk (the round things) that trunk/branch wont grow anymore

Recipe (growing_cactus sapling):
cactus
cactus

Config file settings:
growing_cactus_max_size (maximum size a cactus can grow, default 15)
growing_cactus_slowdown_size (slowing down cactus growth as of this size, default 8)
growing_cactus_spawn_additional_only (set to true if you don't want original cacti to be removed)

Image

Version 0.0.5
Version 0.0.4
Version 0.0.3
Version 0.0.2
Version 0.0.1

Changelog:

0.0.5
-fixed bug in additional spawn algorithm cacti only spawned on diagonal line
-added new "replace original spawner"
-made replace original spawner default spawn algorithm (can be disabled per setting)

0.0.4
-fixed typo crashing as soon as spawning cactus

0.0.3
-fixed branch trunk node
-fixed branch flickering
-limited size to 15 by default
-add settable slowdown and upper limit

0.0.2
-code cleanup
-reduce cpu usage by removing lots of checks not required for cacti
-removed "leaves" on branch start
-fixed wrong branch type directly after being added
-fixed bug cactus branches growing bigger than trunk
-reduced growth speed
-drasticaly reduce growth speed once trunk size has reached 8 and speed is decreasing even more as trunk grows
-make branches grow next to trunk too (with very little chance)
-grow on desert_sand as well as sand

0.0.1:
-initial version

PostPosted: Fri Sep 07, 2012 01:22
by Neuromancer
This is awesome! Only can you make the cactus saplings be place-able on desert_sand? I can place them only on regular sand, but I think that is wrong. They should only grow on desert_sand.

PostPosted: Fri Sep 07, 2012 01:49
by GloopMaster
*sees Minetest-c55 0.4.2-rc1 on the top of the screenshot*

Update dat thing, man! :D

PostPosted: Fri Sep 07, 2012 02:00
by Neuromancer
here's my textures.
Click to Enlarge.

Image

Also, sometimes I see leaves when it's starting a new branch sometimes, was that intentional?

PostPosted: Fri Sep 07, 2012 05:29
by sfan5
Wow!
Nice

PostPosted: Fri Sep 07, 2012 08:32
by sapier
Desert_sand ... ok true would be better I'll change.

Leaves are intentionaly, but i already thought of a viable method avoiding them while reducing cpu usage too.

PostPosted: Fri Sep 07, 2012 22:19
by sapier
ok there was a bug in last version, vertical branches grew up do trunk lenght wich wasn't intended ... do you like it this way or fixed?

PostPosted: Fri Sep 07, 2012 23:38
by Neuromancer
sapier wrote:ok there was a bug in last version, vertical branches grew up do trunk lenght wich wasn't intended ... do you like it this way or fixed?

I looked at pictures of real cactii. The branches were lower than the trunk. So I would like it better fixed. Also can you put a firm limit on how high they grow?

PostPosted: Sat Sep 08, 2012 16:59
by Neuromancer
Can you make it so whenever a player comes in range of a standard minetest cactus, it gets replaced by one of your incredible growing cactii?

These are soooooooooooo much better!

PostPosted: Sat Sep 08, 2012 17:57
by sapier
I'm not quite sure if everyone would be happy with this, probably adding this feature to be enabled in config is an option?

PostPosted: Sat Sep 08, 2012 18:17
by VanessaE
+1 regarding limiting the height of the cacti - maybe to a max of 15m, and making it very rare for them to get that tall. At any rate, they should not grow uncontrollably.

+1 on making them replace the default cacti. You'd probably need to hook into the map generator though, so that the user never sees the original cacti.

Also, I love the rounded tops :-)

Recommend: Add a third type of cactus node to be used on the short horizontal parts of the branches. A little detail so the stripes turn the right direction for those parts.

Like this:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   T
 T C 
 C C 
 CHC T
   C C
   CHC
   C
   C


(C = regular cactus node, T = rounded top, H = cactus node turned horizontally, like a horizontal tree)

PostPosted: Sat Sep 08, 2012 18:51
by sapier
Vanessa its already more detailed than your suggestion
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all


      TR
BR    MT
BT    MT
BT    MT    BR
BT    MT    BT
BT    MT    BT
BR BH MT BH BR
      MT
      MT
      MT
      MT
      MT

TR Trunk round
BR Branch round
BT Branch trunk
BR Branch root (4 variants)
BH Branch horizontal (2 variants)
MT main trunk

EDIT1: I think I just didn't get the textures right for the horizontal ones

PostPosted: Sat Sep 08, 2012 20:14
by Spots
top notch i'm loving the new mod

PostPosted: Sat Sep 08, 2012 21:48
by VanessaE
Oh ok. I couldn't tell from the screenshot (I'm waiting for limited growth before I install it).

PostPosted: Sat Sep 08, 2012 22:35
by sapier
Limited growth ... Yes growth ain't limited hard style true. But as soon as cactus reaches size of 8 chances it will grow is lowered to:

1/(treesize * 10) per minute

I'm not sure but I think this is quite limited. If it's still not limited enough probably changeing it to 1/(2^treesize) might be another option.

I like the idea of creating methusalem cacti by time ;-)

PostPosted: Sat Sep 08, 2012 22:59
by Neuromancer
sapier wrote:I like the idea of creating methusalem cacti by time ;-)

The idea of ginormous cactii is always better than the reality. This is much better than the endless forests 300M tall trees you would soon get with the nature_pack mod, but in a sense they are more of ticking timebombs. The longer you play in a world, eventually you will get a whole bunch of crazy tall cactii that are too much of a hassle to get rid of. Plus you are burning cpu cycles to do this.

PostPosted: Sat Sep 08, 2012 23:19
by sapier
OK you're right some limit is needed.
I still want chances for big cacti I'll limit size to 15. And additionaly replacing all growing cactus nodes as soon as trunk reaches 15 to stop consumption of cpu power for grown up cacti. While freezing cactus shape in current state ... otherwise all branches would grow up to trunk size which doesn't look natural either.

EDIT1: forget about replacing ... the idea isn't as good as I thought I'll think about another solution

PostPosted: Sun Sep 09, 2012 00:32
by sapier
I've made maximum size as well as slowdown size configurable so everyone can set values she/he likes.
Defaults are 15 for maximum size and 8 for slowdown.

Branch growth now randomly stopps as soon as main trunk has reached maximum size. If a branch is removed a new one may grow.

PostPosted: Sun Sep 09, 2012 01:55
by Neuromancer
sapier wrote:OK you're right some limit is needed.
I still want chances for big cacti I'll limit size to 15. And additionaly replacing all growing cactus nodes as soon as trunk reaches 15 to stop consumption of cpu power for grown up cacti. While freezing cactus shape in current state ... otherwise all branches would grow up to trunk size which doesn't look natural either.

EDIT1: forget about replacing ... the idea isn't as good as I thought I'll think about another solution

Ironically I just got done watching The Lorax, and the chorus of the main song is "Let it Grow! Let it Grow!" I feel like some sort of villain for suggesting this to you, but I still really like that you made the max size configurable. There's a limit to growth in nature. Another thing you could add is there is a random chance for cactii dying and decaying, that might counteract the ginormous cactii, but the configurable limits are awesome, please keep 'em in.

PostPosted: Sun Sep 09, 2012 02:02
by Neuromancer
VanessaE wrote:+1 on making them replace the default cacti. You'd probably need to hook into the map generator though, so that the user never sees the original cacti.

Hooking into the map generator would be the best if possible, but if not it is well worth it to replace the default cactii by some other method. Maybe the approach Tonyka took to replace square trees, or just an abm that looks for a standard cactus node and replaces it with a growing cactus. If it's too hard to find and replace specific cactii, just remove what you found in an area and based on a count, randomly place growing cactii.

PostPosted: Sun Sep 09, 2012 02:04
by VanessaE
22:02:59: ERROR[EmergeThread]: ERROR: An unhandled exception occurred: LuaError: error: .../.minetest/mods/minetest/growing_cactus/spawning.lua:88: attempt to call global 'growing_cactuss_debug' (a nil value)

(followed by a rather unflattering crash)

Easily fixed by correcting a typo on that line (should be one 's' in the function name, not two)

PostPosted: Sun Sep 09, 2012 02:16
by sapier
@VanessaE fixed it's been one s too much in function name true.
EDIT1:
by the way congratulations you must have been the first one to get a cactus spawned in wild nature ;-)

@Neuromancer I thought about dieing too but it's a little bit more to do. I'll consider it for following versions.

If replacing cactus is done it has to be done in on_generate function, hoping cactus is already there. ABM's can't be used as risk to accidentaly remove player spawned nodes is to high.

I'll think about a method to do this first thought is that this will be a heavy operation I most likely won't enable by default but only per setting.

PostPosted: Sun Sep 09, 2012 02:29
by Neuromancer
VanessaE wrote:(followed by a rather unflattering crash)

God knows I've created my share of unflattering crashes over the years. How about a blue screen of death on your main database server on a Sunday when you are upgrading the OS and the db version without being able to afford a test environment. Thank my lucky stars it just needed a BIOS flash.

PostPosted: Sun Sep 09, 2012 03:13
by VanessaE
Oh this crash was beautiful - first the actual error, then it spewed a bunch of stuff from Irrlicht regarding meshes, ending with "Aborted (core dumped)", but I didn't care since the real error was evident. :-)

PostPosted: Sun Sep 09, 2012 12:58
by Neuromancer
All I have to say sapier is that this mod is incredible. I love it! I hope you take many of the things here and continue to add them to the growing trees mod. (customizable limited growth, replacing standard trees, and maybe better rounder shapes for the tree branches, and dark brown bark on the undersides of the branches instead of exposed wood (you can see what I'm talking about better if you use misa's or other texture packs).)

I think you have added spawning already.

PostPosted: Sat Jan 05, 2013 00:43
by sapier
bump ... is anyone using this mod?

PostPosted: Sat Jan 05, 2013 02:07
by Inocudom
I suppose you could try to use the L-System's tree generator in this mod to generate cacti if you think that doing so would be beneficial. I heard that there is a way to make cacti that way, but you should ask RealBadAngel how it can be done.

PostPosted: Sun Jan 06, 2013 01:17
by sapier
@Inocudom

no you can't (edit1: use l-system) this are "growing" cactus ... they are called that was because they really grow :-). L-System trees are generated once and don't change later.

PostPosted: Fri May 24, 2013 07:22
by Mossmanikin
sapier wrote:bump ... is anyone using this mod?


Use it almost all the time.
While I like the cubic ones too once in a while, I love yours!

PostPosted: Sat Jan 25, 2014 19:31
by Sokomine
sapier1 wrote:no you can't (edit1: use l-system) this are "growing" cactus ... they are called that was because they really grow :-). L-System trees are generated once and don't change later.

I stumbled about this mod while cleaning up my mod folders, and I'd love to see them as L-system models. Not all cacti ought to be like this - just some of them once in a while. And they don't have to really grow. It's better if they pop up like other tree-like plants from saplings. Could be a diffrent breed.