Help: Castle Under Siege v/s a catapult.

Hi

I was looking at making a castle siege game. I am looking a the moment just to make the entire castle destructible.

Looking at the physics side of things.

Is it possible to do the following.

  1. Tunnel under the wall to weaken the structure so the Catapults do more damage.
  2. Have a variable/random aim, so not every shot is accurate.
  3. If you take out lower parts of the wall, have the top sections crumble down as well
  4. Do not allow a exploding mesh to do damage more than a little to the surrounding meshes.
  5. Slowly able to repair the wall over , ie When you run out of ammo for a day or 2.
  6. Have certain meshes take no damage if the are low enough in the wall because they are structurally strong enough.
  7. Reverse, have meshes that have no meshes above them weaker
  8. Able to put supports behind doors/grates to strengthen them when needed.

Regards

Yes, but there are lots of ways to do this and have their advantages and disadvantages. I don’t know which one to suggest because I don’t even know what perspective you’ll be using. First person, over the shoulder, bird’s eye view?

Absolutely, this is pretty easy.

How do you plan to make it destructible? There are lots of different ways with different tradeoffs. Would you like me to track down some reference materials on a few of the more common approaches?

Pretty easy.

Should be pretty easy with most ways of handling damage.

Invincibility is pretty easy.

Damage multipliers are pretty easy, Unreal is set up to have objects deal damage and then the damaged handles its own logic.

Sure, you can do this.

The limitation on what you can technically do with the engine is not what you need to worry about. Start doing it and tell us when you get stuck. We can’t help with vague questions, but if you hit a problem and tell us exactly what you’re doing, then we have a starting point. :slight_smile:

Cheers, will go as far as I can.

I was going for 3rd person / 1st person with a cat instead of human. But will use human for now as a prob.

I will get the basics done and see if I have gone up the wrong path.

Thanks for the advice, now I know it is worth digging me heals in.

Got my first issue: Walls

I made 32 separate dest. meshes, shot one and this what happens

Thank you, that video actually helps me better visualize your end goal. I was picturing a top-down Stronghold kind of game.

First thing, you definitely can’t be simulating physics every tick for a castle’s worth of individual bricks. You have to cheat, game development is about cheating.

If you want a brick-based castle, you could try chunking them. Meaning you take a range of bricks and you treat them as one mesh until things need to change.

So a 5x5 wall of bricks is just a single mesh with a repeating texture.

XXXXX
XXXXX
XXXXX
XXXXX
XXXXX

And then the player shoots one, and it falls out. So you rebuild the mesh with the missing brick, and swap in a dynamic brick for the one that was just shot. That dynamic brick falls and breaks apart and spawns dust particles and generally looks impressive, and then it sinks into the ground/vanishes. Or maybe you have a static pile of rubble that you swap it for when it hits the ground in a cloud of smoke. Or a bunch of different piles of rubble.

XXXXX
XXXXX
XX_XX
XXXXX
XXXXX

And now there are unsupported bricks above that one. So every few ticks you go through and determine what bricks should fall, and you take those and swap them out as well, they do impressive things as they fall, and the player goes “wow!”

So now you’re wondering “What is this? Minecraft has so many blocks it’s insane, and Unreal can’t even handle 30 or so on my computer?”

Minecraft cheats too. Minecraft cheats hard. Minecraft chunks 16x128x16 blocks at a into a single mesh. That’s 32768 blocks in a single mesh. And then when the player breaks a block, it rebuilds a new mesh and shows you that instead.

“But Minecraft has sand that falls down. How do they do that?”

Same thing. Every a block changes Minecraft checks the neighboring blocks. If any of the neighbor blocks need to do anything different than they currently are, then they do that. So if you take out the block under a column of sand, Minecraft builds a new chunk without the block you took out, and without the sand above it. Then it makes an entity (actor in Unreal) that looks like sand, and has it go straight down. When it touches the ground it builds the chunk again, and adds in the sand that just landed. So it looks like Minecraft blocks are affected by physics, but they’re not at .

So the first thing I’d suggest you look into now that I understand your goal a little better is this project by .

Your game doesn’t have to look like Minecraft. But it would help to get to know why it does a lot of what it does, and apply that to what you’re working on. You have a lot more wriggle room, as a castle isn’t an infinitely large world. It’s a static size and you probably know how you want it to look. (Though you could generate it procedurally if you want.) So you can have chunks shaped like walls, and bricks shaped like bricks. You can have far more complex physics than a column of sand in Minecraft. You can build a static mesh to start with and whenever a block is hit, swap it with a destructable mesh, let it fall, make it spawn particles when it hits the ground, the whole works. But it’s a good start.

Of course there are other ways to go about what you’re doing. This is just the first thing my mind jumps to when I see a wall of bricks individually meshed.

Ok, That does sound beyond my skills. What tutorials would point me in the right direction?

Would it be better to build the bricks in nVidia PhysX Lab then import, would that make the process easier?

Seems like you’ve pulled that off already, you tell me. :slight_smile:

Like I said, that’s only one way to handle it, the first way I came up with off the top of my head. You just need to not have physics enabled for that many objects at once, and probably want to combine the stationary bricks until they need to fall out.

An easier possible solution would be to:

  • have the ball do damage
  • have physics off by default
  • have damage turn on physics for a brick when it’s hit
  • perform a few multi line traces upward from a hit brick to turn on physics for the bricks above it

If you want to learn more about chunking and such there’s a good tutorial here, but it’s in C++, and not Unreal specific.

Cheers, I want to end up with something like this.

That’s a pretty impressive project! Taking a look at that with my next chunk of free .

I don’t know how much further I can help you personally, perhaps someone else with the right expertise will find this thread and point you in the right direction. Any contact info on that project?

I’m working on a sort of similar game, the support meshes are part of the destructive mesh system, so you can set some chunks to be support pieces, which will basically stay, can also then sort of link support pieces together when they touch others, etc. So can get a bit of that going on. You are probably better doing the wall pieces are a more elaborate single destructive mesh instead of trying to stack them aspect, only on the fact that you need some force to break the mesh apart, when you stack and the bottom one crumbles would need to send out a way to have above meshes receive enough damage to break apart as well. It’s do able but a tad complex, instead of having depth layers were the mesh would more accurately break apart into various pieces etc.

The blowing apart aspect has a few pieces with it around the radial force or the impulse force you have. There is a bug currently where the DM doesn’t utilize the weight/ mass values, which should help provide a better resistance to the just blows apart.
The tunneling aspect might be a tad tricky depending on how you setup the wall damage. The regen aspects the same, probably will have to custom code / blueprint a destruction system, not sure if you can reset the damage accumilated or not. I posted something similar that i wanted to do and didn’t get a reply back yet.

The random aim is super easy to do, just set a random value for the velocity of the projectile when it’s created.