GiL, how much resources do tagged machines use when in a tick schematic?
I wanted to use it as "functions".
For example, in my tick schematic I have only have 5 check variable nodes, with five start tagged machine nodes upon their successes. So this means that at least one start tagged machine will be activated every frame.
I am doing this because I used to have just one HUGE tick schematic, but it is turning out to be a mess to edit after a while.
  • Usually depends on what the machines do, but each machine has an overhead in contrast to everything running in one schematic.

    Generally, only the first time the machine is used will have a bigger impact (when it needs to load the schematic) - but as with all things, it depends on the use case.
    E.g. if this is only running on one game object, you shouldn't even worry about it, if it's running on 1000, that's a different story.

    The tagged machines are useful in case different game objects need to react differently to something, e.g. starting a 'damaged' tagged machine could damage an enemy's health, explode a barrel (damaging others around) or spawn an item from a crate.
    If such a setup isn't needed, you can also directly start schematics within a schematic instead of going through the tagged machine.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on!
  • Thanks for the info!
    What I am doing is making a monster ai with makinom.
    First tagged machine is the wander mode.
    Second tag machine is the chase mode.
    Third is the investigate mode.
    So in every update, at least one mode is being called.
    I am doing it for one object only, so I guess I am alright then :)
  • Why do you think use tagged machine for AI is good?

    I think to only use 1 "Auto machine" with repeat and has it check condition (e.g: when seeing player set variable SeePlayer=true )
    Then use the "Start Machine" node to run a schematic base on that condition (e.g: SeePlayer=true -> Start machine "Chase player")
    In this way, you don't have to attach a schematic in any machine, therefore use only 1 machine per object.

    I think is not good to use the tagged machine for this.
    The 1st reason is a performance like you Gil said if you have 1000 object and every them has 5 or more tagged machine for just for AI plus many more for other things. If you make RPG game this basically fine, but if you make Strategy game with many units then this is not good.

    And the 2nd reason is clutter the inspector when you have many tagged machine plus other machines on the same object and then you have to open each of them just to find where is the "Chase player" tagged machine so you can change the condition to run this tagged machine, so is a waste of time.

    But I still want to know why you think use tagged machine is good? :)
  • edited July 2019
    Its cause I am not creating an RPG, but a horror game where there is only one ghost in the scene that is chasing you.

    My ghost ai is huge and complex. There are basically currently 5 states, each with a lot of stuff inside, checking a lot of conditions and doing different actions based on them.

    The reason I forgo the start machine is because like you said, the schematic does not attach to any machine, so in order to get any game objects in the scene, I would have to use the find object setting, which will not be ideal since my scene has over 10000 objects and counting.

    Also, in each of my states, I have quite a few public game object sections that I created in the setting node, so when I had just one huge schematic, it was quite cluttering.

    And the most important reason, I only have one monster with tagged machines.

    Those are the only reasons why I put them in tagged machines.
    I tried it, and having 5 tagged machines on my ghost with clear purpose in each of them put me more at ease than having one huuge schematic :)
    Of course, if I decide to add more complex ai to more ghosts, I will just go back to making huge schematics :D
    Also, I try not to put too many machines in one object. IF I just have to, but I already have a lot of machines on an object, then as to not clutter it, I just create an empty game object, make it as a child of the game object that I wanted to attach the machine to, put the machine on the child instead, and inside the schematic, when using the "machine object" type, I just enable the "root" option.
    Post edited by Shadow_Fire on
  • Don't worry about performance too much - if this really becomes an issue due to having 1000+ objects doing this at the same time, you might want to change to custom scripts anyway, as the overhead of Makinom machines and schematics (or use overall manager machines, that perform tasks for many objects).

    Using tagged machines for AI is a pretty good use case, as it allows you to separate tasks and easily switch them out as needed (e.g. for different enemies).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on!
  • Thanks, Gil! I have never tried out the tagged machine before, so this is my first time doing it, but I am liking the technique so far.
Sign In or Register to comment.