Jump to content

Buildable Bridges


anotherone
 Share

Recommended Posts

Following up on http://www.wildfiregames.com/forum/index.php?showtopic=17825&hl=%2Bbuildable+%2Bbridges#entry278708

If we are to implement buildable bridges, I have some general ideas:

- There will be two types of bridges - wood and stone.

- They should be implemented similar to walls, with sections and towers (maybe?) for the stone ones.

- When a bridge section with units on it is destroyed, the units drown.

- Wooden bridges have less weight capacity than stone ones (might need a weight property for units now)

- Stone bridge sections could upgrade to drawbridges to allow ships to pass

- Bridge sections can be built from ships with units garrisoned aboard, or from adjacent sections or land

- Maximum length for wooden bridges is greater than for stone bridges (no typo)

- Stone bridges will be able to cross a deeper depth than wooden ones

- Bridges needn't be over water

- Bridges over land (a canyon, say) will look different from water bridges

My first post, so take it easy :)

Edited by anotherone
Link to comment
Share on other sites

I think if we're going to implement (buildable) bridges we should make them simple, i.e. no weight. Drawbridges (a bit like gates) sound interesting, I'm curious as to whether that's feasible. I think we should make bridges high enough so that boats can go under. I always hated how bridges blocked boats in AoE, but this might be difficult for the artwork.

Here's my opinions on your points:

- There will should be two types of bridges - wood and stone.

Ok, I agree

- They should be implemented similar to walls, with sections and towers (maybe?) for the stone ones.

I agree, that way the stone bridges can also easily be used for docks :-)

- When a bridge section with units on it is destroyed, the units drown.

Not sure whether 'drown' is the right word here. Let's say we just instakill them for the time being. If someone wants to make drown animations some day in the future that would look amazing, but atm it's overkill.

- Wooden bridges have less weight capacity than stone ones (might need a weight property for units now)

Nope. Let's keep weight capacity out of it. That's good for building sims, but this is a strategy game. The fact that enemies can destroy bridges is enough.

- Stone bridge sections could upgrade to drawbridges to allow ships to pass

Like gates (but over water)? Sounds interesting, not sure how feasible (because of the sudden gap), but definitely something to think about.

- Bridge sections can be built from ships with units garrisoned aboard, or from adjacent sections or land

I'd leave the ship part out. That's going to look weird, and why would you do that???

- Maximum length for wooden bridges is greater than for stone bridges (no typo)

I'd have both bridges be only buildable in a straight line and for a certain max length.

- Stone bridges will be able to cross a deeper depth than wooden ones

Hard for players to see at an instant which one they need to use. I'd leave that out for simplicity.

- Bridges needn't be over water

:thumbsup: agreed

- Bridges over land (a canyon, say) will look different from water bridges

That means 2x the artwork, not sure that is necessary... we could add some waterlines/algae to the water bridge textures.

I'm a cs student and I'm really looking forward to contributing to 0A.D. but I'm afraid that bridges are slightly out of my league for the time being. If no one does it by 2017, I'll do it :-)

  • Like 1
Link to comment
Share on other sites

- Bridge sections can be built from ships with units garrisoned aboard, or from adjacent sections or land

I'd leave the ship part out. That's going to look weird, and why would you do that???

I think he refers to the pontoon bridge the persians built across the Dardanelles (Hellespont) : https://en.wikipedia.org/wiki/Xerxes%27_Pontoon_Bridges

Romans are known to have used such bridges too : https://en.wikipedia.org/wiki/Pontoon_bridge#Greco-Roman_era

And maybe it could be worth considering the carthaginian system too : rafts linked to the shores by ropes which quickly allow to make the elephants cross a river.

Link to comment
Share on other sites

- Wooden bridges have less weight capacity than stone ones (might need a weight property for units now)

Nope. Let's keep weight capacity out of it. That's good for building sims, but this is a strategy game. The fact that enemies can destroy bridges is enough.

IMO, units that cannot be garrisonned on ships should not be allowed to cross bridges, or they can only cross stone bridges.]

- Stone bridge sections could upgrade to drawbridges to allow ships to pass

Like gates (but over water)? Sounds interesting, not sure how feasible (because of the sudden gap), but definitely something to think about.

If this is feasible, it should also prevent units from crossing the bridge.

- Bridge sections can be built from ships with units garrisoned aboard, or from adjacent sections or land

I'd leave the ship part out. That's going to look weird, and why would you do that???

I agree.

I think we should make bridges high enough so that boats can go under.

This is infeasible, as it would allow units to be both over and under the bridge at the same time.

And a reminder that only with walkable meshes will true bridges be possible for now they will be only a hack and that means an almost complete rewrite on the rendering pipeline not a trivial task so I don't see it happening for a long while.

Well, maybe this won't happen after all... :stinker:

Link to comment
Share on other sites

If we choose to implement this, how would it be done? Perhaps the act of building the bridge should change the internal representation of the map for the pathfinder. The representation seen by the renderer would stay the same. Then, models for the bridge could be placed. Could this be done?

Link to comment
Share on other sites


- Stone bridge sections could upgrade to drawbridges to allow ships to pass

Like gates (but over water)? Sounds interesting, not sure how feasible (because of the sudden gap), but definitely something to think about.

If this is feasible, it should also prevent units from crossing the bridge.

I like the similarity to walls you pointed out. In fact drawbridges are possible, even with the workaround, which is somewhat like walkable meshes but one-linear. (and thus working for walkable bridges). It's an idea of stanislas and I think it's the way to go (as walkable meshes will be in 10 years or such and we only want to wait one to two years at max :D).


The construction of eye-candy (like bridges) is already possible in a mod. Though I think to make bridge models tilable / segments would involve some art work. (i.e. splitting the bridge models into segments)


The workaround using prop points 1-dimensional would even allow for units walking on walls in theory.

Link to comment
Share on other sites

Prop points called walking height have to be inserted in the 3D model. If more than 1 is added then it's interpolated, which will allow for ramps up to the walls.

The units then know a height to travel. The pathfinder should be aware of it too which could be troublesome. All credit for the idea to stanislas.

Link to comment
Share on other sites

For drawbridges 2 walking height prop points would be inserted on either side parented to bones of the drawbridge (the wings' bones).

Then if we have a max-angle for steepness of walking height prop interpolation, then we'd know there is no passway anymore (because of 90° or let's say >60° steepness as not all drawbridges might draw their segments/wings up such that they point up fully vertical, i.e. 90° degree). This would then interrupt the interpolation and the obstruction would be freed, allowing ships to pass.

For that tiles in rivers must be marked as "no obstruction" by the scripting side (javascript). The engine marks some regions as unpassable which could make troubles.

If this is ruled out, then removing the obstructions when constructing the bridge-segments (from one side until the other is left, giving the enemy time to interfere as not all segments may be built at once other than when using ships if that'd not be overkill) is all what is needed for the pathfinder to be aware of bridges .

Edited by Hephaestion
Link to comment
Share on other sites

I like the similarity to walls you pointed out. In fact drawbridges are possible, even with the workaround, which is somewhat like walkable meshes but one-linear. (and thus working for walkable bridges). It's an idea of stanislas and I think it's the way to go (as walkable meshes will be in 10 years or such and we only want to wait one to two years at max :D).

The construction of eye-candy (like bridges) is already possible in a mod. Though I think to make bridge models tilable / segments would involve some art work. (i.e. splitting the bridge models into segments)The workaround using prop points 1-dimensional would even allow for units walking on walls in theory.

Is planned I think use bridges in the game.
Link to comment
Share on other sites

  • 2 years later...

I'm reviving this thread to continue the discussion. Here is the above refered IRC discussion (Dead links) :

23:55 < _0ADFan> lol code that
23:56 < _0ADFan> ships pass under bridges
23:56 < _0ADFan> you know..even in real life ;-)
23:56 < franklin> Maybe a length limit... Or weight limit...
23:56 < _0ADFan> at least we will get archers on walls..that's something
23:56 < _0ADFan> in alpha 17
23:57 < franklin> You can already garrison them in towers
23:57 < _0ADFan> but not on walls like in stzronghold
23:57 < _0ADFan> will come in 17
23:57 < _0ADFan> eager to see it...yiüiie
23:58 < scythetwirler> leper: Did the design committe consider bridges yet?
23:58 < franklin> How about stone bridges carrying more weight than wooden ones?
23:58 < _0ADFan> would make sense as well franklin
23:58 < _0ADFan> logical
23:59 <@leper> Would make pathfinding even more fun
23:59 <@leper> (also you need to find a nice way to implement it)

In order to make map mapping and gameplay more interesting, I thought of two implementations of bridges.
 

Spoiler

Bridge.PNG

 

1. Hack the current system of gates for bridges at least draw bridges

Theory:

  • Just like gates change obstruction, bridge change the water moving restriction.
  • It would then make an area passable on a simple click just like for gates. for full bridges though.
  • Bridges should have a higher weight than the rest of the paths, because they are more annoying to cross, especially if we aim to have formations. (In this case they should be disbanded when on the bridge)

Advantages:

  • Performance savvy compared to other solutions.
  • Less coding required

Issues:

  • Not really aesthetically pleasing (you cannot have arched bridges for instance)
  • Bridge height depends on water height unless a origin hack is used.

2. Use prop points to define the path.

Theory:

  • units would be using the prop points in the Collada (*.dae) file in order to make a custom path following the points. 
  • Path would be cached to avoid to recompute the arc again and again.
  • Depending on a given size in the template, the game would make a fake and invisible terrain in stead of the bridge.

Advantages:

  • Visually more pleasing.
    • Arched bridges
    • Different heights possible
    • Not related to terrain around

Issues:

  • Performance costly compared to other solutions.
  • More coding required
  • More use of interpolation functions.

 

Common Issue: Both bridges should have a height offset not to have the bridge collide with the water and units collide with the mesh.

Xml coul

Xml file could look like this :

  <Obstruction>
    <Obstructions>
      <Right width="11" depth="8" x="13" z="0"/>
      <Left width="11" depth="8" x="-13" z="0"/>
      <Pathway heightOffset="15" width="15" depth="8" x="0" z="0"/>
    </Obstructions>
  </Obstruction>
Spoiler

Bridge01.PNG

 

Variants:

  • Draw Bridges
    • If you want to make bridge passable for boats It would require an active query to check whether the approaching unit is a boat or a unit, which might it really slow performance wise. Also the case when both units happen to get on the bridge that could get messy
      • To solve this, maybe don't make it automatic like gates.
    • Bridge will switch with the same button than for gates.

Today's discussion

<Vladislav> Stan`: yep, but AFAIK current pathfinder doesn't support few passable layers on the same (x, z), so another solutions looks like a hack
.:Stan`:. Vladislav, I'm pretty sure we could get the same result that on the first screenshot
.:Stan`:. which is the theoreticall terrain
<Vladislav> Stan`: the bridge demo map already implements this "bridge"
.:Vladislav:. But for ships it's not passable
.:Stan`:. Vladislav, but as terrain, not as a buildable mesh
<Vladislav> Stan`: yep, so for us it would be good to have sanderd17 patch about terrain modificators
.:Stan`:. Vladislav, I don't really understand what it does? Does it create a fake heightmap ?
<Vladislav> Stan`: It could change visible height of map, or only collision height, or both, at least it should be there I think
.:Stan`:. Vladislav, Ah yeah indeed in that case. And if you can do that interactively, you can make draw bridges
.:Stan`:. which imo
.:Stan`:. should be the only ones allowing ships to cross them
.:Vladislav:. If we will a bridge logic to pathfinder then it will be slower in  common case, because more conditions aren't good for caches
.:Vladislav:. *have
.:Vladislav:. *add
.:Vladislav:. Or I could suggest to use 2 different maps, for ships, and for ground units
.:Vladislav:. then it will be possible
.:Vladislav:. fast and easy enough to implement
.:Stan`:. Vladislav, Would make sense as wll
.:Stan`:. having uncrossable areas unless you make a bridge would change gameplay a lot
.:Vladislav:. Yep
.:Stan`:. I guess the best thing would be this
.:Stan`:. map makeers put foundations
.:Stan`:. on random areas of the map
.:Stan`:. (not random)
.:Stan`:. and then players can only build bridges there
.:Stan`:. thoses bridges should be neutral
.:Stan`:. and for now... indestructibles

 

Edited by stanislas69
  • Like 4
Link to comment
Share on other sites

Regarding code and bridges: I actually believe a walkable mesh would be far easier to do than changing terrain. Changing terrain sports a number of drawbacks which I am very reluctant to get into.

A walkable mesh would imply a new component, and tight integration to the pathfinder, but in itself nothing there sounds impossible, and would in theory allow ships and units. Since we cache the obstruction maps, nothing there is insane so long as the update isn't too difficult. We could also add gates to their sides and stuff. It would be a little slower, but it wouldn't be by that much. However, the pathfinding problems of gates still apply: closed bridges currently would be seen as utterly impassable.

The feature is also not really that interesting, since most bridges won't be high enough to let ships through. Have to agree with draw bridges there (though how realistic are those for the time period?). I generally don't see handling height as relevant, that would just add passability classes for a super special case which is annoying.

  • Like 1
Link to comment
Share on other sites

One way to solve this would be to restrict naval classes on some maps, which would I think make more sense. 

  • Naval Maps → Boats
  • Other Maps → Bridges

Also, since we do not have weather ( #40 ) and thus no frozen lakes, it could make it interesting, to have big bridges keypoints to hold could even be a new game mode. (For now likely lag mod but heh)

Edited by stanislas69
Link to comment
Share on other sites

Here are my thoughts on bridges,

Bridges should be plotted like walls, yes, but with small differences that are important not to overlook.  When placing the beginning and end points for a bridge these points are not arbitrary, unlike with walls, instead they should mark the bridge footing*, with the length in between the two footings being the bridge deck**.

Placing the footings further apart builds bigger arches, perhaps to allow large ships to pass underneath (allowing smaller boats to pass under smaller arches could be a nice trick), but bigger arches cost cost more materials.  There's a limit to how far apart you can place the footings but you can build them in series to create bridges with multiple arches that span a greater distance.

Wooden bridges are a good idea too.  Wooden bridges cannot have footings placed in water (they would rot), so wooden bridges must span a body of water in one length.

I do not see the need to add towers to bridges.  If you want to defend your bridge with a tower, build a tower next to it.  However, it would be worth making sure that bridges and walls can tesselate nicely together, so you could protect your bridge by walling it off and installing a gate.

I do not support the idea to have weight limits and damage the bridges by crossing them.  Think how much chaos this would cause trying to stop your units wandering over the bridge all at once and breaking it!

Drawbridges, I am unsure about.  I could probably be convinced they are a great idea and a terrible idea!

* Bridge Footing - The parts in contact with the ground that bear the weight of the bridge.  I think I'm using the correct terms but bridge terminology is new to me.
** Bridge Deck - The part that you travel across.

Edited by Libervurto
  • Like 1
Link to comment
Share on other sites

On 25/12/2016 at 10:22 AM, stanislas69 said:

While I like the idea of bridges working like walls I think they should be of a standard size the players should't be able to place it wherever they want.

Or have a maximum bridge height (or water depth) so that bridges cannot be built across oceans, or at least make it very expensive to do so.  The problem I forsee with having standard bridge sizes is that then in order to make bridges useful the maps would have to be designed with bodies of water with a specific width to cater to bridges.  This would have the effect of there being predetermined bridging points on the map.  I like the idea to keep these things as free-form as possible.  Also, I just want to see people build crazy bridges!  ^_^  I like the idea that a player might endulge in a big bridge building project, and it could end up being a great feat and help them win or it could be a disaster that is never finished and ruins them.  We have all tried to build a "Great Wall" in a game, with mixed results, so why not tempt players with great bridges too?  Reminds me of real life huge building projects that old empires took on, sometimes out of necessity, most often for prestige.

  • Like 1
Link to comment
Share on other sites

8 hours ago, stanislas69 said:

My concern would be the performance cost of such an ability. Imagine the disaster for the pathfinder if they are bridges everywhere. That's why I'd rather have them thought of by mapmakers.

Pathfinder has to update the path grid all the time for new buildings {blocked paths} and depleted resources {new paths}.

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