Page 1 of 2

Demo - tile, cell based world (with collision)

Posted: Wed Dec 21, 2011 6:27 am
by Taehl
This was mainly a test / code-doodle I just made. Its code is small and fairly straight-forward (albeit pretty unoptimized). It features:
- Tile-based, top-down smoothscroller (like an old Zelda game)
- Cell-based world (like Bethesda games or Minecraft uses - chunks are loaded dynamically as needed, rather than the whole world at once). This tried-and-true approach has several uses, such as allowing huge worlds without tonnes of memory.
- Cells are NOT forced to coincide with reality (I have two "warps" to demonstrate it)
- Simple physics (no walking through walls) (known bug: If you diagonally walk into a tile's corner just right, you'll get stuck. This could easily be fixed by making the collision code more than two lines long)
- Cells-over-cells, with parallax

Not sure I'm going to go anywhere with this. Like I said, I was mainly just messing around. But I thought it may be inspiring, or help provide an example of how top-down scrollers work.

Download

Image

Re: Demo - tile, cell based world (with collision)

Posted: Wed Dec 21, 2011 7:21 am
by dandruff
It looks awesome and smooth. The only thing that annoyed me was the fact that the lower floor was visible from the level above, but you didn't notice that you went downwards. I understand that it's hard to find a way that looks and feels good doing this. It would be awesome if the stair-pieces popped up a small amount behind you and raises from in front of you when you walk down for example. Nonetheless, it looks really good and the warp-zones was impressive (didn't notice it at first, then I felt stupid :P).

.d

Re: Demo - tile, cell based world (with collision)

Posted: Wed Dec 21, 2011 12:09 pm
by coffee
I see you doing a project a bit similar to mine. But my game is turn-based instead. Your room-by-room map display is nice and interesting. Congratulations, all seem to be working great. And if you do the message display log before me you bet I will sneak in your code, lol. Have fun working on this Taehl.

EDITED: Only now noticed the discrete "paralax" layer bellow. It's awesome. Well done. You should do something with this, don't stop.

Re: Demo - tile, cell based world (with collision)

Posted: Wed Dec 21, 2011 1:05 pm
by lots_of_birds
It could seem silly, but discovering theses simples lines in your game almost stole me tears of joy

Code: Select all

function love.update(dt)
        dt = math.min(dt, .07)
This resolve in a very simple way all weird cases of collision problem I had with my first love project.

Thanks for sharing

Re: Demo - tile, cell based world (with collision)

Posted: Sun Dec 25, 2011 7:23 pm
by Ensayia
I like the parallax effect below, I assume you are loading the cell or cell data below?

Going up and down stairs feels a little weird in terms of graphics, but this was a quick prototype and that's cool. I like the cell approach... I should look at your source.

Re: Demo - tile, cell based world (with collision)

Posted: Mon Dec 26, 2011 12:58 am
by Taehl
Yeah, the parallax loads and shows another cell. And since it's not based on physical locations, it could be any cell (I just avoided that in my test map to prevent huge confusion). As far as the stair transition... Eh. I had to choose a point to stop showing the "lower" floor and start showing the "upper" one, and this seemed the least strange.

Re: Demo - tile, cell based world (with collision)

Posted: Mon Dec 26, 2011 1:12 am
by ishkabible
parallax is really cool but in trying to get a better look i found a bug

Image

I was coming from the left and after I got there I coudln't move in any direction.

edit:
It's proving difficult to replicate; These are the kind of bugs I hate, the ones you have to can't seem to make happen again.

Re: Demo - tile, cell based world (with collision)

Posted: Mon Dec 26, 2011 6:56 am
by Taehl
Taehl wrote:(known bug: If you diagonally walk into a tile's corner just right, you'll get stuck. This could easily be fixed by making the collision code more than two lines long)

Re: Demo - tile, cell based world (with collision)

Posted: Mon Dec 26, 2011 12:05 pm
by StoneCrow
Wow really cool!
I wondered around the warp area for ages before realising it was bogus haha.

Re: Demo - tile, cell based world (with collision)

Posted: Mon Dec 26, 2011 2:12 pm
by clickrush
wandering in and out of the infinite floor is a psychedelic experience! Everything in this program is beautiful. thx for sharing :)

The most usefull thing to implement from my point of view would be a minimap that also shows on which level you are. you could make a layered minmap or something idk.