Product Chat / Performance killer theory

Author
Message
MooKai
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 22nd Jul 2009
Location: World
Posted: 21st Feb 2019 12:26
I guess everybody who use GG knows that.
You create a nice scene, a perfect level, which runs at a nice frame rate of 30 or maybe 60 FPS.
Then u add your first 10-15 enemies and BAM the frame rate is down at 20fps or from 60 down to 45.
Then u add a few more script controlled things to the scene and the frame rate goes down more...

Yes, I think Lua is one of the bottlenecks, the more lua script controlled NPCs u add the slower the game gets.
Lua is good for scripting ok, but it is still an interpreter language, right? So still slower than compiled code...

So, if u have a lot of NPCs and script controlled things in your level, then the engine is busy with the Lua scripts or is waiting for the interpreted scripts.

So, maybe it would be good, if in the final standalone game all Lua scripts are all already compiled instead interpreting the scripts over and over again.
Or maybe use a faster Lua interpreter, luaJIT...?
But I think already compiled scripts in the standalone would make our games faster with more FPS.

Just a theory.... maybe I am totally wrong.
Old school FPS fan, DOOM!!! Why GG not working on my AMIGA 500?
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 21st Feb 2019 13:03
Quote: "But I think already compiled scripts in the standalone would make our games faster with more FPS."


lua scripts are compiled for the standalone. Not sure it makes a vast amount of difference to performance, but does protect the scripts from being easily changed.

Cheers.
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 21st Feb 2019 13:11
A lua scheduler would be a good idea, so you can set script to run every frame, every 10 frames etc, just have a nice lua command in the init
eg:

Script_Time(e) = 5 -- run once every 5 frames, not every 60 frames.

not sure what syntax it would need but just an idea.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth, Roland D05 Synth Module, Bluedio Victory V Headphones, AKG K141 Studio Headphones, Lenovo Ideapad, with Windows 10 64bit, 8Gb Ram and AMD A10 7th Gen Graphics. Acer Swift i3 Laptop with Intel Optane memory, Intel 620UHD GPU, Windows 10 64bit.
MooKai
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 22nd Jul 2009
Location: World
Posted: 21st Feb 2019 14:45
Hmmm... are u sure they are already compiled or just protected like the other files in the standalone?
Old school FPS fan, DOOM!!! Why GG not working on my AMIGA 500?
PM
Corno_1
GameGuru Tool Maker
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 21st Feb 2019 14:56
Quote: "Yes, I think Lua is one of the bottlenecks, the more lua script controlled NPCs u add the slower the game gets."

Maybe this is caused by the high poly character models with a lot of animations!
Quote: "Lua is good for scripting ok, but it is still an interpreter language, right? So still slower than compiled code..."

Lua is designed for scripting. Yes it is slower, but even if we switch to Assembler that would not solve any performance issue. Python is also a interpreter language and is the first choice for maschine learning software(one of the most resource needed processes ever).

The C++ code of GG is so un-optimized, that even bad scripted lua scripts will never be the bottleneck.

Quote: "A lua scheduler would be a good idea, so you can set script to run every frame, every 10 frames etc, just have a nice lua command in the init "

If you want something like this, you can script it in your lua file yourself.

Ok, you are not completly wrong. The AI scripts are not optimized, but we have bigger performance problems than the AI.
If you want to be sure the AI is your bottleneck, add it to a lowpoly box with no animations and tell us, if the fps drop is still that big.
Ebe Editor Free - Build your own EBE structures with easy and without editing any text files
Thread and Download
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 21st Feb 2019 14:56
Compiled . Open one and you can see.

Cheers.
MooKai
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 22nd Jul 2009
Location: World
Posted: 21st Feb 2019 15:22
Ok, then I was totally wrong he he he : )
Old school FPS fan, DOOM!!! Why GG not working on my AMIGA 500?
PM
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 21st Feb 2019 15:42
If we are discussing performance, a shadow overhaul might be a good idea, turning on shadows kills FPS.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth, Roland D05 Synth Module, Bluedio Victory V Headphones, AKG K141 Studio Headphones, Lenovo Ideapad, with Windows 10 64bit, 8Gb Ram and AMD A10 7th Gen Graphics. Acer Swift i3 Laptop with Intel Optane memory, Intel 620UHD GPU, Windows 10 64bit.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Feb 2019 20:03
Just hit tab and you can see instantly where the performance problems are, if the AI scripting is the cause the top bar will give that away.

Lua itself is the fastest scripting language available, which is why everyone uses it!

Most of the default scripts are not performance optimised in any way though so some improvement could be got from optimising them, not sure if it would make a whole lot of difference to FPS though as it is much more likely to be the rendering of the animated characters that is the cause.
Been there, done that, got all the T-Shirts!
PM
MooKai
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 22nd Jul 2009
Location: World
Posted: 21st Feb 2019 21:12
true... shadows, water and the lightrays are fps hungry.
Old school FPS fan, DOOM!!! Why GG not working on my AMIGA 500?
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 21st Feb 2019 21:15
Interestingly have you tried clicking on that AI bar once it is displayed?

It gives another breakdown set of stats when you do. Only found this out recently, maybe it’s common knowledge that passed by me.

Cheers.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Feb 2019 21:40 Edited at: 21st Feb 2019 21:48
News to me! I'll have a play.

Well bugger me, you learn something new every day with GG!
Been there, done that, got all the T-Shirts!
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 21st Feb 2019 23:38
Where did that come from?
RIP
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

New:
Intel(R) Core(TM) i5-8400 CPU @ 2.81GHz, 12GB RAM, Nvidia gtx1050ti 4gb, Windows 10 Home 64bit, Screen resolution 1920 x 1080. System Passmark 3774




cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 22nd Feb 2019 08:41
Think it’s been in a long time - I just noticed it when I was looking at the source code the other week.

Wonder what else is hidden away

Cheers
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Feb 2019 10:52
When I do that I just get a headache.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 23rd Feb 2019 15:27 Edited at: 23rd Feb 2019 15:29
@ Ciber
it's just an easter egg. LOL

Or naybe a door to go on deep web.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 23rd Feb 2019 15:56
I was considering going into the masked solider .x file and removing a lot of the unused animations like "sitting, typing, talking, ladder climbing, swimming" to create a lighter .x file to see if that would help with performance at all. Since that character after all has a ton of animations most of the users on the forums dont take advantage of.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 23rd Feb 2019 17:08
Teabone? Which character exactly? And how do you implement those animations?

"most of the users on the forums dont take advantage of."
....... obviously if we don't know about it- or how!
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 23rd Feb 2019 17:48
Open the fpe file and look at the animation info. There is a text file in the stock stuff also that lists the animations and frames.
RIP
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

New:
Intel(R) Core(TM) i5-8400 CPU @ 2.81GHz, 12GB RAM, Nvidia gtx1050ti 4gb, Windows 10 Home 64bit, Screen resolution 1920 x 1080. System Passmark 3774




Defy
17
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 24th Feb 2019 05:23 Edited at: 24th Feb 2019 14:14
Pipeline stall creating wait states can have performance issues. Function call/ if conditions.
Functions need to execute, bouncing from physics to graphics create stalls waiting to handle the next function.
Based on the information, Individual objects are then spread all over memory, update code cycling physics, graphics and logic.
I am curious of the function calls on your map before and after AI placement, a similar form of DOD is an option or as suggested above optimize your code/map to suit how the index handles. Removing references in the index can cause dangling pointer issues so keep that in mind.

Also, for those interested (entitybank\Characters) MaskedSoldier.X is 2,425 kb at 6040 frames compared to Rocket Man.X at 10,180 kb, at 6714 frames. Character Creator civilian1.X body model and animation is 6,100 kb and lists at 27335 frames.

Below is an example of randomly placed object design, compared to organizing data placement then design.
Using one folder of Entities, Cityscape. two Different AI model x5 each = 10, no spawns, random location placement.
Also including 2 dynamic barrels x10+ and two of these barrels set to AlwaysActive. Vsync off to give an example in small scene.

First image. AI placed every 5-10 entities during map build. 35k polys, AI referencing is high resulting in low frames.
Second image, AI placed first, dynamic entities and then static. 39k polys (I went a little bigger by mistake) similar location, physics is higher, more polys in scene, draw calls are slightly up and higher frames. This is a single test result, though 10 frames can be a lot if dipping below 60.

Attachments

Login to view attachments
PM

Login to post a reply

Server time is: 2024-11-24 01:25:23
Your offset time is: 2024-11-24 01:25:23