joey101's game-dev https://joey101.net/game-devMy rants about python game development.Blog Movedhttps://joey101.net/game-dev/posts/blog-moved/ <p>This blog has been moved to <a class="reference" href="http://arcticpaint.com/blog/">Arctic Paint</a>. What's here will be left as there are links around the internet to these posts but all new stuff will be at Arctic Paint.</p> <br /> Did you like this post? You can email me at <b>web (@) joey101.net</b>Fri, 13 Jun 2008 07:00:00 -0000Flex and Pythonhttps://joey101.net/game-dev/posts/flex-and-python/ <p>A dream come true; I can make games with python that run on any web browser and any OS! At least <em>code</em> it in python. Using <a class="reference" href="http://code.google.com/p/flex-pypy/">flex pypy</a> it is possible to convert python code to AS3 (Action Script).</p> <p>It's very new still but it's a start. You can check out an <a class="reference" href="http://www.taniquetil.com.ar/py/chimp/chimp.html">example here</a> (source and the resulting game in flash) based on the classic pygame example, "pummel the chimp."</p> <p>It'll be exciting to see what other cool things develop from <a class="reference" href="http://codespeak.net/pypy/">pypy</a>.</p> <br /> Did you like this post? You can email me at <b>web (@) joey101.net</b>Fri, 21 Mar 2008 07:00:00 -0000Next version of SnowballZhttps://joey101.net/game-dev/posts/next-version-snowballz/<img alt="/static/game-dev/snowballz-thumb.png" class="display first" src="/static/game-dev/snowballz-thumb.png" /> <p class="last">SnowballZ is on it's way back! This time with a glorious new codebase that just looks soooo awesome!!! (Oh, I guess the part that you actually see looks awesome too.)</p> <p>Speaking of looking awesome; I would like to thank Aaron Moore for his hard work on this project. He has created nearly all the artwork for this next version and it looks great. No more 8-direction 32x32 penguins! No more trees that are only a few inches taller than the penguins (or was it that the penguins were just a few inches shorter than the trees?)</p> <p>Anyway, the first release is still a little ways off; 3 or so months at the latest <em>I hope</em> - but there is no telling for sure and no guarantee. But the good news is that you can now follow the development at <a class="reference" href="http://snowballz.joey101.net">http://snowballz.joey101.net</a> (thanks due to Krzysztof for maintaining it). Feedback in the comments (below) or on the <a class="reference" href="http://groups.google.com/group/snowballz-fans/">mailing list</a> would be very welcome!</p> <p>~Joey</p> <p>P.S. You can still get the old code (which is playable and many people found fun regardless of major gameplay flaws) here: <a class="reference" href="https://joey101.net/snowballz/">https://joey101.net/snowballz/</a></p> <br /> Did you like this post? You can email me at <b>web (@) joey101.net</b>Sat, 15 Mar 2008 07:00:00 -0000How to program games - part 1https://joey101.net/game-dev/posts/how-to-program-games-part-1/ <p>Want to know how to program games? This is the first tutorial in my series on programming games.</p> <p>This tutorial has been moved and you can find it here: <a class="reference" href="http://arcticpaint.com/tutorials/#lesson1">http://arcticpaint.com/tutorials/#lesson1</a></p> <br /> Did you like this post? You can email me at <b>web (@) joey101.net</b>Sat, 05 Jan 2008 08:00:00 -0000Of terrain and lookshttps://joey101.net/game-dev/posts/of-terrain-and-looks/ <img alt="/static/game-dev/terrain_looks/1.png" class="display" src="/static/game-dev/terrain_looks/1.png" /> <p>If you have ever tried making terrain for a computer game you'll know what I'm talking about. It simply isn't easy to make look good. And some types of terrain are easier than others.</p> <p>Take my game snowballz for example. I found out that snow is <em>very</em> hard to make look good (or rather look at all). How do you texture snow so that you can see it but not look like cotton? And with shading; you have to darken everything in order to have highlights - but then it's, well, dark.</p> <p>With the image on the left here shows a screenshot of snowballz and another game I'm playing around with making. It took me weeks (not working constantly on it; but still a long time) to get it to look the way it does... and it doesn't even look that great in my opinion.</p> <p>But now on the right side is a tile/game engine I'm playing with (I don't know if I'll actually ever release it or not) and guess how long it took me to make it? About 3 hours for the terrain, 1 for the lighting, and 3 or 4 for everything else. I'll admit it doesn't look all that pretty either; but it took much less time to make than the snowballz terrain and I think it looks better.</p> <p>I don't think my method of making terrain is half bad though. It's fast and looks half-way decent. You can check out <a class="reference" href="/game-dev/posts/how-to-make-2d-terrain/">2Dland</a> to see how I do it with vertex arrays. The implementation I use here is actually a bit different but still uses the same principals.</p> <p>One day I'll figure out an uber awesome way to make two dimensional terrain... and you can be sure that I'll post here when I do :-)</p> <br /> Did you like this post? You can email me at <b>web (@) joey101.net</b>Mon, 19 Nov 2007 08:00:00 -0000Easy way to make nice looking tiles in Gimphttps://joey101.net/game-dev/posts/easy-way-make-tiles-Gimp/<img alt="/static/game-dev/tile_tut/tiles.png" class="display first" src="/static/game-dev/tile_tut/tiles.png" /> <p>It seems to me that the hobbyist game developer comunity is most lacking in artits. There just aren't near as many of them as there are programmers or even music artists. This is sad to me because the quality of a game is, more often than it should be, judged by it's looks. The graphics of a game is the first thing perceived. Potential players will see how the games look before they play it. And we all know how valuable first impressions are, right?</p> <p>Being a good artist is difficult. It requires a lot of work and patience. It's not like programming where you can create something that works good after learning the basics. Until you are at least halfway diecent your art won't look good, which can be discouraging.</p> <p class="last">I don't know what all that has to do with this tutorial but anyway, the best way I learn is to take some good art and see how it was created. I don't claim to be good but I don't think I'm bad. Here is a way I discovered to make some nice looking stone/metelish tiles. We start out with a 64x64 image in Gimp.</p> <img alt="/static/game-dev/tile_tut/1.png" src="/static/game-dev/tile_tut/1.png" /> <ol class="arabic simple"> <li>Fill the image with a light gray.</li> </ol> <img alt="/static/game-dev/tile_tut/2.png" src="/static/game-dev/tile_tut/2.png" /> <ol class="arabic simple" start="2"> <li>Use airbrush to paint over it with a rusty color.</li> </ol> <img alt="/static/game-dev/tile_tut/3.png" src="/static/game-dev/tile_tut/3.png" /> <ol class="arabic simple" start="3"> <li>Use the normal brush tool and the 32x32 or 16x16 Sketch brush to lightly paint back over the image with the base gray color. A good way to do this is to turn down the brush opacity and go over it all several times. The texture actually looks pretty good just like this.</li> </ol> <img alt="/static/game-dev/tile_tut/4.png" src="/static/game-dev/tile_tut/4.png" /> <img alt="/static/game-dev/tile_tut/5.png" src="/static/game-dev/tile_tut/5.png" /> <ol class="arabic simple" start="4"> <li>Hurl some noise onto a new layer (Other noise algorithms will work fine too).</li> </ol> <img alt="/static/game-dev/tile_tut/6.png" src="/static/game-dev/tile_tut/6.png" /> <ol class="arabic simple" start="5"> <li>Bumpmap the background layer using the noise layer as the map. I use a depth of 1. Delete the noise layer after your done.</li> </ol> <p>And that's pretty much it! For fun try blurring the noise or playing with different settings in the bumbmap (the waterlevel specifically). You can come up with some very nice and unique looking tiles.</p> <br /> Did you like this post? You can email me at <b>web (@) joey101.net</b>Sat, 03 Nov 2007 07:00:00 -0000An updatehttps://joey101.net/game-dev/posts/an-update/ <p>I haven't posted here for... almost four months. I was browsing around traffic statistics and the like when I discovered I happen to be syndicated on <a class="reference" href="http://libregamewiki.org/planet/">http://libregamewiki.org/planet/</a>? When did that happen? Anyway, finding that got me to thinking that I should probably not abandon this blog as it could be usefull to people and fun to do. Snowballz gives this place a lot of visibility so I might as well not let it go to waist.</p> <p>Just as I was ready to add new content a thought struck me, "Soooo.... what will I write about?" Ahh, my life story. I thought maybe I could write about snowballz development. Well, that only happens when I work on it which hasn't been very much for the past four months. I only did one release which had about 5 or so hours in it (some nice improvements just the same). But I guess I can write about it when there is something to write about.</p> <p>So I think I'll just start rambling my thoughts out here and start posting updates, problems solved (and maybe unsolved) with snowballz or anything else interesting. There will most likely still be dry periods so your only hope is the rss feed. I'll try to get more consistent with time.</p> <br /> Did you like this post? You can email me at <b>web (@) joey101.net</b>Wed, 31 Oct 2007 07:00:00 -0000Rabbyt - Fast 2D sprites in pythonhttps://joey101.net/game-dev/posts/fast-2d-sprites-in-python/<a class="first reference image-reference" href="http://matthewmarshall.org/projects/rabbyt/"><img alt="read on" class="display" src="/game-dev/screenshots/rabbyt.png" /></a> <p class="last">2D sprite libraries are one of those things that people attempt to make so often but rarely end up being anything usefull. And this is what makes me excited about Rabbyt, it is very usefull! (By the way, that warp effect was my idea :-D )</p> <p>First of all I want to mention the speed. Python is known to be quite a bit slower at certain things than C/C++, and as a result allot of game developers use C instead of python. Which is sad because making game logic in python is so much easier and more fun. Rabbyt makes yet another attempt to get the best of both worlds into your game by doing all of the OpenGL calls and number crunching stuff in C (via Pyrex) while having a simple yet flexible interface to it.</p> <img alt="/game-dev/screenshots/rabbyt_los.png" class="display" src="/game-dev/screenshots/rabbyt_los.png" /> <p>Rabbyt's Lots-Of-Sprites example program creates 2400 sprites, gives them different colors, and animates them rotating, scaling, and moving around. With my super extreme wimpy video card I get around 88 frames a second... try doing that in pure python! No, try getting faster than that in C! (my card is REALLY old. I'm guessing that a pure python implementation would go about 3 f/s for me)</p> <p>Rabbyt makes it very easy to create lots of sprites very fast that run very fast with little code. A nice combonation if you ask me. This is one reason I'm using Rabbyt for <a class="reference" href="/snowballz/">snowballz</a> now. Before I used Rabbyt the footprints really slowed down the game... now I can't tell a difference speed wise with or without them.</p> <p>Well anyway, you probably want to check it out for youself. Right now Rabbyt is very new (early alpha) so don't expect a super mature project. It does have a <a class="reference" href="http://matthewmarshall.org/projects/rabbyt/">nice website</a> though that you can get it from.</p> <br /> Did you like this post? You can email me at <b>web (@) joey101.net</b>Mon, 09 Jul 2007 07:00:00 -00002Dland - How to make 2D terrain that looks goodhttps://joey101.net/game-dev/posts/how-to-make-2d-terrain/<a class="first reference image-reference" href="/game-dev/files/2Dland.zip"><img alt="download source" class="display" src="/game-dev/screenshots/terrain.png" /></a> <p class="last">This small program I wrote demonstrates one way of making 3Dish looking terrain in 2D. It uses vertex arrays and OpenGL to render the land. It's quite fast even with larger maps. It's of course made with python but the same thing can be done with C/C++ or any other language.</p> <p>Click <a class="reference" href="/game-dev/files/2Dland.zip">here to download</a> the demo source. You will need <strong>python</strong>, <strong>PyOpenGL</strong>, <a class="reference" href="http://pygame.org">pygame</a> and <a class="reference" href="http://matthewmarshall.org/projects/rabbyt/">Rabbyt</a> to run. Unzip the download and run run.py for the "game" and editor.py for a rather cool editor. You can read on for the docs on using the editor (also included in README.txt)</p> <div class="section"> <h1><a id="editor" name="editor">Editor</a></h1> <p>Using the editor is pretty strait forward. There are three modes:</p> <dl class="docutils"> <dt>Border mode (default)</dt> <dd><p class="first">Pressing the "b" key will get you into this mode. When in this mode you can move points in already made regions by holding down on the CTRL key and left clicking on a point (then drag it around). While holding down on the CTRL key you can press the RMB (right mouse button) to delete the point. Middle clicking with the CTRL key pressed will delete the entire region.</p> <p class="last">You can then create new regions by left clicking anywhere (without CTRL). Keep left clicking to create new points for the region and then right click to finish.</p> </dd> <dt>Terrain mode</dt> <dd><p class="first">You get into terrain mode by pressing the "t" key. While in the terrain mode let click to raise the terrain and right click to lower it. You can also drag your cursor around while clicking to repeatedly perform your terrain deformation.</p> <p class="last">There aren't any hot keys to change the brush but on line 91 in editor.py you can change it from NORMAL to any of the other brushes defined above it (HILL, GENTLE and STEEP).</p> </dd> <dt>Region mode</dt> <dd><p class="first">Pressing "r" will get you into this mode. Region mode is for connecting the regions (This is, for example, useful a risk like game; the connections would tell your game which regions you can move armies between).</p> <p class="last">If you don't have a region selected clicking will select one. If a region is selected and you left click on another one it will connect the two. Right clicking on a region will delete all connection to that region (both ways).</p> </dd> </dl> <p>And finally you can save any modifications to the map by pressing CTRL+s</p> <p>That's it! Have fun and feel free to use the code in your own game (as long as your game is compatible with the GPL license (included, see GPL.txt)).</p> <p>Also if you have any feedback be sure to send it to me at web(@)joey101(.)net</p> </div> <br /> Did you like this post? You can email me at <b>web (@) joey101.net</b>Mon, 09 Jul 2007 07:00:00 -0000