모바일에서 터치 스티어링 컨트롤러 테스트 - 적 차량과 레이스
The english article is below.
지난 번 포스트에 언급했던대로 이번엔 적 차량을 추가하고 레이스를 하게끔 도로를 따가 주행하는 AI를 적 차량에 추가해 실제 플레이를 테스트 해 봤습니다.
퍼포먼스에 대한 문제는 그래픽적인 문제는 차량이 몇 대 추가되는 걸로 퍼포먼스가 문제화 될 정도는 아닐 걸로 기대 했습니다. 차량은 동적인 오브젝트로 되어 있고, 드로우콜이 증가하긴 하겠지만 이전 테스트에서 그래픽 퀄리티를 크게 올려봤을 때도 60fps 이상을 유지 했기 때문에 그랬습니다.
차량들인 동적 오브젝트의 증가로 드로우콜이 늘어나는 게 어떨지 궁금하긴 했습니다만.
하지만, 테스트 해 본 결과 그래픽적인 문제로 프레임이 하락하지는 않는 것으로 보였습니다. 사실 정확하게 프로파일링을 해보진 않았고, 그냥 플레이하면서 왼쪽 화면 위에 표시되는 프레임 수치가 낮아지는 순간의 플레이 환경을 고려해 봤을 때, 그래픽적인 문제보다는 차량의 증가로 인해 물리/AI 계산량이 늘어났기 때문인 것으로 보였습니다.
사실 그간 유니티로 레이싱, 차량 등이 등장하는 프로젝트를 진행해보니 다른 게임장르보다 특히 물리 계산량이 많더군요. 이로 인해서 PC 데스크톱을 타겟으로 하는 프로젝트에서도 물리계산이 진행되는 CPU쪽에 과부하로 인해 병목이 발생하고 프레임 드랍이 생기더군요.
드로우콜 문제에 더해 과대한 물리계산까지 수행해야 하니 그렇습니다.
만일 유니티에서 멀티쓰레드가 매우 원할하다면 최신형 CPU가 아니더라도 이미 코어수가 많은 CPU들을 사용하는 PC와 콘솔이 많이 보급되었기에 제가 작업하는 프로젝트 정도는 충분히 커버했을 거라고 생각됩니다.
분명 유니티의 Burst 같은 멀티쓰레드를 사용하는 코딩도 어느정도 적용되어 있지만, 특히 유니티의 Physics인 경우엔 CPU 부하에 제가 알기론 멀티쓰레드도 제대로 지원되지 않아서 병목이 발생하네요.
유니티가 GPU 연산으로 작동되는 Physics를 지원했으면 좋겠는데, 언제 될지 모르겠네요. 찾아보면 유니티가 빌트인으로 기본 사용하고 있는 NVIDIA Physx의 경우 CPU연산하는 SDK도 있고, GPU연산 SDK도 있는 것 같은데, 유니티는 CPU Physx만 사용하네요. 유니티가 패키지로 설치해 지원한다고 하는 HAVOK 엔진의 경우는 GPU 연산 인 것으로 아는데, 사용법을 새로 배워야 하는데 꽤나 복잡하고 어려워 보이네요.
다른 방편으로는 DOTS를 사용하는 방법이 있는 것 같은데, 이것도 제가 전문적인 프로그래머 기반이 있지 않다보니 어렵네요.
유니티의 로드맵을 보면 DOTS가 유니티 에디터에서 컴포넌트부터 적용해서 쉽게 사용하는 방향으로 개발되어 가는 것 같은데 그렇게 버전업 됐을 때나 사용가능할 것 같아서 아직은 힘드네요.
하여간 얘기가 길어졌는데, 물리연산으로 인해서 프레임이 약간 낮아지는 듯 하지만, 게임 플레이 느낌으로는 프레임이 드랍됐다는 느낌은 없었습니다.
FPS 수치가 표시되지 않는다면, 전혀 느껴지지 않는 정도였습니다.
https://www.youtube.com/watch?v=8hE4U34YUvA
영상 보시면 아직 세세한 부분의 물리설정 등을 정확하게 작업하지 않았기 때문에 충돌이 일어날 때 좀 어색하기도 합니다.
특히 적 차량의 콜라이더가 차량의 전체적인 볼륨에서 약간 위에 있는 상태라서 충돌이 일어날 때, 플레이어 차량이 적 차량의 밑으로 파고 들어 적 차량을 들어올리는 현상이 일어나서 더 비현실적으로 보이게 되네요.
컨트롤 부분은 확실히 기본적으로 쉬운 게임이 아니게 되네요.
대부분의 모바일 게임은 정말 많은 플레이어를 상대로 해야 하기 때문에 매우매우 대중적이고 그에 따라서 아주 쉽게 디자인되곤 합니다.
특히나 컨트롤은 최대한 심플하고, 편하고 쉬운 방향으로 설계하는데, 이 컨트롤러는 기본적으로는 거기에서 벗어나 있습니다.
약간은 매니악하고, 도전적인 컨트롤 방식이라는 점은 분명해 지네요.
제가 출시되어 서비스되고 있는 몇몇 다른 모바일 레이싱게임을 플레이 해 보고, 이런 스티어링 컨트롤 방식은 없나 싶었는데, NFS 니드포 스피드 게임의 경우엔 기본 컨트롤러로는 화면의 좌/우를 오른손 왼손으로 터치해서 차량을 컨트롤 하는데, 옵션에서 폰을 기울이는 자이로스코프 방식이나 스티어링 휠 컨트롤러도 선택할 수 있네요.
스티어링 컨트롤로 바꿔서 플레이 해보니 확실히 다른 컨트롤러 보다 좀 더 어렵네요. (어렵다기 보다 도전적인 컨트롤러라는 표현이 어울리는 것 같습니다)
그럼에도 스티어링 컨트롤이 좋은 점은 오른손이던 왼손이던 한 손의 손가락으로 컨트롤을 할 수 있고, 그로 인해서 다른 손으로는 엑셀, 브레이크, 또 필요에 따라 엔진브레이크나 다른 버튼 등을 사용할 수 있다는 것 입니다.
그래서 많은 레이싱 게임들이 한쪽(특히 왼쪽)에 좌/우 화살표 버튼을 한 손으로 조작하도록 만들어서 스티어링 컨트롤 같은 장점도 취하고 있습니다.
다만, 니드포스피드의 경우는 엑셀, 브레이크 버튼을 없애고, 컨트롤을 쉽게 하기 위해서 화면의 좌/우를 터치해 차량을 컨트롤하고, 위로 스와이프로 순간 터보돌진, 아래로 스와이프해서 엔진브레이크를 잡은 듯이 드리프트를 하도록 만들어 놨네요.
매우 대중적으로 심플하고, 편하게 디자인해 놨습니다.
다만 제가 테스트 하고 있는 프로젝트는 그보다는 훨씬 도전적인 플레이라고 볼 수 있을 것 같습니다.
영상을 보시면 디테일은 차이가 크지만, 대부분의 모바일 레이싱 게임 보다는 데스크톱 레이싱 게임들에 조금이라도 더 가깝다고 느끼실 수 있을 것 같습니다.
여백지미@Self Expression Arts
As mentioned in my previous post, this time I added enemy vehicles and implemented AI for them to drive along the road, enabling a test of actual racing gameplay.
Regarding performance concerns, I didn’t expect the addition of a few vehicles to significantly impact performance in terms of graphics. While the vehicles are dynamic objects, and their addition would increase draw calls, I was optimistic since previous tests with higher graphical quality still maintained over 60fps. I was, however, curious to see how the increased draw calls from additional dynamic objects would affect performance.
After testing, it appears that frame drops were not caused by graphical issues. Although I didn’t conduct detailed profiling, based on gameplay observations and monitoring the frame counter displayed at the top-left of the screen, performance dips seemed more related to the increased physics and AI computations required for the additional vehicles.
This suggests that the bottleneck lies in handling the AI and physics calculations rather than rendering graphics, even with multiple dynamic objects added to the scene.
In my experience with Unity projects involving racing and vehicles, I’ve noticed that they tend to demand significantly more physics calculations compared to other genres. This often leads to bottlenecks in the CPU, even for PC desktop-targeted projects, resulting in frame drops. The combination of high physics computation and increased draw calls makes this particularly challenging.
If Unity's multithreading capabilities were more robust, this issue might not be as severe. Modern CPUs with high core counts are now widely used in PCs and consoles, and such hardware could likely handle the scope of my projects if Unity's threading were more optimized. While Unity has introduced multithreaded features like Burst, physics computations in Unity (to my knowledge) still don’t fully utilize multithreading, which creates a bottleneck in the CPU.
It would be great if Unity supported GPU-based physics calculations. NVIDIA PhysX, which Unity uses by default, apparently offers both CPU and GPU processing SDKs, but Unity currently relies only on the CPU version. Unity also supports the Havok engine via a package, which I believe uses GPU-based physics, but learning to use it appears complex and challenging.
Another potential solution is using DOTS (Data-Oriented Technology Stack), but as someone without a professional programming background, it’s a steep learning curve for me. Judging from Unity’s roadmap, it seems they’re working on integrating DOTS more seamlessly into the Unity Editor, making it easier to use through components. I’ll likely wait until those updates are available before diving into it.
In any case, while the frame rate seemed to dip slightly due to physics computations, it wasn’t noticeable during gameplay. If the FPS counter wasn’t displayed, I wouldn’t have realized there was any drop at all—it felt smooth overall.
https://www.youtube.com/watch?v=8hE4U34YUvA
If you watch the video, you’ll notice that the physics settings still lack polish, leading to some awkward interactions during collisions. Specifically, the collider for enemy vehicles is slightly higher than the overall volume of the vehicle. As a result, when collisions occur, the player’s car tends to slide under the enemy vehicle and lift it, making the interaction appear unrealistic.
In terms of controls, it’s clear this game isn’t inherently designed to be easy. Most mobile games aim to attract a broad players and are consequently designed to be very simple, accessible, and easy to pick up. Controls, in particular, are typically kept as intuitive and straightforward as possible. However, the steering wheel controller in this project deviates from that norm. It’s definitely more niche and challenging, offering a more skill-based, "maniacal" gameplay experience.
I’ve also tested other popular mobile racing games, wondering if this kind of steering control is used elsewhere. For instance, Need for Speed employs a default control scheme where players tap the left and right sides of the screen to steer. Interestingly, the game also provides options for tilt-based gyroscope controls or a steering wheel controller. When switching to the steering wheel control, I found it noticeably more challenging than the other methods. (Perhaps "challenging" is proper rather than just a difficult control way)
The advantage of the steering wheel control is its versatility. It allows players to use one hand (left or right) for steering, freeing the other hand to manage acceleration, braking, engine braking, or other functions. Many mobile racing games compensate for this by placing directional arrow buttons on one side, allowing similar versatility.
However, Need for Speed takes a simpler, more accessible approach by eliminating separate acceleration and brake buttons. Players steer by tapping the screen’s sides, swipe up for a turbo boost, and swipe down to perform an engine-brake-style drift. It’s a highly intuitive, user-friendly design for a mass player.
In contrast, the project I’m testing feels much more challenging and skill-oriented. From watching the video, you might notice that while the level of detail doesn’t match desktop racing games, the overall gameplay approach leans closer to that of PC racing games than most mobile titles. It provides a unique, demanding experience for players who enjoy a greater sense of control and challenge.
Self Expression Arts