Giter Site home page Giter Site logo

던전 랜덤 생성 about g HOT 5 OPEN

todd032 avatar todd032 commented on August 27, 2024
던전 랜덤 생성

from g.

Comments (5)

todd032 avatar todd032 commented on August 27, 2024

시간은 무엇들로 조정되는가에 대해 생각.

  1. 거리
  2. 함정
  3. 바닥(움직이는 발판 같은것들)

from g.

todd032 avatar todd032 commented on August 27, 2024

던전 1개는 N*N 의 조합으로 구성된다.

  1. 먼저 N * N 에 시작점에서 끝점을 통과하는 Main Path를 설정한다 (index 형태로 List로 데이터 저장)
  2. 사용되지 않은 부분중에 SidePath들을 생성한다.(시작점부터, 끝점까지 index List 가지고 있도록)
  3. 가지고있는 part들 중에 조건에 부합하는 part를 골라 랜덤하게 배치한다.(다음 길로 갈 수 있도록)
  4. 배치되지 않은 구역들은 거대한 collider 덩어리로 접근을 못하도록 막아놓는다.
  5. 시작점과 끝지점에 시작오브젝트와, 끝 오브젝트를 놔둔다.
  6. SidePath끝에 mainpath로부터의 길이를 도입하여, 보상을 비례하도록 배치한다.
  7. 각 맵에 기획자가 설정한 오브젝트들이 배치되도록 한다.

from g.

todd032 avatar todd032 commented on August 27, 2024

GDungeonManager - 던전 생성을 판단하는 놈

GDungeonPart - 던전 부분(기획자가 만들어서 제공)

GDunegeonObjectPlacer - 던전 파트에 넣어놓고, 어느 위치에 어느 오브젝트가 생성될지 판단.

from g.

todd032 avatar todd032 commented on August 27, 2024

Main Path의 최대 길이 설정하게끔 만들어주셈.
최대 길이 이하로만 main path의 길이가 생성되게끔 하는 기능.

from g.

todd032 avatar todd032 commented on August 27, 2024

제작중인 dungeon part들은 G/Prefab/MapPrefab 아래에 존재

GDungeonPart를 보면

In Direction List와
Out Direction List가 있음.

789
456
123

위와 같은 구조에서 Main 흐름이
1->2->5->6->3 과 같은 구조라고 가정

1 부분에 적합한 맵 파트를 고르기 위해서는

  1. OutDirection에 Right가 있는 것들만 추려서 생성

2 부분에 적합한 맵 파트를 고르기 위해서는

  1. InDirection에 Left가 있는 것들
  2. 다음 지역인 5로 가기 위해 OutDirection에 Top 이 있는 것들을 추리기

위의 조건에 부합하여 길을 쭉 생성.

그리고 생성할때 GDungeonPart의 Create 함수를 호출해주길 바람.

from g.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.