Author Topic: tileset features  (Read 3983 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
tileset features
« on: 11 January 2009, 11:34:16 »
Here some ideas to expand the possibilities of the tilesets:

- water: currently we can define it with some TGAs which are played back like some kind of animated gif.
  What about one (or more) implemented water surfaces using the posibilities of modern graphics cards that can probably be configured a bit with xml. ( water surfaces like in other 3d-games )

- Objects with animations(animated trees) or effects ( turrets for example )
  But for the effects we must pay attetion not to get too much in trouble with existing maps.

- bigger bmp-files or tga files for ground textures 64x64 is not enough

something that would be nice too:
support for compressed textures like png or compressed tga. This would be good for the models in factions too, because the texture files get smaller.
« Last Edit: 11 January 2009, 19:19:25 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

daniel.santos

  • Guest
Re: tileset features
« Reply #1 on: 14 January 2009, 00:47:23 »
People have posted suggestions a number of times recently and I replied asking them to add enhancement bugs for them and none have done so recently.  The reason I ask is because it's a good mechanism to keep these ideas organized and sift through them when it's time to decide what to work on next.  I really like all of these ideas.  At the moment, I have postfix down on codemonger.org, so bugzilla isn't sending out emails, but I'm doing some updates and will have that fixed 2nite or tomorrow.

It may be premature to have an in-depth discussion about improving water splashes because of how many other items are on the agenda, but the two main ideas I've had about this are bump-mapping and then a more expensive 3d implementation (which I'm guessing you are eluding to when you say "water surfaces like in other 3d-games").

The bump mapping would work similar to waves currently, they would be some type of animated image, but they would effect the way the engine illuminates the flat surface (making it appear to be 3d) instead of just super-imposing a visual animation of a wave.  The other is to track each individual wave and alter the water altitude on a per-cell basis (or break it into multiple hight levels per cell).  This is much more CPU intensive, and I don't know how to offload much of that onto the GPU, but it could look very cool.  The former will be less load on the CPU and GPU, while the later will look more realistic because the water level will change where water meets the land and such.

Either way, the basic data structure would look something like this
Code: [Select]
class Wave {
private:
    Vec2f loc;
    float size;
    float speed;
    float magnitude;
    float time;
};
Fortunately, most of the code for this already exists in the earthquake code, because they work very similarly.  While I don't want to loose track of this suggestion, I also don't think it should be high on the todo list at this time.

Moving on to objects with animations or effects, I don't think turrets can be lumped into this.  A turret is a functional device that effects gameplay, so shouldn't be included in either a tileset or a map.  Animated trees are already a part of the 0.3 specification (see "animated tileset" on the 0.3 planning thread).  As for "effects", what type of effects did you have in mind?  Please elaborate.

Bigger images for tile textures sounds to me like a must.  I don't think the engine should impose a limitation on the pixel size, except perhaps that it is square, because OpenGL sure doesn't care.  I agree, you should be able to use a 4x4 image or a 1024x1024, although I wouldn't personally recommend the later. :)  Support for compressed images also sounds reasonable.  This will probably require another library dependency to decompress them however.  I'm not personally a fan of using lossy compression for a 3d game (and thus less interested in implementing it), but lossless compression I'm all for.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: tileset features
« Reply #2 on: 14 January 2009, 15:02:39 »
I don't want to add feature requests at codemonger.org without discussion! Thats why I post the things here.

One more idea for the tilesets: You can define a texture for steep regions ( but you must not define it, so old tilesets still work )
I think daniel mentioned something like this before, but here is a screenshot from warzone 2100 where you can see textured steep regions.


the texture which was used is this:


( in future this will probably need changes in the pathfinding and navigate implementation of glest too, because you probabaly dont want walk through these steep regions, but thats nothing to think about yet.)
« Last Edit: 14 January 2009, 15:29:31 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: tileset features
« Reply #3 on: 14 January 2009, 17:54:42 »
One more idea for the tilesets: You can define a texture for steep regions ( but you must not define it, so old tilesets still work )
I agree.  Otherwise your terrain can end up looking all stretched out, like this:

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: tileset features
« Reply #4 on: 11 February 2009, 16:00:59 »
for the water, what about this idea:

http://www.neilwallis.com/java/water.html
( yes its written in java, but I think you will understand it ... )
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

modman

  • Guest
Re: tileset features
« Reply #5 on: 12 February 2009, 03:51:25 »
I love it!  But this may not be that useful in Glest, because you generally don't go over water very often and you can't pay attention to the ripples because you have to watch for enemies.

This could definately work for daniel's earthquakes though, because it would be big and noticable!

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: tileset features
« Reply #6 on: 13 February 2009, 10:25:06 »
and for rain!

but if you have a river and the units walk in the water this will show a good effect.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

daniel.santos

  • Guest
Re: tileset features
« Reply #7 on: 14 February 2009, 11:38:06 »
hmm, I hadn't even thought about the refraction aspect of this.  (The java applet you posted demonstrates refraction.) That's usually, as I'm guessing modman was getting at, only noticeable when you are viewing from much closer in that you would usually be in an RTS game.  When much larger masses of water have uneven surfaces (larger waves) it's viscosity isn't usually enough to keep it together and it mixes with the air becoming opaque (white).  Still, I like the idea for realism and I think that it would indeed be noticeable.

So this leaves the topic of refraction in OpenGL for me to research :)  Also, I'm starting to think along the lines of optional 3d waves.  The biggest reason is because I would rather the environment respond to violence as appropriately as possible.  It may also be nice to have a weather system (discussed several times before) that actually dictates how safe it is for ships to set sail.  By implementing a dynamic water (in 3d), that makes waves possible that make ships bob up & down and such.

So moving to steep surfaces, along with the new tileset (also called "Animated Tileset") we're working out the plans for a new map format.  As is always customary, older map formats will always be supported (just like the original version 1 glest model formats are still supported).  Mixing of old maps and new tilesets or visa-versa should be supported as well.  In some cases, there may be a few "fudge" rules as to how this is done, but that's OK.  But you made me think about in broader terms, so thanks titi! :)

Before I cover graphics, I wanted to touch on game rules.  You were mentioning these steep surfaces being non-traversable.  An OO programmer would often want to include the possibility that maybe some objects (units) can traverse them, but other can't and each object would be able to override their traversability behavior such that the game engine could ask the unit if it can traverse a particular slope by calling a function and passing the angle, e.g. "bool Unit::canTraverse(float angle);".  However, when maps have a non-traversable element, it's usually critical to the function of the map.  Having some units be able to traverse a terrain when the map designer had not intended it can ruin it entirely, especially when a separate mod can redefine such behavior.

As I've mentioned before in the 0.3 planning, I'm in favor of being able to dictate more in-depth rules about terrain traversability, e.g.,  maxIncline is the max angle the unit can travel up, maxDecline the max down and then speed modifiers for each.  Most people don't know this, but bears can run faster uphill than downhill (so if you have to flee a bear, head for the decline!)  I'm also intending to incude a "max hurdle" type of settings.  If I run into an area where the ground becomes too steep for me to climb... for about 6 inches, that obviously shouldn't stop a human.  But if a human encounters a 90 degree incline that's 5 feet tall, they should be balked short of some type of "scale wall" skill.  But to a giant, this just might be a large step.  And to a lion, a tall jump.

So this is the system I'm in favor of, but I also figure general rules of sensibility should be followed. If somebody wants to make a tech tree mod that defines a unit that can leap 50 feet up and traverse anything, more power to them.  If they want to define one where everybody moves like that, they're probably going to loose a lot of the "Strategy" part of "Real Time Strategy".  Thus, I say we setup the new map system without any inherently impassible barriers (defined by landscape), but that we do come up with some generally acceptable limit where we expect no "normal" ground units could traverse (like a 6 foot, 45 degree incline).  Trees, dead trees and big trees is another topic :)

So moving on to graphics, I'm thinking along the lines of being able to define multiple levels of steepness, having various textures mappable to them.  As you know, the steeper an incline, the less vegetation that grows on it because it just can't get a foothold.  As I've discussed in the "new map format" thread, I would like to have the new map format define layers down to some depth (probably equivalent the width of 32 cells or depth defined by the map arbitrarily).  Each layer should have a label like sand, sandstone, granite, limestone, bassalt-black, bassalt-grey, dirt-black, etc., and finally water (which will be our special case).  Except for water, each layer will have a barren texture (for when the layer is exposed recently, like from digging a trench or an explosion) and a grassy texture (to the extent it can grow grass -- sand doesn't tend to for instance) and it will have a pair of these for maybe 3 different slope magnitudes, zero to 45 degrees, 45-70, and 70-90.  Of course, it's note likely that dirt, for instance will ever acquire vegetation at a 90 degree angle, it tends to not be a 90 degree angle after a few good rains, and you'll never get sand to do it!  Either way, this will be close enough.

I haven't mentioned many short cuts here, but however we do it, I want it to have the most possibility while keeping the minimal requirements for implementing as simple as possible.  Thus, a tileset could just define the current tile types and the engine should make do with it.  But when everything is present in both the map & tileset, it can render beautiful scenery that also functions well in game play.  Please don't misunderstand me, I'm not trying to make it over-complicated, I just want it to be capable using a high degree of sophistication to produce a realistic landscape.  I have *no* plans on supporting seismic activity of any kind (i.e., movements within these layers) since this isn't a geological simulation engine (just like it isn't a global climate simulator).  I do plan on implementing some mechanism in the near future to make minor alterations to the map by, mostly digging trenches, building moats and removing mass due to explosions.

In the distant future, I have some vague ideas for support of more sophisticated movement of land mass (instead of simple removal) if I end up implementing simulation game support (like simcity, lincity, micropolis types of games).

I also have some vague plans for a dynamic water flow support whereby the map designer specifies water inlets and outlets and the engine flows the water, thus causing currents that effect units who traverse it.  This would add a lot of things that could complicate map design, but also add a lot of new possibilities.  Each map would have to be tested for how it managed precipitation because that would effect water levels everywhere and it would have to drain off or it would form new lakes.  But the cool part would be the strategy element of being able to alter water conditions to flood out your opponent. -- keep in mind this is a just a distant future idea at this point.

Pretty pictures:






hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: tileset features
« Reply #8 on: 15 February 2009, 00:30:44 »
I prefer simple terrain in RTS (maybe that's just me).
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/