This thread generates so much hype.
Computing the unsigned curvature at an arbitrary time t for a planar Bézier curve with n = N-1 (because of the points being indexed from 0) control points:
Curvature(t)
// This returns the scalar curvature on the curve at time t. This is computed as
//
// k(t) = ||Bézier'(t) x Bézier''(t)|| / ||Bézier'(t)||**3
//
// where x denotes the cross product. Even though this is a plane curve, for the
// purposes of this method, when computing the cross product we treat the points
// as though they are embedded on the Z-plane of an XYZ-space. That is, the X and
// Y components can vary as needed but Z is fixed to zero.

var
// First derivative of Bézier(x) with respect to x, at time t.
dx = 0
dy = 0

// Second derivative of Bézier(x) with respect to x, at time t.
dx2 = 0
dy2 = 0

list/Data = TransformPointCache ? TransformPointCache : Points
N = Length()

if(N == 2)
// If N == 2 (N < 2 is not allowed) then the Bézier curve is simply a line,
// and thus has curvature zero.
return 0

if(t == 0)
// Simplifications we can make when t == 0.

dx = (N-1) * (Data[3] - Data[1])
dy = (N-1) * (Data[4] - Data[2])

// Bézier''(x) can be simplified to this.
dx2 = (N-1)*(N-2) * (Data[5] - 2*Data[3] + Data[1])
dy2 = (N-1)*(N-2) * (Data[6] - 2*Data[4] + Data[2])

else if(t == 1)
// Similar to above, but when t == 1.

dx = (N-1) * (Data[Data.len-1] - Data[Data.len-3])
dy = (N-1) * (Data[Data.len ] - Data[Data.len-2])

dx2 = (N-1)*(N-2) * (Data[Data.len-1] - 2*Data[Data.len-3] + Data[Data.len-5])
dy2 = (N-1)*(N-2) * (Data[Data.len ] - 2*Data[Data.len-2] + Data[Data.len-4])

else
// For the rest, we'll compute the first and second derivatives using the following
// formulas, where b(n,k) = Choose(n,k) t**k * (1-t)**(n-k) and P(n) denotes the nth
// control point.
//
// Bézier'(t) = n * Sum( b(n-1,k) * (P(k+1) - P(k)) ) from k = 0 to n-1.
// Bézier''(t) = n*(n-1) * Sum( b(n-2,k) * (P(k+2) - 2*P(k+1) + P(k)) ) from k = 0 to n-2.

BinomialCache = new
BinomialCache.len = N

var
dt_coefficient
dt2_coefficient

// Coordinates for the point P(k).
P0_x = Data[1]
P0_y = Data[2]

// Coordinates for the point P(k+1).
P1_x = Data[3]
P1_y = Data[4]

// Coordinates for the point P(k+2)
P2_x = Data[5]
P2_y = Data[6]

q = 1
r = (1-t)**(N-2)

for(var/k = 0, k < (N-1), k ++)
// Computing the sum for Bézier'(t)

dt_coefficient = (N-1) * _Choose(N-2,k) * q*r
dx += dt_coefficient * (P1_x - P0_x)
dy += dt_coefficient * (P1_y - P0_y)

// This must be done before Bézier''(t), because it has the value that
// Bezier'(t) will have on the next iteration.
r /= (1-t)

if(k < (N-2))
// And for Bézier''(t).

dt2_coefficient = (N-1)*(N-2) * _Choose(N-3,k) * q*r
dx2 += dt2_coefficient * (P2_x - 2*P1_x + P0_x)
dy2 += dt2_coefficient * (P2_y - 2*P1_y + P0_y)

// Shift P0, P1, and P2 appropriately.

P0_x = P1_x
P0_y = P1_y

P1_x = P2_x
P1_y = P2_y

if(k < (N-3))
P2_x = Data[2*k+7]
P2_y = Data[2*k+8]

// Both Bézier' and Bézier'' share the same value for q at each step, so this
// must be done last.
q *= t

BinomialCache = null

// Because A x B is perpendicular to both A and B, it's guaranteed that Bézier' x Bézier''
// will lie entirely on the Z axis, as Bézier(t) lies entirely on the XY-plane. Thus, we
// can simply compute the Z coordinate and take its absolute value in order to gets
// its length.
. = abs(dx*dy2 - dx2*dy)

// And this is |Bézier'(t)|.
var/denom = sqrt(dx*dx + dy*dy)
return . / (denom*denom*denom)

The curvature of some curve f with parameter t is intuitive how "curvy" f is at the point t. For example, a line has 0 curvature everywhere, because it's not curvy at all. On the other hand, a circle has a constant curvature, because everywhere it's just as "curvy" as everywhere else. Furthermore, the larger a circle's radius is, the smaller it's curvature (specifically, it's curvature is 1/r where r is the radius). Intuitively, this is because as you blow up a circle's radius, it becomes closer and closer to a line at any given point on the circle (and, in fact, there are certain geometries where you can treat a line as a circle with infinite radius).

For what this is doing, it's fairly-efficient, and it gets me a good bit of the way to having adaptive Bézier curves, which I've been wanting to do. I also added Derivative() and Bezier() methods, which give the pointwise parametric derivative (I.e., if B(t) = (B0(t), B1(t)) then B'(t) = (B0'(t), B1'(t))) and the value of B at an arbitrary time t, respectively. I'll put this up today, and then proceed with work on the adaptive Bézier curve and put that up when I have it done.


Made the base shape for axe auras and added dodge rolls. (Pondering whether or not it'll be set as a class skill)
I feel like dodge rolls should be an all class ability and allow to dodge damage that way.
In response to Lavenblade
Lavenblade wrote:
I feel like dodge rolls should be an all class ability and allow to dodge damage that way.

It does avoid damage. I don't like the idea of a fragile wizard being agile enough to roll, though or even an armor wearing fighter. If anything, I think I'll give class specific defenses just to have differing game-play.

EDIT Last update because work:

More hats! I have even more, bit I'll have to add them later.
I think a unique way to avoid damage for each class would work. Maybe a roll for someone in leather, some shielding ability for a plate user, and a teleport ability for a wizard.
In response to Lavenblade
And version 1.1.20160422 of pif_BezierCurve is now available, if anyone is interested.
In response to Lavenblade
Sooo

Roll for the assassin/thief/bandit/marauder/archer/berserker/badass

Hiding behind a shield for the knight/captainamerica/paladin/dragoon/tank

bs teleporting around for the
mage/wizard/warlok/witch/vampire/alchemist/priest/pope

Seems fair 8).

In response to Ghost of ET
Yeah, they should totes have a blink instead.

Teleport would be a short range blink basically. Cooldowns can help balance.
In response to Bl4ck Adam
Lavenblade wrote:
I don't like the idea of a fragile wizard being agile enough to roll, though or even an armor wearing fighter.

Give roll another element of speed so your most agile fighters will roll faster than someone bulky or fragile.

A ninja would be able to quickly roll out of damage, while an armor-wearing knight would take a bit longer to complete the roll, thus avoiding damage but not as easily as the ninja. Would make the player think carefully whether to roll or not based on the specific class being played.



Only thing missing is the broken shell of the core, strewn across the ground after the fight, which I'm going to work on today. I wanted to show this off before I did that though.

Also, get hyped for 200 pages on this thread!
In response to Bravo1
Bravo1 wrote:
Also, get hyped for 200 pages on this thread!

Much kudos to Doohl and the developers posting for the thread and it's hype that it's brought. I think there's been a slight significant incline in development motivation from the community because of this thread alone.
In response to Bravo1
Idea: Maybe show pieces breaking off during the fight, exposing bits of wiring and such. Seeing visible damage will makee it more immersive.
In response to Lummox JR
Lummox JR wrote:
Idea: Maybe show pieces breaking off during the fight, exposing bits of wiring and such. Seeing visible damage will makee it more immersive.

Definitely, I'm planning to have openings form on the outer shell which smoke will billow out of.
In response to Lavenblade
Lavenblade wrote:
Teleport would be a short range blink basically. Cooldowns can help balance.

I was doing a joke on a literal blink, but I know. Lol
And now pif_LongInt is available on GitHub, if anyone wanted to muck around with it or view the source code without downloading it. I did the same with pif_BezierCurve but didn't mention it here. I'll probably just put all my libraries up on GitHub as I start updating them, because why not?
Just thought of this for a boss fight:

Sentient robo swords which fly around the room and attack you. Starts with five and the attack patterns change every time one of them is destroyed, becoming more and more difficult to defeat.
In response to Bravo1
Bravo1 wrote:
Just thought of this for a boss fight:

Sentient robo swords which fly around the room and attack you. Starts with five and the attack patterns change every time one of them is destroyed, becoming more and more difficult to defeat.

Bring them together for the occasional gigantor swing for epic damage.

Page: 1 2 3 ... 187 188 189 190 191 ... 349 350 351