Where can I learn how to code/build games with Lumberyard?



I`m currently trying to get into coding with c++ for lumberyard. I followed the tutorials how to set up everything properly and played a little bit with the editor. For now my problem is how to start with the coding. I have visual studio installed and opened the LumberyardSDK solution but I have no clue what I have to do next. In unity for example it is simple, you have to write behaivour scripts and attach them to game objects but what do I have to do in Lumberyard to build a "Game"? Seriously I couldnt find any tutorial about this wich could help me getting into this topic, so It would be nice if somone of you who already is further in getting into Lumberyard could help me with this.

asked 7 years ago323 views
7 Answers
Accepted Answer

Hello tiobald

The first suggestion I have is to look into this video [1] which describes some of the underlying theory of Lumberyard engine's coding architecture and shows a very quick demo of how core concepts as reflection, code generation, components, events and slices work.

Then, actually start making a project in which the object is to create a native C++ component that can be attached to a game entity in the editor.

  1. You will as a minimum need a Lumberyard project. It will be in charge of loading any gems that you create for your game. Open the <lumberyard_root_folder>\dev\Bin64, then run ProjectConfigurator.exe. Create a new project there and give it a name.

  2. Games in Lumberyard should be made as one or more gems. A gem is a way of isolating your own code from the engine code so that, imagine if you update your version of Lumberyard, you don't end up with a bunch of code that you have to untangle to update. Also it may make sense to break up the game into pieces for whatever reason, these would also be gems. Gem creation is covered here [2]. The structure of gems is discussed here [3] but you can basically assume that a gem contains assets that can be loaded, a code module, and some waf data to build the code module in the gem. [4]

     3. Gems in the latest release of Lumberyard (since contain code created as AZ Modules [5] (which is a good thing). These are the libraries (static .lib or dynamic .dll) that contain the built code. The AZ module source includes an interface derived from AZ::Module and this contains a system entity and adds any required system components to it (one by default). It will also come with an event bus by default, and a single system component. System components are singleton components [6]. The module is registered with the autogenerated code, e.g.

AZ_DECLARE_MODULE_CLASS(HelloWorld_010c14ae7f0f4eb1939405d439a9481a, HelloWorld::HelloWorldModule)

    4. You are also free to derive components from AZ::Component and include them in the gem. [7] Registering is as easy as the example code shows:

AZ_COMPONENT(MyComponent, "{0C09F774-DECA-40C4-8B54-3A93033EC381}");

  1. If you will need to store any information out of the component instances, it must have metadata added in a reflect function which tells Lumberyard what will be stored, or serialized. If it is to be seen in the editor, so that you can attach it to a game object, for example, you will need to add metadata in the reflect function which tell Lumberyard what it does in the editor, including what settings you can make on the component and how the UI looks in the editor. Reflection is simply the term used for any code you write that tells another part of the system how to use your class. You may say in the reflection code that a particular function needs to be called when data is changed by the editore, and you should also write these change callbacks in the component. [8]

  2. You should be able to create an entity in the editor now, and attach your component and set values in the object, and print them out or see them in the debugger.

  3. You should learn about slices and dynamic slices now, to get you to the level where you can start using code effectively in Lumberyard. [9]

Please let us know if you run into difficulties, and I will be happy to help,

Al Murray :) Solutions Architect Amazon Game Services

[1] https://youtu.be/mNulWXcJ1JA [2] http://docs.aws.amazon.com/lumberyard/latest/userguide/gems-system-gems.html [3] http://docs.aws.amazon.com/lumberyard/latest/userguide/gems-system.html [4] http://docs.aws.amazon.com/lumberyard/latest/developerguide/az-module-gems.html [5] http://docs.aws.amazon.com/lumberyard/latest/developerguide/az-modules-intro.html [6] http://docs.aws.amazon.com/lumberyard/latest/developerguide/az-module-parts.html [7] http://docs.aws.amazon.com/lumberyard/latest/developerguide/component-entity-system-create-component.html [8] http://docs.aws.amazon.com/lumberyard/latest/developerguide/component-entity-system-reflect-component.html [9] http://docs.aws.amazon.com/lumberyard/latest/developerguide/dynamic-slices.html

answered 7 years ago
profile picture
reviewed 2 months ago

As Cajunction says, You are probably better off using scripts to get the flow of the game worked out and then if needed add in C++ or assembly. If you do go assembly look into MASM. It is purely the best macro assembler ever or even asm{} in C++

I was under impression that maybe you wanted to delve into the core functions of interacting with the engine classes directly through your own code. It is possible to do so but again you need to KNOW coding C++ to get there.

For general stuff stick to scripts for now and through scripts you will learn the basics of C++ programming since C++ is just a lower level of scripts so the flow of code is identical in practice.

answered 7 years ago

Things are kind of shaky when you get to C++ here. Your best bet is to follow the tutorials and get use to the engines interface and hope the developers realize that not everyone using LY wants a cut and dried level building, crysis clone.

If you're like me and want to scrap the editor and build your own interface then you have to decipher it in the engines source directory .

<your drive>:\Amazon\Lumberyard\\dev\Code\CryEngine

It has no API documentation which is frustrating and the most of the code is undocumented. I find it quite challenging but it is doable although I am considering a different option at the moment..

answered 7 years ago


I think you are much more advanced then me, my current aim is to learn how to write games in general with lumberyard(using mostly c++ and not the flow graph) but there are none tutorials about how to build something with c++ or how to do something in lumberyard besides creating levels with the editor... But anyways thanks for your reply

answered 7 years ago


first of all thank you for your replys! Currently I already have knowlede in some languages and I`m following sonme tutorials about C++. My problem is how to do things with C++ in LY..Something like a documentation or video how to build a "wasd" input controller or even a hello world LY version would help me alot because I have to learn the basics of interaction between the code and the game(hope you get what i mean). The only tutorial I can find about Lumberyard wich uses C++ is about writing a gem, but I think this is not what im looking for. Sorry if its hard to understand me but english is not my first language.

answered 7 years ago

I imagine that is so , given most devs know c++ already, and they are concentrating on 'flow' because tho c++ I guess ( I'm not knowledgeable in c++ atm, working on it as well) is faster ,where you need speed, flow is usually enough for scripting needs, which is usually sufficient for many purposes unless you are going deep into code , for things not well done in flow.

Epic via ue4 is suggesting BP use where possible as its fantastic for prototyping and where you only need scripting.

Same thing here applies, I should think.

You likely ? would learn c++ better, once you learn another language, at least that was my experience.

They are mostly the same anyway, hence why that's possible.

To my knowlege anyway, assembly is the only exception, but thats 'machine code' anyway, which you won't be using in any game engine that I'm aware of.

Start small > build up.

answered 7 years ago

Thanks a lot! I

answered 7 years ago

This post is closed: Adding new answers, comments, and votes is disabled.