Jump to content

Fentinor build


VeTaL
 Share

Recommended Posts

About a week ago we (me, leveldesigner, who is working on one PC with me, and some modellers) had finished first build of the level.

Then i showed build to a number of people and was really shocked by extremely low fps.

 

Modern AAA games uses textures 1024*1024 and 2048*2048, and this demo used only 512*512

 

FPS:

 

GeForce 8600M gives 6 FPS, which is epic fail, i think: that laprop runs more complete levels using other engines

 

GeForce 9600 gives 20-30 FPS without shadows and 7-8 FPS with shadows (<ShadowQuality>0</ShadowQuality> in Configuration.xml)

 

ATI Radeon M 56xx 1Gb, IntelCore i7 1.6GHz (boost up to 2,5+), gives 23-26 fps, while Crysis 2 gives 20 fps on maximum settings

 

Top-quality PC: i5 760 2.80, GeForce GTX 460 SE, 4 Gb shows only 45-50 fps, while Crysis 2 gives 70 fps on maximum settings

 

ati mobility radeon hd 5700 - 10 fps

 

gtx 560 ti - about 100 fps

 

The most fail is trying to run build on my laptop: i5 480M 2.66, GeForce GT540M 1 Gb, 4 Gb - that gives me 30 fps without shadows and about 10 FPS with shadows (like on my PC, 9600)

 

 

Can you look at the models and give us some advices?

I believe that modellers made their models in not-optimized-for-this-engine way.

Maybe they used too much materials or something like that.

 

Demo is here: http://www.speedyshare.com/files/29762947/Fentinor.7z

Also take a look into Configuration.xml

 

Updated:

What about current models, here they are: http://www.speedyshare.com/files/29762947/Fentinor.7z

password: nOde46repLY30zOA47yak!

 

post-648-0-00822800-1312762892_thumb.jpg

post-648-0-18658500-1312762898_thumb.jpg

post-648-0-94917400-1312762905_thumb.jpg

post-648-0-52259900-1312762914_thumb.jpg

post-648-0-71640700-1312762922_thumb.jpg

 

PS: got some errors with banner uploading in Chrome, so i had attched them here

post-648-0-35557800-1312762987_thumb.jpg

post-648-0-50140100-1312762993_thumb.jpg

post-648-0-24165900-1312763006_thumb.jpg

post-648-0-63632000-1312763011_thumb.jpg

post-648-0-76081200-1312763016_thumb.jpg

Working on LeaFAQ :)

Link to comment
Share on other sites

It looks mostly like bad code. When I delete models.pak and materials.pak, the game runs with 150 FPS, but with 500 FPS in Editor. So the game code is eating 350 FPS.

Measure the whole main loop time, and the UpdateFramework time, and the RenderFramework time, and the rest of code time in the main loop.

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 do not know what are you doing to get such low FPS on such machines...just to small comparison, my Hidden Dawn level with 350K polys, 12 characters on scene, and plenty of AI controlled NPC's , running 20-25 FPS on dinosaur nVidia 7600GT .. ill check carefully whats going on with code or drivers for given machine..

 

EDIT:

It may be some issues with LE version you running, so just to update, im using version 2.3 (never update after that because, i was scared things whats working will be broken, so i dont know is that case with you)

 

Link to comment
Share on other sites

The program cannot start because MSVCP100.DLL is missing from your computer. Try reinstalling the program to fix this error”

 

You've got to submit that last image as a banner! B)

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

It looks mostly like bad code. When I delete models.pak and materials.pak, the game runs with 150 FPS, but with 500 FPS in Editor. So the game code is eating 350 FPS.

Hm, i'll check that once more time. But on my home PC ( GeForce 9600 ), i have: about 30 in editor and about 20 in the game

 

Measure the whole main loop time, and the UpdateFramework time, and the RenderFramework time, and the rest of code time in the main loop.

Previous buid used SDL+imgui for debug purposes, i thought if i'd drop down SDL, i'll have a little perfomance boost.

I'll post here profiler's results

 

i do not know what are you doing to get such low FPS on such machines

That's what i'm interested in too. I hope, there is a trouble with models, or, at least, in code.

If i can cut down code and check its perfomance, i can do nothing with models- thats why i posted this post here: maybe someone have some recommendations about that.

 

The solution of "The program cannot start because MSVCP100.DLL is missing" is to install Microsoft Visual C++ 2010 Redistributable Package

 

I think Vetal meant for you to see those and add them yourself since he was having issues with the upload feature.

yep

Added this to web-silte report

Working on LeaFAQ :)

Link to comment
Share on other sites

That doesn't tell very much. Can you make a real measurement using some Timer class around each of the commands, like UpdateFramework, RenderFramework, and rest of main loop code?

Somehow like this:

Timer timer1, timer2, timer3;
while(!done)  // main loop
{
timer1.Start(); UpdateFramework(); timer1.Stop();
timer2.Start(); GameLogic();       timer2.Stop();
timer3.Start(); RenderFramework(); timer3.Stop();
timer1.Show(); timer2.Show(); timer3.Show();
Flip(0);
}

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

Like Metatron says, you need some more detailed analysis. I personally use AMD code analyst (free) for the first rough profile. In 90% of the cases this pinpoints the actual bottleneck pretty correct, after which I tune. In some cases, this is not enough end you really need to go inside a couple of performance eating methods, and for that I use a custom Timer. Much like what Metatron shows here, but in a singleton class and logging to csv to easily generate some metrics and charts from it...

Link to comment
Share on other sites

This is without LoadScene

post-648-0-16508500-1312809441_thumb.png

 

		// Update state
		SingletonProfilerManager.SetTime(timeGetTime());
		_stateReturns = _activeState->UpdateState(_deltaTime);			
		__raise updateEvent->UpdateEvent( _deltaTime );
		SingletonProfilerManager.PrintTime("Updating World", timeGetTime() );

		// Render state
		SingletonProfilerManager.SetTime(timeGetTime());
		_activeState->RenderState(_deltaTime);
		__raise renderEvent->RenderEvent( _deltaTime );	
		SingletonProfilerManager.PrintTime("Rendering World", timeGetTime() );

		// Render GUI state
		SingletonProfilerManager.SetTime(timeGetTime());
		_activeState->RenderGuiState(_deltaTime);
		__raise guiRenderEvent->RenderGuiEvent( _deltaTime );
//			_activeState->RenderGuiPostState(_deltaTime);

		SingletonCeGuiManager.Render(_deltaTime);

		SingletonProfilerManager.PrintTime("Rendering Gui", timeGetTime() );
		SingletonProfilerManager.Submit();

 

Here is my main loop. the results are next:

 

137581 [2980] INFO Main logger <> - Updating World: 7

137589 [2980] INFO Main logger <> - Rendering World: 20

137600 [2980] INFO Main logger <> - Rendering Gui: 7

137648 [2980] INFO Main logger <> - UPS:7.611798

137656 [2980] INFO Main logger <> - FPS:9.000000

137666 [2980] INFO Main logger <> - Updating World: 7

137673 [2980] INFO Main logger <> - Rendering World: 20

137784 [2980] INFO Main logger <> - Rendering Gui: 5

137822 [2980] INFO Main logger <> - UPS:7.611798

137831 [2980] INFO Main logger <> - FPS:9.000000

137837 [2980] INFO Main logger <> - Updating World: 7

137851 [2980] INFO Main logger <> - Rendering World: 18

137865 [2980] INFO Main logger <> - Rendering Gui: 5

137948 [2980] INFO Main logger <> - UPS:7.611798

137961 [2980] INFO Main logger <> - FPS:9.000000

137971 [2980] INFO Main logger <> - Updating World: 9

137996 [2980] INFO Main logger <> - Rendering World: 40

138003 [2980] INFO Main logger <> - Rendering Gui: 5

138065 [2980] INFO Main logger <> - UPS:7.611798

138082 [2980] INFO Main logger <> - FPS:9.000000

138095 [2980] INFO Main logger <> - Updating World: 15

138110 [2980] INFO Main logger <> - Rendering World: 25

138166 [2980] INFO Main logger <> - Rendering Gui: 6

138223 [2980] INFO Main logger <> - UPS:7.568590

138230 [2980] INFO Main logger <> - FPS:9.000000

138236 [2980] INFO Main logger <> - Updating World: 11

138246 [2980] INFO Main logger <> - Rendering World: 21

138256 [2980] INFO Main logger <> - Rendering Gui: 9

138301 [2980] INFO Main logger <> - UPS:7.568590

138311 [2980] INFO Main logger <> - FPS:9.000000

138318 [2980] INFO Main logger <> - Updating World: 8

138324 [2980] INFO Main logger <> - Rendering World: 24

138337 [2980] INFO Main logger <> - Rendering Gui: 4

138391 [2980] INFO Main logger <> - UPS:7.568590

138535 [2980] INFO Main logger <> - FPS:9.000000

138544 [2980] INFO Main logger <> - Updating World: 9

138551 [2980] INFO Main logger <> - Rendering World: 21

138558 [2980] INFO Main logger <> - Rendering Gui: 10

138600 [2980] INFO Main logger <> - UPS:7.568590

138609 [2980] INFO Main logger <> - FPS:9.000000

138619 [2980] INFO Main logger <> - Updating World: 6

138625 [2980] INFO Main logger <> - Rendering World: 21

138632 [2980] INFO Main logger <> - Rendering Gui: 7

138673 [2980] INFO Main logger <> - UPS:7.568590

138681 [2980] INFO Main logger <> - FPS:9.000000

138687 [2980] INFO Main logger <> - Updating World: 10

138695 [2980] INFO Main logger <> - Rendering World: 17

138702 [2980] INFO Main logger <> - Rendering Gui: 6

138747 [2980] INFO Main logger <> - UPS:7.568590

138753 [2980] INFO Main logger <> - FPS:9.000000

138780 [2980] INFO Main logger <> - Updating World: 8

138790 [2980] INFO Main logger <> - Rendering World: 23

138933 [2980] INFO Main logger <> - Rendering Gui: 4

138994 [2980] INFO Main logger <> - UPS:7.568590

139001 [2980] INFO Main logger <> - FPS:9.000000

139010 [2980] INFO Main logger <> - Updating World: 11

139021 [2980] INFO Main logger <> - Rendering World: 32

139032 [2980] INFO Main logger <> - Rendering Gui: 6

139080 [2980] INFO Main logger <> - UPS:7.568590

139086 [2980] INFO Main logger <> - FPS:9.000000

139095 [2980] INFO Main logger <> - Updating World: 12

139102 [2980] INFO Main logger <> - Rendering World: 19

139115 [2980] INFO Main logger <> - Rendering Gui: 10

139170 [2980] INFO Main logger <> - UPS:7.568590

139180 [2980] INFO Main logger <> - FPS:9.000000

139186 [2980] INFO Main logger <> - Updating World: 8

139283 [2980] INFO Main logger <> - Rendering World: 23

139289 [2980] INFO Main logger <> - Rendering Gui: 17

139333 [2980] INFO Main logger <> - UPS:8.042895

139350 [2980] INFO Main logger <> - FPS:9.000000

139361 [2980] INFO Main logger <> - Updating World: 6

139368 [2980] INFO Main logger <> - Rendering World: 20

139382 [2980] INFO Main logger <> - Rendering Gui: 6

 

Next step is to separate GameLogic from UpdateWorld

Working on LeaFAQ :)

Link to comment
Share on other sites

The GUI seems to take a lot of time too, compared to the RenderWorld and UpdateWorld time. Maybe you should make an own GUI using simple OpenGL commands.

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 also think so: taking into account that the only gui is in the red rectangle... anyway, its not a problem to turn it off

 

Moreover, fps are nice if player is standing nearg green zone on the picture

 

So, i think that its because of models.. or lights

Working on LeaFAQ :)

Link to comment
Share on other sites

Make sure the light ranges are very low, because higher range eats a lot of FPS. You can have over 300 point lights with only few FPS cost, if you keep the ranges low (like range=5 or so).

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

post-648-0-83622900-1312816822_thumb.png

0_0

Quite strange: i loaded level with this template code (get 6 fps)


//	====================================================================
//	This file was generated by LEBuilder
//	http://leadwerks.com/werkspace
//	====================================================================

#include "engine.h"
#include <iostream>
#include <string>

const int 	ScreenWidth = 1024;
const int 	ScreenHeight = 768;
const char* MediaDir =  "Z:/Leadwerks Engine SDK";
const char* AppTitle = "Test";

void ErrOut( const std::string& message ) { std::cerr << message << std::endl; }

//	-------------------------------
int main( int argn, char* argv[] )
{
// Initialize
if( !Initialize() )
	return 1;        
SetAppTitle( AppTitle ) ;
RegisterAbstractPath( MediaDir ); 

// Set graphics mode        
if( !Graphics(ScreenWidth,ScreenHeight) )
{                
	ErrOut( "Failed to set graphics mode."  );
	return 1;        
}

// Create framework object and set it to a global object so other scripts can access it
TFramework fw = CreateFramework();        
if( fw == NULL )        
{
	ErrOut( "Failed to initialize engine." );                
	return 1;        
}        

// Set Lua framework object        
SetGlobalObject( "fw", fw );                

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

// Get framework main camera        
TCamera camera = GetLayerCamera( GetFrameworkLayer(0) );        
PositionEntity( camera, Vec3(0,0,-2) );        

// Create cube
TMaterial material = LoadMaterial( "abstract::cobblestones.mat" );        
// 	TMesh mesh = CreateCube();        
// 	PaintEntity( mesh, material ); 

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

TEntity cam=CreateCamera(); 
PositionEntity(cam,Vec3(0,2,-10)); 

// Create ground
TMesh ground = CreateCube();        
ScaleEntity( ground, Vec3(10,1,10) );        
PositionEntity( ground, Vec3(0,-2,0) );        
PaintEntity( ground, material );        

// Add some light
TLight light = CreateDirectionalLight();        
RotateEntity( light, Vec3(45,45,45) );        

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

// Spin cube until user hits Escape
while( !KeyHit() && !AppTerminate() )        
{                
	if( !AppSuspended() )
	{
		//Camera look 
		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); 
		//Camera movement 
		move=Curve(KeyDown(KEY_W)-KeyDown(KEY_S),move,20); 
		strafe=Curve(KeyDown(KEY_D)-KeyDown(KEY_A),strafe,20); 
		MoveEntity(cam,Vec3(strafe/10.0 *(1 + 20*KeyDown(KEY_LSHIFT)),0,move/10.0 * (1 + 20*KeyDown(KEY_LSHIFT)))); 


//		TurnEntity( mesh, Vec3( AppSpeed()*0.5f ) );     

		UpdateFramework();                
		RenderFramework();                

		Flip( 0 );        
	}
}                

return Terminate();
}

Working on LeaFAQ :)

Link to comment
Share on other sites

Make sure the light ranges are very low, because higher range eats a lot of FPS. You can have over 300 point lights with only few FPS cost, if you keep the ranges low (like range=5 or so).

 

You was right:

1312817222-clip-190kb.jpg

I changed it to

1312817410-clip-200kb.jpg

and have some fps boost

 

Now level is looking like this, is that ok, or i should decrease torches light radius?

1312817602-clip-183kb.jpg

Working on LeaFAQ :)

Link to comment
Share on other sites

You can also set the light's shadow mode to static, it still is dynamic then when things move inside the light range.

And you can lower the shadowmap size to 128.

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

Lights, that are in the second floor of tavern are dynamic+static, as static only doesnt cast a shadow

Lights, that are near player, are dynamic+static+buffered

 

Also, minimal resolution is 256, so i left it.

 

1312835575-clip-144kb.jpg

Got some additional fps, trying to remove torches

 

looking like i really need to decrease light radius there: as differed shading is used, 16 additional small lights cant drop fps from 25 to 15, i think

Working on LeaFAQ :)

Link to comment
Share on other sites

You need to include the Microsoft Visual C++ 2010 Redistributable Package with your project or at least include the files in your project executable directory or they won't run on any PCs that don't have Microsoft Visual C++ 2010 installed.

 

The level looks great though VeTaL. Glad you got the lighting issue sorted!

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

		// Update framework
		SingletonProfilerManager.SetTime(timeGetTime());
		UpdateFramework();
		SingletonProfilerManager.PrintTime("Updating Framework", timeGetTime() );

		// Update state
		SingletonProfilerManager.SetTime(timeGetTime());
		_stateReturns = _activeState->UpdateState(_deltaTime);			
		__raise updateEvent->UpdateEvent( _deltaTime );
		SingletonProfilerManager.PrintTime("Updating World", timeGetTime() );

		// Render framework
		SingletonProfilerManager.SetTime(timeGetTime());
		RenderFramework();
		SingletonProfilerManager.PrintTime("Render Framework", timeGetTime() );

		// Render state
		SingletonProfilerManager.SetTime(timeGetTime());
		_activeState->RenderState(_deltaTime);
		__raise renderEvent->RenderEvent( _deltaTime );	
		SingletonProfilerManager.PrintTime("Rendering World", timeGetTime() );

		// Render GUI state
		SingletonProfilerManager.SetTime(timeGetTime());
		_activeState->RenderGuiState(_deltaTime);
		__raise guiRenderEvent->RenderGuiEvent( _deltaTime );
//			_activeState->RenderGuiPostState(_deltaTime);
		SingletonProfilerManager.PrintTime("Rendering Gui States", timeGetTime() );

		// Render cegui
		SingletonProfilerManager.SetTime(timeGetTime());
		SingletonCeGuiManager.RenderWithImgui(_deltaTime);
		SingletonProfilerManager.PrintTime("Rendering Cegui", timeGetTime() );
		SingletonProfilerManager.Submit();

 

*VeTaL is ready for searching bottlenecks*

Something like this :)

Working on LeaFAQ :)

Link to comment
Share on other sites

118951 [2408] INFO Main logger <> - UPS:16.949152

118954 [2408] INFO Main logger <> - FPS:17.000000

118957 [2408] INFO Main logger <> - Updating Framework: 8

118960 [2408] INFO Main logger <> - Updating World: 0

118963 [2408] INFO Main logger <> - Rendering Framework: 25

118967 [2408] INFO Main logger <> - Rendering World: 0

118970 [2408] INFO Main logger <> - Rendering Cegui: 4

119002 [2408] INFO Main logger <> - UPS:16.949152

119005 [2408] INFO Main logger <> - FPS:17.000000

119007 [2408] INFO Main logger <> - Updating Framework: 6

119011 [2408] INFO Main logger <> - Updating World: 0

119015 [2408] INFO Main logger <> - Rendering Framework: 17

119018 [2408] INFO Main logger <> - Rendering World: 0

119022 [2408] INFO Main logger <> - Rendering Cegui: 4

119059 [2408] INFO Main logger <> - UPS:16.949152

119062 [2408] INFO Main logger <> - FPS:17.000000

119064 [2408] INFO Main logger <> - Updating Framework: 6

119068 [2408] INFO Main logger <> - Updating World: 1

119071 [2408] INFO Main logger <> - Rendering Framework: 23

119075 [2408] INFO Main logger <> - Rendering World: 0

119077 [2408] INFO Main logger <> - Rendering Cegui: 3

119110 [2408] INFO Main logger <> - UPS:16.949152

119113 [2408] INFO Main logger <> - FPS:17.000000

119116 [2408] INFO Main logger <> - Updating Framework: 6

119120 [2408] INFO Main logger <> - Updating World: 0

119123 [2408] INFO Main logger <> - Rendering Framework: 20

119127 [2408] INFO Main logger <> - Rendering World: 0

119129 [2408] INFO Main logger <> - Rendering Cegui: 3

 

Looking like that code is almost not affecting fps. The mostly fps are eaten by UpdateFramework(); and RenderFramework();

Also, i found my mistake (if be honest till the end :) ), i rendered Cegui two times.. well, tha's fixed fast enough... and i'm thinking about another gui instead of Cegui.

 

Idk, how Metatron get so large difference in running with and without content.

 

Edit: just tested game without logger: got the same fps with and without Cegui: about 25-30

Working on LeaFAQ :)

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