Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
3DGS PERFORMANCE HINTS (growing task) #66347
03/14/06 12:07
03/14/06 12:07

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Hi there!

I want to open this task because there are so many ways to speed up a 3dgs-program, but to find them is often very hard.
Most of us have experience in creating applications with the 3dgs and often good ideas to speed them up - maybe big hints or smaller ones sometimes very detailed or just a direction.

Please post here your experiences in speed up 3dgs-applications to be used by all of us...


My startup-hint:
[programming] Don't use templates for fast/big games! Learn c-script - it's worth every minute you spent!


Maybe we use the topic in bold and brackets like this :

[programming]
[leveldesign]
[models]
[physics]
[...]

thanx, mercuryus

Last edited by mercuryus; 03/14/06 12:14.
Re: 3DGS PERFORMANCE HINTS (growing task) [Re: ] #66348
03/14/06 12:13
03/14/06 12:13

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



[programming] Try to calculate results before use an if-clause


Example:

bad: if (a>b) { c = 5; }
good: c = 5*(a>b);
bad: if(my._health<20 && my._armor==0){you._active=on;}
good: you._active=(my._health<20 && my._armor==0);


mercuryus

Re: 3DGS PERFORMANCE HINTS (growing task) [Re: ] #66349
03/14/06 12:15
03/14/06 12:15
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
- when you use polygonal collision detection, make the model passable and use another invisible model which serves for the bounding-hull with less polygons and a approximated shape.

- use LOD

- if you have places with a lot of small entities which arent moving, join them together in one model to save FPS performance

- models are faster then WMB geometry

- global variables are faster than local variables (caused by allocation)

- programming should be done modul wise to produce reusable code

- design your interface and HUD for one resolution (e.g. 1024x768) and let the rest being scaled and filtered by native panel skills -> saves HD memory and time spent on dubbing it for other resolutions

- avoid shaders if you dont really need them

[edit]

- flags cant be assigned like that: flag1 = flag2; and an if clause is dirty, so do this: flag1 = sign(flag2);

Last edited by HeelX; 03/14/06 12:16.
Re: 3DGS PERFORMANCE HINTS (growing task) [Re: ] #66350
03/14/06 12:15
03/14/06 12:15
Joined: Nov 2004
Posts: 1,011
South Africa
capanno Offline
Serious User
capanno  Offline
Serious User

Joined: Nov 2004
Posts: 1,011
South Africa
Ulilillia should post his engine analyses diagrams here.

Re: 3DGS PERFORMANCE HINTS (growing task) [Re: capanno] #66351
03/14/06 12:49
03/14/06 12:49
Joined: Jan 2003
Posts: 4,305
Damocles Offline
Expert
Damocles  Offline
Expert

Joined: Jan 2003
Posts: 4,305
especially watch for draining calculations like trace,

If an object used frequent traces,
use waitt(x) or sleep(y);

wait(1) is bad, since it will do a trace every frame.

use as many waitt or sleep in loops as possible


dont use a second view! if it is not defenitly needed for gameplay....

Re: 3DGS PERFORMANCE HINTS (growing task) [Re: capanno] #66352
03/14/06 12:49
03/14/06 12:49
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
When building models, have their polygon counts somewhere between 1500 and 7000 polygons for best performance. My graph here has these results from an experiment I did about a month ago:



Code:

+---------------------------+
| object count |
+-+-----+----+----+----+----+
| | | 64| 128| 256| 512|
+-+-----+----+----+----+----+
|p| 10| 78| 91| 100| 102|
+-+-----+----+----+----+----+
|o| 20| 154| 175| 198| 207|
+-+-----+----+----+----+----+
|l| 50| 380| 438| 476| 501|
+-+-----+----+----+----+----+
|y| 100| 720| 830| 910| 950|
+-+-----+----+----+----+----+
| | 200|1330|1510|1660|1750|
+-+-----+----+----+----+----+
|c| 500|2820|3180|3340|3510|
+-+-----+----+----+----+----+
|o| 1000|4310|4930|5050|5320|
+-+-----+----+----+----+----+
|u| 2000|6050|6690|6530|7030|
+-+-----+----+----+----+----+
|n| 5000|6610|6600|6980|6960|
+-+-----+----+----+----+----+
|t|10000|3640|3630| xx | xx |
+-+-----+----+----+----+----+
| |20000|1930| xx | xx | xx |
+-+-----+----+----+----+----+



This graph uses a logarithmic scale. The chart below it has the actual values, in kilopolygons per second, of which are ±2% from the actual, adjusting for the wild variations. The models are flat grids and dynamic. For randomized meshes, it takes 50% longer to render (having 2/3 the frame rate). This is how it is with my system*. The test environment is otherwise an empty level with a single small block (of which can't be seen) and the test subjects. There's practically no script used, only that of what the engine runs by and two very simple camera movement things (only to move the camera faster than what the engine allows as the engine is often too slow.

I do have intentions on running a lot more experiments for more conclusive results on the peak, I've been too involved with my 2D game lately, again.

* My system specs, at the time of doing the experiment, are as follows: CPU = Pentium 4 3.0 GHz with 800 MHz Front-side bus; RAM = 512 MB with 2.5-3-3-6 timing (the center 3's are uncertain), one at 333 MHz and a second at 400 MHz; OS = Windows XP Pro; Video card = Radeon 9600 XT (drivers from August 12, 2004);

Edit: added my chart showing the numbers plotted on the graph.

Last edited by ulillillia; 03/14/06 12:59.

"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: 3DGS PERFORMANCE HINTS (growing task) [Re: Damocles] #66353
03/14/06 12:53
03/14/06 12:53
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Quote:

If an object used frequent traces,
use waitt(x) or sleep(y);




Don't use waitt as it's an old instruction and has been abandoned. Use the wait instruction instead. wait(4); waits 4 frames before processing again. wait(-4); waits 4 seconds.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: 3DGS PERFORMANCE HINTS (growing task) [Re: HeelX] #66354
03/16/06 19:47
03/16/06 19:47
Joined: Feb 2003
Posts: 195
slacker Offline
Member
slacker  Offline
Member

Joined: Feb 2003
Posts: 195
Quote:



- models are faster then WMB geometry






Is this always true? Doesn't the visibility calcualtion affect this?

Re: 3DGS PERFORMANCE HINTS (growing task) [Re: slacker] #66355
03/17/06 14:59
03/17/06 14:59
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Quote:


Quote:
--------------------------------------------------------------------------------



- models are faster then WMB geometry




--------------------------------------------------------------------------------



Is this always true? Doesn't the visibility calcualtion affect this?





True, compiling a level with mdls is faster than blocks.

Re: 3DGS PERFORMANCE HINTS (growing task) [Re: vlau] #66356
03/17/06 19:50
03/17/06 19:50
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Not just with compiling, but also in rendering. Try getting a detailed level with nothing but blocks to render even 1 million polygons per second without any models. Even a moderately-low end system could do that in a model-only level. If a model is offscreen, too far away for reasonable rendering of it, just add my.invisible = on; in the action somewhere and there's a huge speed increase. With 1728 such objects, you can still pass 500 frames per second rendering unlike just 10 fps with all visible, even if just one triangle each....


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Page 1 of 3 1 2 3

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1