<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Brainfold</title>
	<atom:link href="http://www.brainfold.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brainfold.org/blog</link>
	<description>On Python, game development and everything</description>
	<pubDate>Fri, 03 Oct 2008 10:11:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Secrets</title>
		<link>http://www.brainfold.org/blog/2008/10/03/secrets/</link>
		<comments>http://www.brainfold.org/blog/2008/10/03/secrets/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 10:11:57 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Game development]]></category>

		<category><![CDATA[board games]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=97</guid>
		<description><![CDATA[I&#8217;ve actually been working on a game in secret! It&#8217;s not Artillery Brawl, because it&#8217;s a card game. A real paper and cardboard game with custom cards. The advantage is that implementation is a lot simpler than for a computer game, which is good considering my limited free time at the moment. On the other [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve actually been working on a game in secret! It&#8217;s not Artillery Brawl, because it&#8217;s a card game. A real paper and cardboard game with custom cards. The advantage is that implementation is a lot simpler than for a computer game, which is good considering my limited free time at the moment. On the other hand, it will be a pain in the ass to play test, but at least it will be a new experience. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I&#8217;m basically finished with the relatively simple rules and currently putting finishing touches on the the cards (gameplay-wise, there&#8217;s absolutely no art yet). I&#8217;m reluctant to talk more about the game until I have something ready, but I&#8217;ll post a PDF version for you to test as soon as the game is ready for that!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/10/03/secrets/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unfortunately</title>
		<link>http://www.brainfold.org/blog/2008/09/22/unfortunately/</link>
		<comments>http://www.brainfold.org/blog/2008/09/22/unfortunately/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 19:52:55 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=92</guid>
		<description><![CDATA[Looks like my disappearance for the summer is becoming an annual event.  Unfortunately, the only thing I have to report is that I still have too much work with studies, my part-time job and some other stuff to have any left for game development at the moment. I still wanted to say that I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like my disappearance for the summer is becoming an annual event. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Unfortunately, the only thing I have to report is that I still have too much work with studies, my part-time job and some other stuff to have any left for game development at the moment. I still wanted to say that I&#8217;m not dead, and neither are my gamedev plans. I have even made a decision: as soon I have time again, I&#8217;m going to concentrate on Artillery Brawl and not any side projects, even tiny ones, until I&#8217;m convinced Artillery Brawl is or is not a fun game.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/09/22/unfortunately/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Summer</title>
		<link>http://www.brainfold.org/blog/2008/08/05/summer/</link>
		<comments>http://www.brainfold.org/blog/2008/08/05/summer/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 05:45:03 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Real life]]></category>

		<category><![CDATA[Studies]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=89</guid>
		<description><![CDATA[Oops, looks like Real Life ate me for July. I haven&#8217;t even worked on the university project much, but I&#8217;ll have to get it ready before September. Some good news regarding my studies though: I&#8217;m very likely to finish all my remaining courses during the next academic year. After that, I&#8217;m planning to move back [...]]]></description>
			<content:encoded><![CDATA[<p>Oops, looks like Real Life ate me for July. I haven&#8217;t even worked on the university project much, but I&#8217;ll have to get it ready before September. Some good news regarding my studies though: I&#8217;m very likely to finish all my remaining courses during the next academic year. After that, I&#8217;m planning to move back to the capital, Helsinki, to write my Master&#8217;s thesis at some company. If everything goes according to the plan, I&#8217;ll finish my degree late next year, yay! Of course, things rarely go exactly like planned&#8230;</p>
<p>Hopefully I&#8217;ll get more game development done in the Autumn, since it looks like I&#8217;ll still be quite busy during August.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/08/05/summer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I want to&#8230;</title>
		<link>http://www.brainfold.org/blog/2008/07/08/i-want-to/</link>
		<comments>http://www.brainfold.org/blog/2008/07/08/i-want-to/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 22:23:05 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=88</guid>
		<description><![CDATA[
Finish these stupid courses - I have to use Java again for the other one, eww
Prototype a game idea I had while driving home today - but not spend over a week on it
Learn to draw some vector art - because it should be easier for &#8220;programmer art&#8221; than pixels
Get a new job for Autumn
Get [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>Finish these stupid courses - I have to use Java again for the other one, eww</li>
<li>Prototype a game idea I had while driving home today - but not spend over a week on it</li>
<li>Learn to draw some vector art - because it should be easier for &#8220;programmer art&#8221; than pixels</li>
<li>Get a new job for Autumn</li>
<li>Get some sleep</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/07/08/i-want-to/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Artillery Brawl: Prototyping</title>
		<link>http://www.brainfold.org/blog/2008/07/05/artillery-brawl-prototyping/</link>
		<comments>http://www.brainfold.org/blog/2008/07/05/artillery-brawl-prototyping/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 10:47:12 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Game development]]></category>

		<category><![CDATA[Artillery Brawl]]></category>

		<category><![CDATA[game design]]></category>

		<category><![CDATA[prototype]]></category>

		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=86</guid>
		<description><![CDATA[Lately I&#8217;ve read a lot about game design (Danc&#8217;s blog has been especially enlightening). I&#8217;m now convinced I have to prototype a few &#8220;risky&#8221; aspects of Artillery Brawl&#8217;s gameplay to make sure what I&#8217;m doing is actually fun before wasting effort on other parts of the game.
The core gameplay of each game has to be [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve read a lot about game design (<a href="http://lostgarden.com/">Danc&#8217;s blog</a> has been especially enlightening). I&#8217;m now convinced I have to prototype a few &#8220;risky&#8221; aspects of Artillery Brawl&#8217;s gameplay to make sure what I&#8217;m doing is actually fun before wasting effort on other parts of the game.</p>
<p>The core gameplay of each game has to be fun for the game on the whole to be fun. Platformers are about jumping, shooters are about shooting and Go is about placing stones on a board. Players are going to spend most of their time playing doing this core activity; everything else is basically extra to hook players at first or keep them interested in the long run. In Artillery Brawl, core gameplay is of course shooting, and before I dwelve into anything else, I have to make shooting fun. In other words, it has to be rewarding.</p>
<p>Artillery Brawl isn&#8217;t fun yet. There are a couple of obvious problems I&#8217;m going to fix first and see what the results are, then decide what&#8217;s to follow. First, there&#8217;s absolutely no feedback or reward for shooting; there aren&#8217;t any kind of effects (visual or aural) when you shoot or hit something, and units simply disappear when they are destroyed. Not very fun at all. So I&#8217;m going to add some particle explosions and sound effects to help with that. Explosions are always fun, right?</p>
<p>Second, there&#8217;s the user interface. Currently shooting is controlled with the arrow keys and modifiers (alt and shift), but while I want to keep that, I also want to add mouse control that&#8217;s dead simple to use. It should be immediately obvious (at least after pressing the Shoot! button once or twice) what to do in the game without any kind of documentation or tutorials.</p>
<p>Last, but certainly not least, there&#8217;s the camera. Currently, other than automatically focusing on the current unit when a turn begins, the camera is completely manual. With the turn system I have in place; multiple tiny shells in the air, many things happening at once and many players in front of the same screen, each interested in different things, this simply won&#8217;t work at all. I have to improve the automatic behaviour of the camera, and luckily I have a couple of simple to implement improvements in mind. At the beginning of a turn, the camera should focus so that the current unit and the place the last shot landed should be visible. Between turns, the camera should zoom out, showing as much as possible. When a shell is about to land, the camera should zoom in on that. Later, I can improve it so that if multiple shells are about to land at the same time, I can use a picture-in-picture to show both at once. Also, I&#8217;m going to improve the visibility of both units and shells, and add a minimap.</p>
<p>If, after these improvements are in place, the game still isn&#8217;t beginning to approach fun, I&#8217;ll have to either change something dramatically or start a new project. Simple as that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/07/05/artillery-brawl-prototyping/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Artillery Brawl: The concept</title>
		<link>http://www.brainfold.org/blog/2008/07/02/artillery-brawl-the-concept/</link>
		<comments>http://www.brainfold.org/blog/2008/07/02/artillery-brawl-the-concept/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 11:34:59 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Game development]]></category>

		<category><![CDATA[Artillery Brawl]]></category>

		<category><![CDATA[game design]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=84</guid>
		<description><![CDATA[I&#8217;m starting to write about the game design for Artillery Brawl on this blog instead of keeping it in my head and my private wiki. As opposed to Red Nebula, whose concept is wide open, a &#8220;playground&#8221; of sorts, the vision I have for Artillery Brawl is very focused, and I have already dismissed several [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m starting to write about the game design for Artillery Brawl on this blog instead of keeping it in my head and my private wiki. As opposed to <a href="http://www.brainfold.org/blog/2008/01/06/red-nebula-take-two/">Red Nebula</a>, whose concept is wide open, a &#8220;playground&#8221; of sorts, the vision I have for Artillery Brawl is very focused, and I have already dismissed several gameplay ideas that simply don&#8217;t fit that vision. To start with, here&#8217;s the concept for the game.</p>
<hr />Artillery Brawl is a remake of my first real game, Arty, and a tribute to Artillery Duel, Scorched Earth and other games of the classic artillery genre. Two or more players, with one or more artillery units each, battle to gain victory by destroying each other or reaching some other victory condition depending on the rules.</p>
<h4>Core features</h4>
<ul>
<li>OpenGL-accelerated 2D graphics</li>
<li>Realistic physics simulation</li>
<li>Procedural levels</li>
<li>Real-time gameplay paused during turns</li>
<li>Damage model not based on hitpoints</li>
<li>Multiple game modes with different rules</li>
<li>Shopping system to buy and customize units</li>
<li>Hotseat multiplayer on one computer</li>
</ul>
<p>Everything else is extra, but the above features are central to the vision.</p>
<h4>World</h4>
<p>The game world is a 2D terrain always viewed from the side and bounded on each side. No unit or other entity may cross the bounds; for example, artillery shells crossing the bounds are silently eliminated. To help with this, there is a &#8220;buffer zone&#8221; on each side, where no units are placed at the beginning of the game. Scale is at the unit level, with no higher level organization or lower-level detail.</p>
<h4>Gameplay</h4>
<p>A <em>game</em> consists of a number of <em>rounds</em>. Before a game, the players agree on a set of rules, including ending conditions for each round and the game, and how money is gained. A round might end when only one player has units left, or after a time limit. A game might end after a set number of rounds, or when only one player has money left. Before each round, the players may buy new units and customize existing units at a shop screen with their money.</p>
<p>Each round has a continuous timeline. When it&#8217;s not anyone&#8217;s turn, time advances in real time. Time is paused during turns, and continues again when the turn is finished. During a turn, a player may give orders to their units, but units only act between turns. A player may start a turn any time they want by pausing the game, or automatically when a unit has finished its current orders.</p>
<h4>Style</h4>
<p>The style of the game is semi-realistic; not terribly serious, but not &#8220;casual&#8221; either.</p>
<ul>
<li>Units and other equipment will be loosely based on real equivalents</li>
<li>Units and other entities are affected by physics simulation, but some gameplay elements might take liberties with this</li>
<li>The world is larger than usual in the genre, though not realistic; we don&#8217;t want units to be kilometers apart</li>
<li>The damage model is not based on hitpoints as usual, but will be simple</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/07/02/artillery-brawl-the-concept/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Box of horrors</title>
		<link>http://www.brainfold.org/blog/2008/07/01/box-of-horrors/</link>
		<comments>http://www.brainfold.org/blog/2008/07/01/box-of-horrors/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 19:33:21 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Game development]]></category>

		<category><![CDATA[Studies]]></category>

		<category><![CDATA[Artillery Brawl]]></category>

		<category><![CDATA[Box2d]]></category>

		<category><![CDATA[graduation]]></category>

		<category><![CDATA[physics]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[pymunk]]></category>

		<category><![CDATA[setuptools]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=83</guid>
		<description><![CDATA[Today I adapted the nice setuptools-based plugin module from Spineless to more easily support different physics toolkits in my code, and played around a bit trying to write a Box2D plugin. Frankly, I don&#8217;t like the Box2D API design at all, and I like the pyBox2D API even less, as it&#8217;s a direct port of [...]]]></description>
			<content:encoded><![CDATA[<p>Today I adapted the nice <a href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a>-based plugin module from Spineless to more easily support different physics toolkits in my code, and played around a bit trying to write a <a href="http://www.box2d.org/">Box2D</a> plugin. Frankly, I don&#8217;t like the Box2D API design at all, and I like the <a href="http://code.google.com/p/pybox2d/">pyBox2D</a> API even less, as it&#8217;s a direct port of the C++ API and doesn&#8217;t even try to be Pythonic. Eww. Seems I&#8217;ll have to try fake sweeping collision detection and other tweaks to pymunk next to fix the collision problems I <a href="http://www.brainfold.org/blog/2008/06/30/bullet-through-the-wall/">wrote about</a>.</p>
<p>In other news, starting tomorrow I&#8217;ll try to finish two university courses that are really long overdue and that I want out of the way before September. I have one short paper to write and one coding project to do, so game development progress will probably be a bit slower again for a while. But every finished course takes me closer to graduation (which I&#8217;m planning to do next year), so yay for that!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/07/01/box-of-horrors/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bullet through the wall</title>
		<link>http://www.brainfold.org/blog/2008/06/30/bullet-through-the-wall/</link>
		<comments>http://www.brainfold.org/blog/2008/06/30/bullet-through-the-wall/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 22:18:52 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Game development]]></category>

		<category><![CDATA[Artillery Brawl]]></category>

		<category><![CDATA[Box2d]]></category>

		<category><![CDATA[entity system]]></category>

		<category><![CDATA[physics]]></category>

		<category><![CDATA[pymunk]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=82</guid>
		<description><![CDATA[My work with the entity system is pretty much finished for now. Everything seems to be finally working and the code is reasonably clean. I don&#8217;t want to get stuck polishing the code while it&#8217;s still missing most of the planned features. I didn&#8217;t get to gameplay / user interface stuff yet, but I hope [...]]]></description>
			<content:encoded><![CDATA[<p>My work with the entity system is pretty much finished for now. Everything seems to be finally working and the code is reasonably clean. I don&#8217;t want to get stuck polishing the code while it&#8217;s still missing most of the planned features. I didn&#8217;t get to gameplay / user interface stuff yet, but I hope to do so next week. Time to get something concrete done for a change.</p>
<p>I did run into some problems with collision detection though. Shells that are fired travel relatively fast compared to their size, which leads to the infamous bullet-through-wall effect when they collide with ground. In other words: they go straight through it. I tried fixing this both by making the terrain collision shape consist of polygons instead of line segments, and decreasing the step size so that shells wouldn&#8217;t jump over the line segments. Both of these were too much for pymunk though, and the game ground to a halt. Note this isn&#8217;t a problem with Python either, since all the physics number crunching is done in C code.</p>
<p>I now have a couple of options. First, I&#8217;ll try <a href="http://code.google.com/p/pybox2d/">pyBox2d</a>, based on the <a href="http://www.box2d.org/">Box2D</a> physics library (which <a href="http://wiki.slembcke.net/main/published/Chipmunk">chipmunk</a> is based on, which <a href="http://code.google.com/p/pymunk/">pymunk</a> is based on&#8230;) Box2D has continuous collision detection, meaning that objects can&#8217;t jump through each other between steps, but the pyBox2d bindings are based on <a href="http://www.swig.org/">SWIG</a>, which is much slower than ctypes, so it might have performance problems of its own&#8230; Additionally, I just (literally a minute ago) stumbled on <a href="http://elements.linuxuser.at/">Elements</a>, which is another Python 2D physics library based on Box2D, so I&#8217;ll take a look at that as well. A backup plan is faking continuous collision detection by making the collision shapes of shells longer than they actually are. Because the action in Artillery Brawl isn&#8217;t very dynamic, this shouldn&#8217;t cause any noticable errors in collision detection, but I&#8217;ll have to see about that if I&#8217;m not satisfied with pyBox2d.</p>
<p>EDIT: At least <a href="http://wiki.laptop.org/go/Physic_Engines/Speed_Tests">these results</a> look promising for Box2d.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/06/30/bullet-through-the-wall/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Final stretch</title>
		<link>http://www.brainfold.org/blog/2008/06/29/final-stretch/</link>
		<comments>http://www.brainfold.org/blog/2008/06/29/final-stretch/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 00:30:25 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Game development]]></category>

		<category><![CDATA[Artillery Brawl]]></category>

		<category><![CDATA[entity system]]></category>

		<category><![CDATA[issue tracker]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=81</guid>
		<description><![CDATA[Yet more entities
The entity system overhaul is almost finished. Everything looks all right now, but doesn&#8217;t really behave&#8230; there must still be some bugs left in the physics system. I&#8217;ll concentrate on bug hunting and cleanup tomorrow, and hope to get to gameplay as well, next week if not tomorrow. It&#8217;s really nice to have [...]]]></description>
			<content:encoded><![CDATA[<h4>Yet more entities</h4>
<p>The entity system overhaul is almost finished. Everything looks all right now, but doesn&#8217;t really behave&#8230; there must still be some bugs left in the physics system. I&#8217;ll concentrate on bug hunting and cleanup tomorrow, and hope to get to gameplay as well, next week if not tomorrow. It&#8217;s really nice to have some real progress for a change.</p>
<h4>Architecture</h4>
<p>As every programmer knows, or at least should know, program architecture is a hard subject. Really hard. A lot of my development time during the last couple of days has been spent thinking about the perfect architecture for parts of my entity system. I want to get this at least mostly right this time to avoid having to make huge, sweeping changes again in the future (like I&#8217;m doing now, but with a relatively small codebase). I feel I have succeeded quite well, with a couple of minor warts I&#8217;m going to remedy at some point in the future.</p>
<h4>More issue tracking</h4>
<p>Today, I wasted an hour or two trying to install <a href="http://roundup.sourceforge.net/">Roundup</a>. To my surprise, it got stuck trying to initialize the database, the same problem I had with <a href="http://trac.edgewall.org/">Trac</a> yesterday. Digging into the problem a bit deeper, it seems sqlite (or its Python bindings) is to blame! Specifically, it dies, claiming that the database is already locked. That means I might give Trac another chance if I get the sqlite problem sorted out, or maybe I should just try to use Roundup with another database backend. I gave up on issue tracking for now though, so more on that later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/06/29/final-stretch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Entities ahoy!</title>
		<link>http://www.brainfold.org/blog/2008/06/28/entities-ahoy/</link>
		<comments>http://www.brainfold.org/blog/2008/06/28/entities-ahoy/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 01:27:14 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
		
		<category><![CDATA[Game development]]></category>

		<category><![CDATA[Artillery Brawl]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[entity system]]></category>

		<category><![CDATA[GUI]]></category>

		<category><![CDATA[issue tracker]]></category>

		<category><![CDATA[setuptools]]></category>

		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=79</guid>
		<description><![CDATA[Entity system
Today I&#8217;ve continued work under the hood, on the entity system. Both components and entity types are now loaded using the plugin / entry point system of setuptools, which means custom components and units will be really easy to create and distribute. And much easier for me to load.  I have a habit [...]]]></description>
			<content:encoded><![CDATA[<h4>Entity system</h4>
<p>Today I&#8217;ve continued work under the hood, on the entity system. Both components and entity types are now loaded using the plugin / entry point system of <a href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a>, which means custom components and units will be really easy to create and distribute. And much easier for me to load. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I have a habit of making too many sweeping changes to code at once, and this is no exception. On the other hand, this does result in massive improvements to the entity system and especially creation of entity type files, so it&#8217;s all for the greater good.</p>
<p>No screenshots to show for my efforts, but see the end of the post for examples of what entity type files currently look like. This might change before these changes are completed.</p>
<h4>Entity editor</h4>
<p>I&#8217;ll probably have to start working on an entity editor at some point, since I recon unit and other entity creation will get quite complicated when multiple linked entities, collision shapes, etc. etc. get involved. I&#8217;m no big fan of GUI programming, especially since Python&#8217;s <a href="http://wiki.python.org/moin/GuiProgramming">GUI libraries</a> all seem kind of shoddy (though that seems to apply to other languages too, at least C# and Java). Anyway, I&#8217;ll probably use <a href="http://wxpython.org/">wxPython</a> for it. Making it in-game would be cool, but too much effort at the moment.</p>
<h4>Trac</h4>
<p>I tried installing <a href="http://trac.edgewall.org/">Trac</a> (again) today since they just released version 0.11, and couldn&#8217;t get it working (again). After getting over a few hurdles, I was finally stumped when trac-admin hanged while trying to create the environment. Every time. I really want to like Trac, since it&#8217;s excellent when it works, but I&#8217;ve had nothing but problems trying to get it working myself. It seems I&#8217;ll have to let it go and find some other issue tracker when I really start needing one. I&#8217;d like it to integrate with <a href="http://www.eclipse.org/mylyn/">Mylyn</a>, but the (free) options there are a bit limited. We&#8217;ll see&#8230;</p>
<p><span id="more-79"></span></p>
<h4>Entity types files</h4>
<p>Here&#8217;s what a unit type file currently looks like. The interface for this is not fully implemented yet, but I hope I&#8217;ll get that finished during this weekend.</p>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> artillerybrawl <span style="color: #ff7700;font-weight:bold;">import</span> component, entity
<span style="color: #ff7700;font-weight:bold;">from</span> artillerybrawl.<span style="color: black;">entity</span> <span style="color: #ff7700;font-weight:bold;">import</span> Entity
&nbsp;
Unit = entity.<span style="color: black;">get_class</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;unit&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Howitzer<span style="color: black;">&#40;</span>Unit<span style="color: black;">&#41;</span>:
    name = <span style="color: #483d8b;">&quot;howitzer&quot;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        Unit.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">mass</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">material</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">hitpoints</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">resistances</span> = <span style="color: #008000;">None</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Body</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">body_width</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">body_height</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">body_texture</span> = <span style="color: #008000;">None</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">collision_meshes</span> = <span style="color: #008000;">None</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Turret</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_offset</span> = <span style="color: #008000;">None</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_width</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_height</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_texture</span> = <span style="color: #008000;">None</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_min_angle</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_angle</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_power</span> = <span style="color: #008000;">None</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> create<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        entity = Unit.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Body</span>
        body_sprite = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;sprite&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">body_width</span>,
                                       <span style="color: #008000;">self</span>.<span style="color: black;">body_height</span>, <span style="color: #008000;">self</span>.<span style="color: black;">body_texture</span><span style="color: black;">&#41;</span>
        body_physics = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;physics&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">mass</span>,
                                         <span style="color: #008000;">self</span>.<span style="color: black;">collision_meshes</span>, <span style="color: #008000;">self</span>.<span style="color: black;">material</span><span style="color: black;">&#41;</span>
        body_damage = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;damage&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">hitpoints</span><span style="color: black;">&#41;</span>
&nbsp;
        body = Entity<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">name</span>, <span style="color: black;">&#40;</span>body_sprite, body_physics, body_damage<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Turret</span>
        turret_transform = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;transform&quot;</span>, parent=body<span style="color: black;">&#41;</span>
        turret_sprite = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;sprite&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">turret_width</span>,
                                  <span style="color: #008000;">self</span>.<span style="color: black;">turret_height</span>, <span style="color: #008000;">self</span>.<span style="color: black;">turret_texture</span><span style="color: black;">&#41;</span>
        turret_component = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;turret&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">turret_min_angle</span>,
            <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_angle</span>, <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_power</span><span style="color: black;">&#41;</span>
&nbsp;
        turret = Entity<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%s_turret&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #008000;">self</span>.<span style="color: black;">name</span>,
                        <span style="color: black;">&#40;</span>turret_transform, turret_sprite, turret_component<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">return</span> body</pre></div></div>

<p>And an actual unit base on the unit type above.</p>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> artillerybrawl <span style="color: #ff7700;font-weight:bold;">import</span> entity
&nbsp;
Howitzer = entity.<span style="color: black;">get_class</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;howitzer&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> A1<span style="color: black;">&#40;</span>Howitzer<span style="color: black;">&#41;</span>:
    name = <span style="color: #483d8b;">&quot;A1&quot;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        Howitzer.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">mass</span> = <span style="color: #ff4500;">1000.0</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">material</span> = <span style="color: #483d8b;">&quot;metal&quot;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">hitpoints</span> = <span style="color: #ff4500;">100</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">resistances</span> = <span style="color: black;">&#123;</span>
            <span style="color: #483d8b;">&quot;kinetic&quot;</span>: <span style="color: #ff4500;">50.0</span>,
        <span style="color: black;">&#125;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Body</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">body_width</span> = <span style="color: #ff4500;">5.0</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">body_height</span> = <span style="color: #ff4500;">2.5</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">body_texture</span> = <span style="color: #483d8b;">&quot;a1&quot;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">collision_meshes</span> = <span style="color: black;">&#91;</span>
            <span style="color: black;">&#91;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.0</span>, <span style="color: #ff4500;">0.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">1.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">0.0</span>, <span style="color: #ff4500;">1.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">0.0</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>,
            <span style="color: black;">&#91;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.0</span>, <span style="color: #ff4500;">0.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">1.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">0.0</span>, <span style="color: #ff4500;">1.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">0.0</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>,
        <span style="color: black;">&#93;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># Turret</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_offset</span> = <span style="color: black;">&#40;</span><span style="color: #ff4500;">2.5</span>, <span style="color: #ff4500;">2.5</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_width</span> = <span style="color: #ff4500;">5.0</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_height</span> = <span style="color: #ff4500;">1.0</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_texture</span> = <span style="color: #483d8b;">&quot;a1_turret&quot;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_min_angle</span> = -<span style="color: #ff4500;">5.0</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_angle</span> = <span style="color: #ff4500;">85.0</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_power</span> = <span style="color: #ff4500;">100.0</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/06/28/entities-ahoy/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
