Thursday, April 17, 2008

Game construction 04-17

The professor just totally said, "Oh, I just had lunch with the founder of Bungie, he might come in and talk sometime." I mean, he did graduate from here. But still.

And now he's pimping Audacity (again) and Sketch-Up.

Naaaaame drop central.

What did I have for lunch? Gyros.

(For the record, I took paper notes on Tuesday -out of battery- and missed class last Thursday. Whoops.)

For maps: consider using heightmaps.

I'm kind of worried that most of my group seems to be missing today.

The track format are the "bones, not the skin": we can render the view how we like.

Convention: xz plane is ground: x is to the right, z is backwards, y is up

Higher level AI makes decisions; lower level AI interprets those decisions as movements.

Tuesday, April 8, 2008

I wonder who is reading this over my shoulder

It proves impossible to type notes for Computational Models of Speech, there are too many squiggly lines, too many omegas, too much supertext. So much for that.

Basic physics engine (second milestone) doesn't have to be fancy, "bells and whistles" can be added later. Updating state iteratively with accelerations, rotations, positions, et cetera. First-level behaviors, basically.

First milestone ( design document ) pushed back one class. Is the second (physics) also pushed back? His answer is unclear.

physics takes a state and a control, returns a state.

Steering Behaviors:

seek (target)
v = target.pos - self.pos
return (maxAccel * normalized(v), 0)

path following
t = pathParamClosest (self.pos)
targetPos = path(t +Dt)
seek targetPos

predictive path following
find where your headed
find the point on the path closest to that
aim for that instead
that is
targetPos = self.pos + Dt * velocity
param = pathParamClosest (target.pos)
seek (param)

He just said "Catmull-Rom Splines" again.

Approaches to steering:

eg. "arriving" steering

Weighted Blending
weights associated with steering behaviors
w.i , s.i
s = sum.i(w.i * s.i(target))
but situations exist where weights can balance out

separation (not too close to neighbors)
cohesion (not too far away from neighbors)
alignment (with the velocity and direction of the flock)

Priority Based Combination
blended groups ordered by priority
find the highest priority behavior that provides "meaningful steering"
(high, collision avoidance)
(med, enemy avoidance)
(low, path following)

game construction 04-03

mailing list: cmsc23800@

First milestone: design document - get in a group - be thinking about gameplay
read chapter 3.1

Aside: Man, I wish I'd been here for the first class.

AI has to figure out where to go
then, pathfinding
these are high-level issues
"physics" of movement - position, orientation
"graphics" of movement - how is movement displayed

Aside: How could one of two roads be both longer AND straighter?

Low-level AI:
responsible for issuing commands to physics engine
avoid obstacles

State of a character:
position - vector (3) (y is up)
direction - float (angle, but a 2-vector could also be used, or even 3)

Kinematics: movements without forces
velocity - vec3 (y=0)
rotation - float

NB: It's important to make things relative to time rather than, say, frames.

Update (Dt):
pos += Dt * velocity
dir += Dt * rotation

Update` (Dt, linearAccel, angularAccel):
pos += Dt * velocity + .5 * linearAccel * Dt^2
dir += Dt * rotation + .5 * angularAccel * Dt^2
velocity += linearAccel * Dt
rotation += angularAccel * Dt

in practice, if updating happens often enough, we can leave off the second half of the first two

Aside: Dude is totally reading Dinosaur Comics in class.

NB: Want to keep graphics separate from mechanics as much as possible - graphics doesn't need to know the state of the whole world, or even necessarily the whole of the visible world.

Aside: Hm, is the Wii multiprocessor? Answer: Doesn't look like it.

Kinematic Movement: Given a state, change velocity and direction to achieve some goal.
match (state, goal)
seek : attempts to match position
set velocity = maxSpeed * normalize(target.pos - self.pos)
flee : attempt to get as far away as possible from target

Steering Behaviors:
produce accelerations
arrive: like seek, but without overshooting
define two radii
target radius
slowdawn radius
d = distance to target
if d < r(t) then done
elif d < r(s) then slowdown()
else seek()

Aside: "Catmull-Rom Spline" just sounds so ridiculous. Also, I'm starting to get huuungry.

Tuesday, April 1, 2008

A lesson:

"Leave as late as possible" may not be the most effective heuristic. Consider changing to "leave as soon as possible", or one of the other alternatives for second day of class.