Irrlicht Game Engine

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Irrlicht Game Engine

Post by Seven »

Level Editor in progress.
everything Irrlicht / PhysX / IrrKlang
GUI is irrlicht derived classes.

https://youtu.be/T8C2wX9wA4M
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht Game Engine

Post by CuteAlien »

Seems to be pretty far already the editor. Anything open-source? Which Irrlicht version are you working with?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Re: Irrlicht Game Engine

Post by Seven »

thanks. I am using the latest branch and am currently working on the character AI.
I had hoped to have a full blown game completed by the end of the year, but have some travel planned that will interfere with that so it will be early next year. My biggest detraction right now is finding / writing a nice terrain shader and some vegetation (I think i have the vegetation at about 80%). I like the triplaner but havent been able to add dynamic lights to it. maybe I will give it more effort. I also have irrRenderer implemented (with the latest branch - that took a little to convert) but I need to be able to render to only a portion of the screen (in the editor gui) and I havent figured that out yet either.

I was planning to upload the code to github sometime this week.

Seven
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht Game Engine

Post by CuteAlien »

Hm, maybe split-screen example can help. Or render to texture and use the resulting texture in that part of the screen.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Re: Irrlicht Game Engine

Post by Seven »

Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Re: Irrlicht Game Engine

Post by Seven »

Spent the last month out west at the Grand Canyon. If you have never been please take the trip. I was absolutely blown away by it!

anyhow, here is a small project update :

added vegetation - this took a while to get good rendering speeds but in the end I used code from here ( //since 03.04.2010; by Adam 'entity' Krupicka) and modified it.
in particular, I use the camera view frustrum bounding box to determine visible grass instead of distance from the camera (circular to include grass behind camera?).
also added grass layout by image. simply paint red, blue green on image file and the game will load different grasses based on image pixel color, black = no grass)
I now take the terrain height map image, copy it and then paint directly onto it for grass locations. this allows me to easily see where grass should be.

Still working on AI but it is moving along.

Overall I am very pleased. the video doesn't seem to capture high def but the game looks good and is responsive.
here is a video of me walking around a fully populated (buildings and ruins) world.

game play starts at about 2:50 in the video

https://www.youtube.com/watch?v=W7mjwOSTnio


a small break for me while I take up woodworking. Need to pace myself but will be working off and on to complete the game :)
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Re: Irrlicht Game Engine

Post by Seven »

Finally got the vegetation where I want it with good frame rates and I am pretty pleased.
I am using the following SDK's

The Irrlicht Engine SDK version 1.9
PhysX 4.1
IrrKlang

I built the system in layers. (grass, flowers, shrubs, smalltrees and large trees).
each layer uses an image file to determine position, scale and rotation of the vegetation.
for example, in the grass layer, maybe green is short, dense grass while yellow would be tall cornstalks.
i use callback functions to determine these items.

grass layer setup function
load image file
for each pixel (relative to the terrain)
(for example maybe the pixel is green)
get the 'vegetation' style = getStyle(pixelcolor);
maybe this is grass so return style = 1 if it were corn maybe style would be 2
load the proper scenenode based on the style
get the 'vegetation' scale = getScale(pixelcolor);
maybe green means grass so return vector3df(1,1,1) if it were corn maybe it would be vector3df(1,4,1)
get the 'vegetation' rotation = getRotation(pixelcolor);
right now I just get a random rotation vector3df(0, getrandomfloat(0,360),0);

anyhow, I am extremely pleased to have this done using core irrlicht and without geometry shaders

here is small video demonstrating the system with me toggling on/off the various layers to show how they work.

I only have PhysX set on the largetrees but the system is setup for PhysX on all layers if desired.


https://youtu.be/Pfl02V78aYE

Seven
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht Game Engine

Post by CuteAlien »

Impressive jungle. Lighting is done with irrRenderer? You could maybe add a bit ambient light to the character to avoid the dark spots. Thought lighting works suprisingly well for the vegetation.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Re: Irrlicht Game Engine

Post by Seven »

thanks!

I am using a fresh download of irrlicht 1.9 with some very minor modifications (all gui related)
I dont use irrrenderer for now because i cant get the editor to work with it. (i will have to spend more time with it)
I will take a look at the main character model lighting. I never noticed those shadows before. should be fairly simple to remove.

So far I am very pleased with the speed. my target is to maintain over 100 fps with all scenery. it has taken a bit to get there
but I am currently running at 1920x1080 windowed mode and getting 104fps stable. this includes terrain, grass, flowers, shrubs,
trees, rocks, skybox and ocean.

since the vegetation system uses images for layout, I am currently working on those to create a land mass with trails and open areas for buildings.
next step is to create 3 or 4 levels and put them together in game format.

at some point I want to work on the terrain....so far I am using a very high detailed textures but would like to uses some method for placing sand around the water.
maybe in a few weeks I will reach out to see if anyone has some good methodology for doing that.
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Re: Irrlicht Game Engine

Post by Seven »

I am having some lighting trouble with a few (hundred) .x files.
after reading through the .x loader, i think i see the issue.

in the .x file there is a template called

Code: Select all

 
template MeshVertexColors {
 <1630B821-7842-11cf-8F52-0040333594A3>
 DWORD nVertexColors;
 array IndexedColor vertexColors[nVertexColors];
}
 
that all have values of

Code: Select all

 
    MeshVertexColors {
       4935;
       0; 0.000000; 0.000000; 0.000000; 1.000000;,
       1; 0.000000; 0.000000; 0.000000; 1.000000;,
       2; 0.000000; 0.000000; 0.000000; 1.000000;,
       3; 0.000000; 0.000000; 0.000000; 1.000000;,
       4; 0.000000; 0.000000; 0.000000; 1.000000;,
       5; 0.000000; 0.000000; 0.000000; 1.000000;,
       6; 0.000000; 0.000000; 0.000000; 1.000000;,
...
 
it seems that I have two options, option 1 is to modify the .x file so that there is a value of other than 0,0,0,1 for each vertex color (or remove the MeshVertexColors section)
OR
I can remove the if (!mesh->HasVertexColors) test in the .x loader.

Code: Select all

 
    //  if (!mesh->HasVertexColors)
        {
            for (u32 j=0;j<mesh->FaceMaterialIndices.size();++j)
            {
                for (u32 id=j*3+0;id<=j*3+2;++id)
                {
                    mesh->Vertices[ mesh->Indices[id] ].Color = mesh->Buffers[mesh->FaceMaterialIndices[j]]->Material.DiffuseColor;
                }
            }
        }
 
I tested the // if(!mesh->HasVertexColors) option and dont see any negative impact.
modifying all of the .x files would be time intensive.

so I think my question is.....
is there a negative impact i am not seeing? is there some reason that we care whether the vertex's have colors assigned if there is a texture?
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Re: Irrlicht Game Engine

Post by Seven »

as it turns out, commenting out that function call breaks other .x files.....sigh.
seems like the loader should ignore totally black values but i dont think it is something to change.
removing the MeshVertexColors out of the .x files seems to be the simplest so I will write a small program to do that.
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht Game Engine

Post by CuteAlien »

The answer to if vertex colors matters if there is a texture depends on the material or shader. I generally have to test myself what Irrlicht does as it's not really the same for all materials. For "solid" material it combines vertex-colors and textures for solid2 it only uses textures for example.
And for .X it seems it really should ignore vertex colors when a texture is set, but unfortunately mesh-loader can't know about that (you can set textures later).

What you can do is set the mesh-colors to 255,255,255,255 after loading. Or if you sometimes need them - you can set them like that per node (instead of per mesh) when you set the textures.

It might also be possible to change behavior with blend options or something like that. But I'm not familiar enough with all the options there right now to quickly tell.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Re: Irrlicht Game Engine

Post by Seven »

I hadnt thought about changing them after loading. I will give that a try since I am trying to keep my irrlicht untouched.
thanks for the thought!
CuteAlien
Admin
Posts: 9648
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht Game Engine

Post by CuteAlien »

Some error in what I wrote above - you can't easily change vertex-colors per node as it's not a material value but part of the mesh itself.

So can only be changed per mesh. IMeshManipulator has setVertexColor functions. X files use skinned meshes, bit tricky for those as you want to change the color in the original meshes (and not in that you get per frame with getMesh() as then you'd have to change colors each frame). Untested, but I think you can cast to ISkinnedMesh and then use getMeshBuffers from there to get the original meshes.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Seven
Posts: 1030
Joined: Mon Nov 14, 2005 2:03 pm

Re: Irrlicht Game Engine

Post by Seven »

A few new items.

fixed mesh loading by utilizing IrrAssimp (very nice addition btw)
Some models are modeled 180 degrees rotated. very frustrating but in the end programmed code to detect and reverse movement directions.

added an AI structure to the engine.
difficult to explain but seems very powerful in my testing.
goal driven architecture
each goal can pop additional goals as needed
For example, a GOTOOBJECT goal first checks if we are facing the object and if not, pops a TURNTOFACEOBJECT goal which gets resolved and then returns to continue the GOTOOBJECT goal. In theory this will create a cascade of goals based on the first goal.

New video shows a small AI in action.
the human walks around from marker1 to marker2 to marker 3 etc.....
the goblin walks around and picks up marker, wanders aimlessly for 5 seconds and then drops the marker then goes to the next marker and repeats.

just testing my AI system to make sure it cascades the goals as needed. seems to be working fine.

https://youtu.be/Gxvnx5JNisk


next step is to create an NPC town with interactive characters.
Post Reply