1. Home
  2. /
  3. Cryengine
  4. /
  5. Log Key Press Example

Log Key Press Example - Cryengine Typing CST Test

Loading…

Log Key Press Example — Cryengine Code

Logs message when key is pressed.

#include <CryEntitySystem/IEntityComponent.h>
#include <CryInput/IInput.h>
#include <CrySystem/ISystem.h>

class CKeyPressEntity final : public IEntityComponent
{
public:
	virtual void Initialize() override {
		CryLogAlways("CKeyPressEntity initialized!");
	}

	virtual void ProcessEvent(const SEntityEvent& event) override {
		if (event.event == EEntityEvent::Update) {
		if (gEnv->pInput->IsKeyDown('F')) {
		CryLogAlways("Key F pressed!");
		}
		}
	}

	virtual Cry::Entity::EventFlags GetEventMask() const override {
		return EEntityEvent::Update;
	}
};

Cryengine Language Guide

CryEngine is a high-end, cross-platform 3D game engine developed by Crytek, designed for AAA-quality games, simulations, and VR/AR applications. It features advanced rendering, physics, AI, audio, networking, and a full toolchain for game development.

Primary Use Cases

  • ▸AAA 3D games on PC and consoles
  • ▸VR/AR immersive experiences
  • ▸Architectural and engineering visualization
  • ▸Simulations and training applications
  • ▸High-fidelity real-time rendering

Notable Features

  • ▸High-end PBR rendering and global illumination
  • ▸Visual scripting via Schematyc
  • ▸Integrated Sandbox Editor for world building
  • ▸CryPhysics and character animation system
  • ▸Cross-platform deployment (Windows, PlayStation, Xbox)

Origin & Creator

CryEngine was developed by Crytek in 2000 for their debut title Far Cry. Over the years, it evolved through multiple versions and was released as a royalty-free engine with full source code access.

Industrial Note

CryEngine dominates in photorealistic AAA game development, VR/AR experiences, military/flight simulations, and high-end interactive visualization requiring cutting-edge rendering and physics.

Quick Explain

  • ▸CryEngine provides a complete ecosystem including a visual editor, sandbox tools, and scripting with C++ and Lua for full control over game logic.
  • ▸It includes a physically-based rendering (PBR) pipeline, real-time global illumination, advanced AI and animation systems, physics, audio, and networking.
  • ▸CryEngine is used in AAA games, VR simulations, architectural visualization, and research projects requiring photorealistic 3D graphics.

Core Features

  • ▸Entity-component system
  • ▸Real-time 3D rendering
  • ▸Advanced AI and navigation
  • ▸Audio middleware integration
  • ▸Networking and multiplayer support

Learning Path

  • ▸Learn C++ basics
  • ▸Understand CryEngine entities/components
  • ▸Practice Sandbox Editor
  • ▸Add Flow Graph or Lua scripts
  • ▸Deploy AAA-quality levels

Practical Examples

  • ▸AAA shooter like Far Cry
  • ▸VR architectural walkthrough
  • ▸Flight simulator
  • ▸Physics-based sandbox game
  • ▸Real-time photorealistic demo

Comparisons

  • ▸CryEngine vs Unreal: CryEngine smaller AAA footprint vs Unreal ecosystem
  • ▸CryEngine vs Unity: CryEngine high-fidelity graphics vs Unity cross-platform ease
  • ▸CryEngine vs Godot: CryEngine AAA focus vs Godot indie-friendly
  • ▸CryEngine vs Frostbite: CryEngine open source vs proprietary AAA tech
  • ▸CryEngine vs Panda3D: CryEngine commercial AAA vs Panda3D Python prototyping

Strengths

  • ▸AAA-level graphics and photorealism
  • ▸Full source code access
  • ▸Comprehensive world-building tools
  • ▸Advanced physics and AI systems
  • ▸Strong VR/AR support

Limitations

  • ▸Steep learning curve for beginners
  • ▸Heavier system requirements
  • ▸Smaller user community compared to Unity/Unreal
  • ▸Complex C++ integration needed for custom systems
  • ▸Limited mobile support compared to other engines

When NOT to Use

  • ▸Mobile-first projects
  • ▸Small indie games with limited resources
  • ▸Rapid prototyping without C++ experience
  • ▸Lightweight 2D games
  • ▸Projects requiring large marketplace asset ecosystem

Cheat Sheet

  • ▸Entity = game object
  • ▸Component = behavior module
  • ▸Flow Graph = visual scripting
  • ▸Level = scene container
  • ▸Sandbox = main editor

FAQ

  • ▸Is CryEngine free?
  • ▸Yes - royalty-free with optional revenue share.
  • ▸Does it support consoles?
  • ▸Yes - PS and Xbox supported.
  • ▸Can it handle VR?
  • ▸Yes - Oculus, OpenVR integration.
  • ▸Is it beginner-friendly?
  • ▸Steep learning curve for newcomers.
  • ▸Does it offer full source code?
  • ▸Yes - full C++ source code access.

30-Day Skill Plan

  • ▸Week 1: Sandbox Editor basics
  • ▸Week 2: Entity-component system
  • ▸Week 3: Materials, lighting, shaders
  • ▸Week 4: AI and physics integration
  • ▸Week 5: Multiplayer and VR

Final Summary

  • ▸CryEngine is a AAA-grade 3D engine for games, VR/AR, and visualization.
  • ▸Features high-fidelity graphics, Sandbox Editor, PBR, physics, AI, and networking.
  • ▸Open-source access allows full customization and control.
  • ▸Ideal for photorealistic, immersive, and complex 3D projects.
  • ▸Best suited for experienced developers targeting AAA-quality outcomes.

Project Structure

  • ▸GameSDK/ - engine assets and samples
  • ▸Projects/ - user projects
  • ▸Scripts/ - Lua/C++ logic
  • ▸Levels/ - scene files
  • ▸Config/ - engine/project settings

Monetization

  • ▸Commercial AAA games
  • ▸VR/AR experiences
  • ▸Simulation/training software
  • ▸Licensing for architectural visualization
  • ▸Optional royalty model

Productivity Tips

  • ▸Use Sandbox templates
  • ▸Leverage Flow Graph/Schematyc
  • ▸Optimize assets before import
  • ▸Profile early and often
  • ▸Organize entity/component libraries

Basic Concepts

  • ▸Entity: core object in game world
  • ▸Component: reusable behavior module
  • ▸Flow Graph/Schematyc: visual logic scripting
  • ▸Level: 3D scene container
  • ▸Material: shader/texture definition

Official Docs

  • ▸https://docs.cryengine.com
  • ▸https://www.cryengine.com
  • ▸https://github.com/CRYTEK/CRYENGINE

More Cryengine Typing Exercises

CryEngine C++ Entity ExampleCryEngine Entity Move ExampleCryEngine Entity Rotate ExampleCryEngine Entity Scale ExampleCryEngine Entity Toggle VisibilityCryEngine Entity Destroy on CollisionCryEngine Entity Follow PlayerCryEngine Flashing Light EntityCryEngine Timed Destroy Entity

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher