Updated Testing Wiki Link
[sdlgit/SDL-Site.git] / pages / blog-0002.html-inc
CommitLineData
ec946b6b 1<div class="blog">
2<h1 id="NAME">
d6a8ee08 3Perl GameDev: an interview with Construder's author
ec946b6b 4</h1>
5<div class="CONTENT">
d6a8ee08 6<span style="font-style: italic;">For the past several months Perl has gained a lot of momentum in game development. The SDL Perl community now has a <a href="http://sdlperl.ath.cx/releases/SDL_Manual.pdf">complete manual for beginners</a> and nice, sugary layers built on top of a fast and stable API. March's game challenge spawned <a href="http://yapgh.blogspot.com/search/label/Contest">over 15 new games</a>, and all over the world we've seen mini-courses, talks and even printed magazine articles. But nothing prepared us for </span><a href="http://ue.o---o.eu/"><span>Construder</span></a><span style="font-style: italic;">: a jaw dropping 3D game created by Perl hacker Robin Redeker, known as "elmex". It features futuristic settings with some nice graphics and an (almost) infinite world for you to build and play with!<br /><br /><iframe src="http://www.youtube.com/embed/qd95SrdNkgE" allowfullscreen="" frameborder="0" height="349" width="425"></iframe><br /><br />Construder is so cool we wanted everyone to know about it, so we made a quick interview with Robin, who is not only a great programmer but also a very nice guy. Check it out! </span><span style="font-weight: bold;"><br /><br />Can you share a bit about who you are and what's your background?</span><br /><br />I'm a 27 year old Informatics student from Karlsruhe, Germany. I work part time as a (Perl) programmer and programming is my main hobby aside from other things like photography and music.<br /><br />I started programming around 1999 and wrote lots of network related applications since then. Many also found their way to <a href="http://metacpan.org/">CPAN</a> as Perl modules, such as <a href="http://metacpan.org/module/AnyEvent::IRC">AnyEvent::IRC</a>, <a href="http://metacpan.org/module/AnyEvent::XMPP">AnyEvent::XMPP</a> and <a href="http://metacpan.org/module/AnyEvent::HTTPD">AnyEvent::HTTPD</a>.<br /><br /><span style="font-weight: bold;">Tell us a bit about <span style="font-style: italic;">Construder</span>. What's it about?</span><br /><br /><a href="http://ue.o---o.eu/">Construder</a> is a 3D game that takes place in a completely modifiable world that is built from small cubes. The core of the game is construction of buildings and items from those cubes. The goal is to push up your score points as far as possible.<br /><br />In order to score you need to build blocks, construct items and finish assignments. For each score milestone you will get a trophy.<br /><br />The game currently is focused on single player experience, but the architecture has been made to support multiplayer gameplay. As a matter of fact, it's perfectly possible for multiple players to play in the same world at once. (One of the unfinished things is, that you can't see the other players at the moment, only their actions can be observed :-)<br /><br /><span style="font-weight: bold;">How about the technology involved?</span><br /><br />I use the CPAN modules <a href="http://metacpan.org/module/SDL">SDL</a> and <a href="http://graphcomp.com/opengl">OpenGL</a> for all the graphics stuff in the client (there is some C OpenGL code, to render the volumes, but most of the engine is written in Perl using the OpenGL module). The primary purpose of SDL is to give me keyboard and mouse input, loading images and providing an OpenGL context.<br /><br />But there are also other modules at work here:<br /><ul><li><a href="http://metacpan.org/module/Object::Event">Object::Event</a> my own most favorite module for event based programming</li><li><a href="http://metacpan.org/module/AnyEvent">AnyEvent</a> for networking and timer releated stuff</li><li><a href="http://metacpan.org/module/EV">EV</a> as a reliable event loop</li><li><a href="http://metacpan.org/module/Compress::LZF">Compress::LZF</a> for storing and transmitting the map data</li><li><a href="http://metacpan.org/module/JSON">JSON</a> as a generic format for storing data (player files, resource files)</li></ul> <span style="font-weight: bold;">We know <span style="font-style: italic;">Construder</span> is not "finished" yet, but it's pretty complete, playable and fun! How long did it take to get there?</span><br /><br />I started with a basic engine prototype on the 19th April 2011. So it took me 3 months of steady development and research to get the game to the current state.<br /><br />Much research was necessary, as I originally only had basic experience with OpenGL and 3D engines in general. Especially collision detection and finding graphics were noteworthy researches.<br /><br />On top of that I also looked through many books and articles of game design, which helped me a lot with designing the actual game.<br /><br /><span style="font-weight: bold;">You mentioned <span style="font-style: italic;">MineCraft</span> as an inspiration for <span style="font-style: italic;">Construder</span>. How are they similar? And how are they different?</span><br /><br /><a href="http://www.minecraft.net/">Minecraft</a> inspired the aspect of a completely modifiable world that is built from small cubes. In this regard Construder is very similar to Minecraft or it's predecessor <a href="http://thesiteformerlyknownas.zachtronicsindustries.com/?p=713">Infiniminer</a>.<br /><br />But Minecraft is, or at least it will/wants to be, a survival game, where you have to fend off monsters that come at night or from the darkness.<br /><br />With Construder I wanted to put focus on the constructive aspect and build a game around that. Construder of course still has survival aspects, as you have to take care not to starve. But thats more a question of resource management and not survival.<br /><br />Apart from that the generation and design of the world differs completely from Minecraft's medieval theme. Construder has a much is more futuristic world with very artificial structures in it.<br /><br /><span style="font-weight: bold;">How did you get started in game development? Is this your first game?</span><br /><br />Construder is the first game I designed and implemented completely by myself.<br /><br />But around 2005 me and a friend (Marc Lehmann) started to play Crossfire (a 2D (M)MORPG) together. Not long and we started to improve Crossfire and eventually we forked it off into a new project, called "<a href="http://www.deliantra.net/">Deliantra</a>". Our main focus was to fix the stability and balancing problems that accumulated in Crossfire over the decades (it's a really old game).<br /><br /><div style="text-align: center;"><a href="http://3.bp.blogspot.com/-BofjmoCyhC8/ThX0X1GUw9I/AAAAAAAAAQA/tdo1wkGvxuI/s1600/deliantra.png"><img style="cursor: pointer; width: 320px; height: 200px;" src="http://3.bp.blogspot.com/-BofjmoCyhC8/ThX0X1GUw9I/AAAAAAAAAQA/tdo1wkGvxuI/s320/deliantra.png" alt="" id="BLOGGER_PHOTO_ID_5626671999697077202" border="0" /></a><br /><br /></div>As a side note: Deliantra itself can also be called a "Perl game". The core of the server is driven completely by the Perl modules Coro, IO::AIO and AnyEvent. The client for Deliantra was also rewritten in Perl and only uses a small part of XS for the custom SDL and OpenGL bindings.<br /><br /><span style="font-weight: bold;">What are you proudest of about <span style="font-style: italic;">Construder</span>?</span><br /><br />I'm most proud that it is a playable game, which is finished to a certain degree. Next I'm proud that I was able to compile a texture set that does not completely look like the so called "programmer art".<br /><br />However, I'm not that proud of the code in Construder. When developing a game on your own with limited time you need to make sacrifices and compromises. Those usually don't lead to the most elegant or best code. As a result of that there are many things that can be improved in Construder.<br /><br /><span style="font-weight: bold;">Why did you choose Perl?</span><br /><br />As I write 80-90% of my software projects in Perl the choice was quite natural. Minecraft also showed that a 3D engine does not need to be written in C/C++. So I also thought it was time for a 3D game in Perl.<br /><br /><span style="font-weight: bold;">What do you think are the biggest advantages for people considering Perl for game development?</span><br /><br />The biggest advantages of Perl are the data structures like hashes, arrays and string that are tied closely into the core of the language.<br /><br />This allows for rapid development of new ideas and algorithms, which is essential for any game project. You just need to try out many approaches to find the right one for your project.<br /><br />The scripting character of Perl really starts to pay off once you get to implement the game logic and balance and user interface. Everything stays in a flexible shape and you can change it at will without having to rearrange the whole code archtitecture.<br /><br />On top of that modules like <a href="http://metacpan.org/module/Coro">Coro</a> and <a href="http://metacpan.org/module/AnyEvent">AnyEvent</a> which come with utilities like <a href="http://metacpan.org/module/Coro::Debug">Coro::Debug</a> or <a href="http://metacpan.org/module/AnyEvent::Debug">AnyEvent::Debug</a> allow runtime debugging in the running game. You can peek into all your data structures and execute code at will at runtime, and this really pays off for bugs that are hard to reproduce.<br /><br /><span style="font-weight: bold;">How about disadvantages? Where does Perl (and underlying CPAN modules) need to improve for gamedev?</span><br /><br />It would be great if Perl had a JIT, then probably even less parts of Construder would have to be in C/XS. But this doesn't mean that Perl is slow. It's definitively fast enough for 80-90% of the engine, but handling volume data in Perl is neither fun nor fast.<br /><br />The CPAN modules, like SDL or OpenGL are quite useful and don't really need much improvement with regard to Construder. Maybe there could be a more useful 3D engine module for Perl, which makes it easier and faster to handle 3D data.<br /><br />But the Construder engine is quite customized anyways, so a module, except maybe a special voxel world module, wouldn't have helped much anyway.<br /><br /><span style="font-weight: bold;">What's next?</span><br /><br />Next issues that need to be resolved is the distribution. It would be great if distribution maintainers could package it for Debian and/or Ubuntu for example. It would also be great if volunteers could make a binary for Windows.<br /><br />I probably wont have so much time to devote to Construder anymore, as I need to concentrate on finishing my diploma. However, as author I will try to maintain the project, and apply patches and bug fixes.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3102167581424744259-2573155886863173325?l=yapgh.blogspot.com' alt='' /></div>
7<p><a href="http://feedads.g.doubleclick.net/~a/kMkPdNP19mshdfhBGADG7qRzzC4/0/da"><img src="http://feedads.g.doubleclick.net/~a/kMkPdNP19mshdfhBGADG7qRzzC4/0/di" border="0" ismap="true"></img></a><br/>
8<a href="http://feedads.g.doubleclick.net/~a/kMkPdNP19mshdfhBGADG7qRzzC4/1/da"><img src="http://feedads.g.doubleclick.net/~a/kMkPdNP19mshdfhBGADG7qRzzC4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/YetAnotherPerlGameHackeryapgh/~4/_Y5NgDuwAO8" height="1" width="1"/></div></div>