100% found this document useful (2 votes)
13 views

CryENGINE Game Programming with C C and Lua 1st Edition Lundgren instant download

The document provides information about the book 'CryENGINE Game Programming with C++, C#, and Lua', detailing its content, structure, and authors. It includes links to various related programming books and resources for instant digital downloads. The book covers topics such as game AI, custom entities, game rules, and more, aimed at developers using CryENGINE.

Uploaded by

rozzodilagnc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
13 views

CryENGINE Game Programming with C C and Lua 1st Edition Lundgren instant download

The document provides information about the book 'CryENGINE Game Programming with C++, C#, and Lua', detailing its content, structure, and authors. It includes links to various related programming books and resources for instant digital downloads. The book covers topics such as game AI, custom entities, game rules, and more, aimed at developers using CryENGINE.

Uploaded by

rozzodilagnc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

CryENGINE Game Programming with C C and Lua 1st

Edition Lundgren download

https://ebookgate.com/product/cryengine-game-programming-with-c-
c-and-lua-1st-edition-lundgren/

Get Instant Ebook Downloads – Browse at https://ebookgate.com


Get Your Digital Files Instantly: PDF, ePub, MOBI and More
Quick Digital Downloads: PDF, ePub, MOBI and Other Formats

Learning Game AI Programming with Lua 1st Edition David


Young

https://ebookgate.com/product/learning-game-ai-programming-with-
lua-1st-edition-david-young/

Programming With C 3rd Edition Bl Juneja

https://ebookgate.com/product/programming-with-c-3rd-edition-bl-
juneja/

Programming with ANSI C 2nd ed Edition Trivedi

https://ebookgate.com/product/programming-with-ansi-c-2nd-ed-
edition-trivedi/

Linear programming with MATLAB 1st Edition Michael C.


Ferris

https://ebookgate.com/product/linear-programming-with-matlab-1st-
edition-michael-c-ferris/
Fundamentals of Computer Programming with C The
Bulgarian C Book 1st Edition Svetlin Nakov

https://ebookgate.com/product/fundamentals-of-computer-
programming-with-c-the-bulgarian-c-book-1st-edition-svetlin-
nakov/

Learn 2D Game Development with C 1st Edition Jebediah


Pavleas

https://ebookgate.com/product/learn-2d-game-development-
with-c-1st-edition-jebediah-pavleas/

Programming Windows Store Apps with C 1st Edition


Matthew Baxter-Reynolds

https://ebookgate.com/product/programming-windows-store-apps-
with-c-1st-edition-matthew-baxter-reynolds/

An Introduction to Programming with C 6th Edition Diane


Zak

https://ebookgate.com/product/an-introduction-to-programming-
with-c-6th-edition-diane-zak/

Object Oriented Programming with C 2 e Second Edition


Sahay

https://ebookgate.com/product/object-oriented-programming-
with-c-2-e-second-edition-sahay/
CryENGINE Game Programming with C++, C#,
and Lua
Table of Contents
CryENGINE Game Programming with C++, C#, and Lua
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Introduction and Setup
Installing Visual Studio Express 2012
Choosing your CryENGINE installation type
Downloading the book's CryENGINE sample installation
What just happened?
Using a custom or newer CryENGINE installation
Verifying that the build is functional
Integrating CryMono (C# support)
Compiling the CryMono project
Loading and initializing CryMono via the CryGame.dll library
Including the CryMono interface folder
Initializing CryMono at start up
Registering flow nodes
Registering your CryDev account
What just happened?
Running the sample application
Editor
Starting the Editor
Launcher
Starting the Launcher
Dedicated server
Compiling the CryGame project (C++)
What just happened?
The CE Game Programming Sample solution breakdown
CryGame
CryAction
CryCommon
The CryENGINE folder structure
PAK files
File query priority
Attaching the debugger
What just happened?
Summary
2. Visual Scripting with Flowgraph
Concept of flowgraphs
Opening the Flowgraph Editor
A tour of the Flowgraph Editor
Components
Terminology
Component categories
Flowgraph types
AI Actions
UI Actions
Material FX
FG Modules
Entities
Prefabs
Creating a flowgraph
The flowgraph entity
Spawning FlowgraphEntity
Attaching a new flowgraph
Adding nodes into flowgraphs
Input and output ports
Port types
Target entities
Linking flownodes
Testing our flowgraph
The stock flownode overview
Building a clock
Listening for player input
Executing on a loop
Flowgraph modules
Creating a module
Calling a module
Module parameters/ports
Custom flownodes
Creating a custom node in C++
Organizing nodes
Creating a new node file
Breaking down of code
The node functions overview
Implementing GetConfiguration
Creating ports
Assigning arrays to the node configuration
Flownode configuration flags
Implementing ProcessEvent
Creating a custom node in C#
Adding inputs
Adding outputs
Implementing Activate
Target entities
Summary
3. Creating and Utilizing Custom Entities
Introducing the entity system
Entity classes
Entities
entityId
EntityGUID
Game objects
The entity pool system
Creating a custom entity
Creating an entity using Lua
Common Lua entity callbacks
Creating an entity in C#
Adding Editor properties
Property folders
Creating an entity in C++
Creating a custom entity class
Implementing a property handler
Entity flownodes
Creating an entity flownode in Lua
Creating an entity flownode using C#
Creating an entity flownode in C++
Registering the entity node
The final code
Game objects
Game object extensions
Creating a game object extension in C++
Activating our extension
Summary
4. Game Rules
Introduction to game rules
IGameRules interface – game rules
Scripting – game modes
Loading a level
Implementing the game rules interface
Registering the game object extension
Creating custom game modes
Scripting
Lua scripting
Invoking methods
Invoking methods with parameters
Getting values returned from Lua
Getting table values
CryMono scripting
Calling methods
Return values
Properties
Fields
Creating a basic game mode in C#
Defining our intention
Creating the actor
Spawning the actor
Handling disconnections
Assigning the player to a team
Implementing Headquarters
Adding the end game event
Creating the Headquarters entity
Detour – trigger bounds and entity areas
Populating the level
Summary
5. Creating Custom Actors
Introducing the actor system
Channel identifiers
Actor spawning
Removing actors
The view system
Linking views to game objects
Creating custom actors
Creating actors in C#
The CryMono class hierarchy
Using native and CryMono actors alongside each other
C++ actor registration
C# declaration
Creating actors in C++
Registering actors
Camera handling
Implementing IGameObjectView
Creating a top-down camera
View rotation
Player inputs
The hardware mouse
Action maps
Listening for action map events
IActionListener
Enabling action map sections
Animated characters
Movement requests
Adding a movement request
The Mannequin animation system
The Mannequin Editor
Preview setup
Creating contexts
Creating fragments
Adding options
Creating and using tags
Appending tags to Options
Saving
Starting fragments
Acquiring the fragment identifier
Queuing the fragment
Setting tags
Forcing actions into requerying options
Debugging Mannequin
Setting up Mannequin for a custom entity
Initializing Mannequin
Loading the controller definition
Setting the active context
Summary
6. Artificial Intelligence
The Artificial Intelligence (AI) system
Scripting
AI actors
Goal pipes
Creating custom pipes
Selecting pipes
Signals
AI behaviors
Sample
IAIObject
Creating custom AI
Registering an AI actor implementation
In C#
In C++
Creating the AI entity definition
AI behaviors and characters
Understanding and using behavior selection trees
Variables
Signal variables
Leaves / behavior queries
Character
NavigationType
Creating custom behaviors
Listening to signals
AI base definition breakdown
The AISample_x table
The Properties table
The AIMovementAbility table
The CreateAI function
The RegisterAI function
Summary
7. The User Interface
Flash movie clips and UI graphs
Elements
XML Breakdown
Actions
Creating a main menu
Creating menu elements
Exposing ActionScript assets
Functions
Events
Variables
Arrays
Exposing MovieClip instances to flowgraph
Creating the UI actions
Creating the state control graph
Creating the MainMenu action
Adding buttons
End result
Engine ActionScript callbacks
Creating UI game event systems
Implementing IUIGameEventSystem
Receiving events
Dispatching events
Dispatching the event
Summary
8. Multiplayer and Networking
The networking system
Network identifiers
Net channels
Net nubs
Setting up a multiplayer game
Starting the server
Dedicated server
Launcher
Connecting to a server via the console
Debugging networked games
Networking using game object extensions
Remote Method Invocation (RMI)
RMI structure
Parameters
Attach type
Server/client separation
Function definition
RMI example
Network aspect serialization
Aspects
Compression policies
Creating a new compression policy
Exposing Lua entities to the network
Net.Expose
Function implementation
Invoking RMIs
On the server
On all clients
On all other clients
Binding our entity to the network
Summary
9. Physics Programming
CryPhysics
Physicalized entity types
Introducing physical entity identifiers
Drawing entity proxies
Entity types
Helper types
Physical entity actions, parameters, and status
Parameters
Actions
Status
Physicalized entity type details
Common parameters
Common actions
Common statuses
Static
Rigid
Wheeled vehicle
Unique parameters
Unique statuses
Unique actions
Living
Unique parameters
Unique statuses
Unique actions
Particle
Unique parameters
Articulated
Unique parameters
Rope
Unique parameters
Soft
Unique parameters
Unique actions
Ray world intersections
The ray_hit struct
Commonly used member variables
Origin and direction
Object types and ray flags
Object types
Ray flags
Allowing multiple ray hits
Creating a physicalized entity
In C++
In C#
Simulating explosions
Summary
10. Rendering Programming
The renderer details
Shaders
Shader permutations
Shader cache
PAK files
Render nodes
Rendering breakdown
Pre update
Post update
Rendering new viewports using render contexts
Rendering
Using the I3DEngine::RenderWorld function
I3DEngine::RenderWorld flags
Shaders
The shader description
Texture slots
Shader flags
Material flags
Engine flags
Runtime flags
Samplers
Using texture slots with samplers
Obtaining a texture
Manipulating static objects at runtime
Modifying materials at runtime
Cloning a material
Material parameters
Shader parameters
Example – Dynamic alpha-test for vegetation
Summary
11. Effects and Sound
Introducing effects
Material effects
Surface types
Adding or modifying surface types
Particle effects
Sound effects
FMOD Designer
Creating and triggering material effects
Automated playback based on physical interactions
Adding new surface types
Effect definitions
Triggering custom events
Animation-based events and effects
Spawning particle emitters
Exporting sounds by using FMod
Adding sounds to the project
Playing sounds
Using SoundSpots
Programmatically playing sound
Sound flags
Sound semantics
Summary
12. Debugging and Profiling
Debugging the game logic
Logging to the console and files
Log verbosity
Global log functions
The persistent debug
C++
C#
CryAssert
Profiling
Profile usages
Profiling in C++
Profiling in C#
The console
Console variables
Registering a CVar
In C++
In C#
Flags
Console variable groups
Cfg structure
System specifications
Console commands
Registering a console command in C#
Arguments
Creating a Console Command in C++
Summary
Index
CryENGINE Game Programming with C++, C#,
and Lua
CryENGINE Game Programming with C++, C#,
and Lua
Copyright © 2013 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the publisher, except
in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information
presented. However, the information contained in this book is sold without warranty, either express
or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held
liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and
products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot
guarantee the accuracy of this information.

First published: November 2013

Production Reference: 1151113

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-84969-590-9

www.packtpub.com

Cover Image by Carl-Filip Lundgren (<[email protected]>)


Credits
Authors

Filip Lundgren

Ruan Pearce-Authers

Reviewers

Terry Evans

Chris Parthemos

Hendrik Polczynski

Ross Rothenstine

Acquisition Editor

Sam Wood

Lead Technical Editor

Arun Nadar

Technical Editors

Anusri Ramchandran

Rohit Kumar Singh

Project Coordinator

Kranti Berde

Proofreaders

Dirk Manuel

Lindsey Thomas

Indexer

Rekha Nair

Graphics
Ronak Dhruv

Abhinash Sahu

Production Coordinators

Aditi Gajjar

Adonia Jones

Cover Work

Adonia Jones
About the Authors
Filip Lundgren is a Technical Director at Poppermost Production AB where he works on SNOW, the
first free-to-play open-world skiing title. Filip has been working with CryENGINE since 2007 with
the release of Crysis 1 SDK, and has developed community tools such as CryMono and the
CryENGINE toolbox.

Writing the book was a great experience and has involved the help of many CryENGINE community
members. Many thanks to the CryDev community and our reviewers for valuable input that helped
shape the book to what it is now.

Ruan Pearce-Authers is a game programmer currently working for Crytek GmbH. In 2009, he began
managing Crytek's development community, and providing technical support for CryENGINE users.
Prior to this, he was active in the Crysis modding community himself, and followed this up by
producing sample projects and additional tools for the Free SDK. He co-developed the CryMono
engine extension to bring support for .NET to the CryENGINE, and the Tanks game sample written
exclusively in C#. At present, Ruan works as part of the development team for Crytek's award-
winning entrance, into the free-to-play market, Warface, in Frankfurt.

I'd like to thank my family, my friends in the industry with whom I've worked on some amazing side
projects, and my wonderful girlfriend, Iulia, for supporting me constantly throughout the authoring of
this book.
About the Reviewers
Terry Evans is a software developer with a degree from the University of Utah. He has a diverse
background as a result of developing solutions in Unix, Linux, Windows, OS/2, Mac OS X, iOS, and
Android, but has always enjoyed developing games the most during his career. He is the founder and
currently lead developer for Entrada Interactive, which is developing a post-apocalyptic, multiplayer,
survival game titled Miscreated using CryENGINE 3. Visit MiscreatedGame.com for more
information on his latest venture.

Chris Parthemos is a recent entrant into the world of game development, but he has worked in
developing content for AAA games for major studios. His educational background includes a Masters
in Interactive Development from the Guildhall at Southern Methodist University, with a focus in
Design and Scripting.

Hendrik Polczynski is a Software Developer from Germany. He has been working on software for
over 10 years. He likes to take on a variety of different areas from industry automation to web, UI,
and game development. You can find his open source projects at github.com/hendrikp or on his
YouTube channel. Hendrik is maintaining a handful of open source projects around the CryDev
community and the CryENGINE 3 FreeSDK. When Hendrik is not working, he is studying for his
B.Sc. degree in Computer Science and Media Application, or helping out with the development of
Miscreated by Entrada Interactive, which is a post-apocalyptic, survival-based MMORPG unlike
anything you've played before.

Ross Rothenstine is an industry software engineer by day and hobbyist game programmer by night.
He has a staunch reputation at his college for turning any major course project into a playable game
by the end of it. He has a focus on Game Engine architecture and how complex subsystems come
about in an elegant manner to make extensible, robust, and most importantly, fun to design games. This
means quite a bit of time, reading, and coffee.

I would like to thank the authors of this book, as the content within it is pure, simple, and most of all,
needed. In my days of wanting to learn CryENGINE programming, and reading the documents and
code by hand, I had wished that a book like this would come about someday.
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files
available? You can upgrade to the eBook version at www.PacktPub.com and as a print book
customer, you are entitled to a discount on the eBook copy. Get in touch with us at
<[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range
of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library.
Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today
and view nine entirely free books. Simply use your login credentials for immediate access.
Preface
The process of developing and maintaining games has changed very rapidly in the last few years. It
has become more and more common for game developers to license third-party game engines, such as
CryENGINE, in order to focus fully on the game itself.

As the first game engine to ship with a pure What You See Is What You Play (WYSIWYP)
philosophy in mind, CryENGINE focuses on productivity and iteration by allowing developers to
jump directly into their games, previewing changes as they happen, and not waiting for levels and
assets to build.

For a programmer, CryENGINE is the ideal toolset. Development can be done in C++ using the
generous API, allowing developers to jump straight into the code and write high-performing code that
is not limited to obscure scripting languages. Got an idea? Fire up Visual Studio and get right to
work.
What this book covers
Chapter 1, Introduction and Setup, covers getting up to speed with a brief overview of the engine,
detailing its strengths, the possibilities it provides, and a step-by-step guide to set up your
environment.

Chapter 2, Visual Scripting with Flowgraph, introduces you to the visual scripting tool, giving an
easy passage to create game logic in an accessible visual manner.

Chapter 3, Creating and Utilizing Custom Entities, covers the entity system and how to use it to your
advantage. Populate your game world with entities that range from simple physicalized objects to
complex weather simulation managers.

Chapter 4, Game Rules, provides you with an in-depth look into the game rules system, giving you a
standardized template for overarching game and session logic. It also teaches how to implement your
own custom game modes in a variety of languages.

Chapter 5, Creating Custom Actors, details the creation of custom actor classes for both player-
controlled entities and the basis of artificial intelligence.

Chapter 6, Artificial Intelligence, covers the process of creating a living and breathing world by
using the built-in artificial intelligence solution.

Chapter 7, The User Interface, details the process of using Flash and Autodesk Scaleform to spice up
your interface with everything from simple on-screen bitmaps to rendering interactive flash elements
in the game world.

Chapter 8, Multiplayer and Networking, covers the work behind taking the engine online, and
learning how to synchronize the game world across the network.

Chapter 9, Physics Programming, covers the inner workings of the physics system, and the process
of creating physical interactions for everything from the largest of vehicles to the smallest particle
effect.

Chapter 10, Rendering Programming, helps you to learn how the rendering system works, and how
to use it to create and expand everything from render nodes to multiple viewports.

Chapter 11, Effects and Sound, details the workings of the FMod sound engine in use by
CryENGINE, allowing you to implement convincing sound for your project.

Chapter 12, Debugging and Profiling, covers common ways of debugging your game, and the basics
of using the console.
What you need for this book
CryENGINE 3 Free SDK v3.5.4
CryMono v0.7 for CryENGINE 3.5.4
Visual Studio Express 2012
Notepad++
FMod
Who this book is for
This book has been written for developers with a basic working knowledge of using CryENGINE and
its Editor, and in some cases will assume the reader knows about very basic features such as loading
a level in the Editor, and placing an entity. If you have never worked with CryENGINE before, we
recommend either playing around with the CryENGINE Free SDK on your own, or purchasing
CryENGINE 3 Game Development: Beginner's Guide, by Sean Tracy and Paul Reindell.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of
information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The GFx element determines which Flash file should be
loaded for the element."

A block of code is set as follows:


<events>
<event name="OnBigButton" fscommand="onBigButton" desc="Triggered when a big
button is pressed">
<param name="id" desc="Id of the button" type="string" />
</event>
</events>
}

New terms and important words are shown in bold. Words that you see on the screen, in menus or
dialog boxes for example, appear in the text like this: "Once started, the UI graph with the specified
name will be activated, assuming it contains a UI:Action:Start node as shown:"
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book—what
you liked or may have disliked. Reader feedback is important for us to develop titles that you really
get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the
book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to
a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the
most from your purchase.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you
find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if
you would report this to us. By doing so, you can save other readers from frustration and help us
improve subsequent versions of this book. If you find any errata, please report them by visiting
http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form
link, and entering the details of your errata. Once your errata are verified, your submission will be
accepted and the errata will be uploaded on our website, or added to any list of existing errata, under
the Errata section of that title. Any existing errata can be viewed by selecting your title from
http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take
the protection of our copyright and licenses very seriously. If you come across any illegal copies of
our works, in any form, on the Internet, please provide us with the location address or website name
immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at <[email protected]> if you are having a problem with any aspect of
the book, and we will do our best to address it.
Chapter 1. Introduction and Setup
CryENGINE is known as one of the most extensible engines available due to its ability to portray a
vast variety of impressive visuals and gameplay. This makes it an invaluable tool at the hand of a
programmer, where the only limit is one's creativity.

In this chapter, we will cover the following topics:


Installing Visual Studio Express 2012 for Windows Desktop
Downloading the CryENGINE sample installation or using a custom engine install
Registering an account at http://www.crydev.net, the official CryENGINE development portal
Compiling a stripped-down CryGame library
Attaching and utilizing the debugger
Installing Visual Studio Express 2012
In order to compile the game code, you will need a copy of Visual Studio. For this demonstration,
we'll be using Visual Studio Express 2012 for Windows Desktop.
Note
If you already have Visual Studio 2012 installed, you may skip this step.

To install Visual Studio, follow the given steps:


1. Visit http://www.microsoft.com/visualstudio/ and download Visual Studio Express 2012 for
Windows Desktop.
2. After downloading the executable, install the application and proceed to the next step after
restarting your computer.
Choosing your CryENGINE installation type
Now that we have Visual Studio installed, we'll need to download a version of CryENGINE to
develop on.

We have created a stripped-down sample installation for the book, which is recommended for users
who are just starting out with the engine. To download it, see the following Downloading the book's
CryENGINE sample installation section.

If you would rather use another build of CryENGINE, such as the latest Free SDK release, please see
the Using a custom or newer CryENGINE installation section later in this chapter. This section will
cover integrating CryMono on your own.
Downloading the book's CryENGINE sample
installation
For this book, we will be using a custom CryENGINE sample as a base for learning the workings of
the engine. Most exercises in the book depend on this sample; however, the working knowledge you
get from this can be applied to the default CryENGINE Free SDK (available at
http://www.crydev.net).

To download the sample installation, follow these steps:


1. Visit https://github.com/inkdev/CryENGINE-Game-Programming-Sample and click on the
Download ZIP button in order to download a compressed archive containing the sample.
2. Once downloaded, extract the contents of the archive to a folder of your choice. For the sake of
the example, we will be extracting it to C:\Crytek\CryENGINE-Programming-Sample.
What just happened?
You should now have a copy of our sample CryENGINE installation. You can now run and view the
sample content which we will be using for the most part of this book.
Using a custom or newer CryENGINE installation
This section helps out the readers who choose to use custom or newer builds of the engine. If you are
unsure of this process, we recommend reading the Downloading the book's CryENGINE sample
installation section in this chapter.
Verifying that the build is functional
Before starting, you should verify that your version of CryENGINE is functional so that you can use it
for running and creating code based on this book's chapters.
Note
Note that if you are using an older or newer version of the engine, certain chapters may provide
examples and information on changed systems. Keep this in mind, and refer to the sample mentioned
previously for the optimal learning experience.

A good way to check this is by starting the Editor and Launcher applications and checking whether the
engine behaves as expected.
Integrating CryMono (C# support)
If you're interested in using the sample code and chapter contents written with C# in mind, you'll need
to integrate the third-party CryMono plugin into your CryENGINE installation.
Note
Note that CryMono is integrated by default in the sample we created specifically for this book.

To begin integrating CryMono, open the Code folder present in the engine root folder. We'll be
placing the source files here, inside a subfolder called CryMono/.

To download the source code, visit https://github.com/inkdev/CryMono and click on Download Zip
(or Clone in Desktop if you prefer using your Git revision control client).

Once downloaded, copy the contents into the Code/CryMono folder we mentioned earlier. If the
folder does not exist, create it first.

When the files have been successfully moved, your folder structure should look similar to this:

Compiling the CryMono project


Now that we have the CryMono source code, we'll need to compile it.

To start, open Code/CryMono/Solutions/CryMono.sln using Visual Studio.


Note
Make sure to use CryMono.sln and not CryMono Full.sln. The latter is only used when you need to
rebuild the entire Mono runtime, which ships precompiled with the CryMono repository.

Before we compile, we'll need to modify the engine's SSystemGlobalEnvironment struct (this is
exposed using the global gEnv pointer).

To do so, open ISystem.h in the Code/CryEngine/CryCommon/ folder. Find the struct's definition
by searching for the struct SSystemGlobalEnvironment.

Then add the following code to the very end of the struct's members and functions:
struct IMonoScriptSystem*
pMonoScriptSystem;

Note
Modifying interfaces is not recommended if you do not have full engine source, as other engine
modules have been compiled with the default interfaces in mind. However, appending to the end of
this struct is mostly harmless.

Once done, open up the instance of Visual Studio where you opened CryMono.sln and start
compiling.
Note
The automated post-build step in the project should automatically move the compiled files to your
build's Bin32 folder following a successful compilation pass.

To verify that CryMono was compiled successfully, search for CryMono.dll in your Bin32 folder.
Loading and initializing CryMono via the CryGame.dll library
Now that we have the CryMono binaries present in our Bin32 folder, we'll just have to load it during
game startup. This is done via the CryGame project, via the CGameStartup class.

To start, open your CryEngine or CryGame solution file (.sln) present in Code/Solutions/.
Including the CryMono interface folder

Before we modify the game startup code, we'll need to tell the compiler where to find the CryMono
interfaces.

Start by right-clicking on the CryGame project in Visual Studio's Solution Explorer and select
Properties. This should bring up the following CryGame Property Pages window:
Now, click on C/C++ and select General. This will bring up a screen of general compiler settings,
which we'll use to add an additional include folder as shown in the following screenshot:
Now all we have to do is add ..\..\CryMono\MonoDll\Headers to the Additional Include
Directories menu. This will tell the compiler to search CryMono's Headers folder when the
#include macro is used, allowing us to find the CryMono C++ interfaces.

Initializing CryMono at start up

Open GameStartup.h in the CryGame project and add the following to the bottom of the class
declaration:
static HMODULE
m_cryMonoDll;

Then open GameStartup.cpp and add the following before the CGameStartup constructor:
HMODULE CGameStartup::m_cryMonoDll = 0;

Now navigate to the CGameStartup destructor and add the following code:
if(m_cryMonoDll)
{
CryFreeLibrary(m_cryMonoDll);
m_cryMonoDll = 0;
}

Now navigate to the CGameStartup::Init function declaration, and add the following prior to the
REGISTER_COMMAND("g_loadMod", RequestLoadMod,VF_NULL,""); snippet:

m_cryMonoDll = CryLoadLibrary("CryMono.dll");
if(!m_cryMonoDll)
{
CryFatalError("Could not locate CryMono DLL! %i", GetLastError());
return false;
}

auto InitMonoFunc =
(IMonoScriptSystem::TEntryFunction)CryGetProcAddress(m_cryMonoDll,
"InitCryMono");
if(!InitMonoFunc)
{
CryFatalError("Specified CryMono DLL is not valid!");
return false;
}

InitMonoFunc(gEnv->pSystem, m_pFramework);

Now all we have to do is compile CryGame in order to have CryMono loaded and initialized at
startup.
Registering flow nodes

Due to a recent change in the flow system, flow nodes have to be registered at a certain point during
game startup. To make sure that our C# nodes are registered, we'll need to call
IMonoScriptSysetm::RegisterFlownodes from IGame::RegisterGameFlowNodes.

To do this, open Game.cpp and add the following inside the CGame::RegisterGameFlowNodes
function:
GetMonoScriptSystem()->RegisterFlownodes();

Now, after compiling, all managed flow nodes should appear in the Flowgraph Editor.
Other documents randomly have
different content
"Now," said Stark. "What of Delgaun and Berild?"
Fianna said softly, "Their truth, too, is simple. They took Kynon's idea
of empire, and stretched it further. It was Delgaun's idea to bring the
strangers in. They would use Kynon and the tribes until the victory
was won. Then they would do away with Kynon and rule themselves
—with the outlanders and their ships and their powerful weapons to
oppress Low-Canaller and Drylander alike.
"That way, they could rape a world. More outland vultures would
come, drawn by the smell of loot. The Martian men would fight as
long as there was the hope of plunder—after that, they would be
slaves to hold the empire. Their masters would grow fat on tribute
from the City-States and from the men of Earth who have built here,
or who wish to build. An evil plan—but profitable."
Stark thought about Knighton and Walsh of Terra, Themis of Mercury,
Arrod of Callisto Colony. He thought of others like them, and what
they would do, with their talons hooked in the heart of Mars. He
thought of Delgaun's yellow eyes.
He thought of Berild, and he was sick with loathing.
Fianna came close to him, speaking in a different tone that had care
and anxiety only for him.
"I have told you this, because I know what Berild plans. Tonight—oh,
tonight is a black and evil time, and death waits in Sinharat! It is very
close to me, I know. And you must follow your own heart, Eric John
Stark. I cannot tell you more."
He kissed her again, because she was sweet and very brave. Then
she led him on through the dark labyrinth, to where Berild was
waiting, with her dangerous beauty and all the evil of the ages in her
soul.

X
They came out of the darkness so suddenly that Stark blinked in the
unaccustomed light of torches set in great silver sconces on the walls.
The floor had been artificially smoothed, but otherwise this crypt was
as the eroding action of the sea had shaped it out of the coral reef. It
was not large, and it was like a cavern in a fairy tale, walled and
roofed with the fantastic wreathing shapes of the rose-red coral. At
one end there was a golden coffer set with flaming jewels.
Berild was there. Her wonderful hair was dressed and shining, and
her body was clothed all in white, her arms and shoulders warm
bronze from the kiss of the desert sun.
Kynon was there, also. He stood motionless and silent, and he did not
so much as turn his head when Fianna and Stark came in. His eyes
were wide open and blank as a blind man's.
"I have been waiting," said Berild, "and the time is short."
She seemed angry and impatient, and Stark said, "Freka is dead. It
was necessary to hide his body."
She nodded and turned to the girl. "Go now, Fianna."
Fianna bent her head and went away. She did not look at Stark. It
was as though she had no interest in anything that happened.
Stark looked at Kynon, who had not moved or spoken.
"He is safe enough," said Berild, answering Stark's unspoken
question. "I drugged his wine so that his mind was opened to mine,
and he is my creature as long as I will it."
Hypnosis, Stark thought. His nerves were beginning to do strange
things. He wished desperately that he were back in the cell facing
Freka's sword, which at least would deal with him openly and without
guile or subterfuge.
Berild set her hands on Stark's shoulders, and smiled as she had
done that night by the ancient well.
"I offer you three things tonight, wild man," she said. Her eyes
challenged him, and the scent of her hair was sweet and maddening.
"Your life—and power—and myself."
Stark let his hands slip lightly down from her shoulders to her waist.
"And how will you do this thing?" he asked.
"Easily," she said, and laughed. She was very proud, and sure of her
strength, and glad to be alive. "Oh, very easily. You guessed the truth
about me—I am of the Twice-Born, the Ramas. I hold the secret of
the Sending-on of Minds, which this great ox Kynon pretended to
have. I can give you life now—and forever. Remember, wild man—
forever!"
He bent his dark face to hers, so that their lips touched, and
murmured, "Would I have you forever, Berild?"
"Until you tire of me—or I of you." She kissed him, and then added
mockingly, "Delgaun has had me for a thousand years, and I am
weary of him. So very weary!"
"A thousand years is a long time," said Stark, "and I am not
Delgaun."
"No. You're a beast, a savage, a most magnificent cold-eyed animal,
and that is why I love you." She touched the muscle of his breast,
and then his throat, and added, "It's a pity there will never be
another body like this one. We must keep it as long as we can."
"What is your plan?" Stark asked her.
"Simply this. I will place your mind in Kynon's body. You will be
Kynon, with all his power. You will be able then to keep Delgaun in
check—later, you can destroy him, but not until after the battle is
won, for we need the men of Valkis and Jekkara. You can keep your
own body safe from him, and at the worst, if by some chance he
should succeed in slaying the man he believes to be you, you will still
be alive."
"And after the battle," said Stark softly. "What then, Berild?"
"We will rule together." She held his palms against hers. "You have
strong hands, wild man. Would you not like to hold a world between
them—and me?"
She looked up at him, her eyes suddenly shrewd and probing. "Or do
you still believe the nonsense you talked to Kynon, about the tribes?"

Stark smiled. "It's easy to have principles when there's no gain


involved. No. I am as my name says—a man without a tribe. I have
no loyalties. And if I had, would I remember them now?"
He held her, as she had said, between his hands, and they were very
strong.
But even then, Berild could warn him.
"Keep faith with me, then! My wisdom is greater than yours, and I
have powers you don't dream of. What I give, I can take away."
For answer, Stark silenced her mouth with his own.
When she drew away, she said rather breathlessly, "Let us hurry. The
tribes are gathered, and Kynon was to have given the signal for war
at dawn. There is much I must teach you between now and then."
She paused with her hand on the lid of the golden coffer. "This is a
secret place," she said quietly. "Since before the ocean died, it has
been secret. Not even Kynon knew of it. I think only Delgaun and I,
the last of the Twice-Born, knew—and now you."
"What about Fianna?"
Berild shrugged. "She is only my servant. To her, this is only a little
cavern where I keep my private wealth."
She pressed a series of patterned bosses in intricate sequence, and
there was the sharp click of an opening lock. A shiver ran up along
Stark's spine. The beast in him longed to run, to be away from this
whole business that smelled of evil. But the man in him knelt at
Berild's wish, and waited, and did not flinch when the blank-eyed
Kynon came like a moving corpse beside him.
Berild raised the golden lid. And there was a great silence.
On the slave block of Valkis, Kynon had brought forth two crowns of
shining crystal, and a rod of flame. As glass is to diamond, as the
pallid moon to the light of the sun, were those things to the reality.
In her two hands Berild held the ancient crowns of the Ramas, the
givers of life. Twin circlets of glorious fire, dimming the shallow glare
of the torches, putting a nimbus of light around the white-clad
woman so that she was like a goddess walking in a cloud of stars.
Stark's whole being contracted to a point of icy pain at the beauty
and the wonder and the terror of them.
She set one crown on Kynon's head, and even the drugged
automaton shivered and sighed at its touch.
Stark's mind veered away from the incredible thing that was about to
happen. It spoke words to him, hurried desperate words of sanity,
about the electrical patterns of the mind, and the sensitivity of
crystals, and conductors, and electro-magnetic impulses. But that
was only the top of his brain. At base it was still the brain of N'Chaka
that believed in gods and demons and all the sorceries of darkness.
Only pride kept him from cowering abjectly at Berild's feet.
She stood above him, a creature of dreams in the unearthly light. She
smiled and whispered, "Do not fear,"—and she placed the second
crown upon his head.
A strange, shuddering fire swept through him. It was as though some
chip of the primal heart of all creation had been set by an unguessed
magic into the cells of the crystal. The force that shaped the universe
and scattered forth the stars, and set the great suns to spinning.
There was something awesome about it, something almost holy.
And yet he was afraid. Most shockingly afraid.
His brain was set free, in some strange fashion. The walls of his skull
vanished. His mind floated in a dim vastness. It was like a tiny sun,
glowing, spinning, swelling....
Berild lifted a crystal rod from the coffer, a wand of sorcerous fire.
And now Stark's thoughts had lost all track of science. A cloud of
misty darkness flowed around him, thickened....
A great leaping flare of light, a distant echo of a cry that he did not
recognize as his own, and then....
Nothing.

XI

He was lying on his face, his cheek pressed against the cool coral. He
opened his eyes, his mind groping for the shreds of some
remembered terror. He saw, vaguely at first and then with terrible
clarity as his vision became clear, a man lying close beside him.
A tall man, very strongly built, with skin burned almost to blackness
by exposure. A man who looked at him with eyes that were
startlingly light in his dark face....
His own eyes. His own face.
He cried out and struggled to his feet, trembling, staggering, and his
body felt strange to him. He looked down upon the strangeness of
another man's limbs, the alien shaping of flesh and sinew upon alien
bones.
The face of the dark giant who lay upon the coral mocked him. It
watched, but did not see. The eyes were blank, empty, without soul
or intelligence.
The mind of Eric John Stark fought, in its alien prison, for sanity.
Berild's voice spoke to him. Her hand was on his shoulder—Kynon's
shoulder....
"All is well, wild man. Do not fear. Kynon's mind is in your body, still
sleeping at my command. And you are Kynon now."
It was not an easy thing to accept, but he knew that it was so, and
he knew that he had wished it to be so. It was easier to be calm after
he turned his back on the other.
Berild took him in her arms and held him until he had stopped
shuddering, oddly like a mother with a frightened child. Then she
kissed him, smiling, and said,
"The first time is hard. I can remember—and that was very long
ago." She shook him gently. "Now come. We'll take your body to a
place of safety. And then I must tell you all of Kynon's plans for those
outside."
She spoke to the thing that lay upon the coral, saying, "Get up," and
it rose obediently and followed where Berild led, to a tiny barred
niche in a side passage. It made no protest when it was left, locked
safely in.
"Only I can give it back to you," said Berild softly. "Remember that."
Stark said, "I will remember."
He went with Berild to Kynon's quarters in the palace. He sat among
Kynon's possessions, clothed in Kynon's flesh, and learned how
Kynon's mind had planned to loose a red tide upon the peaceful cities
of the Border.
Only a small part of his mind was attentive to this. The rest of it was
concerned with the redness of Berild's hair and the warmth of her
lips, and with the heady knowledge that it was possible to be alive
and young forever.
Never to lose the pride of strength, never to know the dimming sight
and failing mind of age. To go on, like a child in an endless
playground, with no fear of tomorrow.
It was nearly dawn.
Berild rose. She had told him much, but not the things Fianna had
told him, of the secret treachery she had planned with Delgaun. She
helped Stark to clothe Kynon's body in the harness of war, with the
longsword and the shield and the shining spear. Then she set her lips
to his so that his borrowed heart threatened to choke him with its
pounding, and her eyes were wondrously bright and beautiful.
"It is time," she whispered.
She walked beside him, as he had seen her beside Kynon in Valkis,
stepping like a queen.
They came out of the palace, onto the steps where Luhar had died.
There were beasts waiting, trapped for war, and an escort of tall
chiefs, with pipers and drummers and link-boys to light the way.
Stark mounted Kynon's beast. It sensed the wrongness in him,
hissing and rearing, but he held it down, and imperiously raised his
hand.
Throbbing drums and skirling pipes, tossing flames where the link-
boys ran with the torches, a clash of metal and a cheer, and Kynon of
Shun rode down through the streets of Sinharat to the coral cliffs,
with the red-haired woman at his side.
They were waiting.

The men of Kesh and the men of Shun were gathered below the
cliffs, waiting. Stark led the way, as Berild had told him to, onto a
ledge of coral above them. Delgaun was there, with the outlanders
and a handful of Valkisians. He looked tired and ill-tempered. Stark
knew that he had been busy for hours with last-minute preparations.
The first pale rays of dawn broke across the desert. A vast ringing cry
went up from the gathered armies. After that there was silence, a
taut expectant hush.
There was no fear in Stark now. He was past that. Fear was too small
an emotion for what was about to be.
He saw Delgaun's golden eyes, hot with a cruel excitement. He saw
Berild's secret triumph in her smile. He looked down upon the
warriors, and let the magnificent voice of Kynon ring out across the
soundless air.
"There will be no war," he said. "You have been betrayed."
In the moment that was left to him, he confessed the lie of the Rama
crowns. And then Berild, who was behind him now, had moved like a
red-haired fury to drive her dagger into his heart.
In his own body, Stark might have escaped the blow. But the reflexes
of Kynon were not as his. They were swift enough to postpone death
—the blade bit deep, but not where Berild had wished it. He turned
and caught her by the wrists, and said to Delgaun,
"She has betrayed you, too. Freka lies in a coral pit—and I am not
Kynon."
Berild tore away from him. She spurred her beast toward the
Valkisian. She would have broken past him, through the escort, and
up the cliffs to safety in the tunnels under Sinharat. But Delgaun was
too quick.
She would have broken past him, but Delgaun was too quick.

One hand caught in the masses of her hair. She was dragged
screaming from the saddle, and even then her screams were not of
fear, but of fury. She clawed at Delgaun, and he fell with her to the
ground.
The tall chieftains of the escort came forward, but they were dazed,
and confused by the anger that was rising in them. Delgaun's wiry
body arched. He flung the woman over the ledge, and what
happened to her after that Stark did not see, nor wish to see.
He was shouting again to the barbarians, the tale of Delgaun's
treachery.
Behind him on the ledge there was turmoil where Delgaun ran on
foot between the beasts, and the outlanders made their try for safety.
Below him in the desert, where there had been silence, a great deep
muttering was growing, like the first growling of a storm, and the
ranks of spears rippled like wheat before the wind.
And Stark felt the slow running out of Kynon's blood inside him,
where Berild's dagger stood out from his back.
They had headed Delgaun away from the path up the cliff. The two
loose mounts had been caught and held. They had tried to catch
Delgaun, but he was light and fast and slipped away from them. Now
he broke back, toward Kynon's great beast.
Knock the dying man from the saddle, charge through the milling
chieftains, who were hampered by their own numbers in that narrow
space....
He leaped. And the arms of Kynon, driven by the will of Eric John
Stark, encircled him and held him and would not let him go.
The two men crashed to the ledge. Stark let out one harsh cry of
agony, and then was still, his hands locked around the Valkisian's
throat, his eyes intent and strange.
Men came up, and he gasped, "He is mine," and they let him be.
Delgaun did not die easily. He managed to get his dagger out, and
gashed the other's side until the naked ribs showed through. But
once again Stark's mind was free in some dark immensity of its own.
He was living again the dream he had in Valkis, and this was the end
of the dream. N'Chaka had a grip at last on the demon with yellow
eyes that hungered for his life, and he would not let go.
The yellow eyes widened. They blazed, and then they slowly dimmed
until the last flicker of life was gone. The strength went out of
N'Chaka's hands. He fell forward, over his prey.
Below, on the sand, Berild lay, and her outspread hair was as red as
blood in the fiery dawn.
The men of Kesh and the men of Shun flowed in a resistless tide up
over the coral cliffs. The chieftains and the pipers and the link-boys
joined them, hunting the outlanders and the wolves of Valkis through
the streets of Sinharat.
Unnoticed, a dark-haired girl ran down the path to the ledge. She
bent over the body of Kynon, pressing her hand to its heart. Tears
ran down and mingled with the blood.
A low, faint moan came from the man's lips. Weeping like a child,
Fianna drew a tiny vial from her girdle and poured three drops of pale
liquid on the unresponsive tongue.

XII

He had come a long way. He had been down in the deep black
valleys of the Place of Darkness, and the iron frost was in his bones.
He had climbed the bitter mountains where no creature of the
Twilight Belt might go and live.
There was light, now. He had been lost and wandering, but he had
won back to the light. His tribe, his people would be waiting for him.
But he knew that he would never see them.
He remembered, then, with the old terrible loneliness, that they were
not truly his people. They had raised him, but they were not of his
blood.
And he remembered also that they were dead, slain by the miners
who had needed all the water of the valley for themselves. Slain by
the miners who had taken N'Chaka and put him in a cage.
With a start of terror, he thought he was again in that cage, with the
leering bearded faces peering in at him. But in the blinding dazzle of
light he could see no bars.
There was only one face. The anxious, pitying face of a girl.
Fianna.
His brain began to clear. Memory returned bit by bit, the fragments
fitting themselves gradually into place.
Kynon. Delgaun. Berild. Sinharat, the Ever-Living.
He remembered now with perfect clarity that he was dying, and it
seemed a terrible thing to die in the body of another man. For the
first time, fully, he felt the separation from his own flesh. It seemed a
blasphemous thing, more terrible than death.
Fianna was weeping. She stroked his hair, and whispered, "I am so
glad. I was afraid—afraid you would never wake."
He was touched, because he knew that she loved him and would be
sad. He lifted his hand to touch her face, to comfort her.
He saw the fingers of that hand, dark against her cheek. Dark....
His own fingers. His own hand.
He was not on the ledge. He was back in the coral crypt beneath the
palace. The light that had dazzled his eyes was not the sun, but only
the flare of torches.
He sat up, his heart pounding wildly.
Kynon of Shun lay beside him on the coral. He was quite dead, his
head encircled by a crown of fire, his side open to the white bone
where Delgaun's blade had struck.
The wound that Kynon himself had never felt.
The golden coffer was open. The second crown lay near Fianna, with
the rod beside it.
Stark looked at her, deep into her eyes. Very softly he said, "I would
not have dreamed it."
"You will understand, now—many things," she said. "And I was glad
of my power today, because I could truly give you life!"
She rose, and he saw that she was very tired. Her voice was dull, as
though it counted over old things that no longer mattered.
"You see why I was afraid. If they had ever suspected that I, too,
was of the Twice-Born ... Berild or Delgaun, each alone, I might have
destroyed, but I could not destroy both of them. And if I had, there
was still Kynon. You did what I could not, Eric John Stark."
"Why were you against them, Fianna? How were you proof against
the poison that made them what they were?"
She answered angrily, "Because I am weary of evil, of scheming for
power and shedding the blood of men as though they were sheep! I
am no better than Berild was. I, too, have lived a long time, and my
hands are not clean. But perhaps, by what you helped me do, I have
made up a little for my sins."
She paused, her thoughts turned darkly inward, and it was strange to
see the shadow of age touching her sweet young face. Then she
said, very slowly, like an old, old woman speaking,
"I am weary of living. No matter where I go, I am a stranger. You can
understand that, though not so well as I. There is an end to pleasure,
and after that only loneliness is left.
"I have remembered that I was human once. That is why I set myself
against their plan of empire. After all these ages I have come round
full circle to the starting point, and things seem to me now as they
seemed then, before I was tempted by the Sending-on of Minds.
"It is a wicked thing!" she cried suddenly. "Against nature and the
gods, and it has never brought anything but evil!"
She caught up the rod and held it in her hands.
"This is the last," she said. "Cities die, and nations perish, and
material things, even such as these, are destroyed. One by one the
Twice-Born have perished also, through accident or swift disease or
murder, as Berild would have slain Delgaun. Now only this, and I, are
left."

Quite suddenly, she flung the rod against the coral, and it broke in a
cloudy flame and a tinkling of crystal shards. Then, one by one, she
broke the crowns.
She stood still for a long moment. Then she whispered, "Now only I
am left."
Again there was silence, and Stark was shaken by the magnitude of
the thing that she had done. Her slim girl's body somehow took on
the stature of a goddess.
After a while he went to her and said awkwardly, "I have not thanked
you, Fianna. You brought me here, you saved me...."
"Kiss me once, then," she answered, and raised her lips to his. "For I
love you, Eric John Stark—and that is the pity of it. Because I am not
for you, nor for any man."
He kissed her, very tenderly, and there was the bitter taste of tears
on her soft lips.
"Now come," she whispered, and took his hand.
She led him back through the labyrinth, into the palace, and then out
again into the streets of Sinharat. Stark saw that it was sunset, and
that the city was deserted. The tribes of Kesh and Shun had broken
camp and gone.
There was a beast ready for him, supplied with food and water.
Fianna asked him where he wished to go, and pointed the way to
Tarak.
"And you?" he asked. "Where will you go, little one?"
"I have not thought." She lifted her head, and the wind played with
her dark hair. She did not smile, and yet suddenly Stark knew that
she was happy.
"I am free of a great burden," she whispered. "I shall stay here for a
while, and think, and after that I shall know what to do. But
whatever it is there will be no evil in it, and in the end I shall rest."
He mounted, and she looked up at him, with a look that wrung his
heart although it was not sad.
"Go now," she said, "and the gods go with you."
"And with you." He bent and kissed her once again, and then rode
away, down to the coral cliffs.
Far out on the desert he turned and looked back, once, at the white
towers of Sinharat rising against the larger moon.
*** END OF THE PROJECT GUTENBERG EBOOK QUEEN OF THE
MARTIAN CATACOMBS ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookgate.com

You might also like