programming aesthetics learned from making independent games april 1, 2011
TRANSCRIPT
![Page 1: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/1.jpg)
Programming Aestheticslearned from
making independent games
April 1, 2011
![Page 2: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/2.jpg)
![Page 3: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/3.jpg)
http://cloc.sourceforge.net v 1.53
--------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------
C++ 221 25736 8312 73223
C/C++ Header 239 3655 2029 9467
C 3 1046 2249 5986
HLSL 20 354 143 1287
...
--------------------------------------------------------------------
SUM: 488 30907 12746 90347
--------------------------------------------------------------------
Braid source code
![Page 4: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/4.jpg)
http://cloc.sourceforge.net v 1.53
--------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------
C++ 329 37708 14900 96822
C/C++ Header 331 5303 2221 12889
C 2 583 647 3883
HLSL 51 986 311 2458
...
--------------------------------------------------------------------
SUM: 720 44659 18095 116204
--------------------------------------------------------------------
The Witness source code
![Page 5: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/5.jpg)
“Industry Average”: 3250 lines/year
(90000 lines) / (3250 lines/year) ≈ 28 years
![Page 6: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/6.jpg)
512 MB RAM (you can’t use it all), no VM
3 slow in-order coresSlow file access
![Page 7: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/7.jpg)
Certification
Program can’t crash, even with antagonistic user
Loading time is capped
![Page 8: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/8.jpg)
Certification
“Soak Test”
3 days * 86400 sec/day * 60 frames/sec =
15,552,000 frames
If you leak 4 bytes per frame, you’ll fail.
![Page 9: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/9.jpg)
game designlevel designart direction
audio directionbusiness development
marketing / PRfinancial management
![Page 10: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/10.jpg)
be
extremely effective
at
getting things done
![Page 11: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/11.jpg)
… by the way …
![Page 12: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/12.jpg)
Impulses to optimize
are
usually premature.
![Page 13: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/13.jpg)
Most code is
not
performance-sensitive.
![Page 14: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/14.jpg)
Optimization is
usually bad!
(Unless practiced very carefully!)
![Page 15: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/15.jpg)
Data Structures
![Page 16: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/16.jpg)
Data structures are about optimization.
![Page 17: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/17.jpg)
“using the right data structure”
is usually bad!
(Because it is premature optimization!)
![Page 18: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/18.jpg)
![Page 19: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/19.jpg)
Now I use arrays of recordsfor almost everything.
![Page 20: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/20.jpg)
Things you might optimize
seconds per program execution (speed)
bytes per program execution (space)
![Page 21: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/21.jpg)
Instead, optimizing
years of my life per program implementation
(life)
This is a valid optimization parameter you can consider just
like those others!
![Page 22: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/22.jpg)
Data structures are about memory or speed
optimization.
They are not aboutlife optimization
(unless you absolutely need that speed or memory).
![Page 23: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/23.jpg)
Complicated Algorithms
are not good!
![Page 24: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/24.jpg)
Almost all applied CS research papers are bad
propose adding a lot of complexityfor a very marginal benefit
doesn’t work in all cases (limited inputs, robustness)
“supported” by bogus numbers, unfair comparisons
This isn’t fooling anyone any more…
![Page 25: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/25.jpg)
![Page 26: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/26.jpg)
A generalized system
is usually worse
than a specific / hardcoded one!
![Page 27: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/27.jpg)
Adding new systemsis bad!
This should only ever bea last resort.
deleting code >>> adding code
![Page 28: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/28.jpg)
Straight-line codepreferred over function
calls{
a = b + c;
a *= f(k);
a /= g(a);
print(a);
}
float
recompute () {
float a = b + c;
a *= f(k); a /= g(a);
return a;
}
{
recompute(a);
print(a);
}
{
{ // Update a.
a = b + c;
a *= f(k); a /= g(a);
}
print(a);
}
![Page 29: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/29.jpg)
What is a good programmer, then?
(in this context)
![Page 30: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/30.jpg)
gets things done quickly
gets things done robustly
makes things simple
finishes what he writes (for real)
broad knowledge of advanced ideas and techniques(but only uses them when genuinely helpful)
![Page 31: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/31.jpg)
it’s easy to see benefits of an idea
developed for benefit’s sake!
very hard to measure subtlenegatives chained to this idea
(which often outweigh the benefits)
![Page 32: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/32.jpg)
“knowing”
vs.
deeply, intuitively understanding
![Page 33: Programming Aesthetics learned from making independent games April 1, 2011](https://reader035.vdocuments.us/reader035/viewer/2022070323/56649d965503460f94a8015b/html5/thumbnails/33.jpg)