sanderd17 Posted June 20, 2013 Report Share Posted June 20, 2013 (edited) Currently, there are issues with buildings on non-flat terrain.One of the solutions would be to flatten it. But that won't be the nicest one. The main problem is, even if the model has deep foundations. There are still artefacts that shouldn't happen, such as floating props (see screenshots).So I would suggest to add a attribute to the "prop" element of an actor. I imagine something like floating="ground" or floating="water". in which case, the horizontal (X,Z) position would still be taken from the original model (just as the prop is currently bound to a point), but the vertical Y position would be the terrain height on that point.That way, you won't get those floating props (at least not if you have a separate prop for every object you add). But moreover, it could give an advantage to walls.If the wall pieces would just consist out of some small props (a few meters wide, or exactly one merlon wide), repeated with some variation. Then those wall props could float on the ground, and create a nice landscape following layout.It does seem possible (and quite simple) this far, but the render code is huge, so I haven't yet found where the prop placement happens. If someone could help me with that, it would be great. I also like to hear some input from designers.I even believe, once floating props are implemented, terrain flattening shouldn't even happen anymore. Everything could be fixed in the models. Edited June 20, 2013 by sanderd17 Quote Link to comment Share on other sites More sharing options...
RedFox Posted June 20, 2013 Report Share Posted June 20, 2013 Sounds like a good idea for building props. I'd even go so far to suggest we apply the terrain Z to every mesh group in the model that has same Z value as the foundation. This would let us keep the current art unmodified and it would require less from the 3d artists. Mesh groups that have higher Z will be ignored (clay pots on pillars, etc.).This means that the model has to be broken down into sub-objects during loading time. Mesh groups with high Z value stick to the original object, while other mesh groups get extracted.I don't even know how the model importing system works in 0 A.D., though, so perhaps someone else could comment on that. Quote Link to comment Share on other sites More sharing options...
Enrique Posted June 20, 2013 Report Share Posted June 20, 2013 It could be a solution, but a tricky one. IMO having to make each prop a separate mesh doesn't sound like the best method. It also sounds hard to mod.I think partial flattening + clever prop positioning (see mauryan market or mauryan elephant stables) is the way to go. Quote Link to comment Share on other sites More sharing options...
zoot Posted June 20, 2013 Report Share Posted June 20, 2013 In the sample screenshot you show, I doubt it would help much. You would get some pottery props and so on on the ground, but the main building mesh would still 'stick out' in the air. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 20, 2013 Author Report Share Posted June 20, 2013 @RedFox, I don't know if adjusting every group on the ground would be a good idea. It could give some strange results.@Enrique, Wow, I never discovered that about the elephant stables. Nicely done. But how would having multiple props with a single element be more difficult than a single prop with multiple elements? I also would like the decision to the artists if they want their prop to be floating, or if they want it to be fixed. So you wouldn't have to do that trick with the table (which is very well thought). Maybe it could be even extended to set floating in some range if you like.And how do you feel about the walls? Would it be a solution for those? Every wall would need some vertical thing (like the vertical woods in the celtic wall) to obscure the seam I guess.@zoot: stick out on one side, and be burried on the other side indeed. But I think flattening would be more dangerous to implement. If the terrain is almost impassable, and you flatten a part, an other part will become steeper and completely impassable. AI will have a nice time searching where to build the dropsite so the way to the dropsite doesn't become impassable. And some new players could be very surprised. Quote Link to comment Share on other sites More sharing options...
Enrique Posted June 20, 2013 Report Share Posted June 20, 2013 Not sure how the walls would work divided in pieces. It would also break the wall placement system I guess. If I understand correctly, you want to divide the long section in, for example, 5 pieces? I think that would make the wall a little weird on uneven terrain, probably with big differences in height between pieces, and probably hard not to see the seams between pieces and discontinued texture. It also could make difficult to place gates I guess. Not sure if I understood the method you are proposing correctly xDHaving multiple props in each building means a lot more actors per building. One per prop seems to me a too much, but it could be done.Another thing to point out: in your example screenshot, you placed the mill in atlas? the game doesn't let you build on such steep terrain, 90% of the time you can't see the extended underground structure end even on extreme cases. The props are easy to see them floating though.I would like to see partial terrain flattening to test it out to see how it works and if it's so easy to generate impassable terrain. I also wonder if it can be possible to make some kind of check on the surroundings of the building before placement and don't let it build where it would make impassable terrain? this seems harder to get it right though. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 20, 2013 Author Report Share Posted June 20, 2013 (edited) Not sure how the walls would work divided in pieces. It would also break the wall placement system I guess. If I understand correctly, you want to divide the long section in, for example, 5 pieces? I think that would make the wall a little weird on uneven terrain, probably with big differences in height between pieces, and probably hard not to see the seams between pieces and discontinued texture. It also could make difficult to place gates I guess. Not sure if I understood the method you are proposing correctly xDDepending on the desing yes, a piece or five. If the pieces are designed with care (with step-like features between them) I think it could work. Hiding the seam would indeed be the most difficult. It can be done with separate pieces of wood, or some buttresses. Gates would still be one piece I guess. That's a lot harder to change. But at least walls would follow terrain. Which is something Michael wanted (he mentioned that here somewhere).Having multiple props in each building means a lot more actors per building. One per prop seems to me a too much, but it could be done.Well, but you can re-use props directly by just referencing to them. Use the same basket as a prop for a house, the mill, the civil center ... So a lot less duplicate meshes.Another thing to point out: in your example screenshot, you placed the mill in atlas? the game doesn't let you build on such steep terrain, 90% of the time you can't see the extended underground structure end even on extreme cases. The props are easy to see them floating though.I turned on the passability overlay, and the terrain I placed it on is still passable (and also constructable) but only barely. Sorry, that doesn't seem clear as the mill also marks those squares red. But they were originally green.I would like to see partial terrain flattening to test it out to see how it works and if it's so easy to generate impassable terrain. I also wonder if it can be possible to make some kind of check on the surroundings of the building before placement and don't let it build where it would make impassable terrain? this seems harder to get it right though.Could cause some long iterations for big buildings though. But as you're art dept lead, I'll first check that. Edited June 20, 2013 by sanderd17 Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 21, 2013 Author Report Share Posted June 21, 2013 After a night of sleep, I decided I won't change the terrain elevation. That's just too dangerous for a newbie to the code base like me. The terrain has to be synced perfectly. And if I do it, I could cause additional OOS problems. I'll leave it for someone more qualified to do it.I'll instead look around for something else to do. Quote Link to comment Share on other sites More sharing options...
Enrique Posted June 21, 2013 Report Share Posted June 21, 2013 I also thought about the floating props solution. I haven't tried it yet (and I can't right now) but I think the prop's origin is inherited from the building "main" actor, therefore, I think the prop height will stay the same as the main building actor. It's just a guess, haven't tried it yet as I said. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 21, 2013 Author Report Share Posted June 21, 2013 a prop can be attached to the root (as most props currently in the data) or it can be attached to a 'bone' (as I've seen in the software). I don't know a lot about modelling, but I think that's a special point in the model. That could be used to let it float. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 22, 2013 Report Share Posted June 22, 2013 (edited) IRC there already is a ticket that implements terrain flattening somewhere on trac. Also I think terrain flattening is a must, I've never played an RTS before that didn't have terrain flattening and currently it is the most outstanding visual flaw in the game. On the other hand, I think doing something along Redfox's idea might be a little easier for artists to deal with then making nearly everything a prop. Edited June 22, 2013 by Josh Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted June 23, 2013 Report Share Posted June 23, 2013 IRC there already is a ticket that implements terrain flattening somewhere on trac. Also I think terrain flattening is a must, I've never played an RTS before that didn't have terrain flattening and currently it is the most outstanding visual flaw in the game. On the other hand, I think doing something along Redfox's idea might be a little easier for artists to deal with then making nearly everything a prop.http://trac.wildfiregames.com/ticket/21 - I really think we need to test and consider carefully terrain changing during the game. Currently it's not something we even need to worry about (Atlas is a special case, so we do have to handle dynamic terrain modification in the engine, but Atlas is also buggy). Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 23, 2013 Report Share Posted June 23, 2013 http://trac.wildfire...s.com/ticket/21 - I really think we need to test and consider carefully terrain changing during the game. Currently it's not something we even need to worry about (Atlas is a special case, so we do have to handle dynamic terrain modification in the engine, but Atlas is also buggy).Pretty much the best way to do it would be to set the terrain pathfinding in stone when the map is generated and not have it "update" based on the terrain height changes. This is what happens with Age of Mythology. Sometimes the flattened terrain would create little cliffs around some of the edges that would normally cause passability issues, but this should be ignored by the pathfinder. 1 Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 23, 2013 Author Report Share Posted June 23, 2013 But pathfinder in Atlas should update the pathfinding based on the terrain. How can a map designer otherwise design cliffs and passable hills?Since it's the same code being used, that's rather difficult.Btw, I also think a 45° angle is a bit too steep to build on (see the screenshot, Enrique didn't believe it was buildable), maybe we could bring it to something lower? Bring the "building-land" class to a max slope of something like 0.5?For most maps, this won't change, but you won't be able anymore to build on the entrance way to an acropolis (which might even be a good thing, no player wants to build there, and if the AI builds there, it gets pathfinding problems).http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/data/pathfinder.xml Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 23, 2013 Report Share Posted June 23, 2013 But pathfinder in Atlas should update the pathfinding based on the terrain. How can a map designer otherwise design cliffs and passable hills?I'm talking about real-time in a match, not in Atlas. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted June 24, 2013 Report Share Posted June 24, 2013 Pretty much the best way to do it would be to set the terrain pathfinding in stone when the map is generated and not have it "update" based on the terrain height changes. This is what happens with Age of Mythology. Sometimes the flattened terrain would create little cliffs around some of the edges that would normally cause passability issues, but this should be ignored by the pathfinder.That might be possible if we cached the pathfinder's terrain passability at the start of the match. Entity position would use the actual updated terrain, I suspect that would look decent. The difficulty sanderd17 brings up is that Atlas in fact reuses the gameplay logic from matches, so we have to add more special cases for Atlas-specific behavior. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted July 10, 2013 Author Report Share Posted July 10, 2013 I've tried to make a patch for it (http://trac.wilfiregames.com/ticket/2033), it works pretty well, but before I clean it up, I'd like some more input. I've used a maxheight and minheight attribute, those define the relative maximum and minumum height a prop can differ from the main mesh. When not set, they default to 0 (so the prop can't move). You can use it f.e. so that a prop can never rise over the original position, but when the ground is dropped, it can be placed lower so it won't dangle. I'd like to hear if this is a good interface, or if anyone wants other control over the props, or better names for the attributes. Quote Link to comment Share on other sites More sharing options...
Pureon Posted July 10, 2013 Report Share Posted July 10, 2013 Sounds very promising. Enrique and I discussed this during saturday's art team meeting and we agreed this was very useful and we'd start creating buildings from now on that can work with this setup (where certain objects that sit on the ground level are propped to the main actor).I can't test it out, or comment much on whether the attribute names conflict with anything, but the interface you've described sounds ideal for what's needed Quote Link to comment Share on other sites More sharing options...
FeXoR Posted July 10, 2013 Report Share Posted July 10, 2013 About terrain change during play in general.There are two ways possible IMO:1.) Terrain change does not happen at all in-game.2.) Terrain can be transformed in-game - that would include terrain flattening below buildings (which on it's own has its problems besides pathfinding mentioned by historic_bruno (http://www.wildfiregames.com/forum/index.php?showtopic=17405entry270541) and the topic link in that track ticket) as well as some kind of terrain transformation commands to make paths though otherwise unpassable areas as well as making walls and cliffs for defensive purpose.But it seams the favor is leaning towards a mix (again) that only fixes the visual issue while granting no gameplay feature. Maybe it's just me but I strongly reject such things. For me the graphic has to represent the gameplay features and add a specific mood and feel to different regions of a game. If a graphic enhancement comes along with a nice gameplay feature that's quite cool. But making units be able to walk extremely step ground near buildings (because the pathfinder was not updated) but not allowing that on the rest of the map seams quite absurd to me. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted July 11, 2013 Author Report Share Posted July 11, 2013 @Pureon or Enrique, if you say you're creating the new buildings to be compatible to the system, can you send me one (or commit it to the repo)? I'd like to make sure we're not talking next to each other (and have something better to test than that silly carthagian palm thing I used). Quote Link to comment Share on other sites More sharing options...
Pureon Posted July 11, 2013 Report Share Posted July 11, 2013 @Pureon or Enrique, if you say you're creating the new buildings to be compatible to the system, can you send me one (or commit it to the repo)? I'd like to make sure we're not talking next to each other (and have something better to test than that silly carthagian palm thing I used).We already have a few of these in-game. One example is the Persian stables building which has 3 horses propped at ground level each with their own prop points. See here. So props 'horsea', 'horseb', and 'horsec' would move up or down based on where the ground is.Does that work? Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted July 12, 2013 Author Report Share Posted July 12, 2013 Leper got it in the game, and Historic Bruno fixed a Windows problem. So the horses in the Persian stables will adjust to the terrain height, and new buildings can also use this.Btw, there are many possibilities. When a building exists out of two parts (like the L shaped blacksmiths), you can have one part added as a prop, so they move a bit relative to the terrain. But I'll leave it to you artists to see what's nice. 1 Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted July 12, 2013 Report Share Posted July 12, 2013 We already have a few of these in-game. One example is the Persian stables building which has 3 horses propped at ground level each with their own prop points. See here. So props 'horsea', 'horseb', and 'horsec' would move up or down based on where the ground is.Does that work?Pretty cool. Any chance a programmer can extend this to the Actor Editor?Also, looks like we can now have real wheat fields that conform to terrain. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted July 12, 2013 Author Report Share Posted July 12, 2013 I don't have a Windows installation in my home, and as the Actor editor is broken on Linux, I can't help with that. Someone else could probably do it.And for the fields, if you have lots of props on different places, you can indeed have terrain adjusting wheat. 1 Quote Link to comment Share on other sites More sharing options...
Pureon Posted July 12, 2013 Report Share Posted July 12, 2013 Nicely done sandard17. I agree it opens up many possibilities Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.