Jump to content
  • Advertisement

The Hydraulic Press - Not safe for use around explosives.



Hi everyone!

It's been a good couple of weeks since I last posted a blog entry. With the help of @Rutin and his 3D model making expertise, i've now implemented the hydraulic press mechanics within the game, and also finished the appearance of the laser tripwires. These were required to implement level 12 of Mr Boom's Firework Factory, the first level to use electricity mechanics.

The Completed Laser Tripwire

Starting with the laser tripwires, i selected some free to use models, and some cheap paid models and kitbashed them to end up with something visually appealing, with some help from @Rutin converting 3D studio files into FBX. Using a CCTV camera model, an SLR camera tripod, and some weird electrical gadget, this was the end result, connecting the set using a UE4 Cable Component:


There are two arrow components in this model, the one in the lens of the camera dictates where the laser beam originates from, and in which direction, and the one on the control box is a connection point for the cable actor which connects it to the object it powers. With this complete, i could move on to the hydraulic press itself.

Hydraulic Press Development

For the actual hydraulic press that connects to this laser tripwire, I'd started out with a basic primitive prototype, made of some textured boxes which i sent to @Rutin for a sense of scale so he could get started on something better:


I then left @Rutin to do his thing, and after lots of to-ing and fro-ing, talking about how it needed to look, he finally came back with the finished product, which i turned into an actor within the game proper...

The Hydraulic Press - The final model


Animated Parts

I also decided to add some extra parts to the model to allow for connection to a cable (the pylon at the top of the model) and to allow for animation of the display screen. The display screen uses a simple texture atlas to animate its text when it is powered up:


The end result looks like this, and has some emissive applied to make it look more like an oldschool green phospor screen. It only appears when the machine is powered on:


Hydraulic Press Blueprint Events

This needed to be connected to the existing power system by deriving the class from my "Powered Object" class, which implements the base interface, and a set of related events added, one for powering it up and one for powering it down, plus a timer to animate the model.

Power on event

The power on event is called when the device receives power, it changes the materials of the screen and power button to 'lit' ones with texture atlases and emissives.


Power off event

The power off event reverses the behaviour of the power on event, reverting the glowing textures and texture atlases back to plain boring non-animated and non-emissive ones.


Animation event

The animation event is powered by two timelines, one to quickly descend the crusher to the ground, detecting any collisions with crates as it sweeps and registers collisions. Any crates it collides with are set to explode as soon as possible.

The second timeline runs eight times slower, and ascends the crusher back to maximum height. Each of these timelines has a sound attached after it has finished executing, one for a loud slamming sound, and one for a hissing of hydraulics and steam engines.

Both of these events only operate while the object is powered, and if power is removed, the animation always completes, leaving the crusher part at its highest position allowing crates to pass through.


Once these are all rigged up, the whole thing can be tied together, which produces some wonderful and destructive machines:




The videos below show the hydraulic press in all its glory. Note that the first video does not show the camera shake effect, as I had de-posessed the player pawn to reposition the camera in a better position. It appears that in UE4, a de-posessed free floating camera does not receive camera shakes.

The view from the other side of the machine better demonstrates the camera shake effects used to add polish to the machine:


As always, feedback is more than welcome! Please feel free to comment below, and let me know if i missed anything! 🙂


Recommended Comments

Very nice post, Brain. Your game dev is getting really interesting.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By pristondev
      Hey, I've updated my shaders to uses Shader Model 2.0, with ps_2_0 and vs_2_0, works good only on PC's where was possible to use Shader Model 3.0.
      The problem its the shaders its already compiled for SM 2.0, but it doesnt works on PC's with obsolete hardware config. That PC's supports SM 2.0, so I dont know the shaders isn't working. Looks the crash is caused on DrawIndexedPrimitive, but this function never returns something different from S_OK. This way I can't check any log or something like that.
      Im compiling shaders like:
      technique Mesh { pass P0 { VertexShader = compile vs_2_0 MeshVS(); PixelShader = compile ps_2_0 MeshPS(); } } Initialization logs where have that crashing problem:
      16/04/2019 23:18:13 - (INF) Direct3D 9 Interface Created 16/04/2019 23:18:13 - (ERR) Your graphics hardware doest not support 32 bit Dynamic Texture [8876086A] 16/04/2019 23:18:13 - (INF) FPU Preserve 16/04/2019 23:18:13 - (INF) Vertex Processing: Software 16/04/2019 23:18:13 - (INF) Device Created! 16/04/2019 23:18:13 - (INF) Multi Sample: 0 0 16/04/2019 23:18:13 - (INF) Resolution: 800x600 16/04/2019 23:18:13 - (INF) Window Mode 16/04/2019 23:18:13 - (INF) Color Depth: 32BPP 16/04/2019 23:18:13 - (INF) @ Device Capabilities 16/04/2019 23:18:13 - (INF) Vertex Shader Version: 0.0 16/04/2019 23:18:13 - (INF) Pixel Shader Version: 2.0 16/04/2019 23:18:13 - (INF) Max Vertex Blend Matrices: 0 16/04/2019 23:18:13 - (INF) Max Vertex Blend Matrix Index: 0 16/04/2019 23:18:13 - (INF) Max Primitive Count: 65535 16/04/2019 23:18:13 - (INF) Max Vertex Index: 65534 16/04/2019 23:18:13 - (INF) Max Streams: 16 16/04/2019 23:18:13 - (INF) Max Streams Stride: 255 16/04/2019 23:18:13 - (INF) Max Vertex Shader Constant Registers: 0 16/04/2019 23:18:13 - (INF) Max VShader Instructions Executed: 0 16/04/2019 23:18:13 - (INF) Max PShader Instructions Executed: 96 16/04/2019 23:18:13 - (INF) Max Vertex Shader 30 Instruction Slots: 0 16/04/2019 23:18:13 - (INF) Max Pixel Shader 30 Instruction Slots: 0 16/04/2019 23:18:13 - (INF) Max Simultaneous Textures: 8 16/04/2019 23:18:13 - (INF) Max Texture Blend Stages: 8 16/04/2019 23:18:13 - (INF) Max Texture Width: 2048 16/04/2019 23:18:13 - (INF) Max Texture Height: 2048 16/04/2019 23:18:13 - (INF) Max Volume Extent: 256 16/04/2019 23:18:13 - (INF) Max Texture Repeat: 8192 16/04/2019 23:18:13 - (INF) Max Texture Aspect Ratio: 2048 16/04/2019 23:18:13 - (INF) Max Anisotropy: 4 16/04/2019 23:18:13 - (INF) Max Active Lights: 0 16/04/2019 23:18:13 - (INF) Max User Clip Planes: 0 16/04/2019 23:18:13 - (INF) Max Point Size: 256.000000 16/04/2019 23:18:13 - (INF) Max Npatch Tesselation Level: 0.000000 16/04/2019 23:18:13 - (INF) Num Simultaneous RTs: 1 16/04/2019 23:18:13 - (INF) Using Textures Non Pow2 Conditional: Yes 16/04/2019 23:18:13 - (INF) Using Textures Pow2: Yes 16/04/2019 23:18:13 - (INF) Supports HW Skinning: No 16/04/2019 23:18:13 - (INF) Software Skinning My initialization logs (where shader with sm2 works perfectly):
      22/04/2019 14:45:21 - (INF) Direct3D 9 Interface Created 22/04/2019 14:45:21 - (INF) FPU Preserve 22/04/2019 14:45:21 - (INF) Vertex Processing: Hardware 22/04/2019 14:45:21 - (INF) Pure Device 22/04/2019 14:45:21 - (INF) Device Created! 22/04/2019 14:45:21 - (INF) Multi Sample: 0 0 22/04/2019 14:45:21 - (INF) Resolution: 1024x768 22/04/2019 14:45:21 - (INF) Window Mode 22/04/2019 14:45:21 - (INF) Color Depth: 32BPP 22/04/2019 14:45:21 - (INF) 32 bit Back Buffer 22/04/2019 14:45:21 - (INF) @ Device Capabilities 22/04/2019 14:45:21 - (INF) Vertex Shader Version: 3.0 22/04/2019 14:45:21 - (INF) Pixel Shader Version: 3.0 22/04/2019 14:45:21 - (INF) Max Vertex Blend Matrices: 4 22/04/2019 14:45:21 - (INF) Max Vertex Blend Matrix Index: 0 22/04/2019 14:45:21 - (INF) Max Primitive Count: 16777215 22/04/2019 14:45:21 - (INF) Max Vertex Index: 16777215 22/04/2019 14:45:21 - (INF) Max Streams: 16 22/04/2019 14:45:21 - (INF) Max Streams Stride: 255 22/04/2019 14:45:21 - (INF) Max Vertex Shader Constant Registers: 256 22/04/2019 14:45:21 - (INF) Max VShader Instructions Executed: 65535 22/04/2019 14:45:21 - (INF) Max PShader Instructions Executed: 65535 22/04/2019 14:45:21 - (INF) Max Vertex Shader 30 Instruction Slots: 4096 22/04/2019 14:45:21 - (INF) Max Pixel Shader 30 Instruction Slots: 4096 22/04/2019 14:45:21 - (INF) Max Simultaneous Textures: 8 22/04/2019 14:45:21 - (INF) Max Texture Blend Stages: 8 22/04/2019 14:45:21 - (INF) Max Texture Width: 16384 22/04/2019 14:45:22 - (INF) Max Texture Height: 16384 22/04/2019 14:45:22 - (INF) Max Volume Extent: 2048 22/04/2019 14:45:22 - (INF) Max Texture Repeat: 8192 22/04/2019 14:45:22 - (INF) Max Texture Aspect Ratio: 16384 22/04/2019 14:45:22 - (INF) Max Anisotropy: 16 22/04/2019 14:45:22 - (INF) Max Active Lights: 8 22/04/2019 14:45:22 - (INF) Max User Clip Planes: 8 22/04/2019 14:45:22 - (INF) Max Point Size: 8192.000000 22/04/2019 14:45:22 - (INF) Max Npatch Tesselation Level: 0.000000 22/04/2019 14:45:22 - (INF) Num Simultaneous RTs: 4 22/04/2019 14:45:22 - (INF) Using Textures Non Pow2 Conditional: No 22/04/2019 14:45:22 - (INF) Using Textures Pow2: No 22/04/2019 14:45:22 - (INF) Supports HW Skinning: Yes 22/04/2019 14:45:22 - (INF) Hardware Skinning  
      Does anyone know what might be happening?
    • By Belfa96
      I've got a single vertex buffer and an index buffer for a cube in Directx9. I now want to generate a LPD3DXMESH  object from them, so that I can manage mouse picking and other stuff with the cube model. How can I achieve this? Here's the code of my vertex and index buffers:
      CUSTOMVERTEX vertices[] = { { -3.0f, 3.0f, -3.0f, D3DCOLOR_XRGB(0, 0, 0), }, { 3.0f, 3.0f, -3.0f, D3DCOLOR_XRGB(0, 0, 0), }, { -3.0f, -3.0f, -3.0f, D3DCOLOR_XRGB(0, 0, 0), }, { 3.0f, -3.0f, -3.0f, D3DCOLOR_XRGB(0, 0, 0), }, { -3.0f, 3.0f, 3.0f, D3DCOLOR_XRGB(0, 0, 0), }, { 3.0f, 3.0f, 3.0f, D3DCOLOR_XRGB(0, 0, 0), }, { -3.0f, -3.0f, 3.0f, D3DCOLOR_XRGB(0, 0, 0), }, { 3.0f, -3.0f, 3.0f, D3DCOLOR_XRGB(0, 0, 0), }, }; d3ddev->CreateVertexBuffer(8 * sizeof(CUSTOMVERTEX), 0, CUSTOMFVF, D3DPOOL_MANAGED, &vertex_buffer, NULL); VOID* pVoid; vertex_buffer->Lock(0, 0, (void**)&pVoid, 0); memcpy(pVoid, vertices, sizeof(vertices)); vertex_buffer->Unlock(); short indices[] = { 0, 1, 2, 2, 1, 3, 4, 0, 6, 6, 0, 2, 7, 5, 6, 6, 5, 4, 3, 1, 7, 7, 1, 5, 4, 5, 0, 0, 5, 1, 3, 7, 2, 2, 7, 6, }; d3ddev->CreateIndexBuffer(36 * sizeof(short), 0, D3DFMT_INDEX16, D3DPOOL_MANAGED, &index_buffer, NULL); index_buffer->Lock(0, 0, (void**)&pVoid, 0); memcpy(pVoid, indices, sizeof(indices)); index_buffer->Unlock();  
    • By RhinoBladeX2
      hi you my call me rhino would love to chat about blender, gimp and 3d design learning all the time. hope we can be friends I uploaded picture's for everyone 

    • By de123
      Hi everyone, I'm trying to implement the displacement mapping technique by William Donnelly from GPU Gems 2: Chapter 8 for a project. I'm working in XNA/MonoGame and using HLSL for my shaders. The problem I'm having is how to create the distance map and I'm not really understanding how I would go in creating it. I know that Nvidia has released the code for that chapter but the files are in c++ and I'm not familiar with c++ so its been throwing me off on how to recreate it in c#. Any explanation on how I should go about in creating the distance map would be extremely helpful. Thanks for any help or suggestions.
    • By Kripto289
      Hello all.
      I'm newbie on this forum and my english not very good. Sorry ><
      I created a volumetric lighting with a shadow for my water. Right now I need to compute a max height relative to the water (like a volume water depth).
      So, I have only screen space uv and 4 clip space vertexes (graphics.blit of unity3d).
      How I can reproduce the water vertex world space position? My water always is horizontal. Like in this screen.

      I have one bad idea, but I don't like it. I can render the water depth to texture and use this depth for reconstruct world space position in the lighting post effect.
      Also, I can reuse this water depth for manual writing to unity depth buffer (for correct depth of field posteffect). Also, it's only way to write to depth texture with transparent geometry.
      I tried work with a matrix transformations of space (posteffect quad -> world space quad -> transform this quad using TRS (model) matrix of water -> view -> projectrive -> clip), but it does not work for me.
      Any idea?

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!