Schmatyc design / C++ interop

#1
Hi All,

A. Schematyc design and goals
1. What where the design goals of Schematyc , regarding sphere of application? Currently it seems a good tool to build entities low to medium complexity interactive entities from components, but that is all. It lacks so far a decent methd of interentity communication, as far as I can tell. Flowgraph, on the other hand is very well tailored to this task. This leads to a weird situation where you have to maintain 3 scripting languages in the core engine (LUA, FLowgraph, Schematyc) , all while adding a 4th one C#. Not good.

2. If [1] is erroneous, I would like to know which is the intended mean to send messages to an arbitrary component of an arbitrary entity. By arbitrary entity, I understand any entity whatsoever, implemented purely in C++ or in Schematyc. Also, it goes without saying that components of said entity will consume the message in fact. By message I understand more than a simple tag, it **must** carry context with it.
For example pseudo Schematyc GetSensorActivatorEntityId - SendMessage( DAMAGE_MESSAGE_TAG , DAMAGE_TYPE, DmageAmount ... ) . This code would simply get the entity ID of the activator (Note that the activator entity is arbitrary, might not be another Schematyc entity, but a pure C++ one ) of the sensor, then send a message to it, to be handled by a component which knows how to handle DAMAGE_MESSAGE_TAG and properly destructure it. Please point source file in engine which contains such communication. Please elaborate on the subject of inter-entity communication and how seamless is interop of C++ / Schmatyc entities.

3. In light of [2], currently you can send messages in Schmatyc to the components of your own entity, by calling functions on those. If a similar function call mechanism would be implemented for sending messages to other entities, it would generate confusion IMO. Because you would have different versions of message functions for components owned by a Schmatyc entity and foreign entities, which would lead to confusion and unnecessary cluttering of graphs. What is the canon way to doit ? If there is no such functionality, what do you plan to do ?

5. Please provide a pointer to an example in the source tree of the engine which implements a function which exist independent of any component For example, if you want to implement a Get/SetTimeOfDay function to use in your Schematyc visual graph, you **do now want** to implement that as a component which provides functions. Such objects, like all Environmental nodes in Flowgraph, and should be not components of an entity

Re: Schmatyc design / C++ interop

#2
Hello,

first of all thank you for the feedback and sharing your detailed thoughts about the new entity system and Schematyc. Initially it's important to note that Schematyc is a beta feature and we are still working on it, that's also why it might miss functionality or connections to different system within the engine. One of the key features of the new system is that you can implement your own components and add any functionality you want to it, that also enables you to expose those functions to Schematyc. If you want to see some examples of how you can write components and expose functions to Schemtayc you could have a look at the default components https://github.com/CRYTEK/CRYENGINE/tree/stabilisation/Code/CryPlugins/CryDefaultEntities/Module/DefaultComponents. Since you can write the components in C++ you have full access to the API of the engine, which should enable you to, as you mention, create your own TimeOfDay component. Regarding your question about sending events/messages, I would recommend to have a look at the RigidbodyComponent https://github.com/CRYTEK/CRYENGINE/blob/stabilisation/Code/CryPlugins/CryDefaultEntities/Module/DefaultComponents/Physics/RigidBodyComponent.cpp especially the ProcessEvent function to see how we pass events and information to Schemtayc.

Cheers,
Alex

Re: Schmatyc design / C++ interop

#3
Exactly. You can create c++ component and expose any functionality for the schematyc. You can provide your own signals that are sent when something happens, then catch them and give them any functionality in schematyc, also you can expose any function to schematyc and call it from there. It's obvious that default components are just basic components that let you get started. By looking into their code it's extremely easy to create own components. From what I experienced so far, schematyc has already enough access to components, that allows you to do pretty much everything.
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Schmatyc design / C++ interop

#4
Than you for you answers,

1. Do you have an example of adding a naked function to Schematic, which is not tied to a component. Note that my example with TimeOFDay is the perfect example of something which SHOULD NOT be a
component. TimeOfDay is property of the world simulation, and has no business being part of my entity. What is needed here is naked function exposed to Scehmatic that simply asks the world to pass time of day.

2.The components are fine, but they do not provide examples of the cannon on how to pass information from Schematic to C++ only entities. Signals seem to work only with Schematic entities , and anyway, it does not appear to me they are able to carry arbitrary context with them (message payload). I'm looking for the canon way to have messaging and prefect interop between C++/Schematic. Cause if such a seamless interop is not easily possible, I find the system artificially limiting. I understand that is beta, but by Beta I understand a subsystem whose design goals where ironed out long ago, but may lack some implementation details as of now. SO what is the canno way to message from Schematic to C++ only entities ?

3. In the light of [2], could you please enumerate what where the design goals of the Schematyc DSL, so we can understand the true limits of the system, and understand if you will be forced to keep Flowgraph around for the foreseeable future (or worst, hack Schmatic to call into Flowgraph so you can afford making user interface into flowgraph vanish from tools), or you plan to implement equivalent functionality to what Flowgraph was very good at, inter-entity relations ?

With thanks for your answer and hard work, Dan

cry-alex wrote:Hello,

first of all thank you for the feedback and sharing your detailed thoughts about the new entity system and Schematyc. Initially it's important to note that Schematyc is a beta feature and we are still working on it, that's also why it might miss functionality or connections to different system within the engine. One of the key features of the new system is that you can implement your own components and add any functionality you want to it, that also enables you to expose those functions to Schematyc. If you want to see some examples of how you can write components and expose functions to Schemtayc you could have a look at the default components https://github.com/CRYTEK/CRYENGINE/tree/stabilisation/Code/CryPlugins/CryDefaultEntities/Module/DefaultComponents. Since you can write the components in C++ you have full access to the API of the engine, which should enable you to, as you mention, create your own TimeOfDay component. Regarding your question about sending events/messages, I would recommend to have a look at the RigidbodyComponent https://github.com/CRYTEK/CRYENGINE/blob/stabilisation/Code/CryPlugins/CryDefaultEntities/Module/DefaultComponents/Physics/RigidBodyComponent.cpp especially the ProcessEvent function to see how we pass events and information to Schemtayc.

Cheers,
Alex

Re: Schmatyc design / C++ interop

#5
Thank you for responding,

Im afraid I failed to communicate properly what I want to know., since it appears that you missed my point. It is **not** about creating components., and not about what appear to be a crippled messaging system with signals which cant carry context, and can only be delivered to Schematic entities., as far as I can gather. It is about interop of Schematic entities and C++ only entites, and a sane universal messaging system (or lack thereof). And if this means that for now they have to keep flowgraph around, since that DSL was good at entity messaging and relationships. schematic so far it is not.

fury22uk wrote:Exactly. You can create c++ component and expose any functionality for the schematyc. You can provide your own signals that are sent when something happens, then catch them and give them any functionality in schematyc, also you can expose any function to schematyc and call it from there. It's obvious that default components are just basic components that let you get started. By looking into their code it's extremely easy to create own components. From what I experienced so far, schematyc has already enough access to components, that allows you to do pretty much everything.

Re: Schmatyc design / C++ interop

#6
flowgraph is dead. c# and c++ and schemytic and component will not communicate to flowgraph. flowgraph is lonely. flowgraph must be forget.

check source code to check if entity is schemytic or not and how to send singnal to it. nake function is easy. just search source code of existing function. such as float add minus divide multiply.
game engine run functional through
raytrace
trigger
collision

Who is online

Users browsing this forum: No registered users and 1 guest