Now it's starting to look like a base a bit.
screenshot3.jpg
1 important part was finally making that mouse-pointing on heightmap terrain, so that i could place structures (to-be-construction yards) where i point and click. The way i did it was not how i planned to do it though, somehow found an easier way. If i start by getting mouseray - plane-intersection from zero-grid, then moving the intersection.Y to heightmap level, i can repeat the same plane-intersection 3 more times. Each time using plane that is on the height-level of last intersection point. With 4 of these checks it ends up "close enough"/"exactly" to where cursor is on terrain. It might not work if there are hills so high that you can't see land behind it, but i'm not having that kind of camera angles.
Will see how i end up making the construction itself... Showing more polygons as the progress goes? I guess it might work if i sort them in height axis. But then i also need an indicator of a construction site, possibly faded version of the model.
Also made unit construction queue, it's just not showing on screen yet. I'll add tiny numbers on the left icons to indicate how many are being produced, quickest progress and items queued afterwards. Functions are there to retreive all this data.
Seems to be roughly 1300 code lines in overall project so far... It doesn't yet feel like i'd get crushed under in the complexity, and i've been trying to make it very modular and readable. Planning all that ahead is a bit taxing too, maybe.
Bookmarks