I’m interested in creating a game involving an editor where players create custom vehicles. Think KSP, but for cars.
At first I was thinking that the whole vehicle would be one single Actor, subclassed from Pawn. The players “parts” would be loaded from a JSON file format and populated accordingly by some kind of construction method built into my Vehicle base class that knows how to load / save it’s state. Yes I know Unreal has stuff to do this, but I want something I can save off to a remote server and alter later so JSON as a file format seems reasonable and writing JSON parsers isn’t too hard.
So…
Pawn -> Vehicle (C++)
- USceneComponent -> Root Part Component (C++) -> Specific Part (BP)
-
- USceneComponent -> Part Component (C++) -> Specific Part (BP)
-
- USceneComponent -> Part Component (C++) -> Specific Part (BP)
-
- USceneComponent -> Part Component (C++) -> Specific Part (BP)
-
- …
But now I’m thinking that for the editors sake, since parts may be detached in the editor in some cases, that it may be better to handle Parts as Actors. In this case, each part gets an Actor, and are attached to each other or the Vehicle via sockets. The vehicle would still load / save the structure out, but in this case the Vehicle Pawn acts more like a hub. It will still control the other parts, but those parts won’t be components of it, more so probably referenced in a set.
Pawn -> Vehicle (C++)
- Root Part Component
AActor -> Part Actor (C++) -> Specific Part (BP)
AActor -> Part Actor (C++) -> Specific Part (BP)
AActor -> Part Actor (C++) -> Specific Part (BP)
…
I’m very new to UE4, but I’ve spent the better part of this summer trying to learn all I can about the engine.
I’m looking for a little feedback, what would you guys suggest I do in this situation?
Thanks, -