Pseudo-3D Blood Splatter

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
0x29a
Prole
Posts: 27
Joined: Sun Jul 06, 2014 10:22 pm

Pseudo-3D Blood Splatter

Post by 0x29a »

How do I achieve it?
Stuff below is VERY conceptual. No ready code, no *love file.
I would just l◌̈ve it if You guys could point me in the right direction.
All I need is functions names, links for libraries, or just plain ideas on how would You do that.

So...

There is a wall drawn in a 2.5D, top-down perspective, with a collision-box on top of it.
Hero shoots towards the enemy.
When a bullet hits an enemy, it passes right through it in "invisible" mode.
If it hits the wall collision-box after, lets say, 30 pixels or so, it adds a blood-splatter texture on its x and y hit coordinates.
Now:
I want to crop, resize, rotate etc. parts of blood-splash texture that are within wall bounding box, so it would fit a wall picture.
No solid stuff - everything should be calculated on-the-run, so the angle of blood texture would correspond to the bullet angle.

Is it even possible?

Thanks in advance!
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Pseudo-3D Blood Splatter

Post by Jasoco »

It's possible. How it's implemented though depends on how you code your game. You might need to use canvases. You might not. We can't tell until you have something coded.

For example, I was coding a Wolfenstein style raycasting engine once and had planned on having bullet holes and blood splatters on the walls, ceilings and floors by using a whole bunch of canvases. I had planned on making one canvas for each individual wall and would draw blood or holes on the proper wall segment or floor or ceiling canvases in real-time as the game was played. I never finished the project, but as long as the GPU can support that many canvases, it'd be perfectly possible. In a 2D engine it'd be easier probably. We don't know what you plan on making though.
0x29a
Prole
Posts: 27
Joined: Sun Jul 06, 2014 10:22 pm

Re: Pseudo-3D Blood Splatter

Post by 0x29a »

Superb! Sounds exactly like what I need!

So... In a nutshell, all I would need is to have ready-on blood decals, drawn beforehand by my art-whiz, right?

Then, when a blood splatter occurs, all I need is to draw that decal on my canvas, and dimensions of that canvas would take care of cutting the image so it won't exceed it? Am I thinking the right way?

Btw. could you please post some tutorials you find worthwhile, especially ones that would teach me on how to make a trapezoid canvas?

Awesome! I'll dig in it right away, once I'll have sprites to play with.

P.S.
Love2d community is the best! Thanks for forbearance
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Pseudo-3D Blood Splatter

Post by Ref »

0x29a wrote: Btw. could you please post some tutorials you find worthwhile, especially ones that would teach me on how to make a trapezoid canvas?
And here I thought this was the LÖVE forum and not the Blood & Guts forum!

I think what you are looking for is a way to create a SIMULATED trapezoidal canvas.
0x29a
Prole
Posts: 27
Joined: Sun Jul 06, 2014 10:22 pm

Re: Pseudo-3D Blood Splatter

Post by 0x29a »

I apologize for my ignorance :)

But sure... Just how do I do that?

Also, I've searched through forums and I've found two things that seemed to be applicable at a first glance...
That is: meshes and image skewing.
The latter would require some crazy algorithm I cant think of right now...
And it looks like one cant apply many textures on one mesh, not mentioning x and y coordinates...

So far those simulated trapezoid canvases look most promising.
Last edited by 0x29a on Sat Aug 09, 2014 10:32 am, edited 1 time in total.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Pseudo-3D Blood Splatter

Post by Jasoco »

I'm still not sure what kind of game art style you're aiming for. Have you coded anything at all yet? Can you post an example screenshot of what you are trying to achieve?
0x29a
Prole
Posts: 27
Joined: Sun Jul 06, 2014 10:22 pm

Re: Pseudo-3D Blood Splatter

Post by 0x29a »

Hello there!
I don't really have no ready code - regarding my issue - yet.
So far there is just a guy walking around.
Give me a sec and I'll try to make a map with what I'm thinking of...
All right... Now a little gimpy....

So here it is: http://postimg.org/image/6l6wgydoj/
This is how it looks like today. No collision detection, no real enemies yet, graphics will get changed as well ;-)
And this is (kind of) effect I'm aiming at:
http://postimg.org/image/wexcxcrq7/
whereas the green blob represents (deceased) enemy and the red blobs are supposed to be decals.
I want to restrict decals that hit the wall just to this wall, specificly to the certain part of the wall, so they wont overlap on the floor and everything else. I want them to be drawn only in this restricted area. Also, I would need to have lots of such areas, as the hero can walk and shoot in 360 degrees.
Is that doable?
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 47 guests