Blood Engine - A blood engine system

Blood Engine

Blood Engine is a module that can emit blood drips from a base part and make them fall and form pools on the ground. The system uses some predefined constants, variables, and functions to control the behavior and appearance of the blood drips. You can customize the settings of the system, such as the limit, the speed, the delay, the offset, and the visibility of the droplets. You can also use different methods to emit droplets from different parts, directions, and amounts.


It also is possible to use this module for other uses. Just tweak some settings and Tada:

You can also use decals instead by changing the Decals boolean to true! Here’s how it looks:

Usage

To use Blood Engine, you need to require the module in your script and create a new instance of it. You can pass some arguments to the constructor to change the default settings of the system. For example:

-- You can leave any of these values as nil or not assign them, it'll use the default values
local DripSettings = {
    Decals = false, -- Use if you want to have your pools be decals instead of cylinders.
    RandomOffset = true, -- Whether to randomly offset the starting position of the droplets or not.
    DripVisible = false, -- Whether to show the droplets before they become a pool or not.
    DripDelay = 0.01, -- The delay between each droplet.
    DecayDelay = {10, 15}, -- Each pool will start to fade away randomly between min and max seconds after it’s created.
    Speed = 0.5, -- Determines the speed/velocity of the droplets.
    Limit = 500, -- The maximum number of droplets/pools.
    Distance = 1, -- The required distance for the droplet to register with the part below it.
    PoolExpansion = false, -- Whether to expand the pool or not when a droplet lands on it.
    MaximumSize = 0.7, -- The maximum X size of the droplets.
    DefaultSize = {0.4, 0.7}, -- Minimum and Maximum. Both determine the default size of a pool.
    ExpansionSize = {0.1, 0.5}, -- Minimum and Maximum. Both determine the expansion size range of the pools.
    Filter = {} -- An array that stores instances that don't interfere with the droplets raycast process.
}

-- MODULE
local BloodEngine = require(ReplicatedStorage.BloodEngine)
local BloodInstance = BloodEngine.new(DripSettings) -- customize to whatever you want

Then, you can use the Emit method to create blood drips from a base part in a given direction with a given amount. For example:

-- TARGET
local Part = workspace.Part

-- Emits drips from a part in the workspace, emits 10 blood drips only in the front direction
-- Leave the direction nil if you want it to go in a random direction `BloodInstance:Emit(Part, nil, 10)`
-- EXAMPLE: BloodInstance:Emit(Part, nil, 10)
BloodInstance:Emit(Part, Part.CFrame.LookVector, 10) -- also customize to whatever you want.

You can also change the settings of the system after creating an instance by accessing its properties. For example:

BloodInstance.Settings.Speed = 0
BloodInstance.Settings.DripDelay = 5

Now if you’d want to make a fully-fledged system that makes blood appear in all clients, you can make a remote event, from server to client. When drips are needed, you can pass off the settings (BasePart, Direction, Amount) and the client will do the rest. It’s recommended to have only one script manage the blood engine and let the server use its Emit method using the remote event.

Why use it?

Blood Engine is a simple and efficient way to add some gore and realism to your games. It can be used for various purposes, such as fps games, melee combat games, horror games or any game that involves blood. It can also be used for other effects besides blood, such as maybe water, paint, slime, etc. You just need to change the color and texture of the drip part.

Change Log

#V.0.0.1

General:

  • Release
#V0.0.2

General:

  • Bouncing is now removed due to its instability.
  • You can now make drips go in random directions more efficiently.
  • Added the ability to make blood drips ignore certain descendants of parts efficiently.
#V0.0.3

General:

  • Revamped how settings work/get applied.
  • Added an option to make pools expandable if collided by droplets.
  • Added the option to change the default size of a pool.
#V0.0.4

General:

  • Improved drip raycast accuracy.
  • Added DecayDelay, manages the decay time for each pool.
  • Pools can now get on walls and attach/get welded to parts.
  • Support for decals/images for pools. Includes PBR Materials.

Download

GitHubRoblox

*The GitHub repository provides an additional ‘sounds’ folder for your convenience in case you require SFX for the system.

84 Likes

alr ima go sleep m job is done

20 Likes

Looks really cool! I wish Roblox allowed a bit more gore because I’m sure 13 and older aren’t sensitive to a bit of blood (or at least I’ve seen them get angry). Super realistic gore would be put in 17+ or something, but that’s how I view it.

(… I mean, doesn’t God’s Will have huge blood splatters? I don’t know if I remember that well because I turned it off due to lag.)

14 Likes

I mean this is the soft kind of gore if that’s what your asking for. I also wish Roblox allowed gore models to be viewed on 13+ games without it being disabled by default as I hate my games getting content deleted. Games are just games, they don’t make people do these actions at all.

17 Likes

Two questions:

  1. Why are the links from discord? They’ll definitely be scrapped.

  2. Is there a function to have constant spilling? I’m thinking to use this for leaky pipes and such, just wondering about this use case before I make my own system (if I feel like it).

9 Likes

To answer your questions

  1. I have uploaded the files on Github and Roblox now.

  2. What do you mean by constant spilling? This module can be used for other things such as water or other. But can you go further in depth about “constant spilling”

8 Likes

this is so combat warriors :cold_face: :hot_face: :hot_face:

10 Likes

wow combat warriors is the only game that has a blood dripping system no way :speaking_head::speaking_head::speaking_head:

8 Likes

i wasnt blaming that you copied i was praising that you made greatly like cw

2 Likes

ye i know im just stating the fact that other games (like criminality) have a blood dripping system
sorry if that was harsh as da context was hard to understand wid all these emojis

5 Likes

That’s good to hear it’s uploaded to a better source.

Constant spilling would be something like water running from a hose, constant water particles.

4 Likes

i’ll implement a method for it. thanks for the suggestion.

4 Likes

sadly i won’t be able to implement it as at the moment, i’m quite busy with game development on my game.

5 Likes

why is the repo just a README.md???

Just add the source code there, even made a pull request to this

2 Likes

i merged the pull request, sorry for not adding the module’s source code as i was in a bit of a rush

3 Likes

this is amazing! well done, im just gonna take 10 years of my life to figure out how to hook it to emit when damage is taken :joy:

3 Likes

check if the player has lost damage on the client then emit blood, its not that hard (if that’s what your asking for though)

5 Likes

pretty much lol, im just not the best scripter. imma try a few things

3 Likes

bro idk why ur module doesn’t work it says that the module doesn’t work then it outputs an error about an random offset or whatever

i can’t fix something if you don’t show me the error