인디 게임 개발 #6 ( Indie Game Dev #6 ) 랜덤 맵의 구역 찾아내기 ( Find the area of ​​random map )

in #kr7 years ago


[ 데브캣 스튜디오의 마비노기, 도적 코볼트 ]
[Mabinogi of DevCat Studio, Theif Kobold]

안녕하세요? 도적코볼트에요!

여섯번째 개발일지입니다. 오늘은 저번에 포스팅했던 글(https://steemit.com/kr/@krdoko/5-indie-game-dev-5-random-map-generation-using-cellular-automata)의 후반부에 언급한 "방"을 만들기 위한 전 단계인 지역을 찾아내는 것을 만들어 봤어요!

지역을 찾는 이유는 어디서부터 어디까지 이어져 있고 어디서부터 어디까지 떨어져 있는지 확인을 해야하기 때문입니다.

Good morning? It's a thief kobold!

It is the sixth development journal. Today, I mentioned in the last part of my post (https://steemit.com/kr/@krdoko/5-indie-game-dev-5-random-map-generation-using-cellular-automata) "I've made up my mind to find the prefecture to create an area!

The reason for looking for an area is that you need to know where it is from and where it is from.


[ 떨어져 있는 맵 ]
[ Seperated map ]

이렇게 맵이 중간에 끊겨서 어디로도 갈 수 없다면 길을 잃은 미아가 되는 것이죠! 따라서 이런 맵이 끊긴 것을 확인하기 위해서 사전에 이 맵이 어디까지 연결되어 있나 확인을 해야합니다!

그리고 오늘은 바로 이 맵이 어디까지 연결되었는지 확인해 봤습니다.

If this map is broken in the middle and you can not go anywhere, you are a lost mia! So, to make sure that this map is broken, you need to know where this map is connected in advance!

And today I checked to see where the map was.


[ 구불구불한 미로, 과연 바깥까지 연결이 되어 있을까? ]
[A twisty labyrinth, is it really connected to the outside? ]

컴퓨터는 위의 사진처럼 볼 수가 없습니다. 단순히 어떤 정보들이 있을 뿐이에요. 그렇기 때문에 인간과는 다른 방법으로 이런 구역들이 연결이 되어 있는지 아닌지 확인하게 됩니다.

이 때, 사용하게 되는 것이 바로 플러드 필(Flood Fill) 알고리즘입니다.

The computer can not be seen like the picture above. There is simply some information. That's why we are going to make sure these areas are connected in a different way than humans.

In this case, the flood fill algorithm is used.

Recursive_Flood_Fill_4_(aka).gif
[ 플러드 필 알고리즘을 이용해서 구역을 찾아내는 예시 ]
[An example of using the flood-fill algorithm to find a zone]

알고리즘은 단순하게 문제 풀이 방법으로 이해하시면 좋을 것 같아요!

이전에 써놨던 포스팅(https://steemit.com/kr/@krdoko/5-indie-game-dev-5-random-map-generation-using-cellular-automata)에서 봤던 랜덤하게 맵을 생성하는 것에 이 플러드 필 알고리즘을 이용해서 구역을 찾아내 색을 칠해 봤습니다.

I think the algorithm should be understood as a simple problem solving method!

The randomly generated map you saw in the posting we wrote earlier (https://steemit.com/kr/en/doc/5-indie-game-dev-5-random-map-generation-using-cellular-automata) I used this flood-fill algorithm to find the area and paint it.

조금 덜 연결2.PNG
[ 랜덤 맵을 생성할 때 56%만큼 채우는 것을 가정하고 만듦 1 ]
[Assuming 56% fill when generating random map 1]

조금 덜 연결.PNG
[ 랜덤 맵을 생성할 때 56%만큼 채우는 것을 가정하고 만듦 2 ]
[Assuming 56% fill when generating random map 2]

거의 다 연결.PNG
[ 랜덤 맵을 생성할 때 56%만큼 채우는 것을 가정하고 만듦 3 ]
[Assuming 56% fill when generating random map 3]

3번의 경우 파란색 네모를 친 곳을 제외하고 대부분이 연결되어 있습니다. 랜덤하게 만들었기 때문에 56%를 채웠지만 다른 맵이 만들어졌죠.

그 외에 gif로 56%의 다양한 랜덤 맵입니다.

In the third case, most of them are connected, except where they have a blue square. I made 56% of it because I made it random, but I made another map.

There is also a 56% random map with gif.

56퍼움짤.gif
[ 56%의 맵들 ]
[56% of the map]

그런데 56%가 너무 맵이 넓게 만들어지기 때문에 처음에 맵의 64% 채우게 해서 해봤습니다.
However, 56% of the maps are made too wide, so I tried to fill 64% of the map at first.

64퍼센트1.PNG
[ 랜덤 맵을 생성할 때 64%만큼 채우는 것을 가정하고 만듦 ]
[Assume a 64% fill when creating a random map]

56%와 다르게 굉장히 많은 방들이 존재하고 있습니다. 이 부분은 제가 나중에 기획적으로 게임플레이에 적당하게 조절하며 만들어지게 해야할 것 같아요!

Unlike 56%, there are a lot of rooms. I think I'll have to make this part of the game suitably adjustable and later on in the game!

64퍼움짤.gif
[ 64퍼센트의 맵들 ]
[64 percent of the maps]

네, 오늘은 여기까지 작업이 됐구요. 앞으로 해야하는 것은 이렇게 찾아낸 구역들이 연결이 안되어 있다면 그것들을 찾아서 연결해 주는 일입니다. 그런데 64%의 맵을 보면 아주 작은 맵들도 존재하고 있죠. 그렇기 때문에 중간에 적당히 너무 작은 덩어리의 구역들은 없애주는 작업도 해야할 것 같아요.

Yes, I've been working on it so far. What we need to do next is to find and connect these areas if they are not connected. By the way, 64% of the maps have very small maps. So I think we should also work to get rid of the moderately too small chunks in the middle.


[ 인사 ! ]
[ Greetings ! ]

오늘은 조금 이른 시간에 포스팅을 한번 해봤습니다. 낮에 개발하고 밤에 쉬다가 새벽에 글을 쓰니까.. 어제도 새벽 3시가 넘어서 글을 썼거든요. 그래서 조금 이른 시간에 쓰고 싶었어요!

11시 30분이 엄청 이른 시간은 아니지만 요즘 너무 늦게 자는 저에게 있어서 지금은 충분히 이른 시간이랍니다.. ㅜ^ㅜ
오늘도 좋은 하루 보내셨는지 모르겠어요. 내일은 수요일인데 힘내시길 바랍니다.

혹시 제 개발일지가 재미있으셨다면 팔로우와 리스팀을 부탁드려요. 그리고 이 글을 읽어주신 모든 분들께 감사의 인사를 전합니다. 이렇게 개발일지를 쓰는 덕분에 꾸준히 개발을 할 수 있는 동기부여가 되는 것 같습니다.

감사해요!

I did a posting today a little early. I developed in the daytime and rested at night and wrote at dawn. I wrote more than 3 o'clock yesterday. So I wanted to write in a little early!

It is not a very early time at 11:30, but it is early enough for me to sleep so late now .. ㅜ ^ ㅜ
I do not know if you had a good day today. Tomorrow is Wednesday.

If you have a lot of fun with my development journal, I would like follow-up and lease teams. I would like to thank all of you for reading this article. Thanks to this development journal, it seems to be a motivation to develop steadily.

Thank you!

---출처---
---source---

[플러드 필 알고리즘을 이용해서 구역을 찾아내는 예시 ]
[An example of using the flood-fill algorithm to find a zone]
->(https://)upload.wikimedia.org/wikipedia/commons/7/7e/Recursive_Flood_Fill_4_%28aka%29.gif

Sort:  

아항 플러드 필 알고리즘이 있었군요. ㅎㅎ 좋은 정보 감사합니다.

헤헤 정보를 얻으셨다면 저야말로 기쁩니다. ^^ 댓글 달아줘서 고마워요 !

마지막에 커밋이 시선강탈ㅎㅎ

댓글 감사합니다. 이상하게 댓글이 달렸다는 알림이 뜨지 않아서.. 늦게 발견했어요. 12시 점심 시간인데 식사는 하고 계신가여!? 맛있는 점심 드세용! 전 늦게 일어나서 배가 안고프네요 ㅋㅋ;

저도 게임 기획을 공부 하고 있지만 아직도 배울게 많은거 같습니다.. 유용한 정보 감사합니다! ( 오랜만에 마비노기 이미지를 보는군욧.. )

댓글 달아주셔서 감사합니다 ㅋㅋ;; 마비노기는 개인적으로 참 잘 만든 게임이라고 생각하거든요.. bgm는 더 좋은 것 같고.. 제이나 님께 도움이 됐다니 다행입니다!

멋지네요~. 알고리즘의 세계는 파면 팔수록 신기한 게 많이 나오는 것 같아요. ㅎㅎ

고맙습니다 ^0^

도적 코볼트님이 보시면 좋아하실 것 같은 링크 남깁니다. ㅎㅎㅎ
http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap

답글 고마워요. 글이 오래된 것 때문인지 알림이 안뜨네요. - _-;

요즘 알고리즘 확인 안하고 제 맘대로 짜고 있는데.. 그래서 지금 연결이 잘 되는 것에 대해서 문제가 생기고 있네요. 연결은 다 되는데 그 최적의 연결이 문제 -_-;; 하아 그래서 뱅송도 안키고 오늘은 작업중입니다. 좀 집중하려고...

ㅎㅎ 방사이의 연결인가요. ㅎㅎ

연결은 잘 되는데 제가 원하는 형태러 안되고 있어서 계속 그 쪽 부분을 다잡고 있어여... 좀 따 수학학원 알바가는데 쉬는 타임에 좀 생각좀 공책에 천천히 적으면서 해야할 것 같아유ㅜㅜ

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 57346.65
ETH 3107.45
USDT 1.00
SBD 2.40