Adam's Lair Forum

game development and casual madness
It is currently 2019/12/14, 09:54

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3

Would you use TileD for your projects?
Yes, been using it long time now. 0%  0%  [ 0 ]
Yes, I checked it out and it feels great. 67%  67%  [ 2 ]
Not sure, I'll think about it. 33%  33%  [ 1 ]
No, I have another program/system. 0%  0%  [ 0 ]
Total votes : 3
Author Message
PostPosted: 2015/12/07, 05:22 
Member
Member
User avatar

Joined: 2015/10/29, 18:52
Posts: 69
Location: Finland
Role: Hobbyist
Looks like the best way of building shapes for tilemap contours was easier than I thought... First I tried to follow this, and ended up with the image in my earlier post. Well, now, I built edges during the Moore Neighborhood algorithm, which gave me the result that's almost flawless:
Image

Some fixes are still needed, but it's doing exactly what I wanted. The segments aren't tile-by-tile, but from corner to corner, so they should be really efficient.

The algorithm now works like this:
Code:
 - Detected a tile in Moore Neighborhood
    - Check if there's any surrounding tiles (clockwise)
        - Start from left side, end to bottom
        - If no tile is connected on N-side
            - Add a segment to this side

 - Once scanned all tiles in Moore, connect segments by going through them and checking if a segment ends where another starts
     - If this is true, check if they are collinear and set current segment1's end to segment2's end and remove segment2



Will be updating the code on GitHub soon!


EDIT: Got it fixed. It at least works with my test map. I will be doing some testing before releasing the code, so be patient! :)

EDIT #2: Well, looks like it need a lot more testing than I thought. The logic isn't quite there yet, but I'll be tweaking it. Click here to see what I mean.

_________________
.
..
...
....
What?


Top
 Profile  
 
PostPosted: 2015/12/11, 18:24 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
That looks quite good actually. Just a bit glitchy maybe, but once those bugs are fixed.. nice work!

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/12/14, 05:32 
Member
Member
User avatar

Joined: 2015/10/29, 18:52
Posts: 69
Location: Finland
Role: Hobbyist
Adam wrote:
That looks quite good actually. Just a bit glitchy maybe, but once those bugs are fixed.. nice work!

Thanks Adam! Although, once I started fixing the glitches, it got more and more messy... xD ...so I thought I'd rewrite it and see where it takes me.

_________________
.
..
...
....
What?


Top
 Profile  
 
PostPosted: 2015/12/20, 18:04 
Member
Member
User avatar

Joined: 2015/10/29, 18:52
Posts: 69
Location: Finland
Role: Hobbyist
Bump! Just letting you know, that I've frozen this project for now...! ;(
The reason for this are other interests, such as cryptocurrencies.

I will let you know when I get back to it, though! Also I will be publishing a fairly stable release of the plugin in 2 weeks but I'm not sure if the RigidBody and such are included.
We'll see! :redface:

Take care now, and see you soon enough.

_________________
.
..
...
....
What?


Top
 Profile  
 
PostPosted: 2015/12/22, 19:01 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
misthema wrote:
Bump! Just letting you know, that I've frozen this project for now...! ;(

It was a cool project so far :) Thanks for the update. Good luck on your future endeavors!

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group