<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DkQFRXY4eCp7ImA9WxBWFUU.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723</id><updated>2010-02-07T17:11:54.830-06:00</updated><title>Arctic Paint weblog</title><subtitle type="html">The official weblog from the team at ArcticPaint.com</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://weblog.arcticpaint.com/" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/ArcticPaint" /><feedburner:info uri="arcticpaint" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DkQFRXY4fyp7ImA9WxBWFUU.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-4616147632858380907</id><published>2010-02-07T15:45:00.010-06:00</published><updated>2010-02-07T17:11:54.837-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-07T17:11:54.837-06:00</app:edited><title>Number Drill CDs</title><content type="html">My second shipment of 100 &lt;a href="http://numberdrill.com/"&gt;Number Drill&lt;/a&gt; CDs just got in from the &lt;a href="http://www.cdpostershop.com/"&gt;CD Poster Shop&lt;/a&gt;. I can say I am once again pleased with the result. The CD and printing quality is good. Definitely a great price if you are doing less than a 1000 CDs at a time.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_rxNCU1LuKD0/S282c_VJIAI/AAAAAAAAABk/pTI5y3MYmYM/s1600-h/IMG_2920.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 219px;" src="http://2.bp.blogspot.com/_rxNCU1LuKD0/S282c_VJIAI/AAAAAAAAABk/pTI5y3MYmYM/s400/IMG_2920.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5435623146923827202" /&gt;&lt;/a&gt;&lt;br /&gt;On my first order I had them send me the CDs blank. My thinking was I would just burn them as needed. I didn't think I would sell very many CDs, and surly not a 100 of them before I had the next version ready.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It turns out I under-estimated my distributer. I mailed off the last of my stock to them the same week I completed Number Drill 1.2. In other words, over the course of a few months I had to manually burn 100 CDs with the same version.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_rxNCU1LuKD0/S284UxTR_BI/AAAAAAAAABs/5dXioL8eQOw/s1600-h/IMG_2703.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 270px;" src="http://2.bp.blogspot.com/_rxNCU1LuKD0/S284UxTR_BI/AAAAAAAAABs/5dXioL8eQOw/s400/IMG_2703.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5435625204742224914" /&gt;&lt;/a&gt;&lt;div&gt;So this time I decided to send CD Poster Shop the iso and let them burn it. I was a little concerned as they don't exactly target microISVs.  But they did a good job and now I have 100 CDs burned and ready to send out the door (that I don't have to burn one at a time).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-4616147632858380907?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/3quFWkYbQm8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/4616147632858380907/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2010/02/number-drill-cds.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/4616147632858380907?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/4616147632858380907?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/3quFWkYbQm8/number-drill-cds.html" title="Number Drill CDs" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_rxNCU1LuKD0/S282c_VJIAI/AAAAAAAAABk/pTI5y3MYmYM/s72-c/IMG_2920.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2010/02/number-drill-cds.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4DRHoycCp7ImA9WxJbFk4.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-651357855795606450</id><published>2009-07-26T14:13:00.005-05:00</published><updated>2009-07-26T14:52:55.498-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-26T14:52:55.498-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Number Drill" /><category scheme="http://www.blogger.com/atom/ns#" term="packaging" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Pure Python to deb and rpm</title><content type="html">&lt;p&gt;I recently started supporting Number Drill, my &lt;a href="http://numberdrill.com/"&gt;math drill&lt;/a&gt; software, for Linux a few days ago. Number Drill is a pure python program with the external dependencies of pygame, rabbyt, PyOpenGL and a few others. All of which were in the Debian and Fedora repositories.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I originally tried using cx_Freeze to make a binary to distribute. But I kept on running into major problems with this method. And as it ended up I would have to include a plethora of .so files (such as all of pygame and everything that it depends on, libssl and everything it depends on etc) just to avoid version conflicts that resulted in segfaults. Not to mention the resulting package ending up far larger than it should be.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;That was about the time Matthew suggested just distributing the pyc files (gasp! I know, it's not open source) and letting package systems like deb and rpm handle dependencies. This method has ended up working almost perfectly. Both Ubuntu 9.04 and Fedora 11 have all the dependencies I require available. The resulting packages are very small (no binaries included, just the python byte code).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The only disadvantage is that it requires the latest versions of Ubuntu or Fedora (as of today) as they are the only releases that have new enough versions of my dependencies.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;We wrote a bash script that automatically packages up a pure python program into both a deb and rpm. If you are interested in here it is: &lt;a href="http://arcticpaint.com/static/blog/python_to_deb_rpm.sh"&gt;http://arcticpaint.com/static/blog/python_to_deb_rpm.sh&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I believe that this method of packaging is even more effective in the open source world. It essentially just makes getting your program to run from source as easy as possible.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-651357855795606450?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/4TTCuHF7b5s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/651357855795606450/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2009/07/pure-python-to-deb-and-rpm.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/651357855795606450?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/651357855795606450?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/4TTCuHF7b5s/pure-python-to-deb-and-rpm.html" title="Pure Python to deb and rpm" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2009/07/pure-python-to-deb-and-rpm.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMFSHw-eCp7ImA9WxJRFEU.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-759806406637397967</id><published>2009-05-16T09:54:00.004-05:00</published><updated>2009-05-16T10:06:59.250-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-16T10:06:59.250-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PyOpenGL" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="py2exe" /><title>PyOpenGL 3.0 with py2exe</title><content type="html">&lt;p&gt;One of the major hindrances  to using PyOpenGL before 3.0 was released (not python 3.0) was that packaging it with py2exe was next to impossible. Thankfully with the release of PyOpenGL 3.0 it is easy. Just include these two imports in one of your project files:&lt;/p&gt;&lt;pre class="prettyprint lang-py"&gt;from ctypes import util&lt;br /&gt;try:&lt;br /&gt;    from OpenGL.platform import win32&lt;br /&gt;except AttributeError:&lt;br /&gt;    pass&lt;/pre&gt;&lt;p&gt;That will tell py2exe which part of PyOpenGL to include. Otherwise you have to copy them over manually. Be sure to have the try and except around all win32 imports so your program remains cross platform.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-759806406637397967?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/VZEDXGUSzUg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/759806406637397967/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2009/05/pyopengl-30-with-py2exe.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/759806406637397967?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/759806406637397967?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/VZEDXGUSzUg/pyopengl-30-with-py2exe.html" title="PyOpenGL 3.0 with py2exe" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2009/05/pyopengl-30-with-py2exe.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMBR304eSp7ImA9WxJSF08.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-1668491597028552066</id><published>2009-05-07T13:23:00.008-05:00</published><updated>2009-05-07T14:10:56.331-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-07T14:10:56.331-05:00</app:edited><title>Better pygame and rabbyt texture loading</title><content type="html">&lt;p&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="margin-top: 8px; margin-right: 8px; margin-bottom: 8px; margin-left: 8px; font: normal normal normal small/normal arial; "&gt;&lt;span class="Apple-style-span"   style="  ;font-family:Georgia;font-size:16px;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;span&gt;&lt;span&gt;For one of my current projects I'm using rabbyt in conjunction with pygame. With the default texture loading, if your image dimensions are not powers of two your resulting sprite will be blurry. Pyglet fixes this by creating a new texture with correct dimensions, blitting your image onto the texture and then setting the texture coordinates. That way OpenGL doesn't do it's blurry scaling job on your image.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;Well, pygame's texture loading doesn't do that. So you either go to great pains to make sure all your textures are powers of two (which can be annoying when you don't want your sprites to be those sizes) or do the coordinate mapping manually.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;Here is a custom texture loading hook that does this on all textures when you load them:&lt;/span&gt;&lt;/span&gt;&lt;div style="margin-top: 8px; margin-right: 8px; margin-bottom: 8px; margin-left: 8px; font: normal normal normal small/normal arial; "&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia;font-size:130%;"&gt;&lt;span class="Apple-style-span"  style="font-size:16px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="prettyprint lang-py"&gt;from __future__ import division&lt;br /&gt;import pygame, rabbyt, sys, os&lt;br /&gt;import rabbyt&lt;br /&gt;from rabbyt._rabbyt import load_texture&lt;br /&gt;&lt;br /&gt;def next_pow2( n ):&lt;br /&gt;    """&lt;br /&gt;    Find the next power of two.&lt;br /&gt;    """&lt;br /&gt;    n -= 1&lt;br /&gt;    n = n | (n &gt;&gt; 1)&lt;br /&gt;    n = n | (n &gt;&gt; 2)&lt;br /&gt;    n = n | (n &gt;&gt; 4)&lt;br /&gt;    n = n | (n &gt;&gt; 8)&lt;br /&gt;    n = n | (n &gt;&gt; 16)    &lt;br /&gt;    n += 1&lt;br /&gt;    return n&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class Tex:&lt;br /&gt;    def __init__(self):&lt;br /&gt;        self.id = 0&lt;br /&gt;        self.width = 0&lt;br /&gt;        self.height = 0&lt;br /&gt;        self.tex_coords = (0,0,0,0)&lt;br /&gt;&lt;br /&gt;_texture_cache = {}&lt;br /&gt;def load_and_size(filename, filter=True, mipmap=True):&lt;br /&gt;    if filename not in _texture_cache:&lt;br /&gt;        pygame = __import__("pygame", {},{},[])&lt;br /&gt;        if os.path.exists(filename):&lt;br /&gt;            img = pygame.image.load(filename)&lt;br /&gt;        else:&lt;br /&gt;            img = pygame.image.load(os.path.join(data_directory, filename))&lt;br /&gt;        &lt;br /&gt;        t = Tex()&lt;br /&gt;        t.width,t.height = size = list(img.get_size())&lt;br /&gt;        size[0] = next_pow2(size[0])&lt;br /&gt;        size[1] = next_pow2(size[1])&lt;br /&gt;        t.tex_coords = (0,t.height/size[1],t.width/size[0],0)&lt;br /&gt;            &lt;br /&gt;        n = pygame.Surface(size, pygame.SRCALPHA|pygame.HWSURFACE, img)&lt;br /&gt;        n.blit(img, (0,size[1]-t.height))&lt;br /&gt;        &lt;br /&gt;        data = pygame.image.tostring(n, 'RGBA', True)&lt;br /&gt;        t.id = load_texture(data, size, "RGBA", filter, mipmap)&lt;br /&gt;        _texture_cache[filename] = t&lt;br /&gt;    return _texture_cache[filename]&lt;br /&gt;&lt;br /&gt;rabbyt.set_load_texture_file_hook(load_and_size)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-1668491597028552066?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/gC7APHPov40" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/1668491597028552066/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2009/05/better-pygame-and-rabbyt-texture.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/1668491597028552066?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/1668491597028552066?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/gC7APHPov40/better-pygame-and-rabbyt-texture.html" title="Better pygame and rabbyt texture loading" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2009/05/better-pygame-and-rabbyt-texture.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4GRno7fyp7ImA9WxVbFU8.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-7994197144424588080</id><published>2009-03-31T12:05:00.003-05:00</published><updated>2009-03-31T13:08:47.407-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-31T13:08:47.407-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gondola" /><category scheme="http://www.blogger.com/atom/ns#" term="pyweek" /><title>Gondola and 4 types of players</title><content type="html">Gondola was our pyweek 7 entry. Based on &lt;a href="http://pyweek.org/e/yat/ratings/"&gt;feedback there&lt;/a&gt; and elsewhere I have concluded that, at least when it comes to Gondola, there are four types of players.&lt;br /&gt;&lt;br /&gt;1. Those that wanted to optimize their networks. A player from this group can spend hours playing on just one map, trying to make things run better. The ideal group to be in to enjoy Gondola.&lt;br /&gt;&lt;br /&gt;2. Those that wanted to solve a puzzle. They lay out their networks and then they're done. Either they don't realize it or it just doesn't appeal to them to go back and optimize their routs. Keeping these players going takes a lot of large and complex maps. Maps also require some sort of goal; something to work towards and be able to fail at doing. Which is something Gondola's current selection of maps does not provide.&lt;br /&gt;&lt;br /&gt;3. Those that just want explosions. Gondola is similar to simcity in the sense that it is a simulation and a toy. There is no real goal other than to do better that you have before. But one thing that Gondola doesn't have that simcity does is explosions. There are no futureistic robots that come and wipe out your infrustructor. No fires, tordadoes or anything else destructive.&lt;br /&gt;&lt;br /&gt;4. Those that just didn't get it. I guess the game, for some people, isn't explained well enough. I don't blame them at all because the tutorial really isn't that comprehensive. I wish I knew in what way they didn't get it though, so I could address the confusing aspects. A game, idealy, should not require any explination or even a tutorial in order to start playing; Something I am still trying to figure out how to do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-7994197144424588080?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/wLOmspfEw3o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/7994197144424588080/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2009/03/gondola-and-4-types-of-players.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/7994197144424588080?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/7994197144424588080?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/wLOmspfEw3o/gondola-and-4-types-of-players.html" title="Gondola and 4 types of players" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2009/03/gondola-and-4-types-of-players.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYCSHs9eSp7ImA9WxVVGE0.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-8616757119739877201</id><published>2009-03-11T16:45:00.002-05:00</published><updated>2009-03-11T16:49:29.561-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-11T16:49:29.561-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Arctic Paint" /><title>Officially moved</title><content type="html">So I have officially moved this blog (to here) for the third and (hopefully) last time. I really need to stop though because with every move not only do all the comments get cleared but I end up not moving most of the posts. Maybe that's a good thing - keeps the lower quality posts out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-8616757119739877201?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/70aJ9rhW_sg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/8616757119739877201/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2009/03/officially-moved.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/8616757119739877201?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/8616757119739877201?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/70aJ9rhW_sg/officially-moved.html" title="Officially moved" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2009/03/officially-moved.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIAQX0_fip7ImA9WxVVFEs.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-8148805738305263198</id><published>2009-03-07T11:14:00.010-06:00</published><updated>2009-03-07T17:29:00.346-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-07T17:29:00.346-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="implementation details" /><category scheme="http://www.blogger.com/atom/ns#" term="snowballz" /><category scheme="http://www.blogger.com/atom/ns#" term="optimization" /><title>Zooming and performance</title><content type="html">One problem I was continually having with SnowballZ was zooming. The further you zoomed out the slower it went (as, obviously, it had to draw everything). To the point where zoomed all the way in would give me 120fps and all the way out 30fps. Unacceptable.&lt;br /&gt;&lt;br /&gt;I started working on making it fade into a paper-looking map when zooming out; So I could strip out the trees and terrain. But on the fly cartography that looks even half way decent is a lot of work. That's when Matthew suggested rendering the entire map to a texture. Bingo.&lt;br /&gt;&lt;br /&gt;I created a function that set the viewport to cover the entire map and rendered just the terrain, trees and other decor to an off-screen buffer; Which I then saved to a texture. Now when the player zooms out to a certain point it switches to drawing that &lt;span style="font-style: italic;"&gt;one&lt;/span&gt; texture which, compared to a 80,000+ vertex terrain and a couple hundred trees, is much faster.&lt;br /&gt;&lt;br /&gt;The one drawback of this method is that it isn't perfectly seamless. But you wouldn't notice the difference unless you were looking for it. I rendered to a 1024x1024 texture so it is a little blurry when you use it too close up. This could be solved by rendering it to a larger texture but my concern comes when you have a map that is bigger than my 150x150 tiles (odd number, I know).&lt;br /&gt;&lt;br /&gt;If there is any interest in seeing how I did it here it is:&lt;br /&gt;(slightly modified for clarity out of context, my thanks to Richard Jones for showing how to do this on the pyglet mailing list)&lt;br /&gt;&lt;pre class="prettyprint lang-py"&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="com"&gt;# create our frame buffer&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;fbo &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;GLuint&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;glGenFramebuffersEXT&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; ctypes&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;byref&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;fbo&lt;/span&gt;&lt;span class="pun"&gt;))&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;glBindFramebufferEXT&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_FRAMEBUFFER_EXT&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; fbo&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com"&gt;# allocate a texture and add to the frame buffer&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;tex &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; image&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Texture&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;create_for_size&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_TEXTURE_2D&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt; 1024&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt; 1024&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; GL_RGB&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;glBindTexture&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_TEXTURE_2D&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; tex&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;id&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;glFramebufferTexture2DEXT&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_FRAMEBUFFER_EXT&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; GL_COLOR_ATTACHMENT0_EXT&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;GL_TEXTURE_2D&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; tex&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;id&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;status &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; glCheckFramebufferStatusEXT&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_FRAMEBUFFER_EXT&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;assert&lt;/span&gt;&lt;span class="pln"&gt; status &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; GL_FRAMEBUFFER_COMPLETE_EXT&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com"&gt;# now render&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;glBindFramebufferEXT&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_FRAMEBUFFER_EXT&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; fbo&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com"&gt;# Snipped. This is where I render my map. See lib/map/display.py for full code.&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com"&gt;# clean up&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;glDeleteFramebuffersEXT&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; ctypes&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;byref&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;fbo&lt;/span&gt;&lt;span class="pun"&gt;))&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;self&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;offscreen_map &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; rabbyt&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Sprite&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;tex&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; shape&lt;/span&gt;&lt;span class="pun"&gt;=(&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;map_w&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;map_h&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;),&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;tex_shape&lt;/span&gt;&lt;span class="pun"&gt;=(&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;))&lt;/span&gt;&lt;/pre&gt;Using this method requires a certain OpenGL extension that older hardware might not have. You are also limited to a max texture resolution. Which could be an issue when it comes to large maps, even on newer hardware.&lt;br /&gt;&lt;br /&gt;A method that avoids both of these problems is to split up your prerendering of the terrain into sections of 512x512 textures. That avoids the sharpness problem. As long as your section resolutions are smaller than your screen size you can render them to the backbuffer and copy that to a texture, which avoids GL extention problems.&lt;br /&gt;&lt;br /&gt;This is how I'm doing it:&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint lang-py"&gt;&lt;span class="pln"&gt;chunk_res &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;2048&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;chunk_tex_res &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;512&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;num_chunks &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;map_w&lt;/span&gt;&lt;span class="pun"&gt;//&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; map_h&lt;/span&gt;&lt;span class="pun"&gt;//&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;glClearColor&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;for&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="kwd"&gt;in&lt;/span&gt;&lt;span class="pln"&gt; range&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;num_chunks&lt;/span&gt;&lt;span class="pun"&gt;[&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;]):&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span class="kwd"&gt;for&lt;/span&gt;&lt;span class="pln"&gt; y &lt;/span&gt;&lt;span class="kwd"&gt;in&lt;/span&gt;&lt;span class="pln"&gt; range&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;num_chunks&lt;/span&gt;&lt;span class="pun"&gt;[&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;]):&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       tex &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; image&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Texture&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;create_for_size&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_TEXTURE_2D&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;               chunk_tex_res&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; chunk_tex_res&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; GL_RGB&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;       l &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; x&lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;br /&gt;       t &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;br /&gt;       r &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; x&lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;br /&gt;       b &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;br /&gt;       glMatrixMode&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_PROJECTION&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       glLoadIdentity&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       glViewport&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;chunk_tex_res&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;chunk_tex_res&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       glOrtho&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;l&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; r&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; t&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="lit"&gt;1000&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;1000&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       glMatrixMode&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_MODELVIEW&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       glLoadIdentity&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       glClear&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_COLOR_BUFFER_BIT&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span class="com"&gt;# (Snipped) Render your map here.&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;       glBindTexture&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_TEXTURE_2D&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; tex&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;id&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       glTexParameteri&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_TEXTURE_2D&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; GL_TEXTURE_WRAP_S&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; GL_CLAMP_TO_EDGE&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       glTexParameteri&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_TEXTURE_2D&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; GL_TEXTURE_WRAP_T&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; GL_CLAMP_TO_EDGE&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;       glCopyTexImage2D&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;GL_TEXTURE_2D&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; GL_RGB&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;               chunk_tex_res&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; chunk_tex_res&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span class="kwd"&gt;self&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;offscreen_chunks&lt;/span&gt;&lt;span class="pun"&gt;[(&lt;/span&gt;&lt;span class="pln"&gt;x&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;y&lt;/span&gt;&lt;span class="pun"&gt;)]&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; rabbyt&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Sprite&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;tex&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;               x&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt;x&lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt;y&lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;               shape&lt;/span&gt;&lt;span class="pun"&gt;=(&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;chunk_res&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; chunk_res&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;))&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;glViewport&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="kwd"&gt;self&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;scene&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;view&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;width&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="kwd"&gt;self&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;scene&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;view&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;height&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-8148805738305263198?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/dKh2NE7c92Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/8148805738305263198/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2009/03/zooming-and-performance.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/8148805738305263198?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/8148805738305263198?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/dKh2NE7c92Y/zooming-and-performance.html" title="Zooming and performance" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2009/03/zooming-and-performance.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AERXs4eCp7ImA9WxVWFE8.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-8335063413782482374</id><published>2009-02-23T14:17:00.006-06:00</published><updated>2009-02-23T16:55:04.530-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-23T16:55:04.530-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="AI" /><category scheme="http://www.blogger.com/atom/ns#" term="gameplay" /><category scheme="http://www.blogger.com/atom/ns#" term="snowballz" /><title>Penguins with emotions</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_rxNCU1LuKD0/SaMEmsTdbNI/AAAAAAAAAAk/sd36VKS1z_4/s1600-h/screen3.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 313px; height: 372px;" src="http://1.bp.blogspot.com/_rxNCU1LuKD0/SaMEmsTdbNI/AAAAAAAAAAk/sd36VKS1z_4/s400/screen3.png" alt="" id="BLOGGER_PHOTO_ID_5306089848746896594" border="0" /&gt;&lt;/a&gt;Having the penguins share your emotions is a great way to connect with the player. When your little posse is outnumbered 4 to 1 your penguins don't like it any more than you do!&lt;br /&gt;&lt;br /&gt;In fact, as they aren't exactly the most mature little creatures, they'll get down right angry. To the point where they will throw their snowballs faster, harder and further.&lt;br /&gt;&lt;br /&gt;When your on the wrong end of the deal you might find it a little annoying how these little guys don't even take time to aim. Normally that would be a good thing but each snowball, even when thrown just in your general direction, will hit at least one of your penguins.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-8335063413782482374?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/0tOCSE9YduA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/8335063413782482374/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2009/02/penguins-with-emotions.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/8335063413782482374?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/8335063413782482374?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/0tOCSE9YduA/penguins-with-emotions.html" title="Penguins with emotions" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_rxNCU1LuKD0/SaMEmsTdbNI/AAAAAAAAAAk/sd36VKS1z_4/s72-c/screen3.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2009/02/penguins-with-emotions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4CSH87fSp7ImA9WxVWE0k.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-545956138814773970</id><published>2009-02-22T17:22:00.008-06:00</published><updated>2009-02-22T17:56:09.105-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-22T17:56:09.105-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="snowballz" /><category scheme="http://www.blogger.com/atom/ns#" term="user interface" /><title>Run my little penguins, run!</title><content type="html">For the next release of snowballz I'm trying to simplify the user interface for two reasons; So it's easier for players to learn and secondly (and most importantly at this point) it's easier for me.&lt;br /&gt;&lt;br /&gt;One issue I've always had with controlling the penguins is the run mode. In versions 0.9.x, by middle clicking you tell your penguins to run without stop, regardless of enemies, to where you send them. A great way to get your snowballers behind enemy lines. Apposed to if you were to just right click, in which case they would stop and throw snowballs at enemies.&lt;br /&gt;&lt;br /&gt;The one problem I've had with this method is that it isn't obvious. No-one would ever discover it, which could be frustrating.&lt;br /&gt;&lt;br /&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_rxNCU1LuKD0/SaHlsdj82QI/AAAAAAAAAAc/Q0Yohu9kgfM/s800/run.png" alt="" id="BLOGGER_PHOTO_ID_5305774388031576322" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;That's when I remembered hearing about an article talking about networking RTS games. One interesting thing that the article mentioned was to filter out rapid clicking; As players tend to repeatedly tell their units to go to one spot as if it made them get there faster. Thus saving network bandwidth (it was an old article written when most people had dialup).&lt;br /&gt;&lt;br /&gt;So why not use this behavior to do what the player expects? So I got rid of the confusing middle click and set it so that when a player rapidly tells their penguins to move it adds a double arrow to the move icon (which specifies run mode). And their penguins will run through the middle of a snowball fight without stopping until they get to where you sent them.&lt;br /&gt;&lt;br /&gt;And there we go. The run feature will be discovered just by playing. It doesn't have to be in a tutorial or tips &amp;amp; tricks. Now let's see if I can get the rest of the interface like that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-545956138814773970?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/zL0fS66N3As" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/545956138814773970/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2009/02/run-my-little-penguins-run.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/545956138814773970?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/545956138814773970?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/zL0fS66N3As/run-my-little-penguins-run.html" title="Run my little penguins, run!" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_rxNCU1LuKD0/SaHlsdj82QI/AAAAAAAAAAc/Q0Yohu9kgfM/s72-c/run.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2009/02/run-my-little-penguins-run.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAHSHs5cCp7ImA9WxVVF0Q.&quot;"><id>tag:blogger.com,1999:blog-8413630985167522723.post-8274147585623752526</id><published>2008-09-02T14:09:00.000-05:00</published><updated>2009-03-11T14:12:19.528-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-11T14:12:19.528-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gondola" /><category scheme="http://www.blogger.com/atom/ns#" term="pyweek" /><title>Our entry in pyweek 7</title><content type="html">This past pyweek (#7) was the first that Matthew and I got to compete in. It was a lot of fun and it resulted in &lt;a href="http://arcticpaint.com/games/gondola/"&gt;Gondola&lt;/a&gt;. Gondola has turned out to be a very fun game; especially if you are the type that likes laid back games such as simcity or transport tycoon … or have an odd passion for optimizing distribution networks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8413630985167522723-8274147585623752526?l=weblog.arcticpaint.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ArcticPaint/~4/rV6V5TJc2Cw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://weblog.arcticpaint.com/feeds/8274147585623752526/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://weblog.arcticpaint.com/2008/09/our-entry-in-pyweek-7.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/8274147585623752526?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8413630985167522723/posts/default/8274147585623752526?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ArcticPaint/~3/rV6V5TJc2Cw/our-entry-in-pyweek-7.html" title="Our entry in pyweek 7" /><author><name>Joey</name><uri>http://www.blogger.com/profile/10151623862772058797</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14166482683567736578" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://weblog.arcticpaint.com/2008/09/our-entry-in-pyweek-7.html</feedburner:origLink></entry></feed>
