Blood on enemies/player

The place to discuss all things Lugaru.
Post Reply
fpsRF
Posts: 4
Joined: Wed Feb 27, 2008 9:54 am

Blood on enemies/player

Post by fpsRF » Wed Feb 27, 2008 10:05 am

I am also a game developer and i couldent help but be amased by the way you could practically draw on the charecters in the game with sharp weapons. I know this has to be some kind of feature built into the core of the engine.
It litterly looks like the weapon is a paint brush and the enemy is a canvas.
Can anyone explain how this feature works. I think it must be similar to the old n64 golden eye or the modern CS.Source.
In the engine i am working with, i can do little more then fake it by returning the name of the bone last collided with and change a piece of the texture to a bloodied up one. its not very precise and it honestly looks like crap.
so, do anyone think they might have a solution for me?
thanks,
fps

David
Project Leader
Posts: 1995
Joined: Wed Nov 19, 2003 10:45 pm
Contact:

Post by David » Wed Feb 27, 2008 11:33 am

In Lugaru each character has a copy of the usual fur texture, as well as a 'blood' texture (bloodfur.png) which has all of the different regions that can be made bloody in various ways. For most of the moves, such as the wolf's face slash, it looks up all the pixels in the bloodfur texture with a certain specific color value, and then adds that to the fur texture. For stabs and slashes it does the same thing but it first finds the intersection point between the weapon and the character, and then looks up the texture coordinates at that point, and then adds the mark there. After any cuts are added, blood drops are created that move slowly down the texture.

Image

fpsRF
Posts: 4
Joined: Wed Feb 27, 2008 9:54 am

Post by fpsRF » Wed Feb 27, 2008 11:44 am

ok, i now see how the collision works, but i still dont understand how you apply the new texture over the old one in the case of stabs and slashes.
how is it so smooth and precise?
the engine i am working with allows for multiple textures to be saves and swaped out in any one model also, but they cant be applied in any which way. they need to match the shape of the origional skin.


and as for the droplets of blood running down the body, that is just incredible.
can you actively run math functions on the texture to move the blood?
or is it faked?

David
Project Leader
Posts: 1995
Joined: Wed Nov 19, 2003 10:45 pm
Contact:

Post by David » Wed Feb 27, 2008 12:14 pm

The blood droplets move in the direction of gravity with some random perturbation to make it more interesting. I wrote my own engine so I can work with textures at a per-pixel level, so I can pretty much do any texture manipulations that you could do in Photoshop.

fpsRF
Posts: 4
Joined: Wed Feb 27, 2008 9:54 am

Post by fpsRF » Fri Feb 29, 2008 10:33 am

that is really awsome. the engine i am working with is open source so i might be able to try somthing like this, however i don't think it will be really easy.
I am taking a CS major in college so mabey one day i might be able to do this. I am not that advanced yet though.
Thanks for being so helpfull and so quick to reply. :)

also, your game is awsome.
i can't wait for the seccond one.

Post Reply