Jump to content

Graphics Features


Recommended Posts

As a continuation of various earlier ramblings: I've been thinking a bit about graphics recently, and I'd like to do some work on that for alpha 5 before I get bored of graphics again, but probably need to work out what's most important to focus on so I don't get too distracted. Performance is always nice but it doesn't really help get the game complete - simple optimisations should still be done, but at this stage it's probably better to be driven by user-visible features more than by squeezing out every last performance improvement, since optimisations often limit flexibility and will make features harder to add later.

The most relevant things I currently see are:

Display obscured units (draw player-coloured silhouettes when they're behind buildings/hills/etc) - necessary because currently it's too easy to lose units.

Terrain decals (arbitrarily-rotated flat textured rectangles that lie on the terrain/water) - needed for building foundation textures if they're not on perfectly flat land (or hang out over the edge of a flattened area, etc), and probably for nice farms. Also useful for lots of decorations and graphical effects (lily pads, leaves, blood, footprints, nicer unit selection circles, etc), so they work on non-flat terrain and so they don't suffer from z-fighting when overlapping.

Billboard sprites - would artists want to use these for decorative objects (tufts of grass etc)? They wouldn't have the problem 3D meshes have when you see one polygon at a steep angle and it vanishes and looks odd, and they'd need fewer polygons, but they would have the problem of maybe looking odd when rotating the camera (though players usually won't rotate that often).

Nicer FoWed-unit rendering.

Distance fog.

Fix broken shadow/reflection culling.

Particles - there's some code but it probably needs lots of fixing to be usable.

Weather effects.

Nicer shadows.

Specular maps.

Normal maps.

Bloom filters.

Are there things I'm missing that would be worth adding to the renderer eventually? What features do people consider higher priority to work on first?

Link to comment
Share on other sites

The things I personally think are the most important of those listed are (in order of importance, all of course imho):

1. Display obscured units: will improve gameplay, so definitely should be a high priority.

2. Particles: will add a lot to the feel of the game I believe, might be a steep learning curve to work with them, but things like fire, smoke etc will make the game world seem much more alive. Will probably be one of the more difficult things to implement as it requires so many different things, at least compared to something like Bloom which as far as I know is added "above" everything. Particles need to be able to do so many different things, and should preferably be both easy to use and complex. By easy to use I mean: one should be able to quickly add a predefined fire/smoke to a prop point or fire as an actor (or at least as a part of one) in a scenario. By complex I mean: it should support adding your own particles and how they interact/when they're triggered. The ticket talks about things like footsteps, but there might be other examples. (Weather is probably likely to make good use of particles as well.) Most of what I've mentioned is probably straight-forward or at least expected, but I guess most of it simply is to try and make the point about particles being one of the more complex things (other things might be more complex in terms of the actual functions/math required though :) ).

3. Decals: will definitely help in a lot of cases as you say. Automatically smoothen the terrain within reasonable limits (+ limits for how steep a slope a building can be built on) should preferably be implemented at roughly the same time.

About billboards: would it be hard to have them always face the camera, even when you rotate? I believe this is often done in animations for e.g. architectural renderings of buildings etc when you just have a simple image of trees/people etc to give a quick idea of how things will look like. That should probably be a setting though, some billboards might benefit from it, some may not. For example, tufts of grass, or distant trees or similar would probably benefit from it, but if you had a billboard of an entire distant "vista"/view that would probably not work as well. Especially if the billboard would be big and in that case would intersect with trees/terrain/buildings :P

Link to comment
Share on other sites

I think the difficulty with particles is mostly the artistic aspect - there's a huge variety of possible effects, so the problem is working out which ones to implement and how to expose them to artists in a usable form. The code itself should be fairly straightforward.

About billboards: would it be hard to have them always face the camera, even when you rotate?
That's what I meant by the term "billboard" :). Either make them directly face the camera, or rotate them just around their vertical axis. That's easy to do, and it's necessary for particles too.
Link to comment
Share on other sites

To me, the most important thing would be getting to a point where doing these things is easier.

From what I've read, we have like 3 different renderes for shadows, 3 for water, and more.... ideally there would be just one well written one, which scales on older hardware by downscaling the quality of things.

So getting something brand new to build upon would be great! I'd be happy if performance just stayed the same for the moment, though utilizing new features in graphics cards should make things faster?

Then, from there I think the important ones are (in order):

* Hiding changes in FOW, but using a "last known" state to display, which is updated when they next go there (#599)

* Showing units hiding behind buildings (#144)

* Gradual FOW peel back (#732)

* Particle system in place, so that we can have:

* Ground effects (flowing grass as units walk through, fires, flowing water, water falls)

* Sky effects (clouds, rains, lightning, wind)

Link to comment
Share on other sites

Highest priority imo:

Terrain decals - buildings without foundations flying in mid air...

Display obscured units - will have a big impact on gameplay.

Particles - will make the world more fluid.

Distance fog - valuable asset for screenshots.

Billboard sprites - might help farms. Cool idea!

The last 5 features would be nice to have, but only after the others have been completed.

Link to comment
Share on other sites

To me, the most important thing would be getting to a point where doing these things is easier.

From what I've read, we have like 3 different renderes for shadows, 3 for water, and more.... ideally there would be just one well written one, which scales on older hardware by downscaling the quality of things.

They're not really separate renderers, they're just separate modes within the renderer, and scaling down quality inevitably needs multiple modes; but I believe we could remove some of the existing modes and make the new ones more consistent with each other, so they could share most of their code and be a bit simpler. But I think this is what I mean about not getting too distracted - I could get tempted to redesign lots of stuff, but it probably wouldn't be very well designed and it wouldn't really help the game by itself, so it's probably better to focus on real features and only redesign things when they're relevant to making those features work. (That has to be balanced with the long-term cost of hacking new stuff on top of an existing design that can't support the complexity, but I don't really worry about that since I'm in much greater danger of going too far the other way and redesigning things that don't need to be :))

Link to comment
Share on other sites

You asked ;) Here are some more you may consider adding to your list.

Map folks are always interested in another plane of water for a lake or something... Perhaps this could be as simple as a special texture call that could be assigned to an exported pre-shaped flat lake? Then assigning it the attributes that our huge plane of water has? Dunno how difficult it is, but it is something I see mentioned now and again.

Also, along with water, there is the 'waves' feature that would add a nice graphical touch. We have an old demo (with textures) of it somewhere that Daywalker made in the code pit.

As you are aware... billboard sprites and a fixed orthographic camera view would be appealing to the 2D modding community.

Here is another... sort of a graphics feature. There has been talk in the past of wanting a toggle to a larger minimap, that you could turn on and off during the game play.

Another is, simple shaders that could be saved with the map. So, for example - on a snow map, if you wanted to desaturate the colors to make the world look colder... you turn the contrast down. Or, if your playing a tropical map, and you want the green colors to 'pop', you turn the contrast up. Bright/Contrast/Gamma - something that would be a global control over the environmental/lighting controls already in Atlas.

There is several iterations of particle engines, even having one of them in the game. Remember the fountain that used to always show up in the lower left hand corner of the map? We just never had a good tool to control it - save files, and attach them to prop points.

Link to comment
Share on other sites

Map folks are always interested in another plane of water for a lake or something... Perhaps this could be as simple as a special texture call that could be assigned to an exported pre-shaped flat lake? Then assigning it the attributes that our huge plane of water has? Dunno how difficult it is, but it is something I see mentioned now and again.

The biggest problem with multiple planes is the cost of rendering reflection/refraction textures for each one. We could add a much simpler water shader that just reflects the skybox, instead of computing dynamic reflections - that would mean multiple planes have the same cost as a single plane (and a low enough cost we could probably enable it on low-end graphics hardware) and might look fine in most cases. Then the issue is just editing tools, which probably shouldn't be too problematic (e.g. we could represent water as a heightmap instead of a plane, and then have 'fill' and 'empty' tools that do a kind of flood-fill to let you easily produce flat bodies of water, with independent rendering settings for each body, or whatever).

There is several iterations of particle engines, even having one of them in the game. Remember the fountain that used to always show up in the lower left hand corner of the map? We just never had a good tool to control it - save files, and attach them to prop points.

Yeah, there's been many iterations :). I think the current one is needlessly inefficient and could be improved significantly, and it needs to be integrated with actors, and ideally it'd be integrated with Atlas somehow, but otherwise it should be okay.

Link to comment
Share on other sites

The biggest problem with multiple planes is the cost of rendering reflection/refraction textures for each one. We could add a much simpler water shader that just reflects the skybox, instead of computing dynamic reflections - that would mean multiple planes have the same cost as a single plane (and a low enough cost we could probably enable it on low-end graphics hardware) and might look fine in most cases. Then the issue is just editing tools, which probably shouldn't be too problematic (e.g. we could represent water as a heightmap instead of a plane, and then have 'fill' and 'empty' tools that do a kind of flood-fill to let you easily produce flat bodies of water, with independent rendering settings for each body, or whatever).

I think Roller Coaster Tycoon 3 had something similar and it was very easy to use :)

Link to comment
Share on other sites

Map folks are always interested in another plane of water for a lake or something...

Yep :D I created these ponds in a quick 10 minute experiment 2 months ago:

0ADfakewater02.jpg

With some transparency added to the water texture it wouldn't look too bad... or would it? The water is static, and that's quite obvious in-game. If it was possible to add sky reflections to models, the movement of the reflected clouds would probably help somewhat.

Link to comment
Share on other sites

we could represent water as a heightmap instead of a plane, and then have 'fill' and 'empty' tools that do a kind of flood-fill to let you easily produce flat bodies of water, with independent rendering settings for each body, or whatever

I don't know what impact this has on reflections or rendering cost, but it seems like the best long-term strategy for water. Assuming you mean where the water heightmap intersects the land heightmap, water gets rendered. It could be forced parallel to the surface of the land, actually just below ground level, so we don't have "peaks" of water sticking up in a field by accident. Then we could have features like rivers that flow downhill, for instance :)

I imagine in Atlas you would do something like select a water brush, optionally change depth and appearance (color/reflectivity/etc), and then paint it right across existing terrain. Atlas would deform the land slightly and raise the water heightmap appropriately.

Link to comment
Share on other sites

Outlines, ala AOK might be difficult. Either way, awesome work. It would be good to be able to toggle this as well (although silhouettes should be on by default).

Outlines in 3D are a standard cel-shading effect, but as far as I'm aware there's no very fast way to do them. In particular you need to compute and store more information with every vertex in order to render a decent-quality expanded version of the model, and our models are animated so we'd have to compute it all every frame (and we might have hundreds of models). You also render a second copy of every model to act as a stencil to cut out the middle - the outline gets coloured where the expanded model is drawn and the non-expanded model is not drawn. So it's more complexity and slightly worse performance, and probably not worthwhile unless people think it'd be a hugely better effect.

Toggling can be added easily when we have a better graphics options system.

Awesome! Good job Philip. AOE 3 had the option to lower the opacity of the silhouettes, if thats possible it would be great! (not the option to do so, but more transparent silhouettes)

The difficulty is what to do with overlapping silhouettes, of the same colour or of different colours. We can't control the order in which models get drawn (because of performance concerns), so they're effectively random (though consistent from frame to frame). If we could use additive blending, like this, the order doesn't matter since it'll just add all overlapping polygons. If we want standard blending, like this, then whichever model randomly happens to be rendered first will be the one you see, which goes a bit weird for units consisting of multiple models (see the archer's vanished heads (or, rather, don't see them)). But the latter case will be fine if units are all the same colour, and probably players won't really notice when multiple colours are overlapping a little weirdly, so we can do that if people don't like additive blending.

Can I distribute this thing to the general public? :)

Maybe someone could make a nicer screenshot first? :)

Link to comment
Share on other sites

The difficulty is what to do with overlapping silhouettes, of the same colour or of different colours. We can't control the order in which models get drawn (because of performance concerns), so they're effectively random (though consistent from frame to frame). If we could use additive blending, like this, the order doesn't matter since it'll just add all overlapping polygons. If we want standard blending, like this, then whichever model randomly happens to be rendered first will be the one you see, which goes a bit weird for units consisting of multiple models (see the archer's vanished heads (or, rather, don't see them)). But the latter case will be fine if units are all the same colour, and probably players won't really notice when multiple colours are overlapping a little weirdly, so we can do that if people don't like additive blending.

Yes! Either of those are a great improvement IMO. But I agree having this at all is fantastic :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...