Per object multisampling

By on March 13, 2012 12:31:17 PM from JoeUser Forums JoeUser Forums

Frogboy

Chief Executive Officer
Join Date 03/2001
+962

You’ll hear a lot of my posts start with “I’m not a …” 

I don’t have a real specialty at anything.

I’m not a DirectX programmer but I know that the jaggies in Fallen Enchantress were driving me mad.

So I made some tweaks to get objects to multi-sample on the map without it doing everything. So you don’t get the perf hit of trying to multisample everything but you get the smooth graphics on the things you want.

Example:

Before:

image

After

image

You’ll need to click on the thumbnails since thumbnails multi-sample the original.

22 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 1:23:35 PM from Elemental Forums Elemental Forums

Nicely done.

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 1:48:41 PM from Elemental Forums Elemental Forums

Is it wrong that this post reminded me that I want more pose options?

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 1:56:38 PM from Elemental Forums Elemental Forums

How does this NOT incur a performance loss?

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 2:06:24 PM from Elemental Forums Elemental Forums

Quoting Heavenfall,
How does this NOT incur a performance loss?

It does. It's just not noticeable.

We cap the framerate at 60fps no matter what. 

What I'm doing here is having it selectively anti-alias on things that we would notice.

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 2:11:59 PM from Elemental Forums Elemental Forums

Quoting Frogboy,
It does. It's just not noticeable.

 

ಠ_ಠ

You're getting the look of disapproval because I'm not getting 60fps except in the very start of a game.

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 3:19:49 PM from Elemental Forums Elemental Forums

Don't make me come over there.

Right now, if you turn on anti-aliasing, it does it to everything and you get a massive FPS hit.  But 90% of things don't need to be antialiased (a lot of things have anti-aliasing basked into their texture).

As for perf, turn off the particle effects for now. I found a bug that is causing all particle effects to run all the time no matter what and those build up through the course of a game.

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 3:30:23 PM from Elemental Forums Elemental Forums

Quoting Frogboy,
Don't make me come over there.

Right now, if you turn on anti-aliasing, it does it to everything and you get a massive FPS hit.  But 90% of things don't need to be antialiased (a lot of things have anti-aliasing basked into their texture).

As for perf, turn off the particle effects for now. I found a bug that is causing all particle effects to run all the time no matter what and those build up through the course of a game.

Well, that is a nice little gem! Hopefully that increases my stability a bit. Do you have, and if not, maybe you could put this nugget of info in a sticky somewhere out front?

Also, while talking options, what exactly does "Disable Outlines" do? Is that just for the outlines of cities?

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 3:47:50 PM from Stardock Forums Stardock Forums

Quoting Frogboy,
Don't make me come over there.

Right now, if you turn on anti-aliasing, it does it to everything and you get a massive FPS hit.  But 90% of things don't need to be antialiased (a lot of things have anti-aliasing basked into their texture).

As for perf, turn off the particle effects for now. I found a bug that is causing all particle effects to run all the time no matter what and those build up through the course of a game.

 

I wonder if this is why I crash a lot. I'll have to do that tonight

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 4:05:54 PM from Elemental Forums Elemental Forums

Quoting Bellack,

Quoting Frogboy, reply 6Don't make me come over there.

Right now, if you turn on anti-aliasing, it does it to everything and you get a massive FPS hit.  But 90% of things don't need to be antialiased (a lot of things have anti-aliasing basked into their texture).

As for perf, turn off the particle effects for now. I found a bug that is causing all particle effects to run all the time no matter what and those build up through the course of a game.


 

I wonder if this is why I crash a lot. I'll have to do that tonight

 

Ditto

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 4:08:29 PM from Elemental Forums Elemental Forums

Don't make me come over there.

Come at me bro!

 



Right now, if you turn on anti-aliasing, it does it to everything and you get a massive FPS hit.  But 90% of things don't need to be antialiased (a lot of things have anti-aliasing basked into their texture).

As for perf, turn off the particle effects for now. I found a bug that is causing all particle effects to run all the time no matter what and those build up through the course of a game.

Alright, maybe I jumped the gun a bit. I can't go complaining about every change that affects performance, can I? I think it sounds like a good change overall.

 

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 4:19:29 PM from Elemental Forums Elemental Forums

Quoting Leo in WI,

Quoting Frogboy, reply 6Don't make me come over there.

Right now, if you turn on anti-aliasing, it does it to everything and you get a massive FPS hit.  But 90% of things don't need to be antialiased (a lot of things have anti-aliasing basked into their texture).

As for perf, turn off the particle effects for now. I found a bug that is causing all particle effects to run all the time no matter what and those build up through the course of a game.

Well, that is a nice little gem! Hopefully that increases my stability a bit. Do you have, and if not, maybe you could put this nugget of info in a sticky somewhere out front?

Also, while talking options, what exactly does "Disable Outlines" do? Is that just for the outlines of cities?

That wo't affect your stability.

Disable outlines will improve performance. It turns off the black outlines on the mountains and units.  Outlines are part of the visual style for the game but they're expensive.

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 4:25:42 PM from Elemental Forums Elemental Forums

Quoting Frogboy,
That wo't affect your stability.

Disable outlines will improve performance. It turns off the black outlines on the mountains and units. Outlines are part of the visual style for the game but they're expensive.

 

Gotcha, thanks for the tip. Performance is pretty good, until a crash, so I'll just turn off the particles for now and see how it goes.

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 4:46:59 PM from Elemental Forums Elemental Forums

Crashes are the main thing I've been working on this week.  This other stuff I use to keep myself from going insane.  

Here is why your game crashes on you (example):

You have a city selected. You decide to build an improvement. Game crashes...

...Because in another thread it was looking through all the improvements at that city at that moment...

Another example...

You're just playing, you hit the turn button, it crashes....

...Because in another thread, it's doing an autosave and just as a goodie hut was being removed from the world, it was trying to save that goodie hut.

...

Now, those are obvious cases and so they're already protected. The cases I'm dealing with are a lot lot more obscure.  

The original WOM wasn't multithreaded (in fact, a lot of games only use 1 thread).  But not having threads crippled our ability to have a lot of sophistication (like the computer AI) that FE has.  So "they" brought me onto FE to rearchitect the engine to be highly threaded.  But there's a transitionary time (i.e. now) where some systems are thread safe and some aren't.

That's why you see journal entries from me where I do something...different.  Because I have to play the game over and over and over again and certain things end up bugging the hell out of me after awhile. Jaggies. Long turns. Sound effects. Ugly textures. Etc.

And in the process of making the game highly threaded, I had to redo the memory manager.  So for example, I can play 7 games within a game and still only be using about a gigabyte of memory now (before you would have run out of memory -- assuming you didn't crash).

People with Windows XP are still in for some pain I suspect as we're not going to gimp the game for people who won't upgrade from Windows XP (they can only see 2 GB, Windows 7 users can see 4GB)  But XP users should be fine now unless they run mods.

Anyway, with this extra memory I went ahead and redid some of the textures in ways that are pretty subtle (the artists will be able to do a lot more).

Every noticed how crappy the grass looks in the game? That's because it's a picture that's only 32x32 (pixels).  Now they're 256x256 and anti-aliased.

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 5:01:26 PM from Elemental Forums Elemental Forums

Quoting Frogboy,

Quoting Leo in WI, reply 7
Quoting Frogboy, reply 6Don't make me come over there.

Right now, if you turn on anti-aliasing, it does it to everything and you get a massive FPS hit.  But 90% of things don't need to be antialiased (a lot of things have anti-aliasing basked into their texture).

As for perf, turn off the particle effects for now. I found a bug that is causing all particle effects to run all the time no matter what and those build up through the course of a game.

Well, that is a nice little gem! Hopefully that increases my stability a bit. Do you have, and if not, maybe you could put this nugget of info in a sticky somewhere out front?

Also, while talking options, what exactly does "Disable Outlines" do? Is that just for the outlines of cities?

That wo't affect your stability.

Disable outlines will improve performance. It turns off the black outlines on the mountains and units.  Outlines are part of the visual style for the game but they're expensive.

Who knew black lines could be so costly?

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 6:33:48 PM from Elemental Forums Elemental Forums

Martin Luther knew.     

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 8:09:06 PM from Elemental Forums Elemental Forums

Whoo hoo thanks for the info Frogboy! Quite interesting to read about what your doing.

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 8:22:17 PM from Elemental Forums Elemental Forums

Quoting seanw3,
Martin Luther knew.

 

You got karma for that

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 9:00:44 PM from Elemental Forums Elemental Forums

i have so much respect for u Frogboy!

and the 'object specific' Anti Aliasing, is going to be a feature in a future beta build?

it sounds like a really smart thing

tnx for the tips, and as i just told the whole world in a new thread, i love FE ! yey iam in such a good mood right now

 

Reason for Karma (Optional)
Successfully updated karma reason!
March 13, 2012 9:23:59 PM from Elemental Forums Elemental Forums

My preference would be to have a simple [ ] Anti-Aliasing option that if on, we go through and do it intelligently.

There are some things, like the diplomacy screen, you'd want to be super smooth and awesome. But most things in the game, you wouldn't notice the difference between 0 level anti aliasing and 16x anti-aliasing.

Reason for Karma (Optional)
Successfully updated karma reason!
March 14, 2012 6:31:55 AM from Elemental Forums Elemental Forums

Quoting Frogboy,
Crashes are the main thing I've been working on this week.  This other stuff I use to keep myself from going insane.  

Here is why your game crashes on you (example):

You have a city selected. You decide to build an improvement. Game crashes...

...Because in another thread it was looking through all the improvements at that city at that moment...

Another example...

You're just playing, you hit the turn button, it crashes....

...Because in another thread, it's doing an autosave and just as a goodie hut was being removed from the world, it was trying to save that goodie hut.

...

Now, those are obvious cases and so they're already protected. The cases I'm dealing with are a lot lot more obscure.  

The original WOM wasn't multithreaded (in fact, a lot of games only use 1 thread).  But not having threads crippled our ability to have a lot of sophistication (like the computer AI) that FE has.  So "they" brought me onto FE to rearchitect the engine to be highly threaded.  But there's a transitionary time (i.e. now) where some systems are thread safe and some aren't.

That's why you see journal entries from me where I do something...different.  Because I have to play the game over and over and over again and certain things end up bugging the hell out of me after awhile. Jaggies. Long turns. Sound effects. Ugly textures. Etc.

And in the process of making the game highly threaded, I had to redo the memory manager.  So for example, I can play 7 games within a game and still only be using about a gigabyte of memory now (before you would have run out of memory -- assuming you didn't crash).

People with Windows XP are still in for some pain I suspect as we're not going to gimp the game for people who won't upgrade from Windows XP (they can only see 2 GB, Windows 7 users can see 4GB)  But XP users should be fine now unless they run mods.

Anyway, with this extra memory I went ahead and redid some of the textures in ways that are pretty subtle (the artists will be able to do a lot more).

Every noticed how crappy the grass looks in the game? That's because it's a picture that's only 32x32 (pixels).  Now they're 256x256 and anti-aliased.

 



Reduced 66%

Original 860 x 634

 

That is very interesting. So redoing the memory manager for multithreading had the side-effect that you freed up a lot of memory, correct? Did you make it more intelligent in what it holds in memory and what not, or did it not free memory correctly?

I suppose this made it possible to do more visual faction differentiation.

 

Reason for Karma (Optional)
Successfully updated karma reason!
March 14, 2012 8:05:45 AM from Stardock Forums Stardock Forums

Love the optimizations the game engine is going through. FE is really maturing it for future games (and hopefully there-in lies a lot of the value).

Reason for Karma (Optional)
Successfully updated karma reason!
March 14, 2012 8:08:00 AM from Elemental Forums Elemental Forums


Wow!  Keep up the fantastic work.  Fallen Enchantress is really turning an amazingly fun strategy game.

Cheers,

Sword

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108436  walnut3   Server Load Time: 00:00:00.0000093   Page Render Time: