Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
31. May 2018


Now that Armory3D is fully funded an installable version will be available for download any day now.  Armory is a game engine built using the Haxe programming language over the Kha framework that runs inside the open source graphics application Blender.  The timing of this release is ideal, as it was recently announced the Blender Game Engine is being removed from Blender.


Armory is a game engine I’ve been excited for for some time now.  You can learn more about Armory here, access the complete documentation here and download the source code here.  Additionally there are a series of examples available here with more complicated/complete templates available here.  Hopefully the full version will be available for download in the next few days.


I fully intend to do a tutorial series covering using the Armory game engine, which hopefully I will be launching soon.  However in the meantime I created this introduction to Armory which should illustrate to you why this engine has me as excited as it does.  Of course being built on top of Blender, you are also going to have a solid understanding of Blender to make used of Armory3D.  Thankfully, I’ve got you covered there with both a text based and video based Blender tutorial series to get you started.


Video Link

GameDev News Programming


28. May 2018


Last month we reported that Blender Game Engine (BGE) was being removed entirely from the source code of Blender for the upcoming major 2.8 release.  Judging by the comments section this was certainly a polarizing decision, with replies basically falling into two camps.  On one side there was a lot of “good riddance to bad rubbish” type replies, while in the other camp it was mostly “I’m done with Blender if this happens”.  Clearly the decision impact enough people that something had to be done.  Well, that something was just announced on Twitter:

image


The linked article from the developer mailing list:

Hi all,

The Blender Foundation Development Fund has reserved a number of bigger donations (also on donator's request) for game engine and interactive 3D related features.

Now 2.8 is getting shaped up, it was time to check on this topic. Yesterday afternoon I met with Benoit Bolsee and a couple of Code Quest participants, to discuss the future of Blender's real-time 3D needs and "interaction mode".

The outcome is that Benoit accepted a grant to work as designer and lead developer for one year on bringing back a good real-time interactive 3D system in Blender. He will do this part-time, in average 1.5 days per week, starting July 1st.

Obviously all work and further discussions will be done in public; using our regular channels (mailing lists, code.blender.org, developer.b.o, devtalk.b.o). Help from other Blender developers is very welcome. This will be further announced when Benoit starts.

To summarise, work will first be done in two areas;

- Implement a high quality real-time viewport with physics/event handling. This should result in a pleasant & usable environment to setup and bake simulations.

- Design and prototype a new nodal logic system.

Related to this work is also to enable good support (export or some kind of integration) for external game engines such as Godot, Armory, Blend4Web, Unreal, Unity, etc.

I especially invite the first three (open source) projects to connect with us to find ways to keep a high level of compatibility.

Work on typical GE features such as super-fast drawing (LOD, etc) are welcome too but should be part of the regular work on Blender's viewport and our internal drawing engines. That way everyone benefits. Laters,

-Ton-

Blender Game Engine is not coming back, but a great deal of the functionality that was removed with it will be returning. Additionally Blender will be working directly to support Blender as a game development tool for existing game engines.

Art GameDev News Programming


18. May 2018


It’s not very often a game engine takes me completely by surprise.  Especially a full featured, open source, C++ based, cross platform, heavily documented, feature rich, high performance 3D game engine.  Well that’s exactly what happened with the G3D Innovation Engine.  The primary maintainers are Morgan McGuire (@CasualEffects) who is currently an educator as well as a VR scientist at NVIDIA and previously worked on games such as Skylanders, Titan Quest and the Unity game engine, as well as Michael Mara at Standard University and Oculus Research.

The G3D Engine is self described as:

The G3D Innovation Engine is a commercial-grade C++ 3D engine available as Open Source. ss

G3D supports hardware accelerated real-time rendering, off-line rendering like ray tracing, and general purpose computation on GPUs. Its design emphasizes rapid prototyping and innovation, particularly of rendering and game algorithms.

G3D provides a set of routines and structures so common that they are needed in almost every graphics program. It makes low-level libraries like OpenGL, network sockets, and audio channels easier to use without limiting functionality or performance. G3D is a carefully designed, feature-rich base on which to prototype your 3D application.


Beyond being a capable engine it is also an incredible learning resource.  The engine is bundled with over 6GB of assets to experiment with, as well as over a dozen robust ss2samples with thoroughly documented source code.  One of the samples is even a full blown first person shooter, while another demonstrates a Minecraft-esque voxel based level.  There are also examples that show you how to work at the lowest level directly with OpenGL as well as advanced examples showcasing functionality such as real-time raytracing, lighting effects, procedural geometry and even VR.

Additionally each example can easily embed a suite of tools directly, enabling you to screen shot or video capture, change camera settings on the fly or launch the built in profiler.  There is even a complete scene editor built in, allowing you to place entities directly in your scene via simple drag and drop, turning your application into a minimalistic level editor.


Remember back at the beginning I mentioned that the maintainer was also an educator?  He has also authored a companion called the Graphics Codex which goes hand in hand with the G3D game engine.  For a mere $10 you gain access to an advanced reference that may just be one of the single best ways of learning computer graphics GIF2topics such as ray casting, BSDF, rendering and more.  You can see a full chapter list here.  So if you are trying to learn more advanced graphics programming, G3D is certainly a great resource.  Keep in mind however, this material was used with a 300s level graphics course, so you are going to need a solid foundation in math to follow along.

Purchasing the Graphics Codex is by no means a requirement however.  One thing open source projects often suffer from is poor documentation.  Thankfully this certainly isn’t the case with the G3D engine.   There is an extensive manual available here, as well as a comprehensive set of API references.  As mentioned earlier, the engine is also loaded with well documented samples.

If you are looking for a low level foundation to build your game on, a framework to do some graphical experiments or simply are looking for a way to learn more about modern graphics programming, I can think of little reason not to suggest checking out the G3D Innovation Engine. 


If you are interested in learning more about the G3D Innovation Engine, be sure to check out our hands-on video available here and embedded below.  I am almost certain you will be amazed.

GameDev News Programming


14. May 2018

Details


orx-project.org

ZLib License

View On YouTube

  

Orx is a cross platform open sourced 2D game framework written in C and available on Github under the permissive ZLib source license.  What makes Orx somewhat unique among it’s peers is the data driven approach that Orx takes.  Instead of storing game data using a collection of objects in code, it is instead split out into data files.  This enables you to quickly change the content of your game without having to do a recompilation.   So for example you make have an entry like the following for defining the camera in your scene:


[Viewport]
Camera            = Camera
BackgroundColor   = (255, 180, 0)

[Camera]
FrustumWidth  = 1024
FrustumHeight = 768
FrustumFar    = 1.0
FrustumNear   = 0.0
Position      = (0.0, 0.0, -1.0)
;Zoom          = 3.0

By editing this config file you can make major alterations to the camera without having to recompile your code.  Chance the FrustrumWidth in the ini file, and the next time you run your game’s window will be smaller.  Now let’s look at the code required to consume the Viewport/Camera data in your C/C++ application:

orxViewport_CreateFromConfig("Viewport");

Yep, that’s it.  This will create the viewport, notice the camera property and create one of them as well, entirely driven by data. 


This approach has a couple of advantages.  First it creates a clean separation of code and data which should in theory make for easier to maintain code.  It also takes these values out of the compilation process, meaning changes do not require you to recompile your code.  Additionally, this data driven approach makes creating tools for you game a cinch, as you are simply writing out simple easily understood text files. 


There are of course disadvantages too.  Since you moved the code out from the compiler, you lose features such as intellisense as well as compile time error checking.  Moving more details off into data files can make hunting down bugs even more difficult.


Let’s take a quick look at one of the samples from the Orx tutorials, with the comments stripped down for brevity.

#include "orx.h"
orxOBJECT *pstSoldier;

orxSTATUS orxFASTCALL EventHandler(const orxEVENT *_pstEvent)
{
  orxANIM_EVENT_PAYLOAD *pstPayload;

  /* Gets event payload */
  pstPayload = (orxANIM_EVENT_PAYLOAD *)_pstEvent->pstPayload;

  /* Depending on event type */
  switch(_pstEvent->eID)
  {
    case orxANIM_EVENT_START:
    {
      /* Logs info */
      orxLOG("Animation <%s>@<%s> has started!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)));

      break;
    }

    case orxANIM_EVENT_STOP:
    {
      /* Logs info */
      orxLOG("Animation <%s>@<%s> has stopped!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)));

      break;
    }

    case orxANIM_EVENT_CUT:
    {
      /* Logs info */
      orxLOG("Animation <%s>@<%s> has been cut!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)));

      break;
    }

    case orxANIM_EVENT_LOOP:
    {
      /* Logs info */
      orxLOG("Animation <%s>@<%s> has looped!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)));

      break;
    }

    case orxANIM_EVENT_CUSTOM_EVENT:
    {
       /* Logs info */
       orxLOG("Animation <%s>@<%s> has sent the event [%s]!", pstPayload->zAnimName, orxObject_GetName(orxOBJECT(_pstEvent->hRecipient)), pstPayload->stCustom.zName);

      break;
    }
  }

  /* Done! */
  return orxSTATUS_SUCCESS;
}

/** Update callback
 */
void orxFASTCALL Update(const orxCLOCK_INFO *_pstClockInfo, void *_pstContext)
{
  orxVECTOR vScale;

  /* Is walk right active? */
  if(orxInput_IsActive("GoRight"))
  {
    /* Sets walk right as target anim */
    orxObject_SetTargetAnim(pstSoldier, "WalkRight");
  }
  /* Is walk left active? */
  else if(orxInput_IsActive("GoLeft"))
  {
    /* Sets walk left as target anim */
    orxObject_SetTargetAnim(pstSoldier, "WalkLeft");
  }
  /* No walk active */
  else
  {
    /* Removes target anim */
    orxObject_SetTargetAnim(pstSoldier, orxNULL);
  }

  /* Is scale up active ? */
  if(orxInput_IsActive("ScaleUp"))
  {
    /* Scales up the soldier */
    orxObject_SetScale(pstSoldier, orxVector_Mulf(&vScale, orxObject_GetScale(pstSoldier, &vScale), orx2F(1.02f)));
  }
  /* Is scale down active? */
  if(orxInput_IsActive("ScaleDown"))
  {
    /* Scales down the soldier */
    orxObject_SetScale(pstSoldier, orxVector_Mulf(&vScale, orxObject_GetScale(pstSoldier, &vScale), orx2F(0.98f)));
  }
}


/** Inits the tutorial
 */
orxSTATUS orxFASTCALL Init()
{
  orxCLOCK       *pstClock;
  orxINPUT_TYPE   eType;
  orxENUM         eID;
  orxINPUT_MODE   eMode;
  const orxSTRING zInputWalkLeft;
  const orxSTRING zInputWalkRight;
  const orxSTRING zInputScaleUp;
  const orxSTRING zInputScaleDown;

  /* Gets input binding names */
  orxInput_GetBinding("GoLeft", 0, &eType, &eID, &eMode);
  zInputWalkLeft  = orxInput_GetBindingName(eType, eID, eMode);

  orxInput_GetBinding("GoRight", 0, &eType, &eID, &eMode);
  zInputWalkRight = orxInput_GetBindingName(eType, eID, eMode);

  orxInput_GetBinding("ScaleUp", 0, &eType, &eID, &eMode);
  zInputScaleUp   = orxInput_GetBindingName(eType, eID, eMode);

  orxInput_GetBinding("ScaleDown", 0, &eType, &eID, &eMode);
  zInputScaleDown = orxInput_GetBindingName(eType, eID, eMode);

  /* Displays a small hint in console */
  orxLOG("\n- '%s' & '%s' will change the soldier's animations\n- '%s' & '%s' will scale the soldier", zInputWalkLeft, zInputWalkRight, zInputScaleUp, zInputScaleDown);

  /* Registers event handler */
  orxEvent_AddHandler(orxEVENT_TYPE_ANIM, EventHandler);

  /* Creates viewport */
  orxViewport_CreateFromConfig("Viewport");

  /* Creates soldier */
  pstSoldier = orxObject_CreateFromConfig("Soldier");

  /* Gets main clock */
  pstClock = orxClock_FindFirst(orx2F(-1.0f), orxCLOCK_TYPE_CORE);

  /* Registers our update callback */
  orxClock_Register(pstClock, Update, orxNULL, orxMODULE_ID_MAIN, orxCLOCK_PRIORITY_NORMAL);

  /* Done! */
  return orxSTATUS_SUCCESS;
}

/** Run function
 */
orxSTATUS orxFASTCALL Run()
{
  orxSTATUS eResult = orxSTATUS_SUCCESS;

  /* Should quit? */
  if(orxInput_IsActive("Quit"))
  {
    /* Updates result */
    eResult = orxSTATUS_FAILURE;
  }

  /* Done! */
  return eResult;
}

/** Exit function
 */
void orxFASTCALL Exit()
{
  /* We're a bit lazy here so we let orx clean all our mess! :) */
}

/** Main function
 */
int main(int argc, char **argv)
{
  /* Executes a new instance of tutorial */
  orx_Execute(argc, argv, Init, Run, Exit);

  return EXIT_SUCCESS;
}


#ifdef __orxMSVC__

// Here's an example for a console-less program under windows with visual studio
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
  // Inits and executes orx
  orx_WinExecute(Init, Run, Exit);

  // Done!
  return EXIT_SUCCESS;
}

#endif // __orxMSVC__

This example illustrates a simple animation.  The game loop itself consists of implementing 3 simple functions, Init(), Run() and Exit() for handling various stages of the lifecycle.  The actual game loop itself is the Update callback function which is called continuously as your game is run.  Speaking of which, here is the code running.  The left and right arrow keys toggle between the animations, while up and down scale accordingly.

GIF


Now the “guts” of this example is actually in the ini file containing the data.  Let’s take a look:

[Display]
; In this example, we use the same size for the screen display than our camera's frustum so as to obtain a 1:1 ratio
ScreenWidth   = @Camera.FrustumWidth
ScreenHeight  = @Camera.FrustumHeight
Title         = Anim Tutorial
Smoothing     = false
[Resource]
Texture = ../data/object 

[Input]
SetList = MainInput

[MainInput]
KEY_ESCAPE = Quit

KEY_LEFT   = GoLeft
KEY_RIGHT  = GoRight
KEY_UP     = ScaleUp
KEY_DOWN   = ScaleDown

[Viewport]
Camera = Camera

[Camera]
FrustumWidth  = 640
FrustumHeight = 480
FrustumFar    = 1.0
FrustumNear   = 0.0
Position      = (0.0, 0.0, -1.0)

[Pivot]
Pivot = (15.0, 31.0, 0.0)

[[email protected]]
Texture = soldier.png

[Soldier]
Graphic             = Graphic
AnimationSet        = AnimSet
Scale               = 4.0

[AnimSet]
Direction   = right # down
StartAnim   = IdleRight
KeyDuration = 0.1
Digits      = 1
FrameSize   = (32, 32, 0)

Texture     = soldier_full.png
Pivot       = @Pivot

IdleRight   = 1 ; <= We only want one frame
IdleLeft    = 1
WalkRight   = -1 ; <= We want as many frame that can fit in the texture defined by WalkRight
WalkLeft    = -1

IdleRight-> = IdleRight 
IdleLeft->  = IdleLeft 
WalkRight-> = WalkRight 
WalkLeft->  = WalkLeft 

[IdleLeft]
Flip        = x

[WalkLeft]
Flip        = x

[IdleRight]
Direction   = left

[IdleLeft]
Direction   = left # up

[WalkRight1]
KeyEvent    = !!Left!!

[WalkRight4]
KeyEvent    = !!Right!!

[WalkLeft1]
KeyEvent    = !!Right!!

[WalkLeft4]
KeyEvent    = !!Left!!

As you can see, just about every aspect of the game is data driven here, from the animation names, the source graphic files, to the camera, viewport and even keys pressed and the corresponding binding to call for each key.


This post only scratched the service of how Orx works, but should give you an idea of the data driven approach they have taken.  It certainly wont be for everyone, but it could be a great fit for many people.  If you are interested in giving Orx a shot, be sure to check out our video, which is also embedded below, to walk through the installation process and get you up and running.  Then it’s time to jump into the extremely thorough getting started guide and tutorials available on the Orx website.

Programming


25. April 2018


The HTML5 base 3D game engine PlayCanvas has been covered several times here on GameFromScratch, both in the Closer Look series, as well as a more recent 3D game tutorial.  It has been under development for several years, but just yesterday it finally hit that biggest of milestones, a 1.0 release.  There wasn’t actually a huge number of changes in the 1.0 release, in fact there was only a single minor source change.  It’s more a sign of confidence from the PlayCanvas team about the maturity of the game engine.


From the PlayCanvas blog:

PlayCanvas was born 7 years ago, way back on 9th May 2011. In the early days, we were essentially prototyping, seeing what this amazing new WebGL API could do. By October 2011, we set up a source code repository and committed our first engine prototype. Right at the beginning, we adopted semantic versioning for naming our releases. Our initial commit generated engine v0.10.0. From that point onwards, we adopted a rapid release cadence, often publishing more than one release a week. The months and years passed, our team grew and feature after feature was integrated into the codebase. But through all that time, we never incremented the major version number. Why? Well, there were several reasons:

  1. Our rapid deployment meant we never delivered a monster release that seemed to warrant going to 1.0.0.
  2. We always made a huge effort to maintain backwards compatiblity. Projects like the inane Doom3: Gangnam Style created in December 2011 still work fine today! So we never (intentionally) broke your projects.
  3. We, uh, just never got around to it!

The PlayCanvas API is now very stable, mature and battle-hardened. Backwards compatibility is something we take very seriously indeed. And today, PlayCanvas is used in production by thousands of developers.



GameDev News


GFS On YouTube

See More Tutorials on DevGa.me!

Month List