Jump to content

Leadwerks Community GameLib


Canardia
 Share

Recommended Posts

MG: I just tried your version and the ground doesn't look as good as the Gamelib version I am using. There seems to be less layers and the bump maps aren't working?

 

 

I am not entirely sure I follow, as it simply calls LoadScene() ... can you explain a little more?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Actually looking at it again, there isn't a problem other than the Gamelib one is a lot brighter so the details seem to pop out. I attached some pictures for you to compare.

 

The Gamelib one has some extra effects turned on but the roots look kind of flat in the framewerk picture. I don't know if it is the missing effects though.

 

 

framewerk

framewerk.th.png

 

gamelib

 

gamelib.th.png

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

from what I see is that the gamelib has effects like bloom, distance fog, maybe even hdr... and if you had the fps showing on the gamelib screenshot you would also see that the fps was probably lower as well...

 

--edit i see that you edited... yep thats the difference.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

well it could be that the bumpmap isn't being loaded, but it probably is... is this a terrain texture or a vegetation layer? there are no shadows at all... maybe gamelib is also turning on AA/SSAO as well, or it could be just HDR giving the extra contrast... cannot really say because I don't use gamelib/c++

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Do the roots look flat in the framewerk picture to you? Which effect brings them out like they are in the Gamelib version?

 

 

 

Well if memory serves (and it does sometimes just not as often as I'd like lol) both use the same FX that Framewrk does.. as they both use it .. have you got them turned on? what settings are you using for Gamelib?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

is this a terrain texture or a vegetation layer

 

This is terrain only. It is the jungle part of the free set Josh uploaded.

 

 

have you got them turned on? what settings are you using for Gamelib?

 

 

I just checked the effects on both and got this:

 

Gamelib:

ssao, bloom, antialias, dof, fog, god rays.

 

framework

ssao, hdr, bloom, antialias, god rays.

 

I'm not sure if hdr works on my card though.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

Have you tried standardising the FX that is using the same for each?

 

what DoF and Fog settings are you using?

 

Ambient light settings?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

#include "engine.h"

int main(int argc, char** argv)
{
       Initialize();
       RegisterAbstractPath("C:\Users\Davaris\Desktop\MyProject");
       Graphics(640,480);

       AFilter() ;
       TFilter() ;

       TWorld world = CreateWorld() ;
       if (!world) {
       MessageBoxA(0,"Error","Failed to create world.",0);
       return Terminate();
       }

       TFramework framework=CreateFramework();
       TLayer layer = GetFrameworkLayer(0);
       TCamera cam=GetLayerCamera(layer);
       PositionEntity(cam,Vec3(0,0,0));

       //Set Lua variable
       BP L=GetLuaState();
       lua_pushobject(L,framework);
       lua_setglobal(L,"fw");
       lua_pop(L,1);

       // Setup Initial Post Processing FX
/*
	SetGodRays(1);
       SetHDR(1);
       SetSSAO(1);
       SetBloom(1);
       SetAntialias(1);
*/
       SetStats(2);

	game.scene.GetFramewerk().GetRenderer().SetReflectionRenderComponents(ENTITY_ALL);
	game.scene.GetFramewerk().GetRenderer().SetDistanceFogColor(Vec4(0.9f,0.9f,1,0.96f));
	game.scene.GetFramewerk().GetRenderer().SetDistanceFogAngle(Vec2(0,10));
	game.scene.GetFramewerk().GetRenderer().SetDistanceFog(fog);
	game.scene.GetFramewerk().GetRenderer().SetNearDOFRange(Vec2(0,5));
	game.scene.GetFramewerk().GetRenderer().SetFarDOFRange(Vec2(50,1000));
	game.scene.GetFramewerk().GetRenderer().SetAntialias(antialias);
	game.scene.GetFramewerk().GetRenderer().SetSSAO(ssao);
	game.scene.GetFramewerk().GetRenderer().SetNearDOF(dof);
	game.scene.GetFramewerk().GetRenderer().SetFarDOF(dof);
	game.scene.GetFramewerk().GetRenderer().SetGodRays(godrays);
	game.scene.GetFramewerk().GetRenderer().SetBloom(bloom);		


       LoadScene("abstract::mytestmap.sbx");

       // Setup spectator
       TBody spectator=CreateBodySphere();
       SetBodyMass(spectator,1);
       SetBodyGravityMode(spectator,0);
       SetBodyDamping(spectator,1.0);
       EntityType(spectator,3);
       SetBodyBuoyancyMode(spectator,0);
       PositionEntity(spectator,Vec3(0,5,-10));

       TVec3 camrotation=Vec3(0);
       float mx=0;
       float my=0;
       float move=0;
       float strafe=0;

       HideMouse();
       MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);

       // MAIN LOOP
       while (!KeyHit(KEY_ESCAPE))
       {

       mx=Curve(MouseX()-GraphicsWidth()/2,mx,6);
       my=Curve(MouseY()-GraphicsHeight()/2,my,6);
       MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);

       camrotation.X=camrotation.X+my/10.0;
       camrotation.Y=camrotation.Y-mx/10.0;
       RotateEntity(cam,camrotation);

       move=KeyDown(KEY_W)-KeyDown(KEY_S);
       strafe=KeyDown(KEY_D)-KeyDown(KEY_A);
       TVec3 force = Vec3(strafe*10.0,0,move*10.0);
       force=TFormVector(force,cam,0);
       AddBodyForce(spectator,force);

       UpdateAppTime();
       UpdateWorld(AppSpeed()) ; 

       PositionEntity(cam,EntityPosition(spectator));

       // Update timing and world
       UpdateFramework();

       // Render
       RenderFramework();

       // Send to screen
       Flip(0) ;
       }

       return Terminate();
}

 

I pasted the effects from Gamelib in and removed

 

game.scene.GetFramewerk().GetRenderer().

 

And got the following errors:

 

error C3861: 'SetReflectionRenderComponents': identifier not found

error C2660: 'SetDistanceFogAngle' : function does not take 1 arguments

error C2660: 'SetNearDOFRange' : function does not take 1 arguments

error C2660: 'SetFarDOFRange' : function does not take 1 arguments

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

I pasted the effects from Gamelib in and removed

 

 

well you can't actually do that .. you'd have to use the Framework commands not the gamlib specific calls to functions that use the Framework commands.

 

To set fog and DoF just change the settings in the sbx via the options and atmosphere properties dialogue in the editor. LoadScene() should just pick them up.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

I started to work on gamelib 0.0.16.0. This is getting interesting... Framewerk C++ source has been removed, and LEO (which has Framework C++ classes) has been added :)

I think it will be ready today, as it's not too much to change, when done this way.

 

Actually there shouldn't be anything to change, if LEO's Framework works the same way as the Framewerk C++ did, which is again a good thing, because then GameLib keeps it promise that customers don't need to change their code when the engine changes and they use GameLib. That's the idea of ROI.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

well you can't actually do that .. you'd have to use the Framework commands not the gamlib specific calls to functions that use the Framework commands.

 

To set fog and DoF just change the settings in the sbx via the options and atmosphere properties dialogue in the editor. LoadScene() should just pick them up.

 

At that point it was super late and I had to go to bed. 3 of those functions required two params instead of 1 param, so I wasn't sure if they worked the same way. Looking at it with fresh eyes I can see they are the same functions, except one group takes a vector for the two params.

 

Different ways of doing things is confusing for tired newbies! :)

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

Gamelib 0.0.16.0 is now uploaded, and it should work with all kind of old and new and mixed sandbox/editor scenes.

One benefit of its scene loader is that it optimizes the world entities a bit by removing unnecessary physics objects which are left behind when using LUA only. I think when you have many lights in the scene it should also bring some performance boost, but at least it's using less memory.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Thanks for posting this Lumooja.

 

I just tried it out and ran into a show stopper. For some reason it crashes when I move my zombie or when the other zombie touches my character. But for some reason, the zombie I do not control, can follow a waypoint circuit with no problems.

 

It crashes in here:

 

inline void Framework::Update() const

{

::leUpdateFramework();

}

 

Also I still get the null framewerk message and there are no shadows for objects, terrain or otherwise. However for some reason my zombies have shadows. :blink:

 

Edit:

I was wondering if you might be willing to replace those structs in Gamelib with classes? That way people can override some of the functions without disturbing your code.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

The demo might need some files to be updated, I haven't tried it for a while, so I need to work on that next.

Yeah, I was planning to make gamelib more C++, so the structs with methods will be classes also.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

I got the demo working with my own map and 0.0.15, but something is different in 0.0.16. I'm wondering if it is the changes to the unnecessary physics objects you mentioned? The other issue I noticed was the fire is working now, but the smoke is appearing as squares.

 

Anyway I'll do some more testing and see if I can figure out exactly what is causing it to crash. At the moment I think it does it when I attempt to move and change direction with the mouse, because it works for a few seconds walking and then boom.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

I just tried it again and found it crashes when the other zombie walks into my zombie.

 

Also if I keep the zombie's head perfectly level, I can walk for a little while before it crashes, but if I start walking while pointing its head up or down, it crashes immediately.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

If you comment out this line in the demo code, it doesn't crash when the player collides with something:

SetEntityCallback(myapp.zombie1->body,(byte*)EntityCollisionCallback,ENTITYCALLBACK_COLLISION);

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

I just checked the fire barrel again and it was working like I said above with the squares instead of smoke *in a map I made before yesterdays update*.

 

However it isn't working in a test map I made today. The light is working, but there are no flames, heat haze or smoke. I wonder if it is just a problem with its script? Because the monster truck kicks up dust properly when it moves.

 

EDIT:

Oh wait a sec, it works in the editor just fine so there must be another reason.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

I had another look at the shadows issue and it is only the terrain objects that are missing shadows. All other objects have shadows.

 

I also tested the monster truck again and it is not kicking up dust in the editor or in gamelib.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

You need to do:

SetVegetationShadowMode(1);

in your code. Editor has by default the vegation shadow mode: "sometimes" enabled, so you need to enable vegetation shadows in your code. You could also change the vegetation shadow mode in Editor to: "always", but that's not a good idea I think, because then you can't turn the shadows on/off by code.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

You need to do:

SetVegetationShadowMode(1);

in your code. Editor has by default the vegation shadow mode: "sometimes" enabled, so you need to enable vegetation shadows in your code. You could also change the vegetation shadow mode in Editor to: "always", but that's not a good idea I think, because then you can't turn the shadows on/off by code.

 

Thanks!

 

I also noticed the windmill fan, isn't turning in the editor or gamelib. Does that mean the script is broken? Or perhaps there is something I need to turn on, to get Lua to update? If that is the case, it would explain why the fire barrel doen't produce fire.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

Is it still:

 

game.scene.Update();
game.MouseLook(game.scene.cam);

 

To get mouse look working?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...