First off, I’m unsure if this is the best place for this question, but I hope I can get some good answers.
I’ve done work in UE4 before, mostly on shooters/adventure games, but this project I’m embarking on is rather different. It’s a 2D top-down strategy/simulation game. What I’m having a hard time wrapping my head around is how I would structure this.
The game is a spaceship battle game (inspired by FTL, but mechanics are quite different), and I’m confused as to what I would use to represent the player, as there is no single representation of the player in the game world. There are multiple crew members that the player controls, not to mention all the UI that controls greater ship functionality like weapons, shields, etc. Would I want to just have a player controller handling the actual player input and controls, and then pawns with their own controller for the crew (which is semi-autonomous)?
The game is meant to be multiplayer if that makes a difference at all.
Hi, I will share how I approached this in my project.
In my case I used a pawn class for the player. I added a static mesh component and set it to invisible (not sure if you have to do this or it works without any static mesh). I added a camera component and a spring arm as child of my invisible mesh (so that the camera follows your static mesh, which won’t be visible tho), then I set up my movement controls. This way I had a ‘god like’ player looking down, able to move around, but he was invisible.
For the rest I did pretty much what you just described, I created pawns (for the different units) then set them up with their own controls and such. You just need to set up a system that takes control ower a pawn (AI Controller) when you as a player not possesing it.
Kontur, that is incredibly helpful! I wonder if it’s possible to skip the pawn though, as the player controller, by default has a camera attached to it I believe. I may be wrong, and I’d love some clarification from someone knowledgeable about this stuff.
Glad I could help.
I believe you could use the Player Controller instead of a Pawn without any problem, but I am no expert, so hopefully someone with more experience can confirm this.
Yep the pawn seems quite unnecessary, just setup your player controller however you like and you should be good to go, seems like you used the pawn so that the camera would get locked to a physical location on the map easier though?