Blood Splatters?


Questions, Explanations, Howtos

Temple Termagant

Posts: 5

Joined: Wednesday, 25th July 2012, 19:50

Post Monday, 25th August 2014, 17:14

Blood Splatters?

Call me sadistic, buuuut I really want to increase the amount of times enemies leave a gore splatter on the wall or floor?

I just like how the tiles look and feel like enemies would generally leave gore around anyway. The fact that they sometimes don't leave corpses makes sense. I mean if you beat up something enough there might not be much of a corpse, but everything bleeds.

I'm not a coder so please excuse my ignorance.

Thanks :)

For this message the author Samscale1 has received thanks:
Neon

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Monday, 25th August 2014, 18:05

Re: Blood Splatters?

I'm no expert, but bloodspatter.cc may be a good place to start.

Temple Termagant

Posts: 5

Joined: Wednesday, 25th July 2012, 19:50

Post Monday, 25th August 2014, 18:22

Re: Blood Splatters?

BlackSheep wrote:I'm no expert, but bloodspatter.cc may be a good place to start.


Will I need to compile it? Cant find that in the files anywhere, maybe Im just missing it?

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Monday, 25th August 2014, 18:32

Re: Blood Splatters?

Yes, there are no config file options to let you increase blood spatters so you'd need to edit the game code and compile it.
(I assumed you knew that since you posted in the Coding forum.)

Temple Termagant

Posts: 5

Joined: Wednesday, 25th July 2012, 19:50

Post Monday, 25th August 2014, 18:34

Re: Blood Splatters?

I assumed it was in the code, but I didn't realise it would require total compilation (I'm really not a coder)

So no idea how to compile or even open the .tar file i just downloaded

EDIT: Can someone talk me through exactly how to compile and edit? I don't understand the INSTALL.txt
Or can some kind sir or madame edit it for me?

Lair Larrikin

Posts: 25

Joined: Saturday, 26th July 2014, 22:01

Post Monday, 25th August 2014, 21:56

Re: Blood Splatters?

I did make the game bloodier, so here is a short how to:
I assume you are on windows.
Do the first two steps from install.txt, Building on Windows(Mingw) part.(download msys, install it and open it)
Msys is here:http://msysgit.github.io/ don't click the blue download button, scroll down the page and click the silver Download msysGit.

After you open msysgit, do this:
1.type git clone git://gitorious.org/crawl/crawl.git
2.type cd crawl
3.type git submodule update --init

Now we have source code, it's time to edit it and compile. Don't close msysgit.
Crawl source code should be in C:\msysgit\crawl\crawl-ref\source.
Open bloodspatter.cc in your favourite text editor. If you don't have a favourite text editor, open it in notepad.
Find this block of code:
  Code:
static void _maybe_bloodify_square(const coord_def& where, int amount,
                                   bool spatter = false,
                                   bool smell_alert = true,
                                   const coord_def& from = INVALID_COORD,
                                   const bool old_blood = false)
{
    if (amount < 1)
        return;

    bool may_bleed = allow_bleeding_on_square(where);

    bool ignite_blood = player_mutation_level(MUT_IGNITE_BLOOD)
    && you.see_cell(where);

    if (ignite_blood)
        amount *= 2;

    if (x_chance_in_y(amount, 20))
    {
        dprf("might bleed now; square: (%d, %d); amount = %d",
             where.x, where.y, amount);
        if (may_bleed)
        {
            env.pgrid(where) |= FPROP_BLOODY;
            _orient_wall_blood(where, from, old_blood);

            if (ignite_blood
                && !cell_is_solid(where)
                && env.cgrid(where) == EMPTY_CLOUD)
            {
                place_cloud(CLOUD_FIRE, where, 5 + random2(6), &you);
            }
        }

        // The blood spilled can be detected via blood scent even if the
        // spot it would fall is prevented from becoming bloodied (for
        // example, because it is water)
        if (smell_alert && in_bounds(where))
            blood_smell(12, where);

        if (spatter)
        {
            // Smaller chance of spattering surrounding squares.
            for (adjacent_iterator ai(where); ai; ++ai)
            {
                _maybe_bloodify_square(*ai, amount/15, false, true, from,
                                       old_blood);
            }
        }
    }
}


And edit it to this:
  Code:
static void _maybe_bloodify_square(const coord_def& where, int amount,
                                   bool spatter = false,
                                   bool smell_alert = true,
                                   const coord_def& from = INVALID_COORD,
                                   const bool old_blood = false)
{
    if (amount < 1)
        return;

    bool may_bleed = allow_bleeding_on_square(where);

    bool ignite_blood = player_mutation_level(MUT_IGNITE_BLOOD)
    && you.see_cell(where);
   amount*=100;

    if (ignite_blood)
        amount *= 2;

    if (x_chance_in_y(amount, 5))
    {
        dprf("might bleed now; square: (%d, %d); amount = %d",
             where.x, where.y, amount);
        if (may_bleed)
        {
            env.pgrid(where) |= FPROP_BLOODY;
            _orient_wall_blood(where, from, old_blood);

            if (ignite_blood
                && !cell_is_solid(where)
                && env.cgrid(where) == EMPTY_CLOUD)
            {
                place_cloud(CLOUD_FIRE, where, 5 + random2(6), &you);
            }
        }

        // The blood spilled can be detected via blood scent even if the
        // spot it would fall is prevented from becoming bloodied (for
        // example, because it is water)
        if (smell_alert && in_bounds(where))
            blood_smell(12, where);

        if (spatter)
        {
            // Smaller chance of spattering surrounding squares.
            for (adjacent_iterator ai(where); ai; ++ai)
            {
                _maybe_bloodify_square(*ai, amount/15, false, true, from,
                                       old_blood);
            }
        }
    }
}

There are only two changes: I added this line amount*=100; and changed
if (x_chance_in_y(amount, 20))
to if (x_chance_in_y(amount, 5)).
Save modified bloodspatter.cc

Now get back to msys.
1.type cd crawl-ref
2.type cd source
3.type make build-windows
4.wait
5.in C:\msysgit\crawl\crawl-ref\source\build-win is your bloodier crawl.
To get more blood experiment a bit, try amount*=1000 for example. If you have any more problems, ask.

For this message the author lrvs has received thanks: 2
dranichekk, Samscale1

Temple Termagant

Posts: 5

Joined: Wednesday, 25th July 2012, 19:50

Post Tuesday, 26th August 2014, 20:25

Re: Blood Splatters?

Hiya, thanks for the help, but I keep getting errors when i try to make build-windows.

I got an error with the update submodule --init too.

Help?

EDIT: Fixed it

Thank you :)

Return to Coding

Who is online

Users browsing this forum: No registered users and 6 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.