[Mod] growing cactus [0.0.5] [growing_cactus]

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

[Mod] growing cactus [0.0.5] [growing_cactus]

by sapier » Thu Sep 06, 2012 23:18

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
Last edited by sapier on Sun Jan 27, 2013 09:26, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Fri Sep 07, 2012 01:22

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.
 

User avatar
GloopMaster
Member
 
Posts: 213
Joined: Wed Aug 01, 2012 18:03

by GloopMaster » Fri Sep 07, 2012 01:49

*sees Minetest-c55 0.4.2-rc1 on the top of the screenshot*

Update dat thing, man! :D
Meow.

That is all.
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Fri Sep 07, 2012 02:00

here's my textures.
Click to Enlarge.

Image

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

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Fri Sep 07, 2012 05:29

Wow!
Nice
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Fri Sep 07, 2012 08:32

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.
DON'T mention coding style!
(c) sapier all rights reserved
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Fri Sep 07, 2012 22:19

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?
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Fri Sep 07, 2012 23:38

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?
Last edited by Neuromancer on Fri Sep 07, 2012 23:43, edited 1 time in total.
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Sat Sep 08, 2012 16:59

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!
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sat Sep 08, 2012 17:57

I'm not quite sure if everyone would be happy with this, probably adding this feature to be enabled in config is an option?
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Sat Sep 08, 2012 18:17

+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)
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sat Sep 08, 2012 18:51

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
Last edited by sapier on Sat Sep 08, 2012 18:55, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

Spots
Member
 
Posts: 124
Joined: Tue Jul 24, 2012 12:12

by Spots » Sat Sep 08, 2012 20:14

top notch i'm loving the new mod
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Sat Sep 08, 2012 21:48

Oh ok. I couldn't tell from the screenshot (I'm waiting for limited growth before I install it).
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sat Sep 08, 2012 22:35

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 ;-)
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Sat Sep 08, 2012 22:59

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.
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sat Sep 08, 2012 23:19

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
Last edited by sapier on Sat Sep 08, 2012 23:30, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sun Sep 09, 2012 00:32

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.
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Sun Sep 09, 2012 01:55

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.
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Sun Sep 09, 2012 02:02

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.
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Sun Sep 09, 2012 02:04

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)
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sun Sep 09, 2012 02:16

@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.
Last edited by sapier on Sun Sep 09, 2012 02:31, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Sun Sep 09, 2012 02:29

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.
Last edited by Neuromancer on Sun Sep 09, 2012 02:30, edited 1 time in total.
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Sun Sep 09, 2012 03:13

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. :-)
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Sun Sep 09, 2012 12:58

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.
Last edited by Neuromancer on Sun Sep 09, 2012 13:04, edited 1 time in total.
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sat Jan 05, 2013 00:43

bump ... is anyone using this mod?
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sat Jan 05, 2013 02:07

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.
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sun Jan 06, 2013 01:17

@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.
Last edited by sapier on Sun Jan 06, 2013 01:18, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Mossmanikin
Member
 
Posts: 599
Joined: Sun May 19, 2013 16:26

by Mossmanikin » Fri May 24, 2013 07:22

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!

Noob 4 life!
My stuff
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Sat Jan 25, 2014 19:31

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.
A list of my mods can be found here.
 


Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 38 guests

cron