Vantha Posted January 10 Report Share Posted January 10 I've run into an issue while creating the map for the tutorial campaign. Most of the terrain is quite even, but there are also some hilly parts. Now, the problem is that vegetation props don't align their rotation the slope. (I am aware that entity templates can be configured to do exactly that, like rocks and ores for example. But these props simply aren't entities, only actors). This works fine for most of them, but looks very wrong for low and wide actors (in my case underbrushes and grass): Spoiler I used especially those two quite a lot for the rest of the map, so simply leaving out them in affected areas is not a option. And there aren't any good replacements for them either. Any ideas how I could work around this? Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted January 10 Report Share Posted January 10 I'd use the small bushes then. Also, at that angle of slope, I doubt you'd see grasses like that. One thing I encourage you to do from a map design standpoint, is to think about playability and how maps should look from a video game's point of view. So, the super steep mountain sides from reality aren't so good for an RTS game. Think about using "cliffs" as map features instead of mountains, and to add dimensionality, try some nice rolling hills. 1 1 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted January 10 Report Share Posted January 10 5 minutes ago, wowgetoffyourcellphone said: I'd use the small bushes then. Also, at that angle of slope, I doubt you'd see grasses like that. One thing I encourage you to do from a map design standpoint, is to think about playability and how maps should look from a video game's point of view. So, the super steep mountain sides from reality aren't so good for an RTS game. Think about using "cliffs" as map features instead of mountains, and to add dimensionality, try some nice rolling hills. That cliff thing is good for the game, it would be an excellent transformation tool. And it would be excellent to make it compatible with the Nabataeans. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted January 10 Report Share Posted January 10 35 minutes ago, Lion.Kanzen said: That cliff thing is good for the game, it would be an excellent transformation tool. And it would be excellent to make it compatible with the Nabataeans. Quote Link to comment Share on other sites More sharing options...
Vantha Posted January 11 Author Report Share Posted January 11 On 10/01/2025 at 9:42 PM, wowgetoffyourcellphone said: I'd use the small bushes then. Also, at that angle of slope, I doubt you'd see grasses like that. One thing I encourage you to do from a map design standpoint, is to think about playability and how maps should look from a video game's point of view. So, the super steep mountain sides from reality aren't so good for an RTS game. Think about using "cliffs" as map features instead of mountains, and to add dimensionality, try some nice rolling hills. The slope in the screenshot is the steepest of the whole map (and lays on the very edge). There are no cliffs (in the sense of exposed rock) at all in the area, only a few hills. I'd estimate that more than 95% of the map is still fully passable and buildable. But the same also happens on the flatter hillsides; it goes wrong basically as soon as there's an incline. Quote Link to comment Share on other sites More sharing options...
Vantha Posted Thursday at 23:08 Author Report Share Posted Thursday at 23:08 So, call me pedantic but I actually dug around in the code and implemented a way to fix this: https://gitea.wildfiregames.com/0ad/0ad/pulls/7542 Now, as I said, the screenshot above is a bit of an exaggeration and and quite misleading. My situation looks more like this: And with the patch: I know these are very extreme camera angles (that I'm not even sure can be reached in the game), but it is hard to capture the full issue in a still screenshot. It is a lot more noticeable when rotating the camera around. Or at least I can't unsee it now and - call me pedantic again - I can't bring myself to continue working on the map before fixing this 2 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted Friday at 03:01 Report Share Posted Friday at 03:01 It's an improvement, but I think it would be even better if we could have a tag that would bend the geometry to hug the ground but still be vertical. Quote Link to comment Share on other sites More sharing options...
Stan` Posted Friday at 07:30 Report Share Posted Friday at 07:30 It would be nice to be able to override this as well in the <prop tag as well> 1 Quote Link to comment Share on other sites More sharing options...
Vantha Posted Friday at 11:37 Author Report Share Posted Friday at 11:37 8 hours ago, wowgetoffyourcellphone said: It's an improvement, but I think it would be even better if we could have a tag that would bend the geometry to hug the ground but still be vertical. Agreed. This is certainly not a perfect solution, because the grass now protrudes at a right angle to the slope - not straight upwards like it would in reality. But this is a much smaller flaw than the original one in my opinion. Actually bending the mesh is a lot more complicated and would likely require the models to have a rig. 3 hours ago, Stan` said: It would be nice to be able to override this as well in the <prop tag as well> To my understanding this could be done relatively easily as well, but it's not related to this implementation. Unlike props (which are only part of a larger entity), the "Actor" map decorations (like bushes and grass) actually create their own entity and instantiate the position component when placed down. Quote Link to comment Share on other sites More sharing options...
hyperion Posted Friday at 12:07 Report Share Posted Friday at 12:07 Works fairly well for the bushes in your picture, should be good at least for not to steep slopes and not to abrupt changes in slop. For grass which I don't think has benefited much if at all, I suggest to look what @nifa did with palisades: Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted Friday at 17:55 Report Share Posted Friday at 17:55 6 hours ago, Vantha said: Actually bending the mesh is a lot more complicated and would likely require the models to have a rig. I see what you mean, but it might not require rigs on every mesh. We can mess around with it for the R28 cycle and see what we can come up with. Let's do some research and see how other games do it. Quote Link to comment Share on other sites More sharing options...
Vantha Posted Friday at 21:33 Author Report Share Posted Friday at 21:33 One option is indeed to split up the grass patch models in smaller ones and use them as props part of a larger actor (like @nifa did with the palisades in the thread linked above). Judging from the comments over there, this would be very performance-heavy (we'd need at least 10 to 20 times the number of objects). Maybe still be worth a try, though. Does the engine do batch rendering? Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted 22 hours ago Report Share Posted 22 hours ago 10 hours ago, Vantha said: Does the engine do batch rendering? No, but instancing is something we want tho. Quote Link to comment Share on other sites More sharing options...
Stan` Posted 16 hours ago Report Share Posted 16 hours ago As mentioned on the ticket I believe we do have batch rendering, but not instancing. I could not get instancing to work from previous work from @wraitii sadly. It can be picked up at https://gitea.wildfiregames.com/Stan/0ad/src/branch/GL_ARB_Instancing/ (anyone feel free) This will significantly reduce the number of drawcalls, but it might not make a big difference, since we have a lot of different models. Might work with the limit variation option. Quote Link to comment Share on other sites More sharing options...
Vantha Posted 12 hours ago Author Report Share Posted 12 hours ago What exactly is the difference between batching and instancing? Quote Link to comment Share on other sites More sharing options...
Stan` Posted 11 hours ago Report Share Posted 11 hours ago Batching can mean many things but IIRC in our case we're just ordering the models so that we render them one by one by texture combination in order to save some time copying textures and mesh data to the gpu buffers. While instancing would mean that if you have 6 identical barrels to render they can be rendered multiple times with different transformations (position, rotation, scale) and material properties in a single draw call instead of 6 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.