Chapter 5. C++ and Compiling Your Own Game Code

When discussing coding versus scripting, you know that scripting gives you the possibility to implement a lot of functionality without changing code. As you already learned in the previous chapter, you can easily add new entities and implement the behaviour in Lua. You can manipulate AI, script your UI, or use the Flow Graph to create game logic. But you are always limited to the functionality that is exposed to Lua/Flow Graph. Also, Lua is always slower in performance than C++.

With C++ there are no limitations, but be aware, if you create a bug in your script you might not get the expected result—a bug in C++ can easily crash the whole game!

In this chapter, you will learn how to use Visual Studio Express Edition to compile and debug CryENGINE 3. Further, you will learn how to expose new functions to Lua by writing code with C++.

In this chapter, we shall:

  • Install Visual C++ Express Edition
  • Compile game code and run CryENGINE 3 with your compiled game code
  • Attach CryENGINE to the Debugger and hit your first breakpoint
  • Create a new Lua entity
  • Expose a new C++ function to Lua
  • Learn a few C++ basics

So let's go and write some code!

Installing Visual C++ 2010 Express Edition

Programmers basically rule the world when it comes to game development. For this reason, having C++ game code released in the Free SDK for CryENGINE is an invaluable tool. I encourage everyone to download the freely available Visual C++ Express to, at the very least, explore the provided game code. This game code is designed to be a template to create your own games and has a huge array of possible functions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.251.128