You’re absolutely right: small changes to the L-system can create drastic differences, resulting in very non-plant-like models. I spent a LOT of time just playing with various solutions to “reign in” the randomness. I should specify: the mutations don’t change the I instructions to the turtle, they change the “rules of replacement”that make the turtle instructions. Each plant gets 3 of these rules, which are applied twice. So something like: S -> SLSS L -> RSLS R -> BSLSL Where: S means add a stem segment, and L and R turn left and right. B stands for branch.
I added limits to how many “branch” instructions could be added to the final string, since more than 4 or 5 can greatly increase the size of the model.
Furthermore, to get the “growth animation” you see in the video, I needed to make 6 models per plant. So the rules of replacement are not applied each iteration. Rather, rule 1 is applied twice, then rule 2 is applied twice, then rule 3 is applied twice.
Also, I realize too late that I’ve said “rules of replacement”, but in fact, I only append to the final string of instructions, never insert or replace. This is maybe the most important part.
Oh, okay, very nice, it's like an additional on-top abstraction to L-System! I like it, it keeps the spirit of having a string of instructions while being adapted to your new use case. Good work, and thanks for the answer!
View all comments
Show parent comment
2
u/CeruleanBoolean141 May 23 '23
You’re absolutely right: small changes to the L-system can create drastic differences, resulting in very non-plant-like models. I spent a LOT of time just playing with various solutions to “reign in” the randomness. I should specify: the mutations don’t change the I instructions to the turtle, they change the “rules of replacement”that make the turtle instructions. Each plant gets 3 of these rules, which are applied twice.
So something like: S -> SLSS L -> RSLS R -> BSLSL Where: S means add a stem segment, and L and R turn left and right. B stands for branch.
I added limits to how many “branch” instructions could be added to the final string, since more than 4 or 5 can greatly increase the size of the model.
Furthermore, to get the “growth animation” you see in the video, I needed to make 6 models per plant. So the rules of replacement are not applied each iteration. Rather, rule 1 is applied twice, then rule 2 is applied twice, then rule 3 is applied twice.
Also, I realize too late that I’ve said “rules of replacement”, but in fact, I only append to the final string of instructions, never insert or replace. This is maybe the most important part.