Per object multisampling

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.

44,288 views 22 replies
Reply #2 Top

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

Reply #3 Top

How does this NOT incur a performance loss?

Reply #4 Top

Quoting Heavenfall, reply 3
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.

Reply #5 Top

Quoting Frogboy, reply 4
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.

Reply #6 Top

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.

Reply #7 Top

Quoting Frogboy, reply 6
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?

Reply #8 Top

Quoting Frogboy, reply 6
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

Reply #9 Top

Quoting Bellack, reply 8

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

Reply #10 Top

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.

 

Reply #11 Top

Quoting Leo, 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.

Reply #12 Top

Quoting Frogboy, reply 11
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.

Reply #13 Top

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.

 

 

Reply #14 Top

Quoting Frogboy, reply 11

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?

Reply #15 Top

Martin Luther knew.      :rofl:

+1 Loading…
Reply #16 Top

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

Reply #17 Top

Quoting seanw3, reply 15
Martin Luther knew.

 

You got karma for that

Reply #18 Top

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 :D

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

 

Reply #19 Top

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.

Reply #20 Top

Quoting Frogboy, reply 13
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.

 

Reply #21 Top

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).

Reply #22 Top


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

Cheers,

Sword