여러 종류의 벅 만들기를 하다가 또 다른 길로 샜습니다.
벽과 레벨에 대한 에디터 GUI를 만들고 있는데, 이런 생각이 떠오르더군요;
지금 내가 레벨을 쓰는 것은 결국 수직으로 비슷한 층을 반복시키기 위해서인데,
그러면 호텔방 같은 유니트와 같은 걸로 볼 수 있지 않을까?
MonoDeveloper의 찾아바꾸기 기능은 정말 괜찮더군요.
level과 Level을 모두 일괄적으로 unit과 Unit으로 바꿨습니다.
이렇게 레벨의 용어충돌(캐릭터의 레벨, 맵의 레벨)을 해결했죠.
그리고 Floor를 Slab으로 바꿨던 건 무의미한...
이로써 건물에 층 구별이 명확히 없어도 된다는 장점이 생겼지만,
건물 내 길찾기 AI에 문제가 생깁니다.
지금 여기 가장 적합하다 생각되는 건 Voxel 맵입니다.
매 (60cm)^3마다 밑으로 1.2m짜리 Ray를 쏴서, 바닥에 맞고, 위로 0.6m짜리 Ray를 쏴서 천장에 안 맞으면 걸을 수 있는 곳이라는 판정이 나겠고, 그걸로 복셀 맵을 만든 다음 어셋 스토어를 뒤지는 겁니다.
...네, 복셀 길찾기 AI를 제가 짜는 건 무리인 것 같아요.
그래서 이번 주도 내부적인 코드 작업이 주였습니다.
하지만 GUI가 추가되긴 했어요. 사진을 찍은 게 없어서 그렇지.

Unit 2에 ㄷ자 벽을 만들고, Unit 0에 막 뿌린 모습입니다.
여러가지 벽보다는 이 유니트가 더 우선되기 때문에, 다음 주는 블록과 유니트 GUI에 초점이 맞춰질 것 같습니다.

이건 Unit 4에 그 ㄷ자 벽을 만들고, Unit 3에 Unit 4를 2개 배치한 다음, 지금 수정중인 Unit에 Unit 3을 여러 군데 배치한 모습입니다.
즉 유니트 안의 유니트 안의 유니트도 가능합니다.
단 이 깊이는 최대 16번까지로 제한되고, 유니트 개수도 250개라는 제한이 있습니다.
세이브 포맷과 코드를 왕창 뜯어고치지 않는 이상 못 바꾸는 Hard Limit입니다. (Unit 넘버링에는 byte/0xFF를 쓰기 때문)
유니트 개수가 100개를 넘어가는 건물은 없으니(있다면 그 건물은 유니트로 짜는 게 비효율적인 건물이란 거겠죠) 큰 문제는 안 되지만요.
유니트가 생겼으니 이제 배열 기능도 추가해야겠죠.
(직선 방향으로 일정한 간격으로 배치 / 한 점을 중심으로 일정한 개수나 간격으로 배치)
이 기능을 벽 등 다른 것들에도 확장할 지, 유니트에만 한정할 지는 고민 중입니다.
Units in Unit, Units in Units in Unit
I've got sidetracked again while working on the way to draw multiple types of walls.
I've been making editor GUI for Walls and Levels, then suddenly I had an idea;
the reason I'm using Levels is to repeat similar floor vertically.
This is very similar with 'Units' like hotel rooms, and school.
Can I deal with these two same way?
Replace function in MonoDeveloper is really nice.
I replaced 'level' and 'Level' with 'unit' and 'Unit.'
This solved 'Level' being a polysemy(Character's 'Level', 'Level' of Map).
(And I learned a new word; polysemy, hoozah.)
This change made the building without clear floors possible,
but this gives making pathfinding AI puzzling.
So I spent this week mostly internal scripting, again.
But, I added some GUI, though I didn't took pictures of them.

After making A-shaped wall in Unit 2, I placed some Unit 2 in Unit 0.
They are using same data, but there are not a copy of each other.

I drew that A-wall in Unit 4, placeed Unit 4 in Unit 3 twice, and scattered Unit 3 in the Unit I was editing.
So you can put units in units in a unit.
However, you can stack only up to 16 times, and there is hard limt on total number of units (250).
Most of the building doesn't have more than 100 units(it it does, that building shouldn't be drawn with units), so no problem for me.
Since I got units, I need 'Array' them, don't I?
(Array them linear with same space / Array them centering a point with certain number/degree)