Python S3O module and optimizer - Page 2

Python S3O module and optimizer

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Python S3O module and optimizer

Post by FLOZi »

I should stop googling stuff and read my book on Assessment for Learning. :roll:

wrt tristripping:

http://shiny-dynamics.blogspot.com/2010 ... r-osg.html

http://home.comcast.net/~tom_forsyth/pa ... e_opt.html
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Python S3O module and optimizer

Post by Beherith »

I tried it with the version available at the time of posting, and the code didnt save the texture names in the optimized s3o :(

It was 24 bytes smaller than upspring optimized, with no change in frate rate at 500 units. The unit had 2.5k tris.
Muon
Posts: 24
Joined: 23 Jan 2012, 21:42

Re: Python S3O module and optimizer

Post by Muon »

Didn't save the texture names? Huh? What version of Python are you using? Could you give me a hex dump of the header or send the S3O to me?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Python S3O module and optimizer

Post by Beherith »

2.6.4
Attachments
corshroud.7z
(21.22 KiB) Downloaded 20 times
Muon
Posts: 24
Joined: 23 Jan 2012, 21:42

Re: Python S3O module and optimizer

Post by Muon »

Is that the original or the optimized? If it's the optimized, I can read the texture paths just fine.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Python S3O module and optimizer

Post by Beherith »

Its the original
Muon
Posts: 24
Joined: 23 Jan 2012, 21:42

Re: Python S3O module and optimizer

Post by Muon »

Huh, it works fine on mine (Windows, Python 2.7), albeit, with a size change of 0 bytes. Did you get the latest latest latest version? Also, was the size change on the borked one +24 bytes or -24 bytes? At least try reinstalling Python or update to 2.7.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Python S3O module and optimizer

Post by Beherith »

-24 bytes
Muon
Posts: 24
Joined: 23 Jan 2012, 21:42

Re: Python S3O module and optimizer

Post by Muon »

Yeees, and get the latest version. If it's still borked, upgrade to Python 2.7. Please let me know whether to declare 2.6 off-limits :P
Muon
Posts: 24
Joined: 23 Jan 2012, 21:42

Re: Python S3O module and optimizer

Post by Muon »

UPDATE: added the blessed vertex cache optimizer.

Good news: my optimizer reduces the ACMR of your meshes from an average of 3.0 (yes, you read that correctly, every vertex incurs a cache miss) to between ~0.8 and ~1.2.

Bad news: except on certain meshes, the performance change is minimal (+2 to +5 FPS on the average model) even with these heavy optimizations (again, Sandy Bridge graphics, so it might be more important with more bling and an actual GPU), so all of this doesn't mean too much until Spring's renderer is fixed.
Last edited by Muon on 30 Jan 2012, 17:45, edited 1 time in total.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Python S3O module and optimizer

Post by Beherith »

Cool beans, I tested it again, and this time it worked fine. I have yet to performance test the results, but will do so once I get back to main pc.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Python S3O module and optimizer

Post by FLOZi »

edit: i am a moron
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Python S3O module and optimizer

Post by Beherith »

So 500 BAR core t2 jammers (ones by mr bob, 2.5k tris each) are 21 FPS with upspring optimized models, and 25 fps with your vertex cache optimized ones. Excellent work! Especially considering its so easy to use, every modder should try it.
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Python S3O module and optimizer

Post by KingRaptor »

When run on the Zero-K models, this tool appears to have flipped empty pieces along the Z-axis on a few models. I do not know if there is a common pattern.

Most obvious on Krow (unitname corcrw - turrets aim in the opposite direction to target) and Dante (unitname dante - missiles fire backwards; flamethrower FX is backwards).

Do you happen to know what the cause might be?
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Python S3O module and optimizer

Post by yuritch »

Same happened to S44 models - tracers fly backwards after optimizing. Not sure if it affected all empty pieces or not though.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Python S3O module and optimizer

Post by Beherith »

How does one even flip an empty piece along z axis? The only info stored in s3o is the offset position, not the offset angle.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Python S3O module and optimizer

Post by FLOZi »

They often aren't empty but 2 or 4 vertices, and vertex order defines direction.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Python S3O module and optimizer

Post by Kloot »

One does not.

However, many models have "pseudo-empty" pieces (with only one or two vertices) that are used as effect-emission points, and their direction is determined by the order in which the vertices are specified. Such pieces should not be touched by the optimizer.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Python S3O module and optimizer

Post by Beherith »

Cool, I didnt know any of this. How exactly is this emission vector defined?

Is it take two vertices, and the vector drawn by vert1->vert2 will be the emission direction?

What methods do you use to create such pieces?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Python S3O module and optimizer

Post by smoth »

Kloot wrote:However, many models have "pseudo-empty" pieces (with only one or two vertices) that are used as effect-emission points, and their direction is determined by the order in which the vertices are specified. Such pieces should not be touched by the optimizer.
I do this, thanks for looking out for this.
Post Reply

Return to “Engine”