Mathlib v2
Moderator: InsideQC Admins
38 posts
• Page 2 of 3 • 1, 2, 3
http://tlb.circa1984.com/dev/mlx20.zip
Quake Archive Mirror
http://quake.errorabove.com/QuakeC/Weapons/mlx20.zip
Mathfrag Final.
Uses min, min3, max, max3, anglemod, randomvec, sqrt, pow.
Four weapons.
Piecemaker (replaces grenade launcher)
Mr. Smartypants (replaces super nailgun)
Ulysses DemiCannon (replaces supershotgun)
Forte Scale Blaster (replaces nailgun)
You can do whatever you want to with this Frik.
EDIT: above has been updated following the release of MathFrag Final. I'm not going to do any more on this, due to idea burnout.
Besides, I really should get back to Quake: Operation Hellsmash anyway.
Quake Archive Mirror
http://quake.errorabove.com/QuakeC/Weapons/mlx20.zip
Mathfrag Final.
Uses min, min3, max, max3, anglemod, randomvec, sqrt, pow.
Four weapons.
Piecemaker (replaces grenade launcher)
Mr. Smartypants (replaces super nailgun)
Ulysses DemiCannon (replaces supershotgun)
Forte Scale Blaster (replaces nailgun)
You can do whatever you want to with this Frik.
EDIT: above has been updated following the release of MathFrag Final. I'm not going to do any more on this, due to idea burnout.
Besides, I really should get back to Quake: Operation Hellsmash anyway.
Last edited by Dr. Shadowborg on Mon May 22, 2006 3:08 am, edited 2 times in total.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Hey cool DrShadowb0rg, I'll try it out later today. Though it would be cool if you could come up with some things using the more interesting match functions, sqrt, pow etc.
I stealithly uploaded a new mathlib yesterday, recheck the link from the first post.
I stealithly uploaded a new mathlib yesterday, recheck the link from the first post.
- FrikaC
- Site Admin
- Posts: 1026
- Joined: Fri Oct 08, 2004 11:19 pm
FrikaC wrote:Hey cool DrShadowb0rg, I'll try it out later today. Though it would be cool if you could come up with some things using the more interesting match functions, sqrt, pow etc.
I stealithly uploaded a new mathlib yesterday, recheck the link from the first post.
I'll see what I can think up, no guarantees though.
EDIT: Thought up two, they will be ready sometime tomorrow, day after at the latest.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Final version from me posted, see original post for ldownload and quick info.
Condiments and bug reports appreciated.
Condiments and bug reports appreciated.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
CheapAlert wrote:the reflecting rocks
no more abusing movetype_bounce + gravity 0!
Actually, the rebounding stuff doesn't use mathlib.qc functions. It's closer to the code that was used in scourge of armagon, only heavily modified to use a function I wrote called ReboVec. I haven't tested it yet, but in theory, ReboVec can even be used to provide richocet vectors for even hitscan type attacks.
Uses of mathlib.qc in the two new weapons:
sqrt: Used in the DemiCannon's damage calculation for direct hits.
pow: Used in the Forte Scale Blaster's damage calculation.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Is that why it has the same bug as SoA, where the rebound always gets forced closer to the normal than it should be, because you are doing out_vector = in_vector - (normal * 2) and instead you need to do out_vector = in_vector + (normal * (normal * in_vector) * 2) (Thanks to div0 for helping me to work this out)
Also, the spawn weapon feels far too strong, but that's somehting that can be sorted out by almost anyone
Also, the spawn weapon feels far too strong, but that's somehting that can be sorted out by almost anyone
-

Lardarse - Posts: 266
- Joined: Sat Nov 05, 2005 1:58 pm
- Location: Bristol, UK
Lardarse wrote:Is that why it has the same bug as SoA, where the rebound always gets forced closer to the normal than it should be, because you are doing out_vector = in_vector - (normal * 2) and instead you need to do out_vector = in_vector + (normal * (normal * in_vector) * 2) (Thanks to div0 for helping me to work this out)
Also, the spawn weapon feels far too strong, but that's somehting that can be sorted out by almost anyone
Actually, the formula I'm using is result = olddir+(2*trace_plane_normal) NOT result = olddir-(normal*2).
I tried the formula you posted, however, all it did was cause the deathball to not rebound proper. (i.e. it just kept rebounding into the wall, instead of away from it)
If what you mean by spawn weapon is the Forte Scale Blaster, well... It does need a bit of tweaking I suppose. Right now, it operates under a formula of 4 to the power of self.health/25 / 10. Which is rather ugly and amateurish really, but gets the job done. =P
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
I might have my + and - the wrong way around...
But the basic idea is: instead of just using the normal, you need to scale the normal by the dotproduct of the entry vector and the normal. That way you can do nice shallow bounces that will nearly always hit the enemy exactly where you planned, instead of it sharply kicking away almost perpendicular.
But the basic idea is: instead of just using the normal, you need to scale the normal by the dotproduct of the entry vector and the normal. That way you can do nice shallow bounces that will nearly always hit the enemy exactly where you planned, instead of it sharply kicking away almost perpendicular.
-

Lardarse - Posts: 266
- Joined: Sat Nov 05, 2005 1:58 pm
- Location: Bristol, UK
The correct formula is
out = 2N(N dot I) - I
but in that case I (incident vector) points the other way. (away from the plane)
So the formula you want is
out = 2N(N dot I) + I
Where I is velocity, N is trace_plane_normal. I don't think I has to be normalized...
The 2 can be changed to modify bounciness: 1 is no bounce (just slides off surfaces), 1.5 is half bounce (probably similar to Quake grenade), 2 is full bounce, >2 is actually picking up speed with each bounce
out = 2N(N dot I) - I
but in that case I (incident vector) points the other way. (away from the plane)
So the formula you want is
out = 2N(N dot I) + I
Where I is velocity, N is trace_plane_normal. I don't think I has to be normalized...
The 2 can be changed to modify bounciness: 1 is no bounce (just slides off surfaces), 1.5 is half bounce (probably similar to Quake grenade), 2 is full bounce, >2 is actually picking up speed with each bounce
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
Lardarse wrote:I might have my + and - the wrong way around...
But the basic idea is: instead of just using the normal, you need to scale the normal by the dotproduct of the entry vector and the normal. That way you can do nice shallow bounces that will nearly always hit the enemy exactly where you planned, instead of it sharply kicking away almost perpendicular.
Indeed, I'd figured that something like that might have happened, so I tried it just before reading your post here.
Silly me, I should have realized that was what happened immediatly, but I was kind of rushed, having to be somewhere at the time.
Anyway, it works good, so that'll be in the bugfixed version, which will come out sometime in the near future, barring anybody noticing any other bugs...
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
FrikaC wrote:I like the mod, but none of the weapons give that 'woah, math' feeling. I'll try to see if I can come up with an idea that does..
True enough. It's pretty hard to come up with something that does though.
In any event, it was pretty much intended as just a quickie example mod, you might say my half-assed attempt to try and help promote mathlib.qc so that it wouldn't get shoved aside and forgotten like it did when it first came out a couple of years ago.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
38 posts
• Page 2 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 1 guest