Author Topic: Requirements: new map format  (Read 11648 times)

daniel.santos

  • Guest

mictes

  • Guest
Re: Requirements: new map format
« Reply #1 on: 4 January 2009, 18:07:47 »
I dont knwo how this would work with the engine, but what about adding/editing own textures and objects ? This would be great for new tilesets and mods!

gameboy

  • Guest
Re: Requirements: new map format
« Reply #2 on: 6 January 2009, 03:44:41 »
animated objects and animated water with waves, and a way to choose which tileset you want to use, so that objects can have thier own name in the editor, and support for a bigger range of objects.
Also i have a way to make the landscape look different no just 64x64 bmp tiled, IMO it looks crappy.
So heres my idea, you basically have a big image say 512x512px (not glest units, okay) and have tile the whole map with these image and have them overlap, so you have a grassy image overlap an other image in this case a stony area, and the paint tool will actually act like an eraser and erase the topmost image, ofcourse you can choose which layer you want erase so can have three images stacked upon each other one a grassy one another stony one and a road so its stacked somthing like this:
_ = grass
... = stone
::: = road
<-> = erased
 ____<---->____<----------> - grassy
 ..................<------------>.. - stony
 :::::::::::::::::::::::::::::::::::: - road

so the places where the grass is erased you will see stone and the place where the grass and stone are erased you will se a road, you comprehend?

daniel.santos

  • Guest
Re: Requirements: new map format
« Reply #3 on: 6 January 2009, 07:04:42 »
Quote from: "mictes"
I dont knwo how this would work with the engine, but what about adding/editing own textures and objects ? This would be great for new tilesets and mods!
You're going to have to seriously elaborate on this, I have no idea what you are saying.  textures & objects are already defined OUTSIDE of the map, they are in the tileset.

Quote from: "gameboy"
animated objects and animated water with waves, and a way to choose which tileset you want to use, so that objects can have thier own name in the editor, and support for a bigger range of objects.
  • Animated objects falls under the "animated tileset" feature planned for 0.3 already and wouldn't affect the map format
  • Animated waves in water is a nice feature idea, but does not affect the map format.  Can you please add this as a feature request?  I've actually considered this some when working on the earthquake code because my original implementation looked like the land suddenly turned to water and there was a big wave.  Anyway, that's OT, if you can please add a feature request to bugzilla for this item, I would appreciate it.
  • Now this one sounds interesting, and also affects tilesets.  It seems that it will be critical to plan both the new map format version bump along with the animated tileset (or "advanced tileset", whatever) to support this.
Currently, map objects are always either 1x1 or 2x2 cells, I can't remember which right now, and are specified using an integer to specify the model to use from the tileset.  So this is doable, but we need to figure out what we're doing :lol: )

mictes

  • Guest
Re: Requirements: new map format
« Reply #4 on: 6 January 2009, 09:20:31 »
Quote
Quote
I dont knwo how this would work with the engine, but what about adding/editing own textures and objects ? This would be great for new tilesets and mods!
You're going to have to seriously elaborate on this, I have no idea what you are saying. textures & objects are already defined OUTSIDE of the map, they are in the tileset.
Ok, actually a tileset can have for example just 5 textures. But what about adding more textures ? Same for the Objects - for example: trees. That could be very usefull for making tilesets!

daniel.santos

  • Guest
Re: Requirements: new map format
« Reply #5 on: 7 January 2009, 11:28:55 »
Hmm, if you've ever worked with CSS before, when you specify a font, you specify it first by the exact font you want, and then a fallback font and then a fall-back font family, that way, you can get exactly what you want if it's available, but then you can get something close or at least something in the same ballpark if it isn't.  Perhaps we can do something similar with textures and objects.

So both maps and tilesets will specify tile textures (a.k.a., terrain) and objects by names.  The map will contain a list of all of it's terrains and objects by name in the header, that way it can continue to use a small one byte integer to specify which object and terrain is in each cell.  The map can specify a preferred name, and then one or more fallback values, in case the tileset doesn't have exactly what it wants -- that will maintain compatibility between newer maps and older tilesets and visa-versa.  Thus, you may want to have a pile of robotic junk on the ground in some place on your map, but in lieu of that, have it stick in some rocks.

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Requirements: new map format
« Reply #6 on: 8 January 2009, 06:06:47 »
This tiled map editor ( http://mapeditor.org/ ) has layers which could represent each tileset maybe.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Requirements: new map format
« Reply #7 on: 8 January 2009, 16:35:07 »
I don't understand why you need the layers? You can only ever see one layer at a time. Just stick with the current system where every tile has a image on it and images are blended if they are from different sets. Simple and effective.

The one thing I would like to see is the ability to orientate each model in the map editor. This will probably break the map format (?) but it really needs to be possible to do certain things e.g towns.
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

modman

  • Guest
Re: Requirements: new map format
« Reply #8 on: 9 January 2009, 03:57:21 »
OK what about all those other things I suggested near your whatsits inital post?  No good?

How about it supports more objects so that these aren't necessarily different per tileset.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Requirements: new map format
« Reply #9 on: 11 January 2009, 11:22:08 »
I like the current map format, its simple and effective so I think major changes should not be our focus at the moment.(Ok more players would be cool but this will cause several problems regarding for example multiplayer )

A lot of ideas regarding the map format quickly will get mixed up with tilesets/maps/factions. So keep this in mind when posting ideas.
For example a city wall is not a good idea in a map, because it doesn't exists
in the current tilesets. If we create a tileset including this wall, a map will be bend to this tileset.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

daniel.santos

  • Guest
Re: Requirements: new map format
« Reply #10 on: 14 January 2009, 03:19:55 »
titi,
I actually don't mind hacking up the map format, but you are right about remembering what goes where.  For instance, if you want to have a map where units are already built, I think it's better to have that split up and have the unit definitions in a scenario, keeping them out of the map its self.  I think I'm pretty hard set on the idea of having namable objects and resources in the map definition and the appropriate changes to tileset definitions to fulfill it.  The map should always provide a fallback object type (or "ignore") so that it can be used with an older tileset, and if some object can't be used, the "ignore" option will cause it to be dropped.

modman,
be more specific, don't make me go hunt down your post, put a link to it.  My time is valuable too.

wciow,
I mostly agree with you on the layers.  I wouldn't mind it in the map editor, as a means to generate said tiles, but if layers were added to the map format, it would be for other reasons -- specifically, a more advanced concept I had that I'm not too interested in pursuing at this time (defining maps in 3d, using geological data so that in-game changes to the map would be realistic).  There's already a feature request bug for being able to rotate models in-game, and I don't think that will be too hard to implement, but for doing it at design time, I think that should be in the scenario data if they are real live units.  If they are just immutable world objects (like the current statues and such) then I agree, we need to be able to specify their which way they face and more...

hmm, actually, I think we should be able to specify their rotation, pitch, yaw and relative altitude -- thus, you can have stuff partially buried, laying down, etc.  Good requirement! (and again, not hard to implement)

hailstone,
wow, this looks cool! (the map editor that is) I wouldn't mind being able to bypass all of the work involved in the GUI, especially since this stuff tends to be such repetitive functionality (that is, from one game to another).

modman

  • Guest
Re: Requirements: new map format
« Reply #11 on: 14 January 2009, 22:56:06 »
Here is the link.
When I have more time, I will make detailed descriptions of each surface/object's behavior.

modman

  • Guest
Re: Requirements: new map format
« Reply #12 on: 16 January 2009, 01:07:12 »
This is probably the biggest post I've ever made.

Clarification: All these special things do not affect how you move your units around; any special instances for the AI are only guidelines that make up for the fact that it cannot make decisions as you and I do.  This is to say that if you want to, for instance sit your unit on quicksand until dead, you can and it will not attempt to escape, but the AI will never stop a unit on anything that can hurt them.  Also, none of these entities can be attacked with any unit.

Quicksand
Quicksand doesn’t necessarily have to be called quicksand; I would probably rather call it muck.  But you get the general idea.  The idea is that you can only stand on it a certain amount of time before you will be sucked in completely.  I would recommend that a unit of height value of 1 take 3 seconds to be sucked in, and by the way, once you are sucked in it should count as a death.  Also the amount of time it takes to be sucked in should be multiplied by the unit’s height value.  For instance a unit with height value of three should take 9 seconds to die in the quicksand, height value of 2 takes six seconds, etc.  There should also be an animation for the ground so it looks kind of like quicksand.  This could be similar to what open ocean looks like, but a bit less obvious, so the waves and ripples should be smaller.  Another feature of this quicksand or muck, whatever you want to call it, is that every second, until the maximum amount of time the unit could be in the quicksand, the unit’s move and animation speed is only 90% of what it was the second before.  This is to make it a bit more realistic, and so the only way quicksand or muck would hurt you is if you stopped your troops on a patch of it.  In addition, time in quicksand carries over to the next tile, so if you walk into a patch of quicksand, your speed degenerates per second until you get out.  Another thing is that a unit whose size value is greater than the size of the patch of quicksand is immune to any quicksand patches smaller than it.  For instance, if a unit is size value 2 (2x2) then a patch 1x3 or 1x2 should not even effect it.  This is to add a bit of realism; if you were standing on a half a 100 cm squared of quicksand, you would not fall in would you?  Also, the AI pathfinding algorithm would have to change a bit (or is it just the AI in general?) that a unit would not stop on quicksand; this applies to situations where the unit is being attacked.  Thus when a unit is on quicksand, the first priority of the unit is to get off ASAP.  Second priority then is to ward off attackers.  Also, the AI should not build buildings on or closer than 2 tiles away from the quicksand.  Since the quicksand is not randomly generated, but is optional to the maker of the map, there should be no problems with quicksand on a base.  Another more complicated option would be to set zones where quicksand could occur in the new map editor.  Inside the zones, quicksand could occur at set frequency; this way no two maps would be exactly alike.  Also, different zones could have different frequencies of it, so maybe along a river it is more common than 50 tiles away, for instance.  These zones, of course, would exclude the bases.  I personally think the zone option is preferable.

Poisonous Things
Poisonous things would be similar to quicksand in many ways.  But the biggest differences are that the poisonous things take away HP per second, (as opposed to quicksand hurting you only once your unit has sunk completely into it) and they only effect mobile units; thus buildings are not affected.  There could be various types of poisonous things in the map.  They would have specific models that they could be, similar to how a tree can be various different, but similar, models.  Most would probably look like bushes though.  The way they work is for every second you are standing on them, they take away certain amounts of your HP, until you are at 0 HP, when your unit dies.  This is not to say that an object will attack the same way as another unit; armor only helps you half as much as it would against a normal unit, and different types of armor all behave in the same way.  The algorithm for this is: ((damage-(armor/2))*seconds).  Hopefully that makes it clearer; you may observe that the type of armor is not factored in, and the damage is lessened by the amount of armor you have, but less than against a normal unit.  These poisonous things would be walkable, and thus only affect you if you are standing or walking over them.  Different ones could be varyingly poisonous too.  For instance one almost harmless plant may take away a raw amount of 50 per second; (raw meaning that it hasn’t had any armor subtractions from it) a more dangerous plant may take away 150 or 200 per second, but these would be rarer.  This goes back to the zones I spoke of earlier because you would manually input the rarity or frequency of any said type of poisonous thing.  I’m leaning towards most, if not all of the poisonous things being plants; this is because I cannot think of any other type of poisonous thing at the moment.  The AI for poisonous things would act very similar to that for quicksand.  But since the poisonous things only effect mobile units, the AI should probably feel free to build buildings on the poisonous things, except the builder/worker unit has to make sure not to be standing on any while building!  If the unit has no other choice other than to stand on the poisonous things while building, then the building cannot be built.  If the building does somehow get built though, a unit’s first priority is to get off the poisonous things and second priority is to carry out the action it would have carried out before.  While moving, the unit should do everything it can to avoid the poisonous things.  While the unit is attacking, though, if to get to another tile it is 5 or fewer tiles out of the way (extra distance) then the unit should take the long route.  But any distance greater than 5 tiles, the unit just goes over the poisonous things.  I think the ratio 5:1 is good for this instance while attacking.

Enchanted Plants
Enchanted plants are most similar to the poisonous things.  The difference is that they behave (attack) more similar to a unit because they have a range, and have attack types.  For instance a “whipping willow” might have a range of 2, and be slashing type.  Also, they do not take HP away per second, but they attack just like a normal unit.  I should say that the fashion that the attack is calculated is exactly the same as the way damages are calculated in unit v. unit fights.  Enchanted plants would always be immobile though.  Since you could not attack them, there would be no reason to give them any armor type either.  I think it would be most appropriate to have these enchanted plants placed on maps using the zone method.  We need a new map editor anyways.  The way that the AI would behave would be very similar to that of poisonous things, except to stay at least five tiles away from them if possible, and never to stop while you are being attacked by one.  Enchanted plants would be similar to poisonous things also because they cannot affect buildings.  The pathfinding would be the same as with poisonous things in that they would avoid moving within 5 tiles of any enchanted object while simply moving.  While attacking, we have to use the ratio again.  But since enchanted plants can hurt you more than poisonous things could, the ratio would be more like 10:1.  That is moving within the range of the enchanted plants only if it will save you ten tiles per enchanted plant there is.  For attack types, there could be emanations as well, which behaves exactly the same as in GAE.  One more thing about enchanted plants is that they are not passable or walkable.

Healing Objects
Healing objects are the exact opposite as with poisonous things.  These can emanate with a greater range though, because poisonous things can only hurt you if you are standing on them.  Unlike poisonous things, healing objects are not walkable.  They are placed on the map in exactly the same manner as with the enchanted plants, poisonous things, and quicksand.  This is using the top feature I hope to see in the new map editor: zones.  These would also not effect buildings, only units.  The AI would take this into account.  They would attempt to build buildings no closer than two tiles to the healing objects.  This is so injured units can access the healing objects.  All injured units would attempt to go to the healing objects, but not in the way that some ultras do it.  The ring of units around the healing objects should be no greater than 1 tile thick so that once the unit is healed it can do something else.  Also, units shouldn’t go to the healing objects unless they are not doing any other task (that is, stopped) and not unless they are actually damaged.  If a unit sees an enemy, they should attempt to get within the healing aura of the healing object and then attack.  But if the unit has no attack, then it should move away.  Also, if there is resources near the healing object, it would be smart for the AI to start a village there.

Mines
Mines are totally different than the last four.  They cannot be attacked, but that’s pretty much the only similarity.  They are walkable, and are defined in the faction, so in that case they wouldn’t necessarily be mines unless that is what it was really called.  For instance in the Tech faction there could be a bear trap, for my Undeads I was thinking of a hand that pops out of the ground.  A mine is built by the player, and is a one-time only thing.  They would take a set amount of HP every time they are sprung, and this is independent of any other factors that the unit may have.  So if the bear trap takes away 900 each time, then it takes away 900 each time, thus independent of any factors.  The question is then whether or not the unit will be killed, or just mangled.  I guess I forgot to mention it, but different types of mines may take away different amounts of different stats.  Applicable stats are move speed (for move speed, it would also be that much percent slower anim speed), armor, HP, EP, HP regen, (although this would be more of an absolute thing; you would set what you want the regen to be once the unit is a victim.  In this way, you could set the unit’s HP regen to negative numbers!) and another move speed one that freezes you in place for 30 seconds.  The AI for the mines would be a little more interesting.  It would not be able to see mines at all, and would then end up walking over them.  The AI would also never build mines anywhere farther than 10 tiles away from any building.  In this way, mines are another special type of defense.

Portals
The concept of a portal is pretty simple.  Portals take you from one place to another.  Portals are another thing totally different from anything previously mentioned.  They are not placed using the zone method, but are deliberately placed in places that make for an interesting game.  Portals have to be placed in pairs, and there can be a maximum of six pairs of portals per map.  This way, portals can be color coded with red, orange, yellow, green, blue, and purple.  The color coding makes the game simpler because every portal takes you to its partner.  The model of the portal can be defined in the tileset, but all portals are of one tile radius.  Again, no portal can be attacked, but they can be blocked.  This is very easy, since every portal can only expel units onto one tile in front of it; for this reason, there needs to be a capability in the map editor to rotate these portals.  I think that portals add another dimension of strategy to the game because the shortest distance to your base is no longer a straight line.  You can guard the portals or ambush units that come through them.  A possible bug though would be that even though you can walk through the portals, you cannot attack anything by way of the portals, or it would look really dumb.  The AI’s pathfinding would have to have a major revamp too.  Because you want the AI to take the shortest path possible, you have to make the AI compute whether it is shorter to take the portal route or the normal route (the one that doesn’t include the portal).  A solution to this would be to have the AI access whether or not the distance to travel is more or less than 50 tiles away, because you wouldn’t save that much time by taking the portal route anyhow.  If the distance is greater than 50 tiles than it’s OK to access which route is longer.  The AI also should be instructed to keep a fraction of its military near each portal of its knowledge, and that’s its more important to keep military near portals that are closer to the base.  Another important calculation is that if the portal is more than a third of the map away from any of its bases, then it isn’t important to guard at all.  Otherwise, it will continue to send fractions of its military to portals that another AI dominates, or one that a human dominates, which is really lame.  Also when leading what is called “huge attack” I think in the AI code, the AI should NOT use portals, because that could easily kill off its entire attack by the units getting picked off.

Cliffs
Cliffs are the biggest reason why a new map editor is absolutely necessary.  Cliffs have an interesting behavior in that they create a one-way path; you cannot climb up cliffs, but you can jump down.  There is, however, an HP penalty for doing so.  The calculation in terms of lost HP is as follows:  ((height difference)*100) where the height difference is the distance from the peak of the cliff to floor of the cliff.  This is totally different from normal landscape; in normal landscape you can walk everywhere with no penalty on HP as long as your unit is attacked.  But with cliffs you can only go in one direction, and with a HP cost.  This way you can chase workers off cliffs!  There should be a special texture for the sides of cliffs, and for the edge; that way you know it’s a cliff.  A map maker will have to watch out for situation in which units will be trapped; these are not preferable!  In later versions of Glest and/or GAE maybe there could be a possibility of building ladders so that you can go up the cliffs, and you can go down with no HP sacrifice.  The ladder method would be slower to go up and down the cliffs, but again, it has benefits.  The AI pathfinding would have to be altered slightly more to accommodate cliffs.   The AI would “know” whether it would have to go down a cliff to get to a certain point, and if so, would find the spot which would be the smallest drop, and thus take away the least damage.  Otherwise there’s no reason that the AI should have to go down a cliff and take damage if it doesn’t have to.  Also, it should be not allowed to build a building half on a cliff and half dangling over the edge.  In addition, another feature of cliffs is that you cannot attack “up” the cliff, but you can most definitely attack units down the cliff.  This means that the units that can jump down the cliff can attack the units that are below them; those that cannot get at them.  Also when at the edge of a cliff, your range is increased by ((difference in heights)*5)% so if the difference is one tile, your range will be increased by about 3%, but if the difference in heights is 10, the unit’s range is increased by a whopping 50%!  In the future, there could also be a feature where you can push someone else’s unit off of the cliff, thus they will suffer damages.  For now, though, the AI needs to be taught that it should stay away from the bases of cliffs, and that it is better to take the on-the-cliff route instead of the possibly shorter base-of-cliff route, because the units on top of the cliffs can attack you.

gameboy

  • Guest
Re: Requirements: new map format
« Reply #13 on: 17 January 2009, 08:39:55 »
Most of what you suggested are RPG elements, they won't work they way you want in RTS, in fact you might end up hating them, because the amount of micro-managing would have you buying a new mouse every week.

modman

  • Guest
Re: Requirements: new map format
« Reply #14 on: 18 January 2009, 03:24:31 »
Maybe you should be a bit more specific.  Could you say which ones you specifically don't like?  I know some ideas are a bit questionable, but that's why I spent two hours typing it.  This is so people programming don't have to think about how it should be; I've laid it all out for them.

Who says RPG elements are stuck being RPG elements.  I know the GAE team is probably snickering or something right now because I said that, but I did.  I think that at least the cliffs could be implemented; that I know isn't limited to RPG.

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Requirements: new map format
« Reply #15 on: 18 January 2009, 11:36:36 »
I disagree with "these things are RPG elements" because I recognise the basic ideas in C&C Series

Examples:
Poisonous Things -> Tiberium
Mines -> China (in Generals) has two types of mines that are erected around base structures
Portals -> GLA Tunnels
Cliffs -> In most I think
Healing Objects -> Hospitals, repair depots

I had a difficult time following the details (maybe I'm just tired). Perhaps use paragraphing when talking about different things like animation, AI, gameplay.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

modman

  • Guest
Re: Requirements: new map format
« Reply #16 on: 18 January 2009, 22:47:50 »
THANK YOU!

Someone isn't spending all their time (OK not all...) killing my ideas.
What next?  Are there any questions?
OK maybe I should lay it out in bullet form; would that work better?

Ayrin Greenflag

  • Horseman
  • ****
  • Posts: 188
    • View Profile
    • http://www.lostinn.com/ayrin
Re: Requirements: new map format
« Reply #17 on: 19 January 2009, 11:56:36 »
I agree with modman, some of those elements would be nice too... have possibilities wont mean to use them, and maybe some of that ideas could be used in different ways. Poison units would be nice, but poison could be afflictions too so i could make a unit that attack droids with a virus or nanodroids etc etc... but the basic is the same of poisoning/cure poison effects.
For that would be nice to use particle systems on units (emanation style)..that would be not too difficult i guess (if isen't already made )
We need cliffs!
Mines is a complex scenario if maps allow to select different terrains we can tie buildings or units to be built or travel only over them (ships).

ZaggyDad

  • Guest
Re: Requirements: new map format
« Reply #18 on: 20 January 2009, 00:25:49 »
This is probably the biggest post I've ever made.

Clarification: All these special things do not affect how you move your units around; any special instances for the AI are only guidelines that make up for the fact that it cannot make decisions as you and I do.  This is to say that if you want to, for instance sit your unit on quicksand until dead, you can and it will not attempt to escape, but the AI will never stop a unit on anything that can hurt them.  Also, none of these entities can be attacked with any unit.

Quicksand
Quicksand doesn’t necessarily have to be called quicksand; I would probably rather call it muck.  But you get the general idea.  The idea is that you can only stand on it a certain amount of time before you will be sucked in completely.  I would recommend that a unit of height value of 1 take 3 seconds to be sucked in, and by the way, once you are sucked in it should count as a death.  Also the amount of time it takes to be sucked in should be multiplied by the unit’s height value.  For instance a unit with height value of three should take 9 seconds to die in the quicksand, height value of 2 takes six seconds, etc.  There should also be an animation for the ground so it looks kind of like quicksand.  This could be similar to what open ocean looks like, but a bit less obvious, so the waves and ripples should be smaller.  Another feature of this quicksand or muck, whatever you want to call it, is that every second, until the maximum amount of time the unit could be in the quicksand, the unit’s move and animation speed is only 90% of what it was the second before.  This is to make it a bit more realistic, and so the only way quicksand or muck would hurt you is if you stopped your troops on a patch of it.  In addition, time in quicksand carries over to the next tile, so if you walk into a patch of quicksand, your speed degenerates per second until you get out.  Another thing is that a unit whose size value is greater than the size of the patch of quicksand is immune to any quicksand patches smaller than it.  For instance, if a unit is size value 2 (2x2) then a patch 1x3 or 1x2 should not even effect it.  This is to add a bit of realism; if you were standing on a half a 100 cm squared of quicksand, you would not fall in would you?  Also, the AI pathfinding algorithm would have to change a bit (or is it just the AI in general?) that a unit would not stop on quicksand; this applies to situations where the unit is being attacked.  Thus when a unit is on quicksand, the first priority of the unit is to get off ASAP.  Second priority then is to ward off attackers.  Also, the AI should not build buildings on or closer than 2 tiles away from the quicksand.  Since the quicksand is not randomly generated, but is optional to the maker of the map, there should be no problems with quicksand on a base.  Another more complicated option would be to set zones where quicksand could occur in the new map editor.  Inside the zones, quicksand could occur at set frequency; this way no two maps would be exactly alike.  Also, different zones could have different frequencies of it, so maybe along a river it is more common than 50 tiles away, for instance.  These zones, of course, would exclude the bases.  I personally think the zone option is preferable.

Poisonous Things
Poisonous things would be similar to quicksand in many ways.  But the biggest differences are that the poisonous things take away HP per second, (as opposed to quicksand hurting you only once your unit has sunk completely into it) and they only effect mobile units; thus buildings are not affected.  There could be various types of poisonous things in the map.  They would have specific models that they could be, similar to how a tree can be various different, but similar, models.  Most would probably look like bushes though.  The way they work is for every second you are standing on them, they take away certain amounts of your HP, until you are at 0 HP, when your unit dies.  This is not to say that an object will attack the same way as another unit; armor only helps you half as much as it would against a normal unit, and different types of armor all behave in the same way.  The algorithm for this is: ((damage-(armor/2))*seconds).  Hopefully that makes it clearer; you may observe that the type of armor is not factored in, and the damage is lessened by the amount of armor you have, but less than against a normal unit.  These poisonous things would be walkable, and thus only affect you if you are standing or walking over them.  Different ones could be varyingly poisonous too.  For instance one almost harmless plant may take away a raw amount of 50 per second; (raw meaning that it hasn’t had any armor subtractions from it) a more dangerous plant may take away 150 or 200 per second, but these would be rarer.  This goes back to the zones I spoke of earlier because you would manually input the rarity or frequency of any said type of poisonous thing.  I’m leaning towards most, if not all of the poisonous things being plants; this is because I cannot think of any other type of poisonous thing at the moment.  The AI for poisonous things would act very similar to that for quicksand.  But since the poisonous things only effect mobile units, the AI should probably feel free to build buildings on the poisonous things, except the builder/worker unit has to make sure not to be standing on any while building!  If the unit has no other choice other than to stand on the poisonous things while building, then the building cannot be built.  If the building does somehow get built though, a unit’s first priority is to get off the poisonous things and second priority is to carry out the action it would have carried out before.  While moving, the unit should do everything it can to avoid the poisonous things.  While the unit is attacking, though, if to get to another tile it is 5 or fewer tiles out of the way (extra distance) then the unit should take the long route.  But any distance greater than 5 tiles, the unit just goes over the poisonous things.  I think the ratio 5:1 is good for this instance while attacking.

Enchanted Plants
Enchanted plants are most similar to the poisonous things.  The difference is that they behave (attack) more similar to a unit because they have a range, and have attack types.  For instance a “whipping willow” might have a range of 2, and be slashing type.  Also, they do not take HP away per second, but they attack just like a normal unit.  I should say that the fashion that the attack is calculated is exactly the same as the way damages are calculated in unit v. unit fights.  Enchanted plants would always be immobile though.  Since you could not attack them, there would be no reason to give them any armor type either.  I think it would be most appropriate to have these enchanted plants placed on maps using the zone method.  We need a new map editor anyways.  The way that the AI would behave would be very similar to that of poisonous things, except to stay at least five tiles away from them if possible, and never to stop while you are being attacked by one.  Enchanted plants would be similar to poisonous things also because they cannot affect buildings.  The pathfinding would be the same as with poisonous things in that they would avoid moving within 5 tiles of any enchanted object while simply moving.  While attacking, we have to use the ratio again.  But since enchanted plants can hurt you more than poisonous things could, the ratio would be more like 10:1.  That is moving within the range of the enchanted plants only if it will save you ten tiles per enchanted plant there is.  For attack types, there could be emanations as well, which behaves exactly the same as in GAE.  One more thing about enchanted plants is that they are not passable or walkable.

Healing Objects
Healing objects are the exact opposite as with poisonous things.  These can emanate with a greater range though, because poisonous things can only hurt you if you are standing on them.  Unlike poisonous things, healing objects are not walkable.  They are placed on the map in exactly the same manner as with the enchanted plants, poisonous things, and quicksand.  This is using the top feature I hope to see in the new map editor: zones.  These would also not effect buildings, only units.  The AI would take this into account.  They would attempt to build buildings no closer than two tiles to the healing objects.  This is so injured units can access the healing objects.  All injured units would attempt to go to the healing objects, but not in the way that some ultras do it.  The ring of units around the healing objects should be no greater than 1 tile thick so that once the unit is healed it can do something else.  Also, units shouldn’t go to the healing objects unless they are not doing any other task (that is, stopped) and not unless they are actually damaged.  If a unit sees an enemy, they should attempt to get within the healing aura of the healing object and then attack.  But if the unit has no attack, then it should move away.  Also, if there is resources near the healing object, it would be smart for the AI to start a village there.

Mines
Mines are totally different than the last four.  They cannot be attacked, but that’s pretty much the only similarity.  They are walkable, and are defined in the faction, so in that case they wouldn’t necessarily be mines unless that is what it was really called.  For instance in the Tech faction there could be a bear trap, for my Undeads I was thinking of a hand that pops out of the ground.  A mine is built by the player, and is a one-time only thing.  They would take a set amount of HP every time they are sprung, and this is independent of any other factors that the unit may have.  So if the bear trap takes away 900 each time, then it takes away 900 each time, thus independent of any factors.  The question is then whether or not the unit will be killed, or just mangled.  I guess I forgot to mention it, but different types of mines may take away different amounts of different stats.  Applicable stats are move speed (for move speed, it would also be that much percent slower anim speed), armor, HP, EP, HP regen, (although this would be more of an absolute thing; you would set what you want the regen to be once the unit is a victim.  In this way, you could set the unit’s HP regen to negative numbers!) and another move speed one that freezes you in place for 30 seconds.  The AI for the mines would be a little more interesting.  It would not be able to see mines at all, and would then end up walking over them.  The AI would also never build mines anywhere farther than 10 tiles away from any building.  In this way, mines are another special type of defense.

Portals
The concept of a portal is pretty simple.  Portals take you from one place to another.  Portals are another thing totally different from anything previously mentioned.  They are not placed using the zone method, but are deliberately placed in places that make for an interesting game.  Portals have to be placed in pairs, and there can be a maximum of six pairs of portals per map.  This way, portals can be color coded with red, orange, yellow, green, blue, and purple.  The color coding makes the game simpler because every portal takes you to its partner.  The model of the portal can be defined in the tileset, but all portals are of one tile radius.  Again, no portal can be attacked, but they can be blocked.  This is very easy, since every portal can only expel units onto one tile in front of it; for this reason, there needs to be a capability in the map editor to rotate these portals.  I think that portals add another dimension of strategy to the game because the shortest distance to your base is no longer a straight line.  You can guard the portals or ambush units that come through them.  A possible bug though would be that even though you can walk through the portals, you cannot attack anything by way of the portals, or it would look really dumb.  The AI’s pathfinding would have to have a major revamp too.  Because you want the AI to take the shortest path possible, you have to make the AI compute whether it is shorter to take the portal route or the normal route (the one that doesn’t include the portal).  A solution to this would be to have the AI access whether or not the distance to travel is more or less than 50 tiles away, because you wouldn’t save that much time by taking the portal route anyhow.  If the distance is greater than 50 tiles than it’s OK to access which route is longer.  The AI also should be instructed to keep a fraction of its military near each portal of its knowledge, and that’s its more important to keep military near portals that are closer to the base.  Another important calculation is that if the portal is more than a third of the map away from any of its bases, then it isn’t important to guard at all.  Otherwise, it will continue to send fractions of its military to portals that another AI dominates, or one that a human dominates, which is really lame.  Also when leading what is called “huge attack” I think in the AI code, the AI should NOT use portals, because that could easily kill off its entire attack by the units getting picked off.

Cliffs
Cliffs are the biggest reason why a new map editor is absolutely necessary.  Cliffs have an interesting behavior in that they create a one-way path; you cannot climb up cliffs, but you can jump down.  There is, however, an HP penalty for doing so.  The calculation in terms of lost HP is as follows:  ((height difference)*100) where the height difference is the distance from the peak of the cliff to floor of the cliff.  This is totally different from normal landscape; in normal landscape you can walk everywhere with no penalty on HP as long as your unit is attacked.  But with cliffs you can only go in one direction, and with a HP cost.  This way you can chase workers off cliffs!  There should be a special texture for the sides of cliffs, and for the edge; that way you know it’s a cliff.  A map maker will have to watch out for situation in which units will be trapped; these are not preferable!  In later versions of Glest and/or GAE maybe there could be a possibility of building ladders so that you can go up the cliffs, and you can go down with no HP sacrifice.  The ladder method would be slower to go up and down the cliffs, but again, it has benefits.  The AI pathfinding would have to be altered slightly more to accommodate cliffs.   The AI would “know” whether it would have to go down a cliff to get to a certain point, and if so, would find the spot which would be the smallest drop, and thus take away the least damage.  Otherwise there’s no reason that the AI should have to go down a cliff and take damage if it doesn’t have to.  Also, it should be not allowed to build a building half on a cliff and half dangling over the edge.  In addition, another feature of cliffs is that you cannot attack “up” the cliff, but you can most definitely attack units down the cliff.  This means that the units that can jump down the cliff can attack the units that are below them; those that cannot get at them.  Also when at the edge of a cliff, your range is increased by ((difference in heights)*5)% so if the difference is one tile, your range will be increased by about 3%, but if the difference in heights is 10, the unit’s range is increased by a whopping 50%!  In the future, there could also be a feature where you can push someone else’s unit off of the cliff, thus they will suffer damages.  For now, though, the AI needs to be taught that it should stay away from the bases of cliffs, and that it is better to take the on-the-cliff route instead of the possibly shorter base-of-cliff route, because the units on top of the cliffs can attack you.

I agree with a lot of that, but I think the portals should only be for scenarios. Who in their sane mind would even think about wanting to go through a portal in normal play? The only thing similar to that that I've ever thought about wanting is a time skipping feature. ;D

I agree that it should have cliffs, but people definitely shouldn't be able to jump down one, no matter what the HP penalty. Only if they died when they jumped would I possibly want that. ;D

because the amount of micro-managing would have you buying a new mouse every week.

Good one. ;D

modman

  • Guest
Re: Requirements: new map format
« Reply #19 on: 20 January 2009, 02:33:02 »
OK, I'm willing to give in on the dying when jumping over cliffs feature.  It would be a little tricky for noobs anyhow.  But clicking on the vallye below, the pathfinding should be good enough to take you there.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Requirements: new map format
« Reply #20 on: 20 January 2009, 04:08:14 »
Dunno about a dying-because-I-fell-off-a-cliff-OMG-what-a-stupid-way-to-die thing, but cliffs in general would be nice. Traps are also interesting, though I'm not sure if they really should be part of the map, and more like a unit that an archer wouldn't stop to attack. Maybe there should be a way to make a unit undetectable to CPU.

Damaging areas would be fantastic. Could work like the emanations.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

gameboy

  • Guest
Re: Requirements: new map format
« Reply #21 on: 20 January 2009, 05:44:21 »
I also agree with some of the ideas, but the i think they should be part of the faction not maps.

modman

  • Guest
Re: Requirements: new map format
« Reply #22 on: 21 January 2009, 01:45:52 »
i think they should be part of the faction not maps.
They meaning the traps?  The functionality of the traps to the AI would be very similar to a feature I heard somewhere where normal units could have invisiblity abilities, either permanent (not recommended) or short-term.

daniel.santos

  • Guest
Re: Requirements: new map format
« Reply #23 on: 30 January 2009, 20:10:10 »
Ok, now I sorta regret leaving the forums un-trolled for so long.  ;D  Also, I haven't read this full thread yet, but I'll get back to it so please bare with me.

modman, I have no argument with your proposed features.  But (except for cliffs) I'm don't think they belong in the map format.  I'm going to have to give this more thought once my caffeine levels are higher (they are dangerously low right now!!).  I enjoy RPG personally, but not everybody does.  In general, I want to see crap like this in some removable/exchangeable map meta-data (like a scenario).  And forgive my use of the term "crap", I guess my brain can't encapsulate those *mechanisms* any other way right now.  Hey! I did it! They are "mechanisms", not "crap"  ;D

Briefly on the cliffs: units should not fall off of them nor willingly walk off of them.  I suppose its worth considering having some alternate command modifier to tell your units to do it anyway and take damage for falling, but that's a whole discussion in and of its self.  Also, its likely that there be an implementation of forcefully moving units around in the future (explosions or something) that can force units off of a cliff, and thus cause damage, but I don't think that's likely to be in the near future.

When we get to drilling deeper into the new map format and how it will be treated in game and in the editor (and I'm seriously considering Tiled) we can have a discussion about how exactly cliffs will be demarcated and how they will work.  I'm personally contemplating some ideas about having layers (geoligically, like dirt, sand, rock, etc.) in the maps and have tilesets contain images for displaying one of those layers when exposed (as on a cliff wall or other eroded surface, like rivers, etc.).  So this means that the maps would define in 3d what layers it consists of, and how thick each layer is up to a certain depth (and they'll all be one layer if you don't care to mess with it) so that the rendering of cliff walls will have a very realistic appearance.  This also paves the way for very pretty renderings if we ever choose to allow the map to be changed at play time (massive explosives anyone? or digging trenches).

modman

  • Guest
Re: Requirements: new map format
« Reply #24 on: 31 January 2009, 03:26:13 »
Trenches...I forgot that one.  No way I'm typing anything for that one though!

Also, pits from splashes would be nice.  A tag could control magnitude, and so a zero (default) value would be considered no effect.

It would also be a hidden variable, so not all XMLs need to be changed.
All tag-effecting things should probably work this way, until XMLs are updated with a major release.

 

anything