Developing Tools for Indie Games Marc Flury Co-Founder.

58
Developing Tools for Indie Games Marc Flury Co-Founder

Transcript of Developing Tools for Indie Games Marc Flury Co-Founder.

PowerPoint

Developing Tools for Indie GamesMarc Flury Co-Founder

PREPARTIONOpen command prompt

? DROOL . 3 . . !

Hi, Im Marc Flury from the independent developer Drool.Im a game programmer and designer.Today Ill talk about developing tools and engine tech for independent games.1My BackgroundGame programmer for ten yearsWorked at Harmonix for seven years

Worked at AAA developer Harmonix for seven yearsHarmonix was my first job in the industryStarted as a junior programmer doing UI programmingMoved to a more senior position as a lead programmerSome games2NowMoved to Seoul three years agoFounded Drool with Brian Gibson (artist, musician)

Three years ago, I moved here to SeoulAt that time I became an independent developer and started my own company with my partner Brian GibsonWere currently developing our first game, Thumper.3About ThumperTwo developers (one programmer)Years of development timePlan to release within a yearUsing a custom engineTwo developers.I do all the programming.Brian does the art and music.We both do the game design.Weve been working on the game for over 5 years.A long time, but the first three years were not full-time, been developing full-time for 2.5 yearsOur goal is to release the game in about a yearWere using an entirely custom engine that Ive built (audio middle ware, some external libraries).4Why a custom engine?Fun (most of the time)Get better at making gamesNew tools create new design possibilitiesIf youre developing our own game, you have a lot of choices when it comes to choosing the engine and technology you use.Unity, Unreal might make the most sense for youMy personal reasons areWhen developing an engine and tools and understanding them at a deep level, you will have game design insights that you wouldnt have otherwise5Thumper Codebase

Hundreds of data filesThousands of game objectsHundreds of visual script nodesSo this talk is about the lessons Ive learned while building my own engine.This talk will be most relevant to programmers working on small-to-midsized games, but hopefully its mostly relevant to all game programmers.This is a lot of work for one person, so6The ChallengeDevelop tools efficiently - spend time on your game, not toolsDevelop the right tools, so you can create content efficientlyAs much about production as programmingThe challenge is to work very efficiently and effectively.This is obvious7My Experience90% of code I write is not exciting/innovative, its nuts and bolts

My technical skill has improved, but my most important skill is maximizing productivityIn my experience, and in most typical game engines, most of the code is not that innovative or cutting-edge. Most of it just about getting things to work. Most of the effort I spend is on realizing my game designs.

Im learned a lot about fairly advanced topics, like rendering, memory management, etc. but being able to code technically complex systems is ultimately not as important as staying productive and getting things done.8Be your own producerWait, isnt this a programming talk?

Who needs a producer anyway?So part of this talk is about being your own producer.If youre an independent developer no one tells you what you should be working on. That freedom is great in many ways and its a big reason why many people want to be indie developers.Its great to be free of management overhead.But of course it means you have to be good at managing your time or youll never finish your game.So this talk is about programming today, but from a production perspective.Everyone knows that time-management is important, but not many people talk about it in the specific context of programming independent games, so thats what Ill try to do today.9Personal Production TechniquesTrack your time and effortLook at the big pictureStay focusedI decided to call my approach to this personal production, and these are three very general, very high-level techniques Ill talk about.

Looking at this slide, Im a little embarrassed, because these are so obvious and so high-level. But I want to back each one up with some specific examples based on my experience developing my game.10Why track your time and effort?Your intuition of whats important is probably wrongYou can easily waste timeBe a good engineer!Its not a waste of time to track your work.Just like any resource, as a programmer, as an engineer, you should be optimizing for your time, which is really the most valuable resource you have.111. Track your time and effortMaintain a work logText file, spreadsheet, whateverTrack how you spend your time, especially:Bug fixingTasks that take longer than expectedMistakes/bugs made by other developers, including non-programmersTime spent not programming (chatting, e-mail, etc.)Use this actual data to decide when to refactor, improve tools, etc.Whats helpful to meTest-driven developmentImmediate, visual feedbackHelps catch common mistakes (ones I actually make!)Useful up to a point, dont take it too farDebug visualizationsTasks, animationsAudioMemoryTimersRendering

Long Distance Collaboration

Typical E-mailFrom: [email protected]: [email protected]: Rendering bug

There is a rendering problem with shadow.mat in thump/run/decorators/blubber_monster.objlib. Im not sure if theres a problem with material settings or a code issue?DEMO open command prompt16E-mail with Object URLFrom: [email protected]: [email protected]: Rendering bug

There is a rendering problem with drl://decorators/blubber_monster.objlib?obj=shadow.mat. Im not sure if theres a problem with material settings or a code issue?17Other applicationsData validation reportsErrors and warningsWorking with external teamsDEMO: render frame report18Object URL Implementationhttp://drool.ws/2013/10/29/engine-tech-easy-collaboration-with-object-urls/

Editor vs. GameI was spending lots of time writing editor-only codeEditor case is usually more complexObjects can be created, deleted anytimeMaintain and display referencesCut, copy, pasteUndo, redoRobust serialization (backwards-compatible, inter-file dependencies)Game requirements are totally differentFast loadingEfficient memory usageCache-coherent

So that was a small feature that I added because I noticed we were spending a lot of time writing tedious e-mails to each other.Next, Ill talk about a larger refactor I did to our engine that was informed by my work log.20Editor vs. GameThumper is a small game, so I can just use the same file format and serialization code for the game and editor.

My intuition said:It will be less code to maintain (only one save/load)It will be simplerThe editor is integrated into the game app, so the data should be the same21Editor vs. GameReality said:Work log: a lot of time fixing editor-only bugsDifficult to make game data performantPacked binary formats are not ideal for robust save/loadBinary file formats are not merge-able and lead to workflow problemsCode was littered with #ifdefsEditor vs. GameUse a human-readable, text-based format for editorUse packed, high performance binary for the gameDoesnt matter if you have separate editor/game apps or notThe data is what mattersText-based object formatname: approach.sampleid: 4002path: samples/swish/short_whip.wavemode: kOneOffvolume: 0.5pitch: 1.0pan: 0.0channel_group: 3021BenefitsSeparate formats reduce overall complexityOnly need to maintain latest version of game dataCheap concurrent editingcf: dev blog for The WitnessEasy to search your database of objects (just grep)Whats not helpful (to me)C++ const correctnessObject orientated programmingThinking in terms of classes/objectsThinking about public vs. protected vs. privatePlanning inheritance hierarchiesMeshMaterialCameraParticleSystemWhen I started building our engine, I didnt have a lot of experience with graphics programming.I had never written a line of shader code before and my 3D math was a little rusty.But I knew the basics and I started to start designing the system using OOP principles.27MeshMaterialCameraParticleSystemObjectMeshMaterialCameraParticleSystemObjectTransformObjectDrawObjectMeshMaterialCameraParticleSystemObjectTransformObjectDrawObjectMeshMaterialCameraParticleSystemObjectComponentMeshMaterialCameraParticleSystemObjectCompnentComponentDrawCompTransformCompMeshDrawCompTransformCompMaterialCameraTransformCompParticleSystemDrawCompTransformCompObjectComponentDrawCompTransformCompDrawCompMeshDrawCompTransformCompMaterialCameraTransformCompParticleSystemDrawCompTransformCompObjectComponentTransformCompDX9MeshDX9MaterialDX9CameraDX9ParticleSystemDrawCompMeshDrawCompTransformCompMaterialCameraTransformCompParticleSystemDrawCompTransformCompObjectComponentTransformCompDX9MeshDX9MaterialDX9CameraDX9ParticleSystemNow you may think that youll want an Abstract Factory pattern to create your platform-specific objects and you can start on thatWait, STOP. Is this actually solving your problems?OOP is especially cumbersome in C++The biggest drawback is that you are solving problems, but not the most important onesRather than helping solve hard problems, it can obscure them35MeshMaterialCameraParticleSystemMeshMaterialCameraParticleSystemReal problemsSort draw callsBatch/instance draw callsMinimize cache missesMinimize DX9 CPU overheadMeshMaterialCameraParticleSystemKey64-bit keyMeshMaterialCameraParticleSystemDataKey64-bit keyTransform, vertices, particles, etc.MeshMaterialCameraParticleSystemKeyOffsetKeyOffsetKeyOffsetKeyOffsetDraw()UnsortedDataDataDataDataDraw DataMeshMaterialCameraParticleSystemDraw()UnsortedDraw DataSort()KeyOffsetKeyOffsetKeyOffsetKeyOffsetSortedDraw DataKeyOffsetKeyOffsetKeyOffsetKeyOffsetDataDataDataDataDataDataDataDataMeshMaterialCameraParticleSystemDraw()UnsortedDraw DataSort()SortedDraw DataRenderDX9()KeyOffsetKeyOffsetKeyOffsetKeyOffsetDataDataDataDataKeyOffsetKeyOffsetKeyOffsetKeyOffsetDataDataDataDataDataKeyOffsetKeyOffsetKeyOffsetKeyOffsetDataDataDataMeshMaterialCameraParticleSystemDraw()UnsortedDraw DataSort()SortedDraw DataRenderDX9()KeyOffsetKeyOffsetKeyOffsetKeyOffsetDataDataDataDataDrawCompMeshDrawCompTransformCompMaterialCameraTransformCompParticleSystemDrawCompTransformCompObjectComponentTransformCompDX9MeshDX9MaterialDX9CameraDX9ParticleSystemData-orientated programmingUnderstand your real problemStrive for a single point of enumeration, avoid mess of classes/objectsMake your problem easier to visualize, debug, profile2. See the Big Picture

2. See the Big Picture

Property-grid vs. Visual ScriptingFxTriggerFlowEvery feature introduces risk3. Stay FocusedDont compete on feature setDo focused, high-quality workExplore one core tech feature fullyUse constraints to limit scopePrototype

---------------------------------------------------------------------------------------------------b-bb-b-b-bb--b--.....................--------------------------------------------------b....................---------------------------------------------------...-...-..............--------------------------------------------------b--.......................................................................b...-.................................................................... -...................................................................--...b--..-.................................................................--.....b..........................................................................-....-...............................................................--.....b--.....-.............................................................--.......b............................................................................-..............-..............................-bb--bb--........................................................b-b.........................--................b.......b..........................................................-.........................--................b..-....b..........................................................b.....-.....-...............................-.......-..........................................................b..-............................--..........-.......-......................................................--..-................-........-.....--.....-....b..-....b......................................................--..b...........................................b.......b..........................................................-....-bb--bb--bb--bb--bb--bb--bb--bb--bb--bb-....-.--....................................................--....b....b.........................................-....-....................................................--....-....b...-.......-..........-................-......b..........................................................b--bb-..............................................b..........................................................bbb-b-b-bb-b-bb--bb--bb--bb--bb--bb--bb--bb--bb--bb--.-----------------------------------------------------------......-----------------------------------------------------------.........----------------------------------------------------------b..........-----------------------------------------------------------..............-------------------------------------------------------b-b-.........------------------------------------------------------------------------------------------------------------------b-b------------------------------------------------------------------------------------------------------------------------------b-b-------------------------------------------------------------------------------------------------------------------------------b-b-----------------------------------------------------------------------------------------------------------------b--bb-b-b-bb-b------------------------...............................b..................................................................-...-.....-................................................................--b.........................................................-...........b...........-......-....................................................-...................................................................--b......-.............................................................b..........-.........................................................-........................................Thumpers Sequencer ToolA linear stream of data used for level design, animation, characters, etc.Gameplay CreationLevel Editor DemoObstacles, enemiesTentacle FingerZillapede

Unique aesthetic from our simple tool55Gameplay and PhysicsControllerJumpAnim

What we dont haveAnimation package import/export and playbackPhysicsSophisticated 3D editorGameplay