Hello all. I’m trying to get to grips with UE4, and I’m finding it a little confusing at first, and I’m at a loss for where to begin. If you have the time, would you mind answering some questions that would point me in the right direction?
I’m trying to make a warship game that uses a ship creator screen to build it’s vessels and then insert them into the game. Initially, I would like the creator to lay out a series of ribs along a keel, and then lay out shaped plating on the outside with options to customise certain forms, such as the superstructure, bow and stern shape and propeller placement.
Then I would like the creator to define approximated drag, weight and propulsion power (for gameplay).
In game, I would also like the plating to be destructible, exposing inner elements of the ship. In terms of damage such as flooding, I am just going to apply weight based on the location and size of a shell hit which gradually increases if not brought under control, giving the ship a list.
Now, the question I have is really where to even get started with any of this because I don’t know if it is even possible. Do any of you have any suggestions? Thank you in advance for any answers.
Done by a novice? No.
Or at least you’ll become a pro doing it.
You need different model parts that belong to each other.
They also need to be destructible per your request, so you have to make a copy of them that’s damaged as well.
Once you have the 40 or so modular models you can start trying to assemble a builder.
I suggest that each ship has the same amount of modules, to which you exchanges meshes at runtime.
If the meshes are all the same, and you are careful about pivot point placement, you can get this to work well even with completely different mixes.
The builder will probably have to validate the mix/match off a list or something similar. But that’s the easy creative part of the coding.
Hit and damage is done with mesh swaps - hidden by a flash or explosion. There’s probably nothing at all modular about it - though you could visually deform the mesh with a shader. Even poke holes in it with the opacity channel. But it’ll never look as good visually as a mesh swap.
^ This ^ You’ll need at least 3 key areas at a guess:
A rich UI that lets users select (or drag & drop) ship parts and then glue them together to form ships (visually). That has to be built on top of a ship class system that consists of a database or datatable of parts and allowed configurations.
An actual ship builder tool that builds the selected ships efficiently using lots of modular meshes that can be combined / aligned / oriented. It might be worth checking out the Marketplace first to see if there’s anything similar that can help (procedural worlds / vehicle tools that already exist that you can borrow from).
A parent or series of parent BP’s that actually contain or provide all of the underlying key control code to implement collision / movement / combat / damage.
Overall, if I had to do this I’d shamelessly cheat everywhere possible for now. Psychologically this is wise anyway as there’s lots of moving parts here, and making good progress quickly will help keep you motivated, as there’s lots to do (to make this look presentable at least).
First create a parent class that contains all the code needed for ships to move / fight / take damage. Then create as many sub-classes as you need for each ship type. Skip making the ships 100% procedural for now or having to deal with alignment / orientation (snapping to grid). Instead just create 5-10 sub-ships with all the possible parts for each class in every possible arrangement, that will allow you create 50-100 actual ship variations. Then implement code that hides the meshes that won’t be used in those slots (you’ll have to disable collision and tick on sub-components too). Then very quickly just create quick starting samples in Content Browser. During prototyping leverage asset names of ships and use those as building codes to setup specific ship specs. Example: FrigateABC333 might have a front section of type A, middle section of type B and rear section of type C with fighting defensive speed capabilities of 333 respectively. Create ship builder code that interprets those codes and hides / disables meshes and sets up appearance / style colors.
Haha, quote of the day, for sure!