TIL-sparta

스파르타) Node.js 5기 게임 서버 최종 프로젝트 (D-4)

Megadr0ne 2024. 8. 24. 02:35

 

학습 키워드: C#, .NET, Recast & Detour, DotRecast

 

프로젝트 진행 사항

1) 길 찾기 Dedi 서버 성능 개선:

 

Fix/nav manager by donkim1212 · Pull Request #4 · donkim1212/PathfindingDediServer

Works done Player/Monster/Structure agent classes that extends CustomAgent, that extends DtCrowdAgent for customization Improve NavManager performance & readability, use above custom agent cla...

github.com

 

 (상세 내용은 위 PR 및 24-08-23일자 'dev' branch commit history 확인)

 

주요 작업 내용

  • DotRecast의 DtCrowdAgent를 상속받는 자식 클래스 CustomAgent 및 이를 상속받는 Monster/Player/StructureAgent 클래스 구현 (overriding할 메서드를 virtual로 전환)
  • 이전 위치를 저장할 ppos 필드 생성 (기존에 있는 현재 위치 npos 갱신 시점에서 같이 갱신)
  • 위의 클래스 구조 추가에 따라 NavManager 내 불필요한 Dictionary 및 관련 코드를 모두 제거하고 monster/player/structure 3개의 ConcurrentDictionary를 사용 (핸들러의 몬스터 제거 호출과 게임 루프의 몬스터 목록 동시 접근/수정으로 인한 문제 해결)
  • 비동기 몬스터 소환 루프를 비동기 게임 루프에 병합하고 NavManager에 소환 관련 메서드 및 정보를 관리할 필드 추가
  • 움직이지 않는 에이전트의 위치 정보를 보내지 않도록 변경하여 네트워크 부하 감소
  • 전체적인 성능 및 가독성 개선

Figure 1. 작업 내용이랑은 별 상관없는 인게임 스크린샷

 

--


REFERENCES:

 

https://github.com/eliotjang/the-last-rollback-server

 > The Last Rollback - 메인 서버 repo

https://github.com/donkim1212/PathfindingDediServer

 > The Last Rollback - Pathfinding Dedicated Server repo

 

728x90