<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brainfold &#187; tools</title>
	<atom:link href="http://www.brainfold.org/blog/tag/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brainfold.org/blog</link>
	<description>On Python, game development and everything</description>
	<lastBuildDate>Sat, 15 May 2010 21:58:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<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[Uncategorized]]></category>
		<category><![CDATA[Artillery Brawl]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[entity system]]></category>
		<category><![CDATA[game development]]></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'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'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'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'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'm no big fan of GUI programming, especially since Python'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'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'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's excellent when it works, but I've had nothing but problems trying to get it working myself. It seems I'll have to let it go and find some other issue tracker when I really start needing one. I'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'll see...</p>
<p><span id="more-79"></span></p>
<h4>Entity types files</h4>
<p>Here's what a unit type file currently looks like. The interface for this is not fully implemented yet, but I hope I'll get that finished during this weekend.</p>
<div class="codecolorer-container python dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> artillerybrawl <span style="color: #ff7700;font-weight:bold;">import</span> component, entity<br />
<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<br />
<br />
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><br />
<br />
<span style="color: #ff7700;font-weight:bold;">class</span> Howitzer<span style="color: black;">&#40;</span>Unit<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; name = <span style="color: #483d8b;">&quot;howitzer&quot;</span><br />
<br />
&nbsp; &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>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; 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><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">mass</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">material</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">hitpoints</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">resistances</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Body</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_width</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_height</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_texture</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">collision_meshes</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Turret</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_offset</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_width</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_height</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_texture</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_min_angle</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_angle</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_power</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &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>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; 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><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Body</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; body_sprite = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;sprite&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; body_physics = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;physics&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; 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><br />
<br />
&nbsp; &nbsp; &nbsp; &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><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Turret</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; 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><br />
&nbsp; &nbsp; &nbsp; &nbsp; turret_sprite = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;sprite&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; turret_component = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;turret&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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><br />
<br />
&nbsp; &nbsp; &nbsp; &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>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#40;</span>turret_transform, turret_sprite, turret_component<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> body</div></div>
<p>And an actual unit base on the unit type above.</p>
<div class="codecolorer-container python dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> artillerybrawl <span style="color: #ff7700;font-weight:bold;">import</span> entity<br />
<br />
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><br />
<br />
<span style="color: #ff7700;font-weight:bold;">class</span> A1<span style="color: black;">&#40;</span>Howitzer<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; name = <span style="color: #483d8b;">&quot;A1&quot;</span><br />
<br />
&nbsp; &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>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; 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><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">mass</span> = <span style="color: #ff4500;">1000.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">material</span> = <span style="color: #483d8b;">&quot;metal&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">hitpoints</span> = <span style="color: #ff4500;">100</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">resistances</span> = <span style="color: black;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">&quot;kinetic&quot;</span>: <span style="color: #ff4500;">50.0</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Body</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_width</span> = <span style="color: #ff4500;">5.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_height</span> = <span style="color: #ff4500;">2.5</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_texture</span> = <span style="color: #483d8b;">&quot;a1&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">collision_meshes</span> = <span style="color: black;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#93;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Turret</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_width</span> = <span style="color: #ff4500;">5.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_height</span> = <span style="color: #ff4500;">1.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_texture</span> = <span style="color: #483d8b;">&quot;a1_turret&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_min_angle</span> = -<span style="color: #ff4500;">5.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_angle</span> = <span style="color: #ff4500;">85.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_power</span> = <span style="color: #ff4500;">100.0</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/06/28/entities-ahoy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Busy and exhausted</title>
		<link>http://www.brainfold.org/blog/2007/12/08/busy-and-exhausted/</link>
		<comments>http://www.brainfold.org/blog/2007/12/08/busy-and-exhausted/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 16:16:34 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[game development]]></category>
		<category><![CDATA[real life]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/2007/12/08/busy-and-exhausted/</guid>
		<description><![CDATA[Three days of training capoeira behind, one left (tomorrow). It's starting to feel quite exhausting, but has been really fun too! That's also the reason I haven't updated in a while, and haven't made much progress either. But I've done a bit... The plugin system and layout is hopefully more or less final (for) now [...]]]></description>
			<content:encoded><![CDATA[<p>Three days of training capoeira behind, one left (tomorrow). It's starting to feel quite exhausting, but has been really fun too! That's also the reason I haven't updated in a while, and haven't made much progress either. But I've done a bit...</p>
<p>The plugin system and layout is hopefully more or less final (for) now and the renderer is starting to get together again. I want to get the renderer plugin done and do some changes to resource management, then start working on scene management again. When that's sufficiently done, I can <span style="text-decoration: underline;">finally</span> start working on the actual game. I'm not going to work on the engine any more than the game requires. I also released a simple <a href="http://www.brainfold.org/blog/tools/">tool</a> for counting Python lines of code a couple of days ago.</p>
<p>Tomorrow's my final exam for this Autumn and on Friday the deadline for the <a href="http://www.brainfold.org/blog/category/studies/">infovis</a> project, so I will probably have a bit more time for hobby programming afterwards. The week after I'm going to my parents' for Xmas, and who knows what will happen after that...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2007/12/08/busy-and-exhausted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
