New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for multi-layer buildings (village center) #58
Comments
we'll need #121 first |
For "multi-layer buildings" (or at least the town center) we need to implement a combination of building annexes and graphic deltas. If a building has annexes, they are like "extra heads" for the "main building". I don't know how this is handled ingame but it appears that they share hit points (or annex buildings don't have stats and they're only just for rendering purposes?) Graphic deltas are similar, but simpler. They allow to "combine several graphic slots into one". This is graphic 2972 (slp id 3416): On the game assets, the only mention (that i've found) of graphic 3782 is that it's a delta of 2972. This means whenever graphic 2972 gets rendered, graphic 3782 also gets rendered. Both building annexes and graphic deltas have a position (offset) for positioning them accordingly to the "parent" object. This hints that we should use those positions instead of calculating a center like in #57 sources:
|
I think milestone v3.0 sets the bar for ditching TestBuilding, TerrainObject, Texture and refactoring TestBuilding into Building (the real one that should remain for the final game) and Graphic as an enhanced Texture. What is the future of TerrainObject? 😕 |
We will create a GameObject and rename TerrainObject to Building and let it inherit from GameObject. @jamesmintram's rendering improvements will then render GameObjects. The MultiLayerBuilding could inherit from Building then supporting the annexes. |
I don't think we need a MultiLayerBuilding: why Building shouldn't have all |
Maybe, maybe not. I'm thinking of the simple implementation of a single sprite building, which is then extended for multi-sprite stuff. Is hopefully easier to understand and implement. |
The real building (or rather, building type) that will remain for the final game is a Nyan object, pending #28. The only thing we really need for milestone 3 is correct rendering of the deltas. The main design question is: Do we want those delta graphics (I don't like that name, btw) to be rendered by the game, or do we want to merge them to one PNG file during |
even with delta (the name sucks) rendering we need annex buildings too! every town center is made of the "main" building + 3 annexes (that make the layers so the villagers can go through columns and below roofs and stuff like that) i would reimplement the delta rendering instead of flattening all into a single png... when all is done we can optimize it if we consider it proper, but now it's too early to simplify the game assets IMO |
I didn't even know there was a difference between those two... regarding optimization, keeping them separate might make sense (think the blacksmith + the tiny, but animated, column of smoke. combining them will create a large, animated PNG that will eat up a lot more graphics memory). |
omg and somehow the unit outline gets masked by graphics that cover it.. aaaaaaaaaaaaa implementing that sure will be a nightmare |
@franciscod the hard part is to decide which one to draw first. Using a shader to draw the outline isn't that hard. You just look at whether you're overwriting an "outline pixel" and if yes, don't. Regarding the question which to draw first, I think you're safe when you draw the southernmost things first. |
#172 is bringing a huge part needed for having the village center: delta graphics and building annexes :D |
The tc works perfect in my work, its just annexes are not rendered in the editor list. The tc is found after the monestry and blacksmith in the editor list which only shows the side arms of the tc - after placement it should work. |
as #172 is merged, this is more or less done. |
Buildings like the village center consist of multiple parts so that units can walk under roofs etc.
These layers have to be represented somehow, and rendered as one single building.
The draw layer priority is secondary and should be rather easy to implement afterwards.
The text was updated successfully, but these errors were encountered: