Ryan W. Anderson
Quick question: in version 3 of Voxel Farm, will I be able to access the L-System code in Unreal any way? I'd like to be able to develop prefabs in Voxel Studio for testing, and then be able to run that code run-time to generate, say, buildings or trees dynamically.
It doesn't matter to me if I have to package these somehow in Voxel Studio or if I can interpret the L-System code directly in my application.
0 0
voxelfarmtorres
Yes, you can use the LSystem evaluation in your UE4 application or game. There is no example of this for UE4, but this is shown in another example. This is available already in Voxel Farm 2. With the INDIE and PRO licenses, you would still need Voxel Studio to compile the grammars. Your application can the load the compiled files and run them.
0 0
Ryan W. Anderson
Excellent that's exactly what I needed. Thank you for your prompt reply.
0 0
dkloving
Wait, this is surprising news to me... I thought that the L-system grammar was interpreted, not compiled. I messed around with them in VoxelStudio a while ago, and was impressed enough that ever since then I've been conceiving of an app that would present the users with a way to participate in generation via changes in L-system code. I've just been waiting on good UE4 integration and a little more free time to devote to the project... but do I now understand that this is not possible without a AAA license?
0 0
voxelfarmtorres
Here is how it works: the language is compiled into a grammar model, which is a set of objects. This set of objects is what you need to run the grammar later. What we call "compiled" code is just these objects saved to a file. The engine later, at runtime, can load the objects and execute them.

While the text to grammar object parser is only included in Voxel Studio (and AAA license), it is possible for the end application to modify a grammar model, or to build one from scratch. Actually if you were creating a way for users to participate, you may want to provide some sort of UI for this instead of having your users write code in a text editor. In this case your UI would be editing the grammar model directly, there is no need to include a text stage at all.
0 0
dkloving
Yes, I was planning on building a UI for the user rather than expose the text to them transparently. I've never built a parser, but I'm not adverse to building my own. Is there some documentation on the grammar model? I can't find any on the public areas of the website.
0 0
voxelfarmtorres
Please note you do not have to build a parser, unless you want your users to enter grammars in text code.

To build a grammar object model in runtime, you would be creating an instance of CGrammar:

https://s3-us-west-2.amazonaws.com/elasticbeanstalk-us-west-2-457155399432/sdkref/CodeDoc/html/class_voxel_farm_1_1_architecture_1_1_c_grammar.html

This object is a collection of CModule objects, each module is an instance of the CModule class:

https://s3-us-west-2.amazonaws.com/elasticbeanstalk-us-west-2-457155399432/sdkref/CodeDoc/html/class_voxel_farm_1_1_architecture_1_1_c_module.html

Then you can add CRule objects to each module. Each CRule is made of multiple CActions, which are the ones that change the scope, instance meshes and do all the work.

This blog post by Miguel uses this model instead of the compiled language:

http://procworld.blogspot.ca/2011/03/writing-architecture.html

It is five years old but still touches the topic of how to create grammars without building a parser. The constructs you see in the post still work in the current model.

If you are building an UI, then this UI would be hooked to calls to add new objects in this model. You would not be writing static model initialization code, but allowing your users to  create which objects they want.
0 0
dkloving
Okay, that's actually a lot more straightforward than I thought. I now remember reading that blog post a few years ago, although at the time I didn't digest much of it. Now that I think of it, this might actually allow freedom to radically reconsider the possibilities of the UI.

This API is accessible with the Indie license, correct?
0 0
voxelfarmtorres
Yes, this API is available in the INDIE license.
0 0