Inside3D!
     

Official Post Your Enging Coding Tips Thread
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon Aug 03, 2009 10:45 pm    Post subject: Reply with quote

I didn't say anything about running faster. Only compile faster.

Having said that, if you use only a single compilation unit your compiler can optimise through different modules.
In practice, MSVC 2003 upwards or something supports 'whole program optimisation' which basically does the same thing. Intel's C compiler does something similar I gather. While GCC plain sucks and depends upon function order, so you won't see much benefit there either, and you'd need to define everything as static. Frankly, trying to do so is stupid. Code readability is king.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Tue Aug 04, 2009 12:04 am    Post subject: Reply with quote

Spike wrote:
Frankly, trying to do so is stupid. Code readability is king.


I second that.

Choose a consistent coding style, don't worry about suggestions like "put all into the same file to compile faster". Yeah, 30 seconds faster to compile, and a couple hours more trying to figure out things while debugging. Razz
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Tue Aug 04, 2009 12:40 am    Post subject: Reply with quote

Obviously :O!

But this thread should be kept to Quake specific coding tips, you know?
Back to top
View user's profile Send private message
Willem



Joined: 23 Jan 2008
Posts: 73

PostPosted: Tue Aug 04, 2009 1:33 pm    Post subject: Reply with quote

Quote:
I didn't say anything about running faster. Only compile faster.

It's probably best to also say that by "faster" you mean "marginally faster". I mean, it only takes a few seconds as it is...
_________________
www.wantonhubris.com
Back to top
View user's profile Send private message Visit poster's website
Team Xlink



Joined: 25 Jun 2009
Posts: 320

PostPosted: Tue Aug 04, 2009 4:54 pm    Post subject: Reply with quote

Ok.


I am looking to make my engine as fast as possible.

Even if the changes only saved around a few kbs of ram that is good.

I only have about 18 mbs of usable ram on my platform that my engine is designed for.

So I am looking to save as much ram and resources as possible.

I heard somewhere that Tomaz Quake is designed for performance so I have been analyzing that code and looking for things that speed it up.

I really need any performance boosts I can get.

I have added some of Lord Havocs speed fix's to my engine as well.


We have good mappers and modelers,

but there somewhat limited because of the resources that the engine takes.

It isn't fun when you make an awesome map and you literally have to cut it in half just to get an alright frame rate.

I am currently trying to implement the NAT fix, I am looking at other engines to see how they have done it.

These things should be added to the Quake Standards.

Nat Fix
and
Rotating Brush support.

I really don't see a reason for any quake engine not to have them at all.
_________________
Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!


Last edited by Team Xlink on Tue Aug 04, 2009 5:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 910

PostPosted: Tue Aug 04, 2009 5:08 pm    Post subject: Reply with quote

Team Xlink wrote:
Ok.


I am looking to make my engine as fast as possible.

Even if the changes only saved around a few kbs of ram that is good.

I only have about 18 mbs of usable ram on my platform that my engine is designed for.

So I am looking to save as much ram and resources as possible.

I heard somewhere that Tomaz Quake is designed for performance so I have been analyzing that code and looking for things that speed it up.

I really need any performance boosts I can get.

I have sdded some of Lord Havocs speed fix's to my engine as well.

Software or GL?

If you want speed, the best things you can do with a hardware accelerated engine are (1) sort by texture, and (2) use compressed textures. You can tweak half a frame here, half a frame there using other methods, but these two will make your performance shoot ahead.

(PS: I'm not ignoring your recent message, just haven't had time to look into stuff yet).
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Team Xlink



Joined: 25 Jun 2009
Posts: 320

PostPosted: Tue Aug 04, 2009 5:49 pm    Post subject: Reply with quote

It is GL.

Thankfully our platform is good with the GPL Api (I think that is what it is called).


I am going to try to use compressed textures and sort by textures.

If those work then it will help our project a lot.


Also, I understand abut the message, we all have real life and what was in my message isn't the most important thing in the world.
_________________
Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 910

PostPosted: Tue Aug 04, 2009 6:04 pm    Post subject: Reply with quote

Team Xlink wrote:
I am going to try to use compressed textures and sort by textures.

Don't put them on lightmaps though. Wink
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Spirit



Joined: 20 Nov 2004
Posts: 476

PostPosted: Tue Aug 04, 2009 6:32 pm    Post subject: Reply with quote

QuakeForge might be the most performant engine to start with, at least it was some years ago.
_________________
Quake Maps
Back to top
View user's profile Send private message Visit poster's website
Team Xlink



Joined: 25 Jun 2009
Posts: 320

PostPosted: Tue Aug 04, 2009 7:09 pm    Post subject: Reply with quote

That engine is a combination of Quake and Quake World.

http://www.quakeforge.net/

So I am not sure how well I will be able to put some of it in my engine.


Although because it is for Quake and Quake World I might be able to find out where the "bunny hoping" stuff is and put it in my engine because they removed it from glquake and I would like to put it back in.

It would be in the SV_ files right?

Actually which version did they remove it in?
_________________
Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 910

PostPosted: Tue Aug 04, 2009 7:40 pm    Post subject: Reply with quote

QRack with the eye-candy turned off is actually quite capable of some extremely good frame rates too; probably the fastest engine I came across when I was testing on Windows 7 a while back. It may have some heavy hardware requirements though, but I'd guess that if you were to hack it to strip out the custom content you'd have a pretty fast and lightweight baseline (with the advantage of being bang up to date with fixes and enhancements).

One other thing - since you have a low memory ceiling, and if you're using any modern engine as a base, you will be wanting to remove 3 component lightmap support and reverting back to the original single component lightmaps. This is kinda like implementing the old coloured light tutorial in reverse, so hunt around for the old QuakeSrc tutorials (there's a link on here under General, so just search there) and do that.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Tue Aug 04, 2009 7:41 pm    Post subject: Reply with quote

Atually, quakeforge is two separate engines, one nq, one qw, with a lot of shared code.

The bunnyhopping is presumably somewhere in pmove.c... good luck with that.... (lol)

bunnyhopping wasn't removed in glquake. the acceleration is a 'bug' in quakeworld, not something intentional. it happens because you can jump at the same time as you land, thus friction never applies. strafing still accelerates slightly as you move.
But yeah, you can't bunnyhop very effectively in nq because there's a frame of friction each jump. The faster you go, the greater the effect, but I get the feeling that you have slightly more air control in nq thus more acceleration or something.
They're meant to be about the same physics, and at certain framerates they're pretty similar. but mneh
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Tue Aug 04, 2009 8:11 pm    Post subject: Reply with quote

hmm also worth a note for speed is avoiding math like (2 / 4) = 2 use addition instead (2 * 2) = 2; or calc the value if its a constant.

a lot of functions can be put into a macro to speed up things also

check mathlib.h from dp.
carefull tho i found that some functions as macro will actually slow things down instead (printf function macro from an old tomazquake src) :S
Back to top
View user's profile Send private message
Team Xlink



Joined: 25 Jun 2009
Posts: 320

PostPosted: Tue Aug 04, 2009 9:07 pm    Post subject: Reply with quote

Well it will be hard to start with a modern engine as a base.

Our platform is the PSP.

Which for the Series 1000 only has 18mb of ram that we can use.

A lot of the code is platform specific.

So I have been trying to add or edit our engine instead of using a modern pc one.

A lot of it is different.

A lot of things are a huge pain to get to work on the psp.

The files aren't the same name and some of them aren't even there.

like glvidnit.c that file is completely removed and I assume that parts of it are thrown throughout the other code.


So tutorials a lot of times don't work.

If they do sometimes they can require to much ram or what not.

Also what compression level did you have in mind?
_________________
Anonymous wrote:
if it works, it works. if it doesn't, HAHAHA!
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 910

PostPosted: Tue Aug 04, 2009 9:55 pm    Post subject: Reply with quote

Team Xlink wrote:
Also what compression level did you have in mind?

I'm Direct3D these days so it's probably not comparable, but if you've got an equivalent of D3DFMT_DXT1 I've found it to be just fine for most 8 bit textures. 32 bit textures can also use D3DFMT_DXT1 if they don't have an alpha channel; if they do you'll need D3DFMT_DXT3 or D3DFMT_DXT5. D3DFMT_DXT2 and D3DFMT_DXT4 are weighted alpha which shouldn't be used unless you know that's what you want.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group