Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Re:creation - a top down action adventure about undeads [hiatus]  (Read 501575 times)

0 Members and 6 Guests are viewing this topic.

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #540 on: March 10, 2016, 10:28:50 pm »
So basically your tiles have a real z-position now instead of emulating this behaviour with x/y offsets?
Yep. Not only tiles, but objects have real z position too!

Looks pretty neat btw :D
Thank you :)

Can your editor hide certain things? I'd suggest a modifiable height limit. If you build a wall like the one in your example above, you still might need to change the floor behind it that is obscured (or build a smaller wall behind it).
Not yet, but I think I'll add a feature which will let me see vertical slice of the level, so I can see each row individually. This may help. Not sure what's the best interface for it would be, though. I'll see.

If you're feeling adventurous, the editor could now be fully 3D... hehe  ;D
Hehe, I've thought about that. Too much work for little profit. I'll mostly make stuff which isn't obscured behind objects in front of them so 3d is not needed. (Because this will also be a poor level design as the player can't see what's behind the walls!)
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

bitano

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re:creation - a top down action adventure about undeads
« Reply #541 on: March 10, 2016, 10:40:31 pm »
Hehe, I've thought about that. Too much work for little profit. I'll mostly make stuff which isn't obscured behind objects in front of them so 3d is not needed. (Because this will also be a poor level design as the player can't see what's behind the walls!)
You're flaming so many nintendo games here among which many super mario games (lol). Obscured places were the most rewarding ones! :D

Also: Nice work! The Z implementation looks awesome. Can you also go downwards, or does the level editor start from the base allowing you to only build upwards?

Tukimitzu

  • Full Member
  • ***
  • Posts: 117
  • Anti-Hero Member
    • View Profile
Re:creation - a top down action adventure about undeads
« Reply #542 on: March 10, 2016, 10:54:33 pm »
(Because this will also be a poor level design as the player can't see what's behind the walls!)

I'm with you on that.
*caham* chrono trigger *coff coff*

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #543 on: March 11, 2016, 07:02:57 am »
You're flaming so many nintendo games here among which many super mario games (lol). Obscured places were the most rewarding ones! :D
Ha-ha. Well, I think it's okay to have secrets in obscured places, but it's not a good idea to put stuff you can't see but have to interact with. :D

Also: Nice work! The Z implementation looks awesome. Can you also go downwards, or does the level editor start from the base allowing you to only build upwards?
Thank you! For now, it's limited to tiles with z = 0. But there's nothing preventing me from doing tiles with lesser z, so I'll make it. For example, I can build gaps like one I've showed previously where the platform was.

I'm with you on that.
*caham* chrono trigger *coff coff*
Ha-ha. Did Chrono Trigger really do this a lot? I don't remember such stuff here. :D
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

bitano

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re:creation - a top down action adventure about undeads
« Reply #544 on: March 11, 2016, 11:14:23 am »
Ha-ha. Well, I think it's okay to have secrets in obscured places, but it's not a good idea to put stuff you can't see but have to interact with. :D
Very true! I was just messing :P

Thank you! For now, it's limited to tiles with z = 0. But there's nothing preventing me from doing tiles with lesser z, so I'll make it. For example, I can build gaps like one I've showed previously where the platform was.
That would be cool. Again obscuring areas would be tricky to prevent i suppose. Unless you make it so that higher Z objects are hidden / transparent when you move behind them (or hide the entire Z layer)...Tricky stuff.

Also i was wondering - How are you dealing with the drawing of higher structures which have a base outside the viewport? If the base tile (Z=0) is culled, isn't the entire structure above the base tile culled as well (Z=1/2/3/4/etc)?

I'm interested in this as i'm working on something somewhat similar.

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #545 on: March 13, 2016, 08:51:22 pm »
Thank you! For now, it's limited to tiles with z = 0. But there's nothing preventing me from doing tiles with lesser z, so I'll make it. For example, I can build gaps like one I've showed previously where the platform was.
That would be cool. Again obscuring areas would be tricky to prevent i suppose. Unless you make it so that higher Z objects are hidden / transparent when you move behind them (or hide the entire Z layer)...Tricky stuff.
I think that I'll just draw outline as Hapax suggested so there'll be no problems with this.

Also i was wondering - How are you dealing with the drawing of higher structures which have a base outside the viewport? If the base tile (Z=0) is culled, isn't the entire structure above the base tile culled as well (Z=1/2/3/4/etc)?
I have no idea how to solve this yet. For now all I can really think about is this: 1) find the biggest z on the map 2) Write z rows below just in case every time.
Yeah, really stupid, but this may do the job if you don't have much height variation (and when z is not very high!)

My drawing algorithm currently works like this:
prevZ = -100
(for each visible tile row) {
   (for each z in row's zs(height variation in row)) {
        draw sprites which lowest Y point is on the row and which have z between prevZ and current Z
        draw tiles with current Z
        prevZ = current Z
    }
}
This gives me correct Z order for everything.
The problem I currently have is that drawing tiles individually is quite slow and I can't really use VertexArray in this case it seems (unless I have VertexArray for each row and z... don't think it will help much). So, does anyone have any ideas how I can improve this?

And by the way, I've been checking out Dear Imgui which is a very nice immediate mode GUI library which lets me write GUIs for debugging and level editor very easily. I just started using it and implemented my old level editor interface in 1-2 hours! (And improved it a lot in the process, the old one didn't have as many cool things!)

I'll write more about experiences with it later, but currently all I can say is this:
Here's all what I have to do to add working checkbox to the window:
ImGui::Checkbox("Show grid", &showGrid); // showGrid is bool
Isn't it cool? :D
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Re:creation - a top down action adventure about undeads
« Reply #546 on: March 14, 2016, 08:10:53 am »
Do you use your own Dear ImGui SFML integration?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #547 on: March 14, 2016, 08:12:15 am »
Do you use your own Dear ImGui SFML integration?
Nope, I use this one by Mischa Alff

bitano, I've created a thread about the problem, so maybe someone will come up with some ideas
http://en.sfml-dev.org/forums/index.php?topic=19971.0


The explanation how I store maps may help everyone visualize everything. I don't just store heights, I store tile Ids for each "z" in the column though.
But still, is there any way to speed up this row by row drawing? Maybe I should still try to create VertexArrays for each row if it possible? (Sometimes it makes no sense, because tiles may have different tilesets or there may be just one or two tiles for given z...)

P.S. Unless there's a way to do proper z-ordering by drawing each "z" tile layer one by one which I can't figure out... :D
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

bitano

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re:creation - a top down action adventure about undeads
« Reply #548 on: March 14, 2016, 09:19:20 am »
Woa! Thanks for the detailed answer and great idea to dedicate a thread to the issue. Let's see where that leads.
In the meantime, I'll do some puzzling myself :D

Also, that ImGUI looks good. I'm gonna have to borrow that as well. That saves so much work  :o

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #549 on: March 14, 2016, 07:13:43 pm »
You're welcome!

Right now I'm having a problem of dealing with all this stuff. Can't decide which way is better, "flat" or "3d" one, so I want to discuss it with everyone. I don't really know about all SNES games, but it seems like most of them store tile data as in "flat" approach with some tiles being able to be written above everything. Do you think it's really so?
It seems like "3d" way has more disadvantages then advantages...
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

bitano

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re:creation - a top down action adventure about undeads
« Reply #550 on: March 14, 2016, 07:51:38 pm »
Right now I'm having a problem of dealing with all this stuff. Can't decide which way is better, "flat" or "3d" one, so I want to discuss it with everyone. I don't really know about all SNES games, but it seems like most of them store tile data as in "flat" approach with some tiles being able to be written above everything. Do you think it's really so?
It seems like "3d" way has more disadvantages then advantages...
I share the dilemma :P. Personally i decided to work on a system that supports the Z index as i'm sure i'll miss it at some point if I don't (when designing creative encounters).

Unless they tricked it somehow, I think Zelda - a link to the past was in fact 3d, as you were able to move over and under bridges, etc (similar to your last demo GIF).
Having said that, from the top of my head i can't think of any situation where the 3D aspect added a whole lot to the player experience... Grrr i'm gonna have to watch a Zelda gameplay vid on youtube now to make sure :-)

[UPDATE]
Check the following example: https://www.youtube.com/watch?v=xf2IO7P5DVA&feature=youtu.be&t=3h15m16s
The next couple of rooms have some Z-layer mechanics. There are more rooms like this in Zelda where you see both an upper and a lower area that overlap, but most of the game seems pretty flat. I don't think leaving out the overlapping bits would've broken the game :P
« Last Edit: March 14, 2016, 08:37:02 pm by bitano »

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #551 on: March 14, 2016, 08:39:56 pm »
Well, you see, you can have some sort of Z coordinate which will determine some stuff, like entities not seeing/colliding other entities if they have different Z coords or which entities should be drawn under some tiles and which ones should be drawn above the same tiles.
So, for example, suppose you have a bridge which is a bit higher than most of the ground. You can have it with Z = 1 and all entities on the ground will have Z = 0. So, only entities which have Z = 1 or higher will be drawn above the bridge, so you can be under or above the bridge.
The dilemma is: do I store bridge tiles like I do in "3d" version of tile map or in "flat" version... Uhhh... :D
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

bitano

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re:creation - a top down action adventure about undeads
« Reply #552 on: March 14, 2016, 09:06:19 pm »
Well, you see, you can have some sort of Z coordinate which will determine some stuff, like entities not seeing/colliding other entities if they have different Z coords or which entities should be drawn under some tiles and which ones should be drawn above the same tiles.
Of course! A character-bound Z index. That makes sense as you always have to go up/down stairs (Z trigger object) to get onto an overlaying tile. So it's probably flat. But enough about Zelda!

The dilemma is: do I store bridge tiles like I do in "3d" version of tile map or in "flat" version... Uhhh... :D
Shouldn't you take a step back, look at what you want to achieve with the game and go from there? You started with a really cool idea and have a lot of functionality in place. You probably want/need to develop some more mechanics for interesting enemies and items. Possibly add level/world-altering effects. You'd have a storyline you want to implement. Would leaving out the 3D stuff in any way impair your game?

Looking at what you shared so far i'd think not, but my knowledge of your game / concept is very limited :D

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re:creation - a top down action adventure about undeads
« Reply #553 on: March 26, 2016, 03:33:07 pm »
I'm back! I've done lots of studying stuff I had to do, so I'm mostly free again and I'm starting working on the game again.

I've managed to improve the graphics a lot for a last few weeks and I'll show a screenshot once I polish everything. It's a pretty big step forward!

Let's talk about tiles and 3/4 perspective though. This is a problem which haunted me for a long time...
As I've said previously, there are two ways I could store tile info:

"3d" approach was the thing I've experimented with. I could set x, y and z coordinates for each tile to be able to handle different heights easily.
While the "3d" approach makes sense, it's pretty hard to work with, because it's very hard to place tiles and think about all the different heights. It totally makes sense in isometric games. 3/4? Not much.
My game isn't going to be very "height based" after all. 3/4 perspective is not very suitable for such gameplay.

There are number of things I want to discuss with everyone because there are lots of ways to manage height in 3/4 perspective and some downsides to a method I'm going to implement (maybe someone will give me some good ideas!)

Suppose I have a tile map like this:

It's possible to walk under the bridge and on the bridge. There can also be a situation like this:

So, there's a need to establish proper drawing order of tiles and objects. Right now I can think of a simple solution: entities and tiles will have z coordinate. For example if the entity is standing on the grass, its z is 0 and if it's higher, it's z = 1 (or more).

Tiles in the red rectangle will have z = 1:

Here's how renderer will draw stuff:
draw tiles with z = 0
draw entities with z = 0
draw tiles with z = 1
draw entities with z = 1
etc...

This is probably how most SNES games did it. Here's a screenshot from The Legend of Zelda: A Link to The Past where layers are clearly visible!


And this approach works okay in most of the cases... unless there are characters which are more than two tiles high (or some animations like the one on the previous screenshot).  They'll be drawn incorrectly, for example in situations like this:

I don't have a solution to this problem and unless I came up with something, I'll just prevent these situations from happening by not placing entities at such places.

And now for collision. It may vary from one z level to another. For example, for entities which have z = 0 it'll look like this:

(If tile is unmarked, it means that it's walkable, if it's marked by X, it means that tile is completely unwalkable)
When the player starts to climb the ladder, entity's z changes from 0 to 1 and another collision rules work for it, they look like this:

Here arrows show directions in which entity can move while standing on the tile. Red lines show "walls" with which entity will collide, so it'll work as needed. (I've got this idea from various posts on RPG Maker forums, he-he)

So, maybe there are other ways to do similar stuff? Or is my way of doing things alright? What do you think? :D
« Last Edit: March 26, 2016, 03:43:14 pm by Elias Daler »
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Tukimitzu

  • Full Member
  • ***
  • Posts: 117
  • Anti-Hero Member
    • View Profile
Re:creation - a top down action adventure about undeads
« Reply #554 on: March 27, 2016, 05:07:28 am »
Damn scarecrow, always causing trouble, so many places for it to be, but noo, slightly below the platform is the best spot.

Also, what if I want to jump from the second to the first floor with the character (while performing a double front flip, of course) and want the impact to cause an earthquake that destroys the platform I was on? I think you should handle this situation as well.

I hope you find my criticism helpful.

Cheers!  :)

 

anything