Search Unity

ARCHIMATIX PRO Node-based Parametric Modeling for Unity [Unity Awards Finalist]

Discussion in 'Assets and Asset Store' started by roryo, Jun 4, 2015.

  1. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    Apologies for the error in my guide there, it has been corrected. Writing documentation is not my strong suite, but this sort of guide is the number one thing people ask me about, so ill try to stay vigilant on updating it.

    I have also posted the beginning of the second guide which is Archimatix Runtime – AXParametricObject Overview. It also is not completed yet, but does give you a bit of important information on the AXParametricObject class and some of the more common fields to access.
     
  2. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    MathNodeSplash.png

    AXMathNode is here to help you with all your basic arithmetic needs. Designed to make handling complex and chained math operations easier to write and follow. This node will make it into the Archimatix Basic nodes pack, however there are a few others im wrapping up before i post a new update for that free packages. In the meantime you can find out more information and download this new node from the link above.

    As always hope you all are enjoying the nodes, and I Welcome any questions, comments or feedback.

    Cheers
     
  3. xj1982xj

    xj1982xj

    Joined:
    Sep 19, 2017
    Posts:
    35
    Hi RuinsOfFeyrin, thank you for sharing your runtime guide. I read your article, one thing you mention is 'autobuild' method for runtime . actually I don't know what's the difference between 'autobuild' , 'build' , 'generate' in Archimatix code , seems they all using for build mesh ? it's only speed different between these methods ? what are the user case should we using these three methods ? thanks.
     
  4. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    So i would love to swoop in here, and give you a detailed answer on the differences between these, however I would be spouting smoke out my rear. I'm not entirely sure exactly the difference between all of these either.

    In general when working on runtime, I have asked rory which function to use, and the answer has been that you pretty much always want to use autoBuild.

    Perhaps @roryo can chime in here with a more comprehensive description of each of the build method.
     
    brisingre likes this.
  5. roryo

    roryo

    Joined:
    May 21, 2009
    Posts:
    1,479
    I'll write up the build practices as tomorrow's manual page effort. ;)
     
    wetcircuit and brisingre like this.
  6. xj1982xj

    xj1982xj

    Joined:
    Sep 19, 2017
    Posts:
    35
    Hi roryo, sorry for bother you. There is a feature i hope Archimatix pro can support.

    Currently I just want to using Unity UI to instantiate AxModel and AxParameterObject.

    For example : "After Unity is running , when I press a button in UI , this button can generated an AxParameterObject or a group which contains many AxParamObjs , that just like when i click a 2d/3d left bar items in Archimatix Editor , meantime , this UI button behavior can also trigger to show the Node in Graph Editor of Archimatix ".

    I try to add this , but failed.
    ( I just add one mono script file in ArchimatixPro Editor project in order to let UI hook the method of this file ,but this file always jump into ArchimatixPro Core project so that i cannot using method such as"instantiateParametricObject" in Library.cs that only exist in Editor project) .

    I think this feature can enhance the runtime behavior for ArchimatixPro , Image that i can generate the AxObj at runtime , and changing the paramters of this ax obj at runtime. so hope you can have this feature in your further plan .
    how about your idea ?

    ( BTW, could you tell what's wrong with my try , why this mono file always jump from Editor project to Core project ?)

    looking forward your answer , thanks.
     
  7. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    Heya,

    Long story short. This can not be achieved with out some serious changes to the code. Part of what you are asking to do exists only in the Editor namespace, which is not loaded at run time.

    I actually have this *mostly* working after a good bit of coding, but I have yet to complete it since ive been working on other projects.
     
  8. SpindizzyGames

    SpindizzyGames

    Joined:
    Jun 29, 2017
    Posts:
    108
    I havent played with TerrainDeformer yet - but I'm curious - does it give me control over the winding of the triangles in the square cells of the terrain? How a square cell 'folds' diagonally is dependent on the winding (clockwise vs counterclockwise) of the two triangles in the cell, right ?
     
  9. SpindizzyGames

    SpindizzyGames

    Joined:
    Jun 29, 2017
    Posts:
    108
    toggle.png like for example, what if i wanted to 'toggle' how it folds at the red lines...
     
  10. xj1982xj

    xj1982xj

    Joined:
    Sep 19, 2017
    Posts:
    35
    Hi RuinsOfFeyrin, thanks for your sharing your idea.
     
  11. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
  12. roryo

    roryo

    Joined:
    May 21, 2009
    Posts:
    1,479
    Hi @logixworx - interesting question. Currently you can't specify the orientation of the quad -triangle breaks. Would you want to control this at a quad-by-quad level or is there some algorithm that we could use?
     
    Xepherys likes this.
  13. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I have a workflow question, in which I am about to reveal that I did something stupid in my scene workflow.

    I have built a really elaborate scene using mostly Archimatix objects. This is a spacecraft that is about 400 meters end-to-end and quite detailed. Archimatix is working great, modulo some very minor (probable) bugs that I'll report once I'm sure they're in your code and not my own pilot error. :)

    The problem is that I have so much procedural Archimatix content in the scene that saves take about 10 seconds. This is on a quad-core Kaby Lake CPU at 4.7 GHz. I now realize that I should have built my Archimatix objects in a dedicated "object construction" scene and then just instantiated baked mesh prefabs into my real scene. I now know how to do the stamped meshes, but I have no idea how to move the original, procedural Archimatix objects out of my scene and into an otherwise-empty construction scene. Is there a way to do this?

    Treating my main scene as the construction scene and making a new main scene is not an option. I have a ton of work in this scene that won't migrate well, and it would be days of work to make that happen.

    Thanks for any advice, and mea culpa for not having anticipated this problem in my workflow.
     
  14. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    Should be able to simply drag the game objects from the scene to your project, this will make a prefab. Open your new scene, pull said items from project window to your scene. Viola... should work, at least it did a couple version of ax ago, haven't tried it recently.
     
  15. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Thanks, but....I thought the manual said not to do that. Or is this a special case? When I get to the other scene, do I then need to do something to break the prefab connection?
     
  16. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    If you don't want to use prefabs, you can select them in the current scene, ctrl-c, open the new scene, and ctrl-v. It might be kinda laggy but it should work. You can do them all at once, so it shouldn't take more than a few minutes.
     
    syscrusher likes this.
  17. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Hey, do you think it’s possible to build a roads and electricity pole at runtime or this is outside of the scope of this product?
     
  18. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    A lot depends on what shape your roads need to be. There is a terrain deform tool in Archimatix that might let you do what you want. If your game is very stylized/cartoonish, and your roads are all something like city blocks on a flat plane, then Archimatix may do very well for you.

    If you need long, complex roads on a large exterior terrain, you could also consider a road-specific asset like EasyRoads 3D. (I am not connected with its publisher, but I have the asset and find that it works well.)
     
    blitzvb likes this.
  19. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    Hmmm. Honestly the manual was far less flushed out when i picked up AX, and I have not looked at it since.
    Im not sure why it would say not to do this though. Perhaps @roryo could shed some light.
    But ive done this before without adverse issues that ive noticed.
     
    syscrusher likes this.
  20. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    I will say: I have seen plenty of AX bugs, but I've never seen one directly to-do with using prefabs. That doesn't mean there are none, just none that have ever affected me.
     
  21. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Here is the section of the manual to which I am referring:

    The only way to create a Unity Prefab from an Archimatix model is to make sure the model is selected in the Hierarchy window and then click the Prefab button at the upper right of the Node Graph Editor window. This is similar to Stamping in that it “freezes” the model, but it also saves all of the meshes in the GameObjects to the AssetDatabase in an optimized way.

    Note that you can not simply drag a Stamped model to the Project window to create a Prefab, since the meshes will not be in the AssetDatabase.
    (Emphasis added)​

    I was not meaning to imply there was a bug, only that the manual seems (?) to say that you can't just cut and paste AX models around.

    Before I had read that section, I did in fact try a casual prefab in a test scene, and it did not end well for me. {ahem} That was the incentive to RTFM, and I didn't do that any more. :)

    All that being said, I will try the suggestion from @RuinsOfFeyrin after I make a full backup of my project. That should tell me for sure how things behave. :) I'll report back here after I do, for others' benefit.
     
  22. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    Sounds like that's only referring to stamped models.

    With stamped models, the manual is accurate. If you make a prefab from a stamped model, it comes out blank, so you have to use the prefab button to make prefabs of stamped geometry.

    Making prefabs of non-stamped AX models is fine as far as I can tell.
     
    syscrusher likes this.
  23. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I'm going to do some experimenting in a test scene before I try this on my real project.
     
  24. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    That is always a wise decision.

    AX has a bad habit of developing bugs that can corrupt/wipe graphs. So: backups backups backups!

    I actually saved myself from a glitch that completely wiped out my AX models earlier this week by copying them from an older git revision.

    Backups!
     
  25. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I wouldn't single out AX for this -- it can happen with any asset that stores complex data structures into scene or asset files. Procedural content is especially vulnerable to this problem, no matter which asset created it.
     
  26. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    It's not a problem unique to AX, certainly. Unity itself used to be bad about breaking scene files between version updates.

    AX has a pretty bad case, though -- I'm genuinely surprised you haven't already lost graphs to AX updates. In the couple months I've been an AX user, I've encountered what I believe to be two totally distinct species of graph corruption bugs, and had to recreate a graph or restore one from a backup multiple times in both cases.

    I'm sure there's assets that have even worse data corruption issues out there, but in my years using Unity I don't think I've personally seen anything else find two different ways to devour its own files in two months.

    In any case, backups are just a best practice. Because you're totally right, all sorts of things can ruin your files.
     
    Last edited: Jan 20, 2018
  27. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    100% agreed. In addition to git, I make a separate backup of my project after every significant-length work session, and before any major change such as upgrading a scripting asset to a new version. I also often make a backup right *after* a major milestone, such as a new feature added and working correctly.
     
    brisingre likes this.
  28. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Final rooftop tutorial is written..., I'm just getting Rory to check over it to see if he spots any glaring errors…. RibbedVaultB.png
     
    punk, coverpage, rgarrett7 and 8 others like this.
  29. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I did some testing tonight, after a careful backup, to better understand the behavior. Here is what I've observed. Rory, please correct me if I've misinterpreted any of my test results.
    1. As stated by @RuinsOfFeyrin, you can move AX models from scene to scene by dragging them to your Project folder from the Hierarchy to make a prefab of the procedural model.
    2. When you drop the procedural prefab into the destination scene, it will at first fail to render as anything other than gizmos and (if you select an appropriate node) collider wireframes. Right-click in the model graph and select Build Model to force a render, and all is well.
    3. The Build Model step appears to break the linkage back to the procedural prefab. I didn't test this aspect extensively, but the color of the parent GameObject changes from blue to black, which is usually how Unity indicates a prefab has been dissociated. (In my situation, this is actually desirable behavior.)
    4. Once the destination scene has been saved with the dissociated AX models (and that dissociation is IMPORTANT!), it is safe to delete the procedural prefabs from the Project folder. (If you try this at home, make sure you have a backup first, in case I've got this one wrong! It worked for me, but YMMV.)
    5. You emphatically cannot make a stamped version of the model and then create a prefab from that. If you try, you end up with missing meshes.
    6. Right-clicking in the graph and choosing Create Prefab does exactly what the AX manual says it should do. It creates a non-procedural copy of the model that, unlike the stamped version, can be safely dragged to the Project folder to make a prefab that appears in all respects ordinary.
    The workflow I need, then, is this:
    1. From my production scene, drag all of the AX models to a folder in the Project area to make procedural prefabs.
    2. In my "object build" scene, drag in these procedural prefabs, and Rebuild Model for each to dissociate it from the temporary prefab.
    3. Once all is well in the destination scene, use the Create Prefab menu function for each model to create a real prefab, and drag it to the production prefabs folder in the Project.
    4. Back in the production scene, delete the live models one by one and replace them with the static prefabs.
    Once again, if you try anything like this in your own project, make sure you have a backup first. I don't want to be the person who gave advice that wrecked your project.
     
  30. wanglibin

    wanglibin

    Joined:
    Nov 13, 2016
    Posts:
    14
    An Asia traditional luxuriant passage made with Archimatix.

     
    coverpage, TeagansDad, roryo and 9 others like this.
  31. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hi Guys! I've sent a few people this beta version of my 40-page rooftop tutorial/style guide, but I won't be able to update it for a little while so I'm going to make it downloadable from the AX community site in the meantime. It's a work-in-progress, but I cover most situations and traditional rooftops. Your feedback is appreciated.

    cover.png

    ARCHIMATIX DOME AND ROOFTOP FUNDAMENTALS
    • 20+ mini-projects: build spline models to learn construction methods.
    • Expose the controls that style each roof for parametric and runtime.
    • Create traditional rooftops in Archimatix. Fit to any building plan.
    • Design custom roof shapes for historic and fantasy villages.
    • Deconstruct complex multi-level rooftops into manageable parts.
    • Get out of the “layer cake” building rut with detailed domes and roofs.
    http://community.archimatix.com/main-forum/dome-and-rooftop-fundamentals/
     
  32. mons00n

    mons00n

    Joined:
    Sep 18, 2013
    Posts:
    304
    This looks fantastic! Thanks for sharing.
     
    wetcircuit likes this.
  33. Hitch42

    Hitch42

    Joined:
    May 12, 2015
    Posts:
    98
    Amazing! As much as I like the abstract creations that are possible with Archimatix, this is a fantastic example of a more realistic application of it. Great job!
     
    roryo and syscrusher like this.
  34. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Update on my move-to-prefabs testing and discussion from a couple of days ago:
    1. The workflow I outlined worked perfectly in my production project.
    2. That being said, I'm probably going to revert to my backup and not do that after all. Reason: After prefabbing everything, I discovered that AX was not the cause of the editor slowdowns. It was another procedural asset instead. So I might as well keep my AX models in the scene where I can work with them.
    At least I now know the workflow is an option. In future projects, I'll probably use AX to make some prefabs that are more conventionally deployed in to scenes, rather than what I did this time, which is to create large models that have significant parts of the scene.

    My scene has something like 15 Archimatix models in it, and some of them are pretty complex. It's definitely been a nontrivial exercise. :)
     
    wetcircuit likes this.
  35. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    Does this tool allow for runtime creation. Like if my players can make levels from scratch with this.
    Also is there a save feature which will save objects created in runtime???
     
  36. roryo

    roryo

    Joined:
    May 21, 2009
    Posts:
    1,479
    Hi @witcher101 - Runtime AX is geared for allowing parameters in a graph to be exposed for easy access to runtime UI. The idea is that you might make a parametric model that can generate dozens of custom version, as is demonstrated in the SpaceshipShop WebGL app. The editor is not available at runtime, so your players can't build models from scratch. While it is possible to generate the node graph through code, this level of API is not published as yet.
     
  37. roryo

    roryo

    Joined:
    May 21, 2009
    Posts:
    1,479
    Fantastic, @wanglibin - thanks for posting this!

    A texturing tip: the roof rafter's texture is not parallel to the direction of the beam. If you use a PlanSweep instead of an extrude, you should be able to get the wood grain going in the right direction.

    In the image below, an open triangle is thickened and extruded ( as I think you might have done) to generate the rafters on the left. If you use the triangle as Plan for a PlanSweep and a Rectangle as a section, the sweep will keep the UV's parallel to the Plan path:

    Archimatix 2018-01-31_08-46-39_AM.jpg

    Rafters.gif
     
    Last edited: Jan 31, 2018
  38. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    I see do you plan to implement this in near future
     
  39. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    @roryo, just a quick FYI, you have a Debug.Log() trace left over from testing that is at line 73 in AX.Generators.PrefabInstancer.cs. I've disabled it locally, but it was spamming the console and might be a candidate for commenting out in your next upstream build. :)
     
  40. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Is there a good way, other than making static prefabs, to use Archimatix with a LOD-generating program such as SimpleLOD?
     
  41. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    I don't think so. There was some talk about potentially adding hooks into AX models so the LOD could be a built-in function. It might happen, but I don't think that would necessarily be a good solution, don't see how that works smoothly without the whole AX model rebuilding (rebuild being the thing that slows AX down). It's just my opinion, though.

    I've also gotten a bit nutter over building AX models recently, and I would rather use my own settings to reduce the polys.

    Unity is also always THERE, so things that are theoretically possible in AX are often not practical because Unity is designed to do it much faster if you co-operate with the Unity way of doing things (and will hold you down with noogies until you cry "Uncle".)
     
  42. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    True enough, although LOD groups are a Unity function (but creating them is not). I'll have to look at some of my generated objects and see what the poly count looks like. Right now my scene totals over 150 million triangles. :)
     
  43. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
  44. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    Yeah, Rory had mentioned that he might be able to add the ability to make LOD's a part of Archimatix at some point, but I haven't seen anything more about that.

    I haven't done anything runtime, but AX creations work well with Automatic LOD as well as Simple LOD in Unity. Automatic LOD's use of relevance spheres is really amazing, and made the purchase well worth it for me.
     
    syscrusher and blitzvb like this.
  45. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I watched the video, and while it looks like a fine asset, generating LODs at runtime would make the level load pretty slowly. In the example video, for just that one humanoid character the LOD generation was taking several seconds. It would be painful to generate LODs for a whole scene every time it loads.
     
  46. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I have Simple LOD already, but haven't tried it with AX yet. What's your workflow for this?
     
  47. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    From what I heard, it’s pretty fast ... but I don’t have it so ...
     
  48. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I was going by the time it took in the asset's own demo video. :)
     
    blitzvb likes this.
  49. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    Stamp something out, then select it and use SimpleLOD as normal. The manual process also works fine... stamp a model and rename with _LOD0, then use the decimation slider in AX to reduce it, stamp again and rename with _LOD1, rinse and repeat for any other levels you'd like. Then create your empty gameobject, make the LOD models children and set up the LOD group manually.
     
  50. JasonCG

    JasonCG

    Joined:
    Oct 6, 2012
    Posts:
    29
    I'm learning Archimatix and have gone through some tutorials. I am quickly coming to the realization that there is more than one way to do something with Archimatix!

    I'm trying to design a dynamic wall. I want to be able to use FreeCurve (generated at runtime) to draw the path of the wall, and then specify where door and windows are on the wall.

    MedWall.png
    So far I've made good progress with the wall itself. I can draw a FreeCurve, and it automatically fills in support columns and beams along the top. I can specify the wall height in one place and the value propagates to the relevant nodes. I'm using PlanSweep to drag the wall rectangle around the FreeCurve.

    MedWallPlan.png

    Now I'm trying to figure out how to insert doors and windows.

    My first pass as tackling this is to use a ShapeMerge with my main wall FreeCurve and a rectangle that I use to highlight where I want a door. I use the DifferenceRail to carve out a hole in the wall and support columns, and the IntersectionRail to indicate where I want the door.

    MedWallCutPlan.png

    There seem to be a couple issues with this approach. It feels imprecise... I'm having to carefully position the "cutting" shape over the FreeCurve. I'm using the width of the cutting shape as the width of the doorway so if it's not positioned precisely then the doorway might not be the right size, or even sometimes there is this weird geometry that gets generated where the doorway seems to stretch back to the origin of the scene (0,0,0). I can probably overcome the imprecise issue by doing additional checks before I place the doors and windows when I generate the FreeCurve and "cutting" shape (and ensure it's snapped to the FreeCurve properly), but I feel like perhaps I'm might be going about it the wrong way. (Also at the moment I'm just cutting a spot for the door, but I'll want to actually have a door on a hinge. But I'm still learning this tool, baby steps!)

    Another approach I've considered is to create multiple graphs: one for walls with windows, one for walls with doors, and one for plane walls, then use ShapeConnectors to link them together. But it seems like it would be a lot of redundancy to go that route, and I'm still not sure how I would actually insert the windows and doors into the curve even if they were at essentially fixed intervals.

    Most of the tutorials and examples I've seen draw a wall back/front, whereas I'm drawing it side to side along a path using PlanSweep. I'm thinking maybe I need to somehow just generate the flat wall (not along the path) and extrude it in/out (with all the nodes for windows/doors), then do something like a PlanDeformer to stretch it along the FreeCurve?

    Thanks!
     
    red2blue likes this.