1 / 15

Introduction to demo programming

Introduction to demo programming. Martti Nurmikari - Assembly’08. What is a demo?. Programmed, realtime demonstration that combines visuals and audio. What goes in a demo?. Effects (visuals in general) Interface to OS (windowing etc) Resources (images, meshes, shaders..)

lucky
Download Presentation

Introduction to demo programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to demo programming Martti Nurmikari - Assembly’08

  2. What is a demo? • Programmed, realtime demonstration that combines visuals and audio

  3. What goes in a demo? • Effects (visuals in general) • Interface to OS (windowing etc) • Resources (images, meshes, shaders..) • Timeline (what happens when) • Synchronization (visuals to music) • Utilities • Parameters / tweaking

  4. Which platform to choose? • DirectX • modern, Windows only • OpenGL • easy, partly outdated, all modern platforms • Oldskool (c64, MSX, homebrew) • Software rendering • own charm • kind of outdated

  5. The two schools of demomaking • “The Artist’s Way” • Programmer makes a tool that someone (usually artist) uses to make a demo • Big project • Fairlight, Farbrausch, Conspiracy, Still • “The Programmer’s Way” • Better to start out with • Programmer codes visuals • mfx/synesthetics, ASD, Traction..

  6. Some basic goals • Be smart! • learn your programming tools and languages (especially STL!) • Be sensible! • don’t overengineer, stick to simple solutions that work • Be lazy! • write good, reusable code • write systems, not bits of code

  7. Code structure • Keep code and data separate • Always think of reusability

  8. Interface to your operating system • Windowing, keyboard handling, boring stuff • SDL for OpenGL • DirectX SDK examples • Lots of audio libraries (FMOD, BASS) and image libraries (OpenIL, libjpeg, libpng) • Be lazy! • Other people have already written a lot of stuff you can use

  9. Utilities • Simple, small stuff like mathematics, file handling etc. • Primitive rendering/drawing (simple shapes like cubes etc, overlays/images) • Font system

  10. Resources • Do not handle them manually • too much work, easy to create bugs, difficult to share resources between effects • The Manager Pattern • one line of code to bind a texture, for example • easy to implement with a Map • one single point of all operations • good for debugging and tweaking

  11. Timeline • Thousands of lines of if statements..? • why not? • Base effect/scene class from which all other classes are inherited from • each object contains start time, end time, render priority • engine renders them automatically

  12. Synchronization • Triggers • Events • Beat calculation • FFT/audio data • Time in seconds / beat measures

  13. Parameters / tweaking • Some way of tweaking effect values while the demo is running • saves a lot of time and frustration • Read from a text file / XML for example • Play/Pause/Rewind/Reload/Reinit • Add a GUI and you’re halfway to a demotool...

  14. And last, but not least.. the Effects! • Concepts vs. Technology? • preferably both • Source codes to demos available • There is nothing special about demo effects • learn graphics programming properly (or improperly) and you too can make demos • “Sin and cos can build cathedrals”

  15. Question time! • #scenebooth @ IRCNet • I’m on IRC as elsewhere/elsewhere_, or you can mail me at syksyisin@gmail.com • come talk to me in person :) • http://in4k.untergrund.net for 4k intros • http://frontend.outtracks.net for a good example demo/game engine with source codes to demos as well.

More Related