[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Impacts in water using darkplaces

Impacts in water using darkplaces

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Impacts in water using darkplaces

Postby Nahuel » Sun Nov 13, 2011 9:21 pm

Hello forum!, I've been doing a pack of materials for the impacts according to the texture. But I have a question: is there any way to know that a Traceline touches the liquid via qc?
I just want to hit bullets into the water and there put a sprite or particles. But the bullet continue his career once touch the water. Is there any way to do this? I am using darkplaces, thanks in advance:)
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Impacts in water using darkplaces

Postby Alex » Mon Nov 14, 2011 7:56 am

I don't know if this helps, but you could use

if (trace_inwater) {

You could also try using an actual projectile (like a spike or missile) moving at very high velocity instead of a traceline (note: to do this I think you have to alter sv_maxspeed or something like that). That way you might be able to detect something like..

if ((projectile.flags) == FL_INWATER) {
WaterSplash();
}

Using an actual projectile can also be cool because you can create bullet drop at extreme distances. Just an idea anyway.

Alex
Alex
 
Posts: 24
Joined: Sun Feb 13, 2011 6:24 pm

Re: Impacts in water using darkplaces

Postby Seven » Mon Nov 14, 2011 1:42 pm

Dear Nahuel,

There is this tutorial from Tux:
http://inside3d.com/showtutorial.php?id=15

He uses "pointcontens" to check for water and spawns a splash (as impact).
You could extend this for different materials / textures of course.

Maybe this helps you.
Best wishes my friend.
Seven.
Last edited by Seven on Mon Nov 14, 2011 3:41 pm, edited 1 time in total.
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: Impacts in water using darkplaces

Postby Qrv » Mon Nov 14, 2011 2:03 pm

Far as I understand it, that tutorial works for entities, you'd need to create a dummy entity for hitscan weapons like the Shotguns.

Imagine if you will, you fire the shotgun, normal hitscan bullets do their thing, but you also spawn a single nail spike in the fireshotgun routine, if using darkplaces, (and maybe other engines, i dunno) you can set this nail spike to be invisible easily using .alpha, or maybe even EF_NODRAW (the nail spike wouldnt need to be sent to clients as an entity, as we only care for the point where it intersects the water brush for spawning the splash effect.)
( This concept is a combination of the tutorial posted by seven ofcourse, along with Alex's idea. )

Could you not also use Alex's idea, and use traceline(), check if trace_inwater == true, then use the traceline_endpos and travel back along the trace'd line, till your pointcontents() say your out of the water, maybe do it in decent size steps the first pass, then small steps to find a more exact position of the intersection of the waterbrush?

That tutorial + spawning an extra projectile for hitscan weapons just *sounds* slow and heavy, compared to doing a couple of extra tracelines, but I could easily be wrong.
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
Qrv
 
Posts: 45
Joined: Thu Oct 20, 2011 7:43 am
Location: Stuck in a Slipgate.

Re: Impacts in water using darkplaces

Postby Spike » Mon Nov 14, 2011 3:07 pm

it would be possible to mod the engine such that water leafs block traces as solid leafs do, as well as have empty leafs block traces (so you can do splashes when shooting out of water too).

note that dp has a .float dphitcontentsmask; field somewhere, which you can temporarily set to DP-specific content-mask value to achieve something like Q2 has, which is quite hacky and won't work properly on the e4 puddle on start.bsp, and will likely misbehave in teleporters too.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Impacts in water using darkplaces

Postby Qrv » Mon Nov 14, 2011 3:31 pm

I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
Qrv
 
Posts: 45
Joined: Thu Oct 20, 2011 7:43 am
Location: Stuck in a Slipgate.

Re: Impacts in water using darkplaces

Postby Nahuel » Mon Nov 14, 2011 5:18 pm

[quote="Qrv"][/quote]
Thank you!! Very nice work!! I just add some pointparticles!!!
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Impacts in water using darkplaces

Postby Qrv » Mon Nov 14, 2011 5:21 pm

Hey, no prob buddy.

You'l obviously need to re-work that QC some, to support other entities/weapons. Maybe even make a simplified manager for entities to track them hitting liquids.
Something else you'l need to edit there, mine only checks for pure WATER, not LAVA, SLIME, But yeah, have fun with it. ;)
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
Qrv
 
Posts: 45
Joined: Thu Oct 20, 2011 7:43 am
Location: Stuck in a Slipgate.

Re: Impacts in water using darkplaces

Postby Seven » Sat Nov 19, 2011 6:33 pm

Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: Impacts in water using darkplaces

Postby Seven » Sat Nov 19, 2011 6:58 pm

Update to my above post.

I realized what my mistake was... :roll:
Either I must use greater multipliers for "v_right" and "v_up" ("12" looks good),
or use standard vectors instead (like '5 -5 0'. Together with a good random routine)

But regarding the second question, I would be happy if someone could drop a line.

Thank you.
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: Impacts in water using darkplaces

Postby Qrv » Sat Nov 19, 2011 9:43 pm

I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
Qrv
 
Posts: 45
Joined: Thu Oct 20, 2011 7:43 am
Location: Stuck in a Slipgate.

Re: Impacts in water using darkplaces

Postby Seven » Sun Nov 20, 2011 1:55 pm

Hello Qrv,

Moving the call for W_BulletSpash into the loop of FireBullets() function worked.
That really saved a few lines of code, cause the random spread calculation must not be done twice.

Unfortunately the sound "h2ohit.wav" cannot be called from QC. It simply doesnt work (at least for me).
I had to duplicate it, rename it to whatever (i used "watersplash.wav") and then call it the usual way.
That worked.

In the end, I want to say: Thank you.
Your shotgun bullet code works flawlessly parallel to Tux´s entity watersplash code.
I could not hold off to post a small clip of both features (I hope you dont mind).
This is really an enhancement to Quake.

http://www.youtube.com/watch?v=_N-BEJJ7T30
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: Impacts in water using darkplaces

Postby Qrv » Sun Nov 20, 2011 2:39 pm

Actually, I think I prob typo'd lol.

try h2ohit1.wav, or better yet, open the original iD pak's, and look in the sound folders yourself.

Also, after watching your video, what your splash needs is a ripple ring.

I dont have time now to look into making one myself, but you basically just need a square ripple texture, that aligns itself to the water, and have it scale its size up, so you get a fake ripple effect going on, if you know what I mean.

Dont forget to sling me some credits if you do use that mess of code, just a comment in the qc would be nice. :D
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
Qrv
 
Posts: 45
Joined: Thu Oct 20, 2011 7:43 am
Location: Stuck in a Slipgate.

Re: Impacts in water using darkplaces

Postby WickedShell » Sun Nov 20, 2011 6:58 pm

For shit's and giggles, I'd thought I'd add that all of those water splash entities could be done in CSQC to save the server from having to send out one as one entity, with just the origin, the baseline angle for the shot, and a seed for the random number generator. That makes it a single splash entity that gets networked once, rather then many entity's being added, keeps the load off the server, and since it's all pretty graphics effects, not gameplay there's no reason the server needs to know about it.

The seeded random number generator is optional, but nice because you can then have each bullet splash be at precisely where the bullet actually ended on the server, (because you can sync the seed values and calls to your RNG so that the same values pop out. The accuracy this offers you is probably not needed for a graphics effect, although it will be more noticeable if you have trail's from your projectiles.

If I'm missing something, lemme know (I've done CSQC work for maybe 2 days now), but I believe the theory is solid.
WickedShell
 
Posts: 24
Joined: Mon Feb 14, 2011 5:16 am

Re: Impacts in water using darkplaces

Postby Qrv » Sun Nov 20, 2011 7:09 pm

I've not looked into CSQC at all yet, but I've been reading bits about it here and there, from what I understand, yes, most of this splash effect could be moved to CSQC, and would indeed probably be better.

As I've not looked into CSQC much yet, if anyone could prehaps show a method of porting whats need of my code, over to CSQC, I'd be very grateful.
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
Qrv
 
Posts: 45
Joined: Thu Oct 20, 2011 7:43 am
Location: Stuck in a Slipgate.

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 3 guests