1
Advertisements / Re: EuroGangster Online Mafia Has Relaunched !!!!
« Last post by eurogangster on May 23, 2012, 02:08:44 PM »New layout will be launched very soon ( 1-2 days )
|
1
Advertisements / Re: EuroGangster Online Mafia Has Relaunched !!!!« Last post by eurogangster on May 23, 2012, 02:08:44 PM »New layout will be launched very soon ( 1-2 days )
2
Code Help / Re: object arrangement in tile map« Last post by 71104 on May 22, 2012, 03:21:45 PM »In this case you cannot just select any tile but it will have to be a very specific one. Imagine this long building goes from the bottom left to the top right. And somewhere in front of it but towards the top (seen as "in front of the end" of the long building) there is a small hut. The hut should be in front of the building. yep, that was the problem I was thinking of. more generally, the idea of multiple tiles can cause situations where there cannot be any suitable sorting because a multiple tile might have to stay in front of something that's in front of something else that must stay in front of it. I mean, there might be an "overlapping loop" that cannot exist. imagine to add another small hut behind the long building but towards the bottom, so we have B (the long building), H1 (the hut towards the top) and H2 (the hut towards the bottom). is H1 > B > H2 the right sorting? it is ideal for rendering, but H2 should actually be > than H1 because it might have wild parts that climb over B and overlap with H1 (another drawing would be better but I'm lazy). some rectangular multiple tiles must be split. Quote I want to say that your version might work if we had a proper function to determine a fitting representative tile. I do not doubt that there is some logic behind it somewhere, but I can't see it yet. Further the "any tile" way (and in your example the one to the lower right) is probably a correct decision when comparing it with that very specific building we have there. But for other, further buildings it wouldn't be correct anymore. and that's why Canvace allows to manually set a different reference cell for each tile you create. Quote I live in Switzerland maybe speaking Italian is even better for us then ![]() 3
Introductions / Re: whoops« Last post by raestlyn on May 22, 2012, 01:56:52 PM »I requested invitation
![]() 4
Projects / probably my last bbg« Last post by CygnusX on May 22, 2012, 10:55:22 AM »The site is rinvesting.net
I built this for the investing community at reddit. The long term goal is to give articles, definitions, etc, about investing as well as a quarterly competition to see how much you can grow your portfolio by. The game portion is not completely finished, but 29 have signed up at the time of writing this, and I figured one or two from here may want to check it out. After this, I think I'm done with bbgs. : \ 5
Code Help / Re: object arrangement in tile map« Last post by Doidel on May 22, 2012, 07:04:06 AM »@71104
In this case you cannot just select any tile but it will have to be a very specific one. Imagine this long building goes from the bottom left to the top right. And somewhere in front of it but towards the top (seen as "in front of the end" of the long building) there is a small hut. The hut should be in front of the building. I want to say that your version might work if we had a proper function to determine a fitting representative tile. I do not doubt that there is some logic behind it somewhere, but I can't see it yet. Further the "any tile" way (and in your example the one to the lower right) is probably a correct decision when comparing it with that very specific building we have there. But for other, further buildings it wouldn't be correct anymore. How would you choose that one certain tile from any building? I live in Switzerland ![]() @Monatar You are describing how I currently solved it ^^ More or less at least, but the idea is the same. Here's a graphical representation of the approach: And yes, it's a sorting paradigm ^^ ... for JavaScript's Array.sort. And yes, internally overlapping buildings (L-Shaped or "circles" as you call them) is what I tried to avoid. 6
Code Help / Re: object arrangement in tile map« Last post by Monatar on May 22, 2012, 06:52:09 AM »If you only have rectangular, non-overlapping buildings you also could compare the rightmost corner of each building with the leftmost corner of other buildings (and left vs. right). If they overlap (x-wise) the building with the lowest Z of the overlapping corners is in front of the other building. The front building is put later in the drawing sequence. If there is no x-overlap any drawing sequence can be applied.
If a building is square the Z-values of both corners are equal, but if it is a rectangle the values differ. In your example the right side of the long building overlaps with the left side of the small building. The Z-value of the right side of the long building is clearly lower than that of the left side of the small building, even though the center of the long building has a higher Z than the center of the small building. Effectively this is an extended sorting paradigm. It should result in a back-to-front sequence of buildings. I am pretty sure a circle like A > B > C > A is not possible if you only use rectangles. 7
Introductions / Re: whoops« Last post by 71104 on May 22, 2012, 06:51:30 AM »Your website for it has a simple feel yet is very effective, I'd rework the site's design; this is kind of conflicting feedback, lol, but thank you both anyway ![]() and once you publish it, certainly do include both screenshots and code examples (and screencasts if you'd have any), right on the index page I sure will, and I guess you're right in that it will actually require a redesign. 8
Code Help / Re: object arrangement in tile map« Last post by 71104 on May 22, 2012, 06:44:03 AM »I created this image to show where I see a problem. Compare the two buildings, one is very long while the other is small and square. Your logic would put this long building behind the small one, which is wrong. This happens since the middle-tile of the yellow, long building would be smaller than the square one, is that correct? you don't need to select anything in the "middle" as a tile's reference cell, you can choose whatever cell you want. for the big yellow rectangular building I would choose the corner on the lower right (the one next to the small building) and the problem would be solved. ![]() anyway there's another problem with long rectangular multiple tiles that cannot be solved in any way, with any algorithm, and might force one to split it in smaller tiles as Monatar says (still multiple tiles but smaller). I think you will easily detect that problem. ![]() Quote This afternoon I'll have some time to think about it. Tell me if I'm wrong what's the problem? ![]() PS: I live in Rome, I think my afternoon is very different from yours. ![]() 9
Code Help / Re: object arrangement in tile map« Last post by Doidel on May 22, 2012, 05:41:16 AM »Hello Monatar
We're aware of this approach We declined to do so because of its inefficiency and because we have only rectangularly shaped buildings. Splitting such a building into its tile-parts with background-positioning costs a lot of time, even more since my map is made with an alterable image map => the image map areas would have to be reshaped as well. (A lot of calculations, DOM manipulation, etc. I forsaw that and therefore limited our buildings to rectangular shapes).So far my own approach still wins, although 71104's is right behind, he just needs to prove that my theory is wrong ^^ 10
Code Help / Re: object arrangement in tile map« Last post by Monatar on May 22, 2012, 05:22:50 AM »Doidel, you could think of larger buildings as a group of (perfectly aligned) same-sized square building parts. Each part of the building is an individual object that can be drawn separately (and has its own picture). Because every object now is located on the square grid you can simply draw them from further away to closer by (descending Z) without any problem.
This approach even allows for non-rectangular buildings, that can stand partly in front of another object an at the same time partly behind it! Imagine the long building in your example is L-shaped, curving around the little square building. It would consist of 3 square parts. You would draw the back part of the L-shaped building first, then the middle part of the same building, followed by the small building as a whole (those would be in front of the back part of the larger building). Finally you would draw the front part of the L-shaped building, in front of the smaller building and the back parts of the large building. ![]() |