Skip to content
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

Closed
TheJJ opened this issue Oct 30, 2014 · 15 comments
Closed

Support for multi-layer buildings (village center) #58

TheJJ opened this issue Oct 30, 2014 · 15 comments
Labels
area: assets Involved with assets (images, sounds, ...) improvement Enhancement of an existing component lang: c++ Done in C++ code
Milestone

Comments

@TheJJ
Copy link
Member

TheJJ commented Oct 30, 2014

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.

@TheJJ TheJJ added improvement Enhancement of an existing component lang: c++ Done in C++ code area: assets Involved with assets (images, sounds, ...) labels Oct 30, 2014
@TheJJ TheJJ added this to the v3.0 milestone Oct 30, 2014
@franciscod
Copy link
Contributor

we'll need #121 first

@franciscod
Copy link
Contributor

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):
1415190220
And this is graphic 3782 (slp id 4164)
1415190238

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:

@franciscod
Copy link
Contributor

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? 😕

@TheJJ
Copy link
Member Author

TheJJ commented Nov 5, 2014

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.

@franciscod
Copy link
Contributor

I don't think we need a MultiLayerBuilding: why Building shouldn't have all
the capabilites for handling annexes?

@TheJJ
Copy link
Member Author

TheJJ commented Nov 5, 2014

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.

@mic-e
Copy link
Member

mic-e commented Nov 6, 2014

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 openage.convert?

@franciscod
Copy link
Contributor

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

@mic-e
Copy link
Member

mic-e commented Nov 6, 2014

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).

@goto-bus-stop
Copy link
Contributor

Note also that in a Town Center, villagers have to be rendered on top of the center building part, but below the extensions. That would be difficult using just one PNG.

Town Center

@franciscod
Copy link
Contributor

omg and somehow the unit outline gets masked by graphics that cover it.. aaaaaaaaaaaaa implementing that sure will be a nightmare

@mic-e
Copy link
Member

mic-e commented Nov 7, 2014

@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.

@franciscod
Copy link
Contributor

#172 is bringing a huge part needed for having the village center: delta graphics and building annexes :D

@Jon0
Copy link
Member

Jon0 commented Feb 19, 2015

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.

@TheJJ
Copy link
Member Author

TheJJ commented Mar 22, 2015

as #172 is merged, this is more or less done.

@TheJJ TheJJ closed this as completed Mar 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: assets Involved with assets (images, sounds, ...) improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
None yet
Development

No branches or pull requests

5 participants