[1] Fences And Walls
10/14/2022, 06:06pm
Something Antorum was missing was structures. Seems like that would be pretty important for a game in an urban setting, so I've started experimenting with some new editor features. I started with walls, to keep things simple. You can paint them onto the terrain with a new tool.
A wall mesh is built out of a few different individual pieces. The game uses these and creates mesh resources for all their possible orientations. Then, they are stitched together at runtime. To decide which piece to use, I sum up the neighboring walls that exist to get a sort of "neighbor score". Then, each potential score is mapped to the proper piece. It's a technique I learned from this cool Blob Tileset article on cr31.co.uk.
There are a few improvements I gotta make, mostly performance related. Every time you place a wall, the entire terrain chunk is rebuilt. So you definitely notice the slowdown when placing a ton of them. The other annoying thing is that transparent walls (like fences) have to be in a separate mesh from the opaque ones, due to sort order, materials, etc. Not sure I can really do anything about that, but I can at least make the two wall mega-meshes as lightweight as possible.
As far as structures go, roofs are the next important feature. I'll get to that soon enough, but will probably take a break and work on something else next.
- Declan (@dooskington)