Re: Multiple basic questions

#11
First of all, thanks for the answer, Cry-Flare.
3. If we expose some Variables, Structs or similar to Schematyc, will these values be automatically serialized when creating a savegame? Or how do we serialize? Inside the doc I found multiple functions for this (see here: https://docs.cryengine.com/plugins/serv ... w/29797021)
So do we need to use the GameSerialize function for this purpose? Or is there some kind of auto savegame serialization for values that are exposed to Schematyc?
Unfortunately no. The current Schematyc system is not exposed to the save game logic. It would be advised to create your logic in a way that reads data from such systems as GameTokens upon level load to crate your starting state.


Yeah, I already thought that. All right. I guess that the IEntityComponent functions "virtual bool NeedGameSerialize ()" and "virtual void GameSerialize (TSerialize ser)" should be used now. Makes kind of sense. Just wanted to know if there is a simpler way (so that I wouldn't have to care about it). But that's all right.


4. In the old entity system we could easily (with LUA) implement a FlowNode for an entity. However I couldn‘t find anything like that in Schematyc. Is there any way to do so?

5. Also in the old entity system we could easily create states in LUA (by just adding their names as a string to our state table). Then we could easily switch between states and have some logik for entering and leaving the state. I know that Schematyc has a state machine aswell. But can we somehow access it inside of C++? If so, how do we create states? How do we switch between them? How do we react to entering and leaving the state?
This LUA functionality is not exposed to Schematyc as the Schematyc graphs are to be a considered a complete replacement for LUA based scripting. The idea of the LUA scripts was to allow designers the ability to create and extend functionality in the engine to suit their needs. Now designers can do this visually inside of Schematyc - in Sandbox.


This however is something that I don't really understand, because Schematyc already offers a state machine. I would have thought that we could use it in our code aswell. But all right. I guess that I will create kind of a state machine component, so that my other components can still use a similar system.

But what I really don't get is that there is no FlowGraph interaction currently. This would be really great for "one time events" that typically happen in the story of a game. If we need to create a new component for every of these situations it would really be kind of a mess. I think that it would be highly benefitial if we would have some kind of FlowNode for each entity just like it was before. It would make life much easier. So basically just the ability to create some C++ Code that would then be used für Entity FlowNodes. I guess that adding entities to FlowGraph communication is a "must have".


6. Is there any good approach about how to implement AI? I know that we have a pathfinder component, factions, MBT, perception, dynamic respone system and so on, but did anyone have any success in actually putting everything together to implement a basic AI? I currently have no idea about how to approach this. Specially about how to make it react to the player (recognize the player, shoot at him or hunt him, recognizes when player is not in sight anymore, etc.). I would really appreciate any help about this.
This varies from game to game and you would need to use the base AI functions like perception to build your AI logic around. Not every game will tell the AI to shoot the player on sight. I am not an AI designer but the way I see it at the moment these actions are handled by behavior trees. you can read more about the stock AI system in CRYENGINE on our revised documentation at https://docs.cryengine.com/pages/viewpa ... d=25534272


Yep, of course this varies. I'm currently looking at the CryAISystem code to get familiar with it. However it's pretty complex and hard to understand. So what I basically mean is just some kind of explanation about how to get all of these bricks together (some basic stuff like how to move an AI, how to make it recognize others, how to react to others, or how to include the ability to read an MBT and use it). So just basic stuff.


7. How do we properly pack these Template Games for publishing? I guess that we now need to do proper release builds of all the default components, etc. aswell?
CRYENGINE now ships with release binaries. For templates, it should be as easy as right-clicking your project file and selecting "Package build". This will consolidate all the engine binaries and necessary files, as well as packaging your game assets into a single folder that you can redistribute. Depending on what assets you are packaging, you may need to tweak the RC Jobs file to your specific needs. You can find out more about the RC Jobs file in our documentation here:
https://docs.cryengine.com/display/CEMA ... nd+Job+XML

The files in question to modify would be here by default:
C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.5\Tools\CryVersionSelector\rc_jobs


I hope this answers most if not the rest of your questions. If you still have questions feel free to ask again.


I just looked into the rcjob_release_game_assets.xml, which is at the location that you stated. I have to admit that this is pretty cool. Just tried to pack a game. Works fine. However I couldn't find out if it properly sets the "#define RELEASE" for release builds. If you look for example into CryDefaultAssets, you'll notice, that this needs to be defined for a release build. However I could not see this anywhere inside the rcjob_release_game_assets.xml. But the good news is this: the CryDefaultComponents and everything else is properly packed into the bin folder.
The other thing was about encryption (see my first question). After I packed the game, I noticed that the Assets don't get auto-encrypted, not even signed. So I had no problem to just unpack them. I couldn't find anything about encryption inside the rcjob_release_game_assets.xml. So how do we do this now?
Furtheremore the GameLauncher.exe does not seem to work (just tried a win64 release build. Nothing happens if I try to start GameLauncher.exe).

Greetings
- Jannis

Re: Multiple basic questions

#12
This however is something that I don't really understand, because Schematyc already offers a state machine. I would have thought that we could use it in our code aswell. But all right. I guess that I will create kind of a state machine component, so that my other components can still use a similar system.
A general state machine can be implemented as a simple variable switch such as an enum, there is not much more than that and I'm not sure it would be possible to call this specific block of code from Schematyc' Core. Or are you looking to get access to a Schematyc Entities State Machine Element or the State Machine element that is attached to an entity/all entities?


But what I really don't get is that there is no FlowGraph interaction currently. This would be really great for "one time events" that typically happen in the story of a game. If we need to create a new component for every of these situations it would really be kind of a mess. I think that it would be highly benefitial if we would have some kind of FlowNode for each entity just like it was before. It would make life much easier. So basically just the ability to create some C++ Code that would then be used für Entity FlowNodes. I guess that adding entities to FlowGraph communication is a "must have".
This is something we would like to avoid, Schematyc will evolve into a system that can ideally replace Flow Graph entirely, this will alleviate a lot of the issues with Flow Graph and it's inherent limitations. As mentioned, Schematyc itself is a beta feature and will evolve quite a lot moving forward. For now, if you want to communicate with Schematyc via a Flow Graph component, you could write your own Schematyc component and Flow Graph node to be able to communicate via "signals" for example - this is rather trivial and a rudimentary example can be found here:
viewtopic.php?f=15&t=10942&p=21641&hili ... aph#p21641


Yep, of course this varies. I'm currently looking at the CryAISystem code to get familiar with it. However it's pretty complex and hard to understand. So what I basically mean is just some kind of explanation about how to get all of these bricks together (some basic stuff like how to move an AI, how to make it recognize others, how to react to others, or how to include the ability to read an MBT and use it). So just basic stuff.
AI can indeed be a rather complex topic. Have you checked out the AI tutorials on the YouTube channel? This can give you an idea of how the AI system generally works, if not specifics on how to implement certain things.
https://www.youtube.com/watch?v=ll14eJO ... yAMXkMvb4I


I just looked into the rcjob_release_game_assets.xml, which is at the location that you stated. I have to admit that this is pretty cool. Just tried to pack a game. Works fine. However I couldn't find out if it properly sets the "#define RELEASE" for release builds. If you look for example into CryDefaultAssets, you'll notice, that this needs to be defined for a release build. However I could not see this anywhere inside the rcjob_release_game_assets.xml. But the good news is this: the CryDefaultComponents and everything else is properly packed into the bin folder.
This is not part of the packaging process. If you want to use the release/performance binaries that have debugging features stripped out you can either;
1. Use the shipped release binaries from the CRYENGINE Launcher downloaded engine version, then compile your project in "Release" configuration to be compatible.
2. Compile the engine yourself in release configuration, as well as, of course, your own project. <- This is required if you want to use encrypted PAK files.


The other thing was about encryption (see my first question). After I packed the game, I noticed that the Assets don't get auto-encrypted, not even signed. So I had no problem to just unpack them. I couldn't find anything about encryption inside the rcjob_release_game_assets.xml. So how do we do this now?
There is no 'auto-encryption' process in CRYENGINE at this time, it is something we would like to look into though for sure but would need some structural changes we have to investigate.
For now, the process boiled down would be:
1. Generate a key using the Key Generator (Ignore the #USE_RSA_KEY section)
2. Embed the key into the system initialization code as outlined in the linked post
3. Compile the Engine and Project in Release configuration
4. Package your assets using the RC Jobs if necessary (More details on the system used here)
5. Encrypt the generated PAK files using PakEncrypt (The directories may have shifted slightly, generally the generated key.dat must be in the working directory when called parsebuild)


Furtheremore the GameLauncher.exe does not seem to work (just tried a win64 release build. Nothing happens if I try to start GameLauncher.exe).
The engine requires the project file to know what plugins to load etc. Without this, you may get an error when starting the engine directly. For CRYENGINE 5.5 you can put your cryproject file (make sure to name it game.cryproject) into a PAK file of it's own into the root directory of your packaged game, into the file named config.pak. You can see this in action if you "Package Build" a template project. AFAIK this PAK file can also be encrypted.


If you still have issues starting your game from a packaged project let us know and we'll try to find a solution :).
Uniflare
CRYENGINE Technical Community Manager
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Re: Multiple basic questions

#13
A general state machine can be implemented as a simple variable switch such as an enum, there is not much more than that and I'm not sure it would be possible to call this specific block of code from Schematyc' Core. Or are you looking to get access to a Schematyc Entities State Machine Element or the State Machine element that is attached to an entity/all entities?

I am just curoius here, because Schematyc already offers a state machine. I thought that we might have access to it from C++. However you are right. In the end I could also just use a variable switch (and I guess that this is just what I'll do). I just thought (because Schematyc has a State Machine) that we might have some kind of access to it. Like I've mentioned, I used LUA a lot, which had a simple State Machine. However, it's not that important to me (because like you said: I could also use a variable switch).

This is something we would like to avoid, Schematyc will evolve into a system that can ideally replace Flow Graph entirely, this will alleviate a lot of the issues with Flow Graph and it's inherent limitations. As mentioned, Schematyc itself is a beta feature and will evolve quite a lot moving forward. For now, if you want to communicate with Schematyc via a Flow Graph component, you could write your own Schematyc component and Flow Graph node to be able to communicate via "signals" for example - this is rather trivial and a rudimentary example can be found here:
viewtopic.php?f=15&t=10942&p=21641&hili ... aph#p21641

That's sad to hear. I didn't know that CryTek wants to replace FG entirely with Schematyc. The problem that I see here is that Schematyc is pretty great for entities. However FG is also a really great system, which is used for "gameflow". So basically the game story and single-time events that occur during the game's story. I guess that Schematyc is not really suited to replace it entierely. You can see it inside of other engines aswell. For example Unreal. They have "Blueprints" (like Schematyc) and "Level Blueprints" (like FG). Beside the fact that these systems share the same name, it's like Schematyc and Flowgraph. We have a clear difference between entity logic and gameflow logic.

So currently let's say we have e.g. a door entity which is implemented with the new Schematyc system. If the player picks up a key inside the game, it should be unlocked. This was pretty straight forward in FG. However witch Schematyc (since we don't have FG nodes for our entity instances) we would need to create an entierely new setup for every door that should have a similar functionality. At least I don't really know about a simple way to do so.
This is why I don't think that Schematyc should replace FG. I guess that these Systems would perfectly work together.

AI can indeed be a rather complex topic. Have you checked out the AI tutorials on the YouTube channel? This can give you an idea of how the AI system generally works, if not specifics on how to implement certain things.
https://www.youtube.com/watch?v=ll14eJO ... yAMXkMvb4I

Yep, I know about these videos and I already tried a lot of stuff with the GameSDK AI. I also wrote some MBTs for it. However I now want to build up on the First Person Template. So this question was not really about how to use AI. It was more related to the implementation of it. I noticed, that we got some Components (inside the default components), that can handle AI stuff. But I don't know how to put it all together to the point where I have an AI that can use MBTs, Movement, Factions, e.t.c.
So basically how to approach the implementation of a custom AI with the new EntityComponent system that came witch Schematyc.
Regarding the default components: This plugin currently has some of the new EntityComponents and some legacy entities. However it seems as if there is some kind of bug inside the registration of the legacy entities. At least I am not able to find them inside of Sandbox (also not unter "Legacy"). However the new Components are present inside of Sandbox and seem to work fine.

This is not part of the packaging process. If you want to use the release/performance binaries that have debugging features stripped out you can either;
1. Use the shipped release binaries from the CRYENGINE Launcher downloaded engine version, then compile your project in "Release" configuration to be compatible.
2. Compile the engine yourself in release configuration, as well as, of course, your own project. <- This is required if you want to use encrypted PAK files.

There is no 'auto-encryption' process in CRYENGINE at this time, it is something we would like to look into though for sure but would need some structural changes we have to investigate.
For now, the process boiled down would be:
1. Generate a key using the Key Generator (Ignore the #USE_RSA_KEY section)
2. Embed the key into the system initialization code as outlined in the linked post
3. Compile the Engine and Project in Release configuration
4. Package your assets using the RC Jobs if necessary (More details on the system used here)
5. Encrypt the generated PAK files using PakEncrypt (The directories may have shifted slightly, generally the generated key.dat must be in the working directory when called parsebuild)

Thanks a lot for this info. I'm currently not at a point where I would release a game. But it's great to hear that it is possible with the GamePlugins. The links were really helpful in underestanding the process. Thanks a lot.

The engine requires the project file to know what plugins to load etc. Without this, you may get an error when starting the engine directly. For CRYENGINE 5.5 you can put your cryproject file (make sure to name it game.cryproject) into a PAK file of it's own into the root directory of your packaged game, into the file named config.pak. You can see this in action if you "Package Build" a template project. AFAIK this PAK file can also be encrypted.

Oh now I feel stupid :D I always tried to "Package Build" it with the "release" option. However I didn't create a release build (just profile). Well... now it works :D Thanks for the help.

By the way: I have another problem right now. Like I mentioned, I'm currently working with the FP Template. Now I tried to implement the IActor interface in the player component. This sadly throws some errors (seems as if the IActor, which itself is a IGameObjectExtension is not compatible with an EntityComponent like the player component). The problem here is that it is not possible to use the actor system that way.
I stumbled over this because I also tried to implement some savegame code. It didn't work so I tracked it down. And as far as I get this right, the checkpoint system inside of the engine tries to get the local player (as an actor from the actorsystem) and checks if it is alive (health check).
Of course also the actor flownodes don't work with the current setup aswell. So is there any plan to fit the actor system to EntityComponents? Or else it would be pretty hard to even get the local player actor and like I said to create a savegame.

But to conclude this post: Many thanks to you for the clarification about releasing, encrypting and packaging a game. This was really helpful. However currently the new system seems to create more problems than it solves (well it's just in beta, I know. But it seems to be more like an alpha). So a final question from my side would be: should we currently even use the new system or should we go for the old one for now?

Thanks and greetings
- Jannis

Re: Multiple basic questions

#14
At least I don't really know about a simple way to do so.
I think you still may use FG for interaction with level's objects
for this you should:
create for player FG node<Singletone> with output event - "pressing E"
create for door FGnode (that may be assigned to door entity) with input property "open"
create for inventory FGnode<Singletone> with input property "keyName" and output "I have this key"
then just link player FGnode("pressing E") with inventory FG node (with some keyName query("redkey1 for example")) and then link with door ("open")
Inventory FG node jsut test internally for this name all elements and if such name exist - it generate event for door.

Or another way to open doors without any exposing anything to FG either Schymantic.
To do so, you must allow to Player entity(component) doing the Area or RayCasting "Queries", for example doing pereodic(or by keyevent) proximityquery
you will got list of nearest entities, then you just test they for IInteractable (you shuld derive all your interactible objects from this class)
if you got IInteractible from entity, you need trying to get typeof interaction.
interactible->GetInteractionType() and go futher

Code: Select all

SEntityProximityQuery query;
Vec3 pos = worldPosition;
Vec3 wsMax = Vec3(pos.x + radius, pos.y + radius, pos.z + radius);
Vec3 wsMin = Vec3(pos.x - radius, pos.y - radius, pos.z - radius);
query.box = AABB(wsMin, wsMax);

#ifdef VISUAL_DEBUG
debug->Begin("AABB", true);
debug->AddAABB(wsMin, wsMax, ColorF(1, 1, 0), 1);
#endif
query.pEntityClass = gEnv->pEntitySystem->GetClassRegistry()->GetDefaultClass();
gEnv->pEntitySystem->QueryProximity(query);

int32 count = 0;
for (int32 i = 0; i < query.nCount; i++)
{
IEntity* ent = query.pEntities[i];
IInteractible* component = ent->GetComponent<IInteractible>();
if (component)
{
switch (component->GetTypeOfInteraction()) // got through all kind of interaction in game
{
case EInteractionDoor:
{
//CDoor* door = dynamic_cast<CDoor>(component);
CDoor* door = ent->GetComponent<CDoor>();
if (door)
{
if (player->IsItInInvetoryName("redkey1"))
door->Open()
}
}
break;
case EInteractionButton:
{

}
break;
default:
break;
}
}
}

Re: Multiple basic questions

#15
Thank you MoonBeam.
Yes, that would indeed be possible. However I just made this up as an example ;) What I wanted to say is that it would be much easier to keep the old "Entity FlowNode" concept. However as Cry-Flare mentioned: it seems as if CryTek wants to get rid of FG entirely. So I guess that they won't care about implementing such a system. However I think that this is a pretty bad idea. FG is designed for gameflow and for this purpose it is a pretty powerful tool (in my opinion much better than Unreal's "Level Blueprints").

However EntityComponents seem to be incompatible with a lot of the engine systems (I've mentioned the Actor system. But you can also take a look at items inside of CryAction (IItem.h). They are GameObjectExtensions aswell).
Currently I feel pretty lost with the usage of EntityComponents. I know that they are still considered beta but it bothers me that we cureently can't use even the most basic systems of CryEngine.

- Jannis

Who is online

Users browsing this forum: No registered users and 3 guests

cron