Microsoft Powerpoint - [learn_about_the_90s.ppt]

 

Everything I know about games I learned from the 90s

me

  • digitalicarus in cyberspace, Adam Horton in meatspace
  • Native Oklahoman
  • Raised on Nintendo
  • Hacking enthusiast/amateur
  • Engineer / web developer by day
  • I play the vidya games

Prologue

  • Why the 90s? New millennium not extreme enough?!

  • A system fraught with limits

  • Magick, lore, wisdom

  • Casting some spells

  • Oddities - you can't do this with that!

Awkward Ubiquity

x86 was a limited platform borne out of business machines... but it was EVERYWHERE

Why the 90s?

Novel Distribution

Shareware - a new distribution model

1GAM IRC

Why the 90s?

Opening the Guild

Programming is not a zero-sum game. Teaching something to a fellow programmer doesn't take it away from you. ~ John Carmack's forward in Michael Abrash's Graphics Programming Black Book
The architecture of Quake, and most of the technology discussed in these articles, is the creation of John Carmack. John, I figure that making this freely available is the form of "thank-you" that would mean the most to you. ~Michael Abrash on open sourcing the Black Book
Working with John was like the sequence in "The Matrix" where Neo has one martial art after another pumped into his brain. ~ Michael Abrash http://blogs.valvesoftware.com/abrash/valve-how-i-got-here-what-its-like-and-what-im-doing-2/
... if knowledge is power, then anyone who restricts your access to the information you need to create a high-quality game is really restricting your power and ability to create your vision. ~Mark DeLoura Game Programming Gems Vol 3

Carmack + abrash

Why the 90s?

Limitation Breeds Creativity

It doesn't matter what technologies you choose. Every tech has pros and cons. You can build the same thing and acheive the same outcome using different tools if you know the tools and how to use them. -Jacky (sencha)

A system fraught with limits

Games, ah... uh... find a way

A system fraught with limits

pdp-1 1962, Tennis for 2 Donner Model 3 1958 analog

Games, ah... uh... find a way

A system fraught with limits

pdp-10 1975

Games, ah... uh... find a way

A system fraught with limits

ti-89 series introduced in 1998

Games, ah... uh... find a way

A system fraught with limits

lotus 123, IBM PC first "killer app" - 1983 PC/DOS games sucked compared to computers aimed at consumers (amiga, atari, MSX, etc)

Games, ah... uh... find a way


A system fraught with limits

Tomes of great power







Magick, lore, wisdom

Midpoint Displacement

Magick, lore, wisdom

Midpoint Displacement


Lunar Lander - Atari 1979

Casting some spells

Learnin' from the Lander

  • Read = know, Code = grok; Grok > Know
  • There's the first 90% and the second 90%
  • Most learning happens in second 90%
  • Finishing small things completely more times > few large things?
Grok - stranger in a strange land - Heinlein 1961. Understand so thoroughly observer becomes the observed. Becomes part of identity.

Casting some spells

Raycasting

Magick, lore, wisdom

Raycasting - casting a ray (Permadi)

  1. find first horizontal grid intersection by solving the triangle
  2. figure out if going up||down (down is +!)
  3. check first horiz grid for hit, keep incrementing until hit or out of bounds
  4. repeat above for vertical intersections, but sideways :)
  5. horizHitDist < vertHitDist?
  6. mark hit tile and texture offset

Casting some spells

Raycasting - cast data


var rayInfo = [{
	dist: 42, // the ray distance
	horizHit: true,
	vertHit: false,
	horizDist: 42,
	vertDist: Infinity // or undefined?
	tile: 3,
	offset: 12, // which vertical strip of texture to sample
}];
					

Casting some spells

Raycasting - cast sweep

var fov       = deg2rad(60)
,   numstrips = xres / stripwidth
,   numrays   = numstrips
,   rayincr   = fovrad / numstrips
;

// cast rays
for (i = player.angle - fovrad/2; i < player.angle + fovrad/2; i += rayincr) {
	rayInfo.push(cast(player.pos, i));
}

// draw
ctx.lineWidth = stripWidth;
for (i = 0; i < numStrips; i++) {
	ctx.beginPath();
	ctx.moveTo(
		i * stripwidth, // x position
		(yres/2) - (rayInfo[i].dist*scalefactor/2), // canvas center - 1/2 strip height
	);

	ctx.lineTo(
		i * stripwidth,
		(yres/2) + (rayInfo[i].dist*scalefactor/2), // canvas center + 1/2 strip height
	);
	ctx.stroke();
	ctx.endPath();
}

Casting some spells

Concludin' from the Caster

  • Use the timeline/profiler luke (stay on target - lose porkins)
  • Var'ing 120*2*60 per second is expensive :)
  • Performance computing is an exercise in cacheing
  • try/catch isn't so expensive - always running code is
  • Really high performance JS looks kinda like C, makes Crockford ಠ_ಠ
  • Hinting high perf code cuts like a knife, but it still feels so right
  • Raycasting isn't just for display (other vision, audio)
trivia
Coerce to boolean:   !!var
Truncate to integer: ~~, |, >>0
Capitalize:          str.charAt(0).toUpperCase() + str.slice(1)

Casting some spells

Detours - yes, have some

  • Apple Floppy Copy
  • Evercookie
  • Pointer arithmetic for mathematics - Abrash
  • clippy.js "We built clippy.js over the weekend to remind people to try risky and silly things"
Try weird stuff!

Oddities - you can't do this with that!

Epilogue

  • Assume nothing - measure
  • Know your toolkit (links!)
  • Study the lore and artifacts of the past
    • Read old books
    • Play old games (System Shock, Thief, Quake, Deus Ex)
    • Repeat old experiments
  • Use tools for unintended purposes (what does this really do?)
  • Do things for fun or just to see if you can
- nothing is holy, nothing is scripture - make with the web, not for the web - try random shit - respect the past. Stop bashing C, Java, Perl, etc.

Acknowledgement