theTrav wrote:Reynolds wrote:Drawbridges. Way easier to code.
Not appropriate for the tech level and setting
Nonsense! Drawbridges were fairly standard tech on Castles. Given the Plate Armour and similar, I've been assuming a medieval period setting (and long for the day I may build a sweet, sweet Castle

).
I can understand bridges would be difficult to code though but I think a lot of the basics are already in place.
Laremere wrote:Loftorb can correct me if I'm mistaken, but the game works on a 2d grid, and two tiles can't exist at the same point on said point on the grid (such as having a bridge tile, and a water tile underneath.)
A boat (as an object) can be drawn on top of the water. Along with a person being drawn on top of that boat. You can even have a person, in a boat, on top of the water, behind a tree. So sprites already overlay other sprites (trees hide things, several trees can exist with various bits of themselves on top of each other, you can walk behind houses, walk on top of farm fields) and we already have special invisible stuff like scents and claims which also overlay on top of each other and everything else (village claims, individual claims and scents all seem to be able to exist on top of each other).
Laremere wrote:in addition the engine doesn't have the support to have multiple layers of objects all moving around at the same 2d coordinates. It would take extreme hacking of the engine to get it so that players could walk on a surface that boats go under, and even more to make it so that players don't collide with boats under the bridge, while boats collide with boats, and players collide with players.
The collision detection code already exists. It's just a matter of working out whether someone is "going under" or "going over" the bridge, then working out who else is in that area and also going under / going over that bridge.
I'd imagine a bridge would have some kind of special claim associated with it that defines its area. The bridge would exist on the map at a certain point (edges of the river, where you can't walk under it) and a sprite would be drawn across / on top of the water (much like a boat with a person in it is). Some kind of invisible "bridge" claim would be created. Then if you're on a boat / in the water and passing through a bridge claim, you go underneath the bridge (cue collision code dealing with people / objects in the water). If you're not swimming or in a boat, you go over and are blocked from walking off by the bridge's edge (cue collision code dealing with people and things on top of the bridge).
The two people existing at the same point (x,y) would be handled based on whether they were "going under" or "going over" the bridge. The graphics code seems to be able to draw objects on top of each other so can't see too many issues there, however I always imagined someone underneath the bridge would be hidden by the bridge, while somebody on top of the bridge would be on top of the bridge.
Laremere wrote:It's never a good thing to program something to work in a way that it is not intended to work, which is why the concept of bridges is so difficult, if not impossible without changing the way the engine works, to implement in a way people imagine seeing.
In addition, "just change the engine" is never something someone should suggest, unless they know exactly what they are talking about, because they can suggest something that seems logical in the real world, but is completely horribly illogical in the specific instance of code, if not within the entirety of programing itself.
I agree that changing the engine is asking for a beating but I think the engine is already capable of most of the things that are essentially required. That is, drawing the bridge on top of everything else and the collision code to deal with people running into each other. The only issue left in that case appears to be determing whether someone or something is "over" or "under" the bridge.
Obviously I'm not aware of how this game is coded though and given jorb (or loftar) is the one who's job it would be, if they can't figure it out, I figure it's not happening until they do.
Anyway, it's interesting to speculate.
You do not have the required permissions to view the files attached to this post.