How does Cryengine works?

#1
Hi guys I am using Unity atm but thought about using cryengine. I am just not quite sure how it works, I already used it but couldnt really figure out how its build up could somebody maybe give me a brief introduction into the engine.
I just know how Unity works for example in Unity there are Gameobjects they are all placed somewhere in the Level and have a transform component now I can add single scripts(Components) to the Gameobject telling it to render a mesh etc.
In Cryengine I only know that there are Entities I am not quite sure anymore if they could be lights or also similiar to gameobject from unity, furthermore it would be interesting what project settings and enviromental settings are avaible in cryengine.
I used cryengine a bit ago but got confused about what to do there were many pre existing tools like the road tool which I totally didnt knew how it worked and there was also no great tutorial explaining how to really code instead they were about how you can create shiny levels by downloading the default asset and place some fancy trees :/
Greetings Phil aka Droni
gramma mistakes included intentionally

Re: How does Cryengine works?

#2
Gonna warn you, to learn CryEngine, you have to be determined. But don't worry, it's much easier than the old days when there was almost no learning material.
Ok, here we go, (it's just my personal option, though)

Step 1: Follow this tutorial series [TUTORIAL] 5.4 - Creating RPG Game from scratch! by fury22uk (To episode 7, you should have basic understand for CryEngine, and explore on your feet)
Note: this series uses FlashDevelop to make UI, you should need ActionScript2 project for Flash develop

Also search in fury22uk's channel
and CryEngine channel
to learn basic things like how to make GUI, Particle Fx,...

Step 2: Follow this tutorial: Cryengine 5 programming tutorials - Animation, Player Camera , this make you familiar with the character things.

Step 3: Start reading the C++ code of default third person project (which I find pretty simple), and try making something of your own.
I know that I bias toward C++, but C++ is cool, hard but cool, make you start seeing the bones of the Engine - no longer think: "What's kind of magic is this?"

The advantage of CryEngine is you have access to its source code, try building the source code of CryEngine and watch it run in action
Follow Cry-Flare's image tutorial to build CryEngine from source.
Make sure you read the following sections:
a. Installing Visual Studio 2015 --> to know that you must have Windows 10 SDK
c. Setting up and Registering your local engine
d. Using Visual Studio with your local engine
e. Building and testing your local engine
And this post to know how to connect the CryEngine source code with you current project.

And finally, don't try to swallow all these things at once, take one thing at a time.

gramma mistakes included not because I'm intentional, just because I'm stupid
Small tips
How to add an image to a forum post
[C++] How to smoothly turn your character

Re: How does Cryengine works?

#3
Since I have quite some experience in both engines I'll add a bit of my experience from a programming perspective.
First of all, in CRYENGINE 5.4 you create a separate C# solution, instead of the editor doing this for you. This is done by right-clicking on the game.cryproject file in your project's root folder and selecting Generate Solution. This will generate a new solution in the Code folder which you can open in Xamarin Studio if you have the CRYENGINE add-in installed. More information about that can be found in the C# Programming documentation

GameObjects in Unity are comparable to Entities in CRYENGINE. But where in Unity a GameObject is not much more than a container of components the CRYENGINE Entities have a bit more responsibility. A simple example is the Transform component in Unity, which is always attached to a GameObject. In CRYENGINE the Entity itself holds the Matrix of its transform.

Code: Select all

// Setting the position of the object to 0,0,0
// Unity3D
// World position
gameObject.transform.position = new Vector3(0,0,0);
// Local position
gameObject.transform.position = new Vector3(0,0,0);

// CRYENGINE
// World position
Entity.WorldPosition = new Vector3(0,0,0);
// Local position
Entity.Position = new Vector3(0,0,0);
As you can see in the example some small things are also different in CRYENGINE like setting the local-position by default instead of world-position when setting the Position property.

Other components are added to Entities just like they are added to GameObjects in Unity. Which is either in the Sandbox by pressing the Add Component button on entities, or in code by calling

Code: Select all

Entity.AddComponent<ComponentName>();
Code wise the components work a bit different in CRYENGINE. In the CRYENGINE you can only expose properties in C# components, instead of fields which is normal in Unity. For example a movement speed property would look like this:

Code: Select all

[EntityProperty(EntityPropertyType.Primitive, "Speed of the player in meters per second.")]
public float MoveSpeed { get; set; } = 20.5f;
For more information about how to use components I recommend looking at the C# templates that are included with the engine, and taking a look at the documentation of the templates.

Another difference is the y = up vs z = up that you have to take into account when switching. CRYENGINE is height-map oriented, which means that the z-axis is the up-axis. Unity is camera oriented, which means it's y-axis it the up-axis.

In the future we're adding more features that should make it easier to work with C# in the CRYENGINE. For example we'll be adding C# assets to the sandbox in the future so you don't need to leave the Sandbox anymore to create a C# component. And we'll be adding support for debugging C# with Visual Studio 2017 to the engine as well.

Re: How does Cryengine works?

#6
Hi guys, thank u for those tips, i come from unity and beginning on this is a little hard XD.

Btw when i change a entity property, (name, for example) and build i need to restart the sandbox to show this change in inspector.
Is this some type of bug? in Unity code changes auto update in inspector.

Im using C# as main language and 5.4 version.

Re: How does Cryengine works?

#7
Btw when i change a entity property, (name, for example) and build i need to restart the sandbox to show this change in inspector.
Is this some type of bug? in Unity code changes auto update in inspector.
At the moment the Sandbox doesn't automatically reload when a component is changed, so restarting the Sandbox is required for that. In 5.4 we did add an experimental console command to reload the C# plugins. You can use this by typing "mono_reload" in the console. Keep in mind that this is very experimental in 5.4 and might have side-effects, including crashes.
For 5.5 we're introducing C# assets in the sandbox which will automatically reload when they're changed, similar to Unity. For C# files that were changed outside of the assets folder you can trigger the reload with the "mono_reload" command, which will then try to reload your C# plugin. Keep in mind that for C# plugins you always have to compile it yourself in either Visual Studio or Xamarin Studio.

Who is online

Users browsing this forum: No registered users and 0 guests