Jump to content

Is GameLib fully functional with 2.30 at the moment?


Argorius
 Share

Recommended Posts

Is GameLib fully functional with 2.30 or do I have to tweak something to make it work properly?

 

I have 2.30 installed and followed the Power tutorial from the Wiki. If I run it, it actually works (except my cobblestone is bright red but if I replace it with a different texture, it is fine). Also, the main map from the tutorial is all messed up if I load it in the Editor (the light is way bright and makes everything looks white etc.)

 

However, if I take the exact code from the tutorial and try to load a simple map with pretty much nothing on it that I made myself then the program doesnt show any errors but wont compile and crashes. If I remove the mouselook function call then it works (but with no mouselook of course.

 

I am probably missing something major but I figured I'd ask if it is all fully functional with 2.3 first or if I need to do something special first...

 

This is the code:

 

//	====================================================================
//	This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard
//	Written by Rimfrost Software
//	http://www.rimfrost.com 
//	====================================================================


#include "gamelib.h"
#include "leo.h"
using namespace LEO ;

int main( int argc, char** argv )
{

TGame game;
Engine engine;

engine.Create();
game.Initialize( 800, 500 );
Engine::SetFilters();
::Collisions();

game.scene.LoadMap( "abstract::gamelib.sbx" );
//game.scene.SetCurrentPlayer("info_playerstart");


// Game loop
while( !Keyboard::I****() && !Engine::IsTerminated() )
{
	if( !Engine::IsSuspended() ) // We are not in focus!
	{

		// Render
		game.scene.Update();
		game.MouseLook(game.scene.cam);
		game.KeyboardMove();
		game.PositionPlayerModel();
		game.PositionCamera();
		game.scene.Render();

		// Send to screen
		Engine::Flip(0) ;
	}
}

// Done
return engine.Free() ;
}

Windows XP Home Edition Service Pack 3/ Intel Q9450 @ 2.67GHz / 3.5GB DDR3 SDRAM / GeForce 8800 GTS 512

Link to comment
Share on other sites

The map from the Power Tutorial works fine for me with GameLib with LE 2.3.

There might be some issues with the LoadMap command since it was mainly developed with LE 2.28, but I don't know of any bugs at the moment.

The mouselook is supposed to crash if no player entity is found in the map and if you don't set the player in code (like you commented the line out), I could add somekind of checking to it :)

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

ahh - Thanks for the help...if I add an info_playerstart node to the map and uncomment that playerstart piece of code - then it should work? Does it have to be a playerstart node from 2.28? I think I used one from 2.20 or so and had the playerstart uncommented and it still crashed. If I look at the black window that comes up - it seems like it crashes while it is doing some shader stuff sometimes. I have the normal 2.30 shaders - I assume that is correct?

Windows XP Home Edition Service Pack 3/ Intel Q9450 @ 2.67GHz / 3.5GB DDR3 SDRAM / GeForce 8800 GTS 512

Link to comment
Share on other sites

You can see in the engine.log if there are any errors while loading the game.

 

I attached a screenshot of what the main.sbx from the power tutorial looks like in the 2.3 Editor. Turns out, if I replace the cobblestone with soemthign else - it is still red. I can mess around with the lighting and get it to look more normal but that shouldn't be, right? Any ideas of what is wrong?

post-264-12609882186963_thumb.jpg

Windows XP Home Edition Service Pack 3/ Intel Q9450 @ 2.67GHz / 3.5GB DDR3 SDRAM / GeForce 8800 GTS 512

Link to comment
Share on other sites

Maybe you forgot to update some files, make sure you have the newest framewerk files, newest shaders.pak, newest graphics card drivers.

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

HDR and Bloom - as well as all the other fancy options are off now - it looks different but not better.

 

I pretty much just installed 2.30 into a clean directory - kept hitting update until it said there were none. yesterday I forced an update to completion again. That should mean that I have the current shaders.pak and framewerk files, right? I also got new nvidia drivers a few days ago for my video card trying to fix this.

 

Any other ideas? I am puzzled - I have been trying this for days and searching both forums.

post-264-12610692192368_thumb.jpg

Windows XP Home Edition Service Pack 3/ Intel Q9450 @ 2.67GHz / 3.5GB DDR3 SDRAM / GeForce 8800 GTS 512

Link to comment
Share on other sites

Windows XP Home Edition Service Pack 3/ Intel Q9450 @ 2.67GHz / 3.5GB DDR3 SDRAM / GeForce 8800 GTS 512

 

I put it in my sig - thanks for the reminder.

 

I solved the initial problem I think - now I can load my own maps (as of yet without water and sky) and the program runs. The issue was that I called info_playerstart and the gmf file that I used was also called info_playerstart. However, in the editor when I placed the playerstart onto the map - it named it playerstart_1. That gave the issue apparently and now if I call playerstart_1 instead - it works.

 

The gamelib map, however, is still all messed up (same with the gamelib test.sbx maps - they are the same way except they aren't red). At least some progress haha!

Windows XP Home Edition Service Pack 3/ Intel Q9450 @ 2.67GHz / 3.5GB DDR3 SDRAM / GeForce 8800 GTS 512

Link to comment
Share on other sites

Another question about GameLib

 

I tried to use the DrawShadowText function but it keeps saying that:

 

1>.\main.cpp(196) : error C2039: 'DrawShadowText' : is not a member of 'leadwerks::Renderer'

1> c:\program files\leadwerks engine sdk\cpp\renderer.h(20) : see declaration of 'leadwerks::Renderer'

1>Build log was saved at "file://c:\Documents and Settings\The Squid\Desktop\GameLib\source\Release\BuildLog.htm"

1>letest - 27 error(s), 0 warning(s)

 

If I look at the sln project for the gamelib demo (if I hit the exe, the demo works) and try to compile it...it gives me the above error on everything that uses DrawShadowText

 

Do I need to do something with the Renderer.h or cpp file?

Windows XP Home Edition Service Pack 3/ Intel Q9450 @ 2.67GHz / 3.5GB DDR3 SDRAM / GeForce 8800 GTS 512

Link to comment
Share on other sites

I just got Gamelib to compile and when I tried to load the new deserthighway.sbx, it exited without displaying the map.

 

When I looked at the engine.txt file I found this:

 

Error: Shader file "abstract::postfilter_adjust.frag" not found.

 

I also tried:

 

terrain_arctic.sbx and tunnels.sbx and got the same message.

 

 

The editor loads them fine 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

Thanks I just ran it and it loads now. I noticed on exit from loading the maps, I am getting this message now:

 

Null framewerk.

 

I am also getting the red markings a previous poster mentioned with the tunnels.sbx. The editor displays it perfectly though.

 

Edit:

All the files in directory I am running from are from the latest update.

 

I found these messages in the Editor.txt

 

Warning: Uniform "saturation" does not exist in shader.

Warning: Uniform "brightness" does not exist in shader.

Warning: Uniform "contrast" does not exist in shader.

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 "Null Framewerk" message comes probably because I need to publish the framewerk object to LUA in GameLib.

The shader errors might be because you didn't use the latest shaders.pak.

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 shaders pack and it is the up to date one.

 

This is the code I ran:

 

#include "gamelib.h"
#include "leo.h"
using namespace LEO ;

int main( int argn, char* argv[] )
{

TGame game;
Engine engine;

engine.Create();
game.Initialize (800,500);

Engine::SetFilters();
::Collisions();


game.scene.LoadMap("abstract::tunnels.sbx");
//game.scene.LoadMap("abstract::deserthighway.sbx");
//game.scene.LoadMap("abstract::terrain_arctic.sbx");
//game.scene.LoadMap("abstract::train.sbx");

while (!Keyboard::I****() && !Engine::IsTerminated())
{
	if (!Engine::IsSuspended())// We are not in focus
	{
		// Render
		game.scene.Update();
		game.scene.Render();

		// Send to screen
		Engine::Flip();
	}
}

return engine.Free();
}

 

This is what Engine.txt said about my card:

 

OpenGL Version: 3.2.0

GLSL Version: 1.50 NVIDIA via Cg compiler

Render device: GeForce 9800 GTX/9800 GTX+/PCI/SSE2

Vendor: NVIDIA Corporation

DrawBuffers2 supported: 1

32 texture units supported.

GPU instancing supported: 1

Max batch size: 1024

Shader model 4.0 supported: 1

Conditional render supported: 0

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 get those warnings in shaders.pak too, but everything seems to work. The only change I had to do in gamelib so far, was to add the skybox loader for Editor:

(after the block with if(ek=="0"))

			ek=GetEntityKey(e,"skymaterial","nothing");
		if(ek!="nothing")
		{
			GetFramewerk().GetRenderer().SetSkybox(LoadMaterial((str)string("abstract::"+ek).c_str()));
		}

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

There were more things not working with Editor created scenes in gamelib. I have fixed so far skybox, water, sounds. Testing emitters now. Gamelib still supports 2.28 scenes, so I needed to add a variable to choose between non-lua and lua processed scenes: TScene::uselua=true is the default setting, so it will work with 2.3.

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 haven't published GameLib 0.0.15.0 yet, but I'll inform when it's ready for download.

 

 

Just out of pure curiosity, will gamelib be compatible with both 2.2x and 2.3? or will it now be geared towards one or the other?

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

It works with both.

 

 

cool good to know.

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 found out that a uselua=true/false control is not enough, as there is also an 3rd option: using LE 2.3 sbx files without LUA.

 

This is needed, because some things in LUA don't work very well, like lights. They leave an unnecessary physics object in the scene, and I found no way to remove it without removing the whole light. So in order to load LE 2.3 scenes optimally, you would want to use LUA where it works, and ProcessScene for those parts which are not working so well in LUA.

 

For this this I've thought to have 2 control flags: uselua and usenewsbx. Uselua would be then a 3-state flag (0=don't use lua, 1=use lua where it works, 2=use lua always). Default would be uselua=1. Usenewsbx would be default true, so LE 2.2x users can set it to false to load Sandbox scenes. LE 2.2x users could also specify non-sense combinations like uselua=2 and usenewsbx=0, to see what LUA would do for you, this would of course make sense only for testing purposes.

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

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...