Game Render Loop

Hello. I would like to create a graphic similar to the one attached but for Armory3d instead of the iOS spritekit. I was looking through the Armory Manual but I cant seem to find the documentation on the order events occur. update, physics, ect. Could someone point me in the correct direction? thanks.

I have attached my work in progress. I’m happy to give the file to the community as open source material to be added to the Armory Manual if it’s wanted. I just need to get the correct info.


Thanks @kenthinson for this and I hope you will get the correct info very soon from @lubos as it’s a very useful diagram to have in the help manual.
(waiting to see where events take place into it too :tada: )

Hi not trying to bug you or be annoying just want to make sure you saw this @lubos. Thanks for your time :slight_smile:

Maybe using some nodes, with event and time nodes and with print between them could already be done as a first step ?


Traits have a notifyOnRender2D function wich allows you to get the g2 functionality of the buffer.
Check the ui_script2d example

Simply check the draw functions of ‘g’ past trough the function

For now with Kha you can attach another listener to the render callback;


where render takes an array of framebuffers.

function render(framebuffers:Array<kha.Framebuffer>)

To draw something to frambuffer:

var f = framebuffers[0]; // Gets the first screen buffer

then you can use f to make draw calls :

f.g2.begin(false);// notify the system we are beginning to draw. false = do not clear.
f.g2.drawXXX(...) // Draw your stats here
f.g2.end();       // notify the system we are done with the buffer

if you need more control and want to do things manually you can use g4 instead.

I don’t know what armory provides internally but ill keep an eye out.

Thanks for the reply. I’m not looking to customize the render loop right now. I just want to document what Armory provides and when the provided callbacks happen in what sequence.

The notifyonrender2d takes care of that and is done after the 3D render path has been executed.

Im not sure what else you need?

Yes I think we are not understanding each other. I cant find documentation on notifyOnRender2D however looking at the example you linked it looks like it’s talking about creating a 2d UI like a game menu. I am not trying to create a 2d UI with armory. This image is being made in a graphics software as documentation only.

I’m looking for information like this:

Again not trying to be annoying just cant find the information I am looking for. Thanks for trying to help me :slight_smile:

I would like to create a graphic similar to the one attached but for Armory3d

This is what you said also.

The example shows how to make use of ZUI, but you don’t have to use zui, the g property passed down into the function is kha level api. I’m pointing out you can draw your custom graph with that.

Armory already does some stats, you might want to look into the source code how it’s currently handling execution time and go from there? Then see if you can draw bits by bit?

Ok I’ll look into the source.

As a second note I said “for” not “in” armory3d :wink: but I can see how it would be confusing.

Well currently debug information is done inside of the game view. I’m not sure why you couldn’t do the same?

My goal is to try and make the documentation more in line with what we get with Unity, Spritekit or other engines. So others and myself can know what is happening without having to dig through source. I guess I’ll have to trail blaze this one for others later.

Ok I understand now I thought you were trying to create some debugging stats. I assumed every strip would have different circumference based on the time it needed to complete.