<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Mega Great</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/" />
    <link rel="self" type="application/atom+xml" href="http://claytonhughes.com/mega_great/atom.xml" />
    <id>tag:claytonhughes.com,2009-08-08:/mega_great//1</id>
    <updated>2010-11-05T08:20:01Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.3-en</generator>

<entry>
    <title>Hit My Goal Today!</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/11/hit-my-goal-today.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.34</id>

    <published>2010-11-05T08:15:40Z</published>
    <updated>2010-11-05T08:20:01Z</updated>

    <summary><![CDATA[I think I just have to give up the&nbsp;pretension&nbsp;of ever hoping to get anything written on a weekday.I'll see you all tomorrow, or more likely Saturday.In the meantime, though, I've been doing a teensy bit of work. &nbsp;It's all in...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
    <category term="nanogamo" label="NaNoGaMo" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[I think I just have to give up the&nbsp;pretension&nbsp;of ever hoping to get anything written on a weekday.<div style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 191); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(0, 0, 0); margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; text-align: left; width: auto; direction: ltr; z-index: 99995; background-position: initial initial; background-repeat: initial initial; "></div><div><br /></div><div>I'll see you all tomorrow, or more likely Saturday.</div><div><br /></div><div>In the meantime, though, I've been doing a teensy bit of work. &nbsp;It's all in C# and so not really usable, but I hope to play around with the interface and some actual gameplay. &nbsp;I'm hoping to get something that resembles fun without any narrative or anything. &nbsp;I'm sort of doubting my ability to do that, but we'll see. &nbsp;I'll go into more detail when it isn't post-1AM and I have to be up in a few hours.</div><div><br /></div><div>Here's some proof:</div><div><br /></div><object width="640" height="390"><param name="movie" value="http://www.youtube.com/v/Ef0b1-PfrL8&amp;hl=en_US&amp;feature=player_embedded&amp;version=3" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://www.youtube.com/v/Ef0b1-PfrL8&amp;hl=en_US&amp;feature=player_embedded&amp;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="390"></object><div style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 191); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(0, 0, 0); margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; text-align: left; width: auto; direction: ltr; z-index: 99995; background-position: initial initial; background-repeat: initial initial; "></div>]]>
        
    </content>
</entry>

<entry>
    <title>A Slow Start</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/11/a-slow-start.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.33</id>

    <published>2010-11-02T07:43:06Z</published>
    <updated>2010-11-02T07:56:05Z</updated>

    <summary>Since Washington State and King County have abandoned the sacred institution of the secret ballot in favor of saving some change and forcing everyone to go buy a stamp and mail in their votes, I had to spend much of...</summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="NaNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="xnac" label="XNA C#" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[Since Washington State and King County have abandoned the sacred institution of the secret ballot in favor of saving some change and forcing everyone to go buy a stamp and mail in their votes, I had to spend much of this Nov. 1 doing my democratic duty with a pen. &nbsp;Other duties performed today, include, but are not limited to: fatherly, husbandly, and juggle-ly.<div><br /></div><div>Anyway, I had like 20 minutes left in the day to work on it. &nbsp;I decided since it was only a small amount of time, prototyping would be a good idea! &nbsp;I fired up the ol' Visual Studio and created a new C# program--my prototyping language of choice, due to its rapid compile and coding times, without giving up such niceties as a familiar syntax and strict compile-time typing--and realized, staring at a WinForm, that it would be sort of a pain to get sprites on it moving around and doing things. &nbsp;In retrospect, it probably wouldn't really be that bad. &nbsp;But it seemed pretty&nbsp;unpalatable&nbsp;to me at the time.</div><div><br /></div><div>So I went and (spent quite a lot of time) downloading XNA Game Studio 4.0, having used the 2.0 carnation to create a game rather successfully and enjoyably in the past. &nbsp;The goal here is still to target mobile devices with code mostly in C++ (and XGS4 actually targets Windows Phone 7 (aliass WP7, WinMo7), though I probably won't be using that--I hear there's no native code at all!)</div><div><br /></div><div>Anyway - the goal, as I said - is a quick prototype on the PC. &nbsp;Hopefully I'll be able to mimic finger gestures to some extent with a mouse (laptop&nbsp;track pad&nbsp;may prove helpful here).</div><div><br /></div><div>Speaking of XNA Game Studio 4 - if you just want that package, and not all of the other crap (like a free version of VS 2010 that won't install if you're still on XP--nevermind that the paid version installed fine on XP), then you can grab it here: &nbsp;<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9ac86eca-206f-4274-97f2-ef6c8b1f478f">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9ac86eca-206f-4274-97f2-ef6c8b1f478f</a></div><div><br /></div><div>Tomorrow: &nbsp;Some actual progress (I hope), plus I talk about games on the Kindle! Though only briefly and tangentially, so don't get your hopes too up or down.</div>]]>
        
    </content>
</entry>

<entry>
    <title>Quick Note</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/10/quick-note.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.32</id>

    <published>2010-11-01T07:00:23Z</published>
    <updated>2010-11-01T07:03:46Z</updated>

    <summary><![CDATA[I was planning to get this out yesterday, but it appears the clock has just rolled over.Anyway - November is, of course,&nbsp;NaNoWriMo. &nbsp;I will be picking up the game thing again. &nbsp;There will be no StarCraft 2 to distract me...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[I was planning to get this out yesterday, but it appears the clock has just rolled over.<div style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 191); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(0, 0, 0); margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; text-align: left; width: auto; direction: ltr; z-index: 99995; background-position: initial initial; background-repeat: initial initial; "></div><div><br /></div><div>Anyway - November is, of course,&nbsp;<a href="http://www.nanowrimo.org">NaNoWriMo</a>. &nbsp;I will be picking up the game thing again. &nbsp;There will be no StarCraft 2 to distract me half-way through though! &nbsp;(Although Rock Band 3 <b>did</b>&nbsp;just come out, I think I can restrain myself).</div><div><br /></div><div>So, the goal: &nbsp;1.5+ hours per day working on the game. &nbsp;Either design thoughts, coding, prototyping, etc.</div><div><br /></div><div>I'm sort of scared about prototyping here. &nbsp;I have a feeling I'll get something workable in a nice easy-to-code-in language that is fun and then have no desire to write it again "for real this time" in a more-phone-friendly language.</div><div><br /></div><div>I guess it'd run on WinPhone7, though.</div><div><br /></div><div>(I suck at Quick Notes. &nbsp;Anyway, see you guys with an update in about 23 hours.)</div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Phone!</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/phone.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.31</id>

    <published>2010-07-29T06:46:15Z</published>
    <updated>2010-07-29T07:28:24Z</updated>

    <summary><![CDATA[I received, about a week early, my Droid Incredible in the mail today! &nbsp;That was cool. &nbsp;I plugged it in, promptly rooted it and made a restore backup image to NAND. &nbsp;I'm considering doing the overclocking/custom ROM thing, although I'm...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[I received, about a week early, my Droid Incredible in the mail today! &nbsp;That was cool. &nbsp;I plugged it in, promptly rooted it and made a restore backup image to NAND. &nbsp;I'm considering doing the overclocking/custom ROM thing, although I'm mostly interested in an early copy of FroYo (rather than waiting for the Sense-UI OTA version). &nbsp;Since I'm still getting used to things, I probably won't miss Sense if I do that.<div><br /></div><div>I also synched contacts with my Gmail account -- I'm not so sure that was a good idea. &nbsp;Now I've got a phone contact for every last person I've e-mailed (it feels like). &nbsp;support@paypal.com? &nbsp;Ugg, why is that there. &nbsp;I've got some pruning to do. &nbsp;I found an option to trim it down to just those I had phone numbers for, but my contact book was pretty sparse on that. &nbsp;Guess I'll have to rectify it.</div><div><br /></div><div>Game-wise: &nbsp;I've done a bit more thinking about how things should work, and it's not exactly TDD worthy but at least I have some solid thoughts on the matter. &nbsp;No plan survives the enemy and all that, so I think my next big coding step (after fixing the snafu I'm about to describe) will be to figure out how to Profile this stuff. &nbsp;Whether I wrote my own code (probably necessary), or can somehow use the Android tools. &nbsp;I'll also try debugging on my device, since I have that now. &nbsp;Should be fun!</div><div><br /></div><div>So, as things currently stand, about a few hours into making the document I got bored and wanted to write some code. &nbsp;I coded up a C++ test rig and wrote a few test cases for my reals class. &nbsp;Ideally, I want the reals to work like any other built-in type, so this means I've got some operator-overloaded muck to deal with.</div><div><br /></div><div>The usual stuff wasn't that big of a deal: &nbsp;arithmetic and arithmetic-assignment operators are all done, as well as logical comparisons--inequalities (and equalities, I suppose). I had also coded up some constructors, assignment operators, and some cast operators, but they were causing me no end of grief with the equality operators. &nbsp;Briefly, it couldn't decide how to handle equality, so in a case like this:<br />&nbsp;&nbsp;real r = 32.2f; float f = 32.2f;</div><div>&nbsp;&nbsp;if( r == f ) { // ...<br />it would call real(32.2f) to convert that number to a real type, but then when it got to the second line, it didn't know whether to call real(float) with f to convert f to a float, or to call real::operator float() to convert r down to a float before it could compare them. &nbsp;And then there was some ugly template mess thrown into the mix. &nbsp;(The fixed-point version of real uses an int template to determine where exactly the point is.)</div><div><br /></div><div>Anyway, I solved <b>that</b>&nbsp;problem by getting rid of the constructors, but through some sequence of events that eludes me unless I sit and think really hard (like, with pencil and paper) about it, it managed to break my list class (and my vector class). &nbsp;Something about how my list was expecting &lt;T&gt;'s (just any old type), but I guess it was trying to construct them and that didn't work, and so I tried to change it to take pointer-to-&lt;T&gt;'s, but that doesn't work in the simple value-case where I don't mind if it gets copied around. &nbsp;That is, I can't just have a list of ints (or vectors) anymore, I have to specifically allocate each one somewhere and then keep track of it. &nbsp;It's sort of a mess.</div><div><br /></div><div>I've downloaded a few STL implementations and if I can manage to decipher the typedef/macro insanity that all STL implementors feel is necessary, I'll try to do something similar in my own class. &nbsp;I suspect I may have to create my own allocator for the case where I want to store simple value-types that are larger than a native pointer. &nbsp;This isn't a huge problem, though, since I was planning on creating a couple fixed-size allocators to use for such a purpose. &nbsp;I'll just&nbsp;cordon&nbsp;off a smallish chunks of memory near the end for 4, 8, 16, and 32 byte allocations and be happy (well, maybe not 4 bytes, that's a bit small).</div><div><br /></div><div>Goals for the immediate future include: figuring out what chain of events fixing my real type causes lists to explode, documenting it, and fixing all of that so that it compiles.</div><div><br /></div><div>Oh, I should manage that I have like three working directories now. &nbsp;My trunk, which I've sort of given up on because it's in all sort of non-compile state: &nbsp;I was trying to port some things around and it's been a while since I looked at it so all I know right now is that it doesn't compile. &nbsp;I spawned a new repository from the latest commit in that (which compiled), and used that to fix some of the issues I discovered while writing the test cases. &nbsp;I was able to commit those changes, push them back into the trunk repo, pull and (seemlessly!) merge those changes down into the test repo, and then push a bit of the test rig setup back to the main repo. &nbsp;It was all so smooth. &nbsp;It's amazing! &nbsp;SVN has nothing on this. &nbsp;(I hear Perforce might be okay, but I have to wonder how much the cost of it helps indoctrinate its users into thinking it's so great. &nbsp;While that can be had for <a href="http://www.perforce.com/perforce/price.html#eval">free</a>&nbsp;for individual users, I can't imagine it being as painless to use as <a href="http://mercurial.selenic.com">Mercurial</a> is.)</div><div><br /><div><br /></div><div><br /></div></div>]]>
        
    </content>
</entry>

<entry>
    <title>Weekdays are so short</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/weekdays-are-so-short.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.30</id>

    <published>2010-07-20T06:29:52Z</published>
    <updated>2010-07-20T07:15:07Z</updated>

    <summary><![CDATA[I realized I was going to talk about my goals, but I didn't really set them. &nbsp;Or well, I probably did, but I forgot about them once they were achieved. &nbsp;I'll write them down next time.I spent a pretty amazing...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[I realized I was <a href="http://claytonhughes.com/mega_great/2010/07/progress.html">going to talk about my goals</a>, but I didn't really set them. &nbsp;Or well, I probably did, but I forgot about them once they were achieved. &nbsp;I'll write them down next time.<div><br /></div><div>I spent a pretty amazing time this weekend hammering out some things on the game. &nbsp;First, I had fixed some pernicious bugs that were plaguing my graphics system. &nbsp;I can now appropriately texture things (with different! gasp textures). &nbsp;The issue seemed wholly unrelated, and I think is another problem with the OpenGL implementation (which is a software renderer, I discovered. &nbsp;Although I'm not sure why that's surprising, since I'm running on an emulator anyway). &nbsp;It turns out that the GLES spec <i><a href="http://www.khronos.org/opengles/sdk/1.1/docs/man/">specifies</a></i><a href="http://www.khronos.org/opengles/sdk/1.1/docs/man/">&nbsp;</a>that the GL State should remain completely unchanged if an error occurs in a function, as if the call was never called at all (there's an exception for out of memory errors, which are allowed to totally break everything completely). &nbsp;Well, turns out one of my calls was producing an error, and fixing that was a necessary, though not sufficient, part of the solution. &nbsp;It turns out that two of the parameters you pass to the function to glTexImage2D (the function to configure 2D Textures) need to be the same, and I was accidentally passing in different values - I had written some code to derive the second value based on the texture as loaded from the file, but the first value was old code from where I was assuming everything was the same. &nbsp;I don't really remember what else I had to do to get it fixed, but it did eventually happen. &nbsp;Here's Proof: &nbsp;<div><br /><div style="text-align:center"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/aGZgDCZZzt8&amp;hl=en_US&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://www.youtube.com/v/aGZgDCZZzt8&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></object></div><br /></div><div>By Sunday, I was growing pretty tired of working with C++, so I dove into the much friendlier C# and whipped up a pretty awesome tool. &nbsp;I now have a nice command-line utility and a bash script (I was apparently not content to go completely without suffering)&nbsp;that will take a directory, compress it to a new file with zlib, and then combine those files into a custom file format. &nbsp;It's essentially gzip + tar (or just a .zip archive, on Windows), but less general, and probably better compression since I throw away directory information. &nbsp;Also I didn't have to look up the tar format and could roll my own pretty easily. &nbsp;The tool also outputs a header file for inclusion in C/C++ that creates identifiers for the assets based on where they are in the filesystem. &nbsp;So, after running bpack on /assets, I can refer to the file at /assets/foo/bar.tga as BPKID_FOO_BAR_TGA. &nbsp;You didn't think I was completely throwing away the directory structure, did you? &nbsp;In the header it's just #defined to a unique integer. &nbsp;The idea being I can write a module (some of which I've written today) that will associate the number with an offset in the archive, and then read it, un-zlib it, and return the data when it's requested, and that throughout the rest of the game, I can just ask for assets by their BPKIDs.</div><div><br /></div><div>Speaking of the amount of work I've gotten done today, it feels like virtually nothing. &nbsp;And I keep running up across questions I've been putting off. &nbsp;Things l like "where should the memory for this be allocated?" or "Which module should be responsible for <i>x</i>" or "On an error, should I halt here? &nbsp;Throw up a return code? &nbsp;Keep going if I'm in a relatively recoverable state?" &nbsp;I should really whip up a technical design document which begins to address these things.</div></div><div><br /></div><div>I started on something like that once, but it got hard to think about and so turned into a Coding style document. &nbsp;I don't need a coding style document, it's just me! &nbsp;(Although it probably wouldn't hurt, since I do tend to change my style slightly from day to day because I think something seems a little better or worse for the situation at hand--e.g. sometimes <b>int Value()</b> feels nicer to me than <b>int GetValue()</b>. &nbsp;It would definitely behoove me to stick to something logical).</div><div><br /></div><div>So, there you have it - my goal for tomorrow is to come up with a draft of the document which will describe what I'm trying to accomplish with each module at nice medium-depth level, so that I won't have to worry too hard about making those decisions while I'm coding, which will hopefully let me just code, and not have to pull my head out and start thinking about the big picture. &nbsp;I'll have a postcard of the big picture next to me so I can just do what it says :)</div><div><br /></div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Progress!</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/progress.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.29</id>

    <published>2010-07-18T08:14:08Z</published>
    <updated>2010-07-20T07:16:25Z</updated>

    <summary><![CDATA[I've been scolded for not having written lately. &nbsp;It was a combination of factors, but largely the fault is mine. &nbsp;I am now amending the situation, hopefully.An interesting thing happened, which is that it got a bit harder to keep...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[I've been scolded for not having written lately. &nbsp;It was a combination of factors, but largely the fault is mine. &nbsp;I am now amending the situation, hopefully.<div><br /></div><div>An interesting thing happened, which is that it got a bit harder to keep doing work as the month wore on. &nbsp;This feels very much like the mid-week demotivation that also occurs in NaNoWriMo, which I thought was interesting. &nbsp;Combined that with one day forgetting to bring home the power to my laptop, a growing desire to play some games, a house to myself all evening, and Mass Effect 2 already installed, and sitting with just a few hours in it yet, and I missed a day of work, and the next day it was also hard to pick myself back up again. &nbsp;I think that after today, though, I probably caught up with most of what I missed.</div><div><br /></div><div>I ran CLOC on my project and was surprised by the results: &nbsp;only about 2000 lines of code, maybe another 1000 of whitespace and comments. &nbsp;I would've thought it would have been much more than that, but that shows what I know. &nbsp;(And a bunch of that is stuff I #included, like hundreds of lines of GL declarations).</div><div><br /></div><div>There's been a few things that have cropped up over the last few days that I wanted to highlight. &nbsp;Here goes:</div><div><br /></div><div><ul><li>Old Spice has <a href="http://www.youtube.com/oldspice#p/c/484F058C3EAF7FA6">won advertising</a>&nbsp;by creating TV-quality short YouTube responses to about two hundred people who posted on the internet (sometimes not even to them). &nbsp;These are absolutely hilarious. &nbsp;Everyone else go home and try harder. &nbsp;<a href="http://www.readwriteweb.com/archives/how_old_spice_won_the_internet.php">How they did it is pretty interesting, too.</a></li><li>I ran across <a href="http://positech.co.uk/cliffsblog/">Cliffski's blog</a> again yesterday, and stumbled across <a href="http://positech.co.uk/cliffsblog/?p=753">this list</a> for staying motivated on the game you're working on. &nbsp;It was a nice read, since I was struggling with that. &nbsp;I seem to have overcome it, though.</li><li>I managed to fix the doorbell - turns out there were a few jumpers on the inside of the ringer and the speaker. &nbsp;I was able to find the instructions online and change it so that it didn't interfere with our neighbors, and it now plays a nice normal 2-chime "ding dong." &nbsp;It holds the last note a little obnoxiously long, but I can deal with it.</li><li>The 12th has come and gone and I didn't get a call from any of the 3 or 4 Verizon retailers I asked to call me when the Incredible got back in stock. &nbsp;I'm guessing they have them and they're just lazy, but who knows. &nbsp;Gives me more time to double-check to make sure that paying extra for the phone and buying pay-as-you-go minutes isn't a better deal (for my usage habits) than signing up for another 2 year contract.</li><li>C++ syntax is a terrible terrible thing. &nbsp;Also, I'm weirded out by the sorts of things that the compiler doesn't catch because they're legitimate syntax (apparently?) but then the linker barfs because it's not quite what you meant and so something is undefined. &nbsp;For example, consider this code:</li></ul><div><div>// header file:</div><div>class Foo {</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>static Foo * blargh;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>static Foo * GetFoo();</div><div>}</div><div><br /></div><div>// cpp file:</div><div>#include "foo.h"</div><div><br /></div><div>Foo::Foo * blargh = NULL; // WHY WAS THIS COMPILING. &nbsp;Should be Foo * Foo::blargh;</div><div>Foo * Foo::GetFoo() { return blargh; }</div><div><br /></div></div></div><div><br /></div><div>So, the game! &nbsp;I've got things refactored well enough and objects <b>back</b>&nbsp;on the screen and doing their happy dance. &nbsp;I've spawned some threads and have input and a gameloop (well, almost--input isn't really there yet) going. &nbsp;I made a video, but really it's pretty dull.</div><div><br /></div><div>I've got Mercurial up and running on my website and have been committing code to my local repository and pushing it up there today; so that's cool. &nbsp;I keep forgetting, though, and I'm treating it more like SVN where I want to commit as infrequently as possible. &nbsp;My goal here is to basically commit whenever I've got something decent and compiling.</div><div><br /></div><div>I should maybe look at getting some type of debugger up and running, though, because printf() debugging is getting a little old.</div><div><br /></div><div>Also, I just need to figure out a whole bunch of boring underlying stuff that isn't done yet. &nbsp;I need to decide how I'm loading things from [ROM, the FileSystem, whatever], as well as what I'm going to do about memory allocation. &nbsp;I've been avoiding templates, too, because someone who's opinion I trust was vehemently opposed to them for the bloat in the size of the code they produced. &nbsp;When you've only got so much memory, having your executable take up too much of it can be a problem. &nbsp;Also, larger code tends to be slower, since you'll have to suffer through more cache fetches (pulling the instructions from RAM into the processor's working storage (i.e. cache) so that they can be executed) to get the same amount of work done as smaller code.</div><div><br /></div><div>I need to write up a bunch of these utility functions and proper test suites for them. &nbsp;I've been avoiding that, but I was bit by a bug today where a float was being cast to an integer for some reason and so nothing was happening (the value was &lt;1, so it became 0, and then when it got multiplied into the rest of the equation a whole lot of nothing happened).</div><div><br /></div><div>Also, just now, I seem to have discovered a Texturing bug. &nbsp;I'm not sure if it's my fault or just another bug with glDrawTex_OES() on the emulator, but calls to glBindTexture() don't seem to change the texture that it's going to be drawing with. &nbsp;I don't get it.</div><div><br /></div><div>I'll talk to you all tomorrow, and let you know what my goals were for the day, and what got accomplished. &nbsp;For real!</div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Bad Programmer</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/bad-programmer.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.28</id>

    <published>2010-07-13T06:25:39Z</published>
    <updated>2010-07-13T13:40:27Z</updated>

    <summary><![CDATA[I have to admit, I've been a little delinquent on my work so far today. &nbsp;I poked around at the code for a few minutes, and then spent some time diving into Replica Island to see how they a few...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[I have to admit, I've been a little delinquent on my work so far today. &nbsp;I poked around at the code for a few minutes, and then spent some time diving into Replica Island to see how they a few different things. &nbsp;Pretty much a lot of nothing happened today. &nbsp;My goal is to make up for some missed time by doing an <i><b>extreme coding</b></i> weekend, since I did that the first week and I felt really productive and happy about it.<div><br /></div><div>But that's okay, because I found this: &nbsp;<a href="http://tinyurl.com/chrome-stayfocusd">http://tinyurl.com/chrome-stayfocusd</a>--a quite configurable extension for Chrome that helps you stay on task by limiting the amount of time you can spend daily on a list of blocked websites. &nbsp;I found it looking for a way to block google reader for free, without having to block all of google.com along with it (the HOSTS trick failed when I discovered google.com/reader in addition to reader.google.com. &nbsp;Alas.)</div><div><br /></div><div>Anyway. &nbsp;This thing looks super-amazing! &nbsp;I'm so psyched. &nbsp;I struggle pretty hard with procrastination, and I can use this to take out my largest outlets (particular websites) where I tend to waste my time. &nbsp;I mostly only use chrome now, so while it's still possible for me to fire up FireFox or IE to go waste time, I can't really see myself doing that. &nbsp;Both of those browsers feel so slow and bloated now that I've continued to drink Google's Kool-Aid.</div><div><br /></div><div>Also, Summer is apparently over. &nbsp;I hope you all enjoyed it as much as I did. &nbsp;Most of today was spent in the 50's, with a 6pm high of 68 degrees. &nbsp;When I got home the windows were open and before it even got dark I had to put on a sweater. &nbsp;<b>A SWEATER.</b></div><div><b><br /></b></div><div>Here are some depressing graphs, courtesy <a href="http://www.wolframalpha.com/input/?i=temperature+in+98034">wolframalpha</a>:</div><div><br /></div><div><img alt="graph showing the temperature every hour from mid-June to mid-July.  There are five peaks that go higher than the rest, indicating that the five days previous were over 70 degrees farenheit" src="http://claytonhughes.com/mega_great/2010/07/12/weather/monthtemp.png" width="512" height="187" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></div><div>Note the precipitous decline to the pre-summer period of Jun 14 - Jul 4. &nbsp;This is even worse:</div><div><br /></div><div><img alt="graph showing the median daily temperature for every day from 2009 July to 2010 July.  The summer of '09 is warm, but the temperature remains relatively constant for most of the Fall, Winter, and Spring.  There are some cold weeks in Winter, and a very gradual upward slope, the mean changing from about 45 degrees Farenheit in January to about 55 degrees in May and June." src="http://claytonhughes.com/mega_great/2010/07/12/yeartemp.png" width="513" height="207" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></div><div>Note that today apparently isn't on that chart, or else it would be back down there with the rest of the temperatures between September and June, excluding the week or so in December it dropped below freezing.</div><div><br /></div><div>Oh, so, I didn't really mention this, but I'm not going to stay up (too) late killing myself working on the project. &nbsp;Instead, I'm going to work out a little in the morning! &nbsp;The ! is because I'm scared. &nbsp;I've never really had to or tried very hard to take care of a body before. &nbsp;I wonder what it will be like. &nbsp;I also bought some multi-vitamins, that's how you can tell I mean business. &nbsp;Workout courtesy&nbsp;<a href="http://myfitstream.com">myfitstream.com</a>, which <s>actually looks a lot different back when I was beta-testing it</s>&nbsp;I confused with&nbsp;<a href="http://fitstream.com/" rel="nofollow" style="text-decoration: underline; ">fitstream.com</a>&nbsp;(understandably, I hope you'll agree). &nbsp;The&nbsp;site's still in beta, I suppose, but the&nbsp;<s>initial</s>&nbsp;pitch is this: &nbsp;free accounts get a new work-out every week of some pre-recorded VODs (think youtube) of exercise routines that target the areas they want to work on, and use the equipment they have indicated they have available at home. &nbsp;Premium accounts get access to that, plus they get custom-made VODs (basically, a virtual personal-trainer), and maybe something else. &nbsp;I'll try it out and report back whether the exercise kills me.</div><div><br /></div><div><b>[Update]:</b>&nbsp;&nbsp;My wife is drinking hot chocolate.</div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Sunday Update - Social Games Edition</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/sunday-update---social-games-edition.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.27</id>

    <published>2010-07-12T06:44:05Z</published>
    <updated>2010-07-12T07:20:39Z</updated>

    <summary><![CDATA[Unlike last week, I didn't really totally grill myself this weekend working on the game. &nbsp;I sort of feel like I got a lot less accomplished, though I felt like there was more time for other things (or that other...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[Unlike last week, I didn't really totally grill myself this weekend working on the game. &nbsp;I sort of feel like I got a lot less accomplished, though I felt like there was more time for other things (or that other things happened at all).<div><br /></div><div>Going to the park with the family yesterday was definitely a good thing, but I don't really know what all I accomplished today. &nbsp;In fact, I'm pretty sure there wasn't much at all.</div><div><br /></div><div>Well, I know what I accomplished - I (almost completely) explored a new area and completed the quest in it with some online&nbsp;acquaintances&nbsp;in a game. &nbsp;I've had some sort of&nbsp;<i>thing</i>&nbsp;brewing against what I'm calling Social Games--the kind of games that leverage the (in my experience, in-game) community that they build up to keep you coming back to them and playing them. &nbsp;I feel that they're dangerous because you can sink a ton of time (and I mean a <b>ton</b>) into these things without really anything to show for it. &nbsp;You have some great experiences and neat stories to tell, but they don't really transfer that well to others who don't have a similar basis for understanding it. &nbsp;That is, nobody wants to hear about your raid. &nbsp;I don't want to say that they're unrewarding, just that I'm not sure the rewards merit the rest.</div><div><br /></div><div>I feel like it's unnecessarily focusing your time spent playing games (consuming game media) on one narrow aspect. &nbsp;This is a terrible analogy, but it strikes me as similar to listening to only one style of music, or only watching tragedies on stage or something. &nbsp;As I write this though, I'm growing to see it more in the light of a depth vs. breadth of experiences question and considering that choosing depth may be acceptable choice to some. &nbsp;But I've been really turned off to it, lately. &nbsp;Between Wives of WoW, and my own experiences playing on a MUD as well as the revelation I had when I quit these sort of games completely coming off of Evony/Civony, I've got a pretty bad taste in my mouth for what these games have to offer in relation to what they demand.</div><div><br /></div><div>I don't really want to come out and say they destroy your social life, but I think it's easy to see the feedback loop wherein 1) you establish very real relationships with online friends and 2) you spend time with your online friends, preventing you from doing so with your real life friends and 3) each time you play, you're making a decision to join one group of friends over another, and the more you make it the harder it is to break. &nbsp;Not a problem for everyone, of course, but I spent a ton of my time playing a trash game I wish I hadn't because I had forged friendships with some folks and enjoyed exploring and exploiting the game mechanics with them, and the general&nbsp;camaraderie&nbsp;that developed from doing that.</div><div><br /></div><div>Now, that's just in the case where your real life friends don't also game. &nbsp;I guess that could also be good, but I imagine the case where one player gets more into it than the rest and&nbsp;surpasses&nbsp;everyone else, causing them to lose interest because they can't keep up is a common one.</div><div><br /></div><div>Anyway, I've gotten back into my MUD a bit because I'm getting really excited for Guild Wars 2. &nbsp;They seem to be addressing a lot of the problems I have with MMOs. &nbsp;The two biggest things I want to highlight are these:</div><div><ul><li>No need to waste time looking for a particular type of player - everyone can control, support, or damage (that is: tank, heal, and blast)</li><li>Events affect the world. &nbsp;Actually. &nbsp;I see the potential for stories and world involvement to be much more. &nbsp;Your story and experience is now not <i>just</i>&nbsp;the cool thing you did, but also all the knock-on effects that it might have, and how the world has changed because of your success or failure.</li></ul><div>But there is a ton of things in general that look really good and really fun. &nbsp;Check out some of their talk about game design choices at their adver-blog-site-thing:</div></div><div><br /></div><div><a href="http://www.guildwars2.com/en/the-game/dynamic-events/">http://www.guildwars2.com/en/the-game/dynamic-events/</a></div><div><a href="http://www.guildwars2.com/en/the-game/combat/">http://www.guildwars2.com/en/the-game/combat/</a></div><div><a href="http://www.guildwars2.com/en/the-game/personal-stories/">http://www.guildwars2.com/en/the-game/personal-stories/</a></div><div><br /></div><div style="font-size:75%">[Disclaimer: I have friends who work at ArenaNet, the developers of Guild Wars and Guild Wars 2. &nbsp;I have received discounts on their products in the past. I'm not getting anything out of writing this, though. &nbsp;I hate that the FCC have decided I need to write this.]</div><div><br /></div><div>Oh, right, the game!</div><div><br /></div><div>Well, I got it compiling again and things organized much nicer. &nbsp;Not much more progress than that, though I have discovered that the GL_VERSION strings aren't consistent across GLES version! Can you believe that? &nbsp;Total madness! &nbsp;So, like, there might be some future version of OpenGLES that my game just totally barfs on because they have decided to change the string around again. &nbsp;Insanity!</div><div><br /></div><div>cf <a href="http://www.khronos.org/opengles/sdk/1.1/docs/man/glGetString.xml">the 1.x version</a>&nbsp;and <a href="http://www.khronos.org/opengles/sdk/docs/man/glGetString.xml">the 2.0 version</a>! &nbsp;1.x looks like "OpenGL ES-C<b>X</b> <b>M</b>.<b>m</b>" and the 2.x looks like "OpenGL ES <b>M &lt;V&gt;</b>".</div><div><br /></div><div><b>X </b>is one of M or L, to indicate Common or Light</div><div><b>M</b>&nbsp;is the major release number</div><div><b>m</b>&nbsp;is the minor release number</div><div><b>&lt;V&gt;</b>&nbsp;is vendor-specific-information, whatever that means.</div><div><br /></div><div>Now that I know that, I can figure out the version pretty easily, but of course there's no reliable pattern for knowing what future versions will look like (let's hope they stick with the 2.0 pattern, but I don't know what to expect).</div>]]>
        
    </content>
</entry>

<entry>
    <title>Tempting Fate</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/tempting-fate.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.26</id>

    <published>2010-07-11T06:04:52Z</published>
    <updated>2010-07-11T08:13:50Z</updated>

    <summary>So this whole &quot;write after I&apos;m done each day&apos;s work&quot; thing isn&apos;t working out too well, as you may have noticed from the lack of a post yesterday.So now I&apos;m going to commit to just sitting down at 11 and...</summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[So this whole "write after I'm done each day's work" thing isn't working out too well, as you may have noticed from the lack of a post yesterday.<div><br /></div><div>So now I'm going to commit to just sitting down at 11 and pounding one out. &nbsp;Shouldn't be too hard to do.</div><div><br /></div><div>I tempted fate yesterday at lunch by mentioning to my coworkers how there had been 3 clear days in a row, with bright blue skies and a nice view of Mt. Rainer. &nbsp;By the time I left work for the day, the entire thing was back to the usual overcast. &nbsp;Although it was a nice sort of orange-ish pink, as if the sun were shining through somewhere.</div><div><br /></div><div>Today, though, I felt properly chastised and nature relented and let it be bright out again. &nbsp;We went to the beach (I use the term loosely) where my daughter did not like the waves, did like the ducks, and sat still playing with rocks long enough for me to build a sand castle (again, loosely) around her.</div><div><br /></div><div>As far as programming goes, I spent a few hours last evening and some time today on it. &nbsp;It certainly <b>feels</b>&nbsp;less productive when I'm not necessarily producing more builds or adding features or anything. &nbsp;Mostly, I've been re-arranging and rewriting the code I do have. &nbsp;I had been being really lazy and dumping most everything I needed to get it to work all into one file, which was getting pretty monstrous and disgusting. &nbsp;It was also getting hard to add new code without proper function definitions/header files. &nbsp;I'm refactoring quite a lot, with the focus on separating different functions into different files appropriately and separating out the interfacing-with-SDK-specific things from the core engine to ease the whole cross-development thing I've got going. &nbsp;I'm still struggling with how I want to declare things, and what's going in which header files and all that. &nbsp;I've got to just go with a 'what-works' approach for now, and worry about making it nicer later. &nbsp;I don't want to spend too much time on stuff that isn't really going to be important.</div><div><br /></div><div>I promised <b>Programming Potpourri</b>&nbsp;yesterday but didn't deliver. &nbsp;I apologize.</div><div><ul><li>Whenever someone rings the doorbell our neighbor's house across the street, ours rings to. &nbsp;It played <a href="http://www.theclockdepot.com/clock_chimes/westminster_acoustic.mp3">Westminster</a>.&nbsp;&nbsp;I have since removed the batteries. &nbsp;We need a new doorbell.</li><li>After googling for long enough, I found the OpenGLES 1.1 and 2.0 man pages. &nbsp;Yay!</li><ul><li>http://www.khronos.org/opengles/sdk/1.1/docs/man/</li><li>http://www.khronos.org/opengles/sdk/docs/man/</li></ul><li>If you're using Chrome, this plug-in will render the MathML on those pages (or anywhere, really). &nbsp;It's sweet: &nbsp;https://chrome.google.com/extensions/detail/elbbpgnifnallkilnkofjcgjeallfcfa</li><li>Speaking of Chrome, it has totally spoiled me. &nbsp;Whenever I use an application which doesn't automatically adjust tab-widths so that the next tab's close button is immediately under my mouse cursor after i click to close one tab I get frustrated at having to mouse around. &nbsp;It's like <a href="http://www.asktog.com/columns/022DesignedToGiveFitts.html">Fitts' Law 101</a>. &nbsp;You can resize them to an appropriate width after I move my mouse away, thanks.</li></ul></div>]]>
        
    </content>
</entry>

<entry>
    <title>Another Beautiful Day, Another Late Night</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/another-beautiful-day-another-late-night.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.25</id>

    <published>2010-07-09T09:06:14Z</published>
    <updated>2010-07-09T09:14:57Z</updated>

    <summary><![CDATA[We've had two days in a row of bright blue sky and sunny hot weather! &nbsp;It's been like 11 months at least since this last happened! &nbsp;I've never really considered myself much of a summer person, instead preferring to stay...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[We've had two days in a row of bright blue sky and sunny hot weather! &nbsp;It's been like 11 months at least since this last happened! &nbsp;I've never really considered myself much of a summer person, instead preferring to stay huddled inside around my Air Conditioner, but Seattle is really turning me into one. &nbsp;I ate lunch quickly today, then spent a half an hour or so chucking a frisbee around.<div><br /></div><div>Also, had friends over and I played Carcassone tonight. &nbsp;Hadn't played before, but I won, barely. &nbsp;I had one point more than the next guy, although I did get to take one more move then everyone else (netting me like 5 or 6 points), and also after we were done there were claims of finding a few extra tiles my daughter had hidden under the table. &nbsp;Oh well!</div><div><br /></div><div>Got started with the game pretty late, but I accomplished a few things: &nbsp;Got my Mercurial Repo set up at my website, managed to determine that GoDaddy won't let me install a certificate I didn't buy from them on their cheapo-hosting-plan, and fixed a pernicious bug I had introduced into my code (turns out things don't get constructed if you declare them as static or just malloc them and cast the pointer! Whoops. &nbsp;-- Also, I can't believe it's been so long since I've used objects correctly that I've forgotten about this. &nbsp;I guess I am much more of a C programmer now than C++... weird). &nbsp;How could I have forgotten <b>the new</b>.</div><div><br /></div><div>Also - holy crap I have an optometrist appointment early tomorrow. &nbsp;Yay new glasses, eep still being up this late.</div><div><br /></div><div>Looking forward to the potpourri tomorrow. &nbsp;I hope I haven't forgotten too much of it - I should really write this down next week.</div>]]>
        
    </content>
</entry>

<entry>
    <title>Ayup.</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/ayup.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.24</id>

    <published>2010-07-08T08:58:05Z</published>
    <updated>2010-07-08T09:00:27Z</updated>

    <summary><![CDATA[Did what I set out to do, pretty well:got the input thing nice and pretty, and starting to work on like a real, final, weapons-grade compilable OpenGL renderer! &nbsp;So far, I uh, check the Version String. &nbsp;And handle all errors!...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[Did what <a href="http://claytonhughes.com/mega_great/2010/07/first-day-of-summer.html">I set out to do</a>, pretty well:<div><br /></div><div>got the input thing nice and pretty, and starting to work on like a real, final, weapons-grade compilable OpenGL renderer! &nbsp;So far, I uh, check the Version String. &nbsp;And handle all errors! &nbsp;Oh yeah <b>*flex*</b>.</div><div><br /></div><div>Maybe I'll get some video up tomorrow AM, but I wouldn't count on it (note the current time is two AM).</div>]]>
        
    </content>
</entry>

<entry>
    <title>First Day of Summer</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/first-day-of-summer.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.23</id>

    <published>2010-07-08T05:57:20Z</published>
    <updated>2010-07-08T06:26:17Z</updated>

    <summary><![CDATA[It was so beautiful today. &nbsp;We had a clear blue sky (itself a rare wonderful treat), and weather in the 80's. &nbsp;I ate my lunch outside in the grass again, today. &nbsp;It was glorious. &nbsp;Also, after work I went to...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[It was so beautiful today. &nbsp;We had a clear blue sky (itself a rare wonderful treat), and weather in the 80's. &nbsp;I ate my lunch outside in the grass again, today. &nbsp;It was glorious. &nbsp;Also, after work I went to the park and tossed around a frisbee with some friends for a bit. &nbsp;I finally learned how to successfully do the fore-hand wrist flick thing (and consequently, an over-head hammer type throw).<div><br /></div><div><span title="In so ding so">In doing so</span> I now see the folly of selecting July as the month to get things done! &nbsp;Seattle's only few days of warm and tempting weather will mostly be this month; and it's light outside until 9:30 or so, so I don't always realize "oh wow I should get to work so I can get to bed at a reasonable time" until it's a bit too late.<div><br /></div><div>Such was yesterday's fate, and I felt bad for not working too heavily on my project (mostly a research day; although I spent some time trying to figure out how to handle input in a nice way and doing a bit more OpenGL-wrestling, more on that later) that I worked on it well into the night. &nbsp;I wasn't about to burn another half hour or so writing a post at two in the morning, and then I failed at getting up early enough to bang it out before work (no surprise, really). &nbsp;I hope no one is too sad you missed me for a day. &nbsp;I did do some work, just no post!</div><div><br /></div><div>That same chain of events has caused me to write this post before doing any work (and here it is already eleven--erk), so I'll go ahead and let you know my plans for the <s>day</s>&nbsp;night, rather than talk about what I've done: &nbsp;the goal is to get some sort of working debug input system, such that I can easily (in one line) define: &nbsp;a button, which pixels it will cover, pressed/depressed colors, and the function to call when it's being pressed. &nbsp;The "which pixels it will cover" thing is a bit tricky, as the touch input coordinates are given with (0,0) as the top-left-most pixel, whereas my rendering viewport is defined with (0,0) as the bottom-left-most pixel, and because I like to keep things simple, my UI's orthographic camera (for rendering textures when the fast-path isn't available), (0,0) is in the center of the screen.</div><div><br /></div><div>I might also see if I can get something maybe like <a href="http://www.opengl.org/sdk/libs/GLee/">GLEE</a>&nbsp;to compile, to give my renderer a good idea of what functions are available on the particular device I'm working on. &nbsp;(For example, the orthographic camera business I mentioned earlier is for any GPUs that don't implement the optional GLES Extension for draw_texture.)</div></div>]]>
        
    </content>
</entry>

<entry>
    <title>To render a texture from scratch, you must first create the !#$@%~ universe</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/to-render-a-texture-from-scratch-you-must-first-create-the-universe.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.22</id>

    <published>2010-07-06T06:35:41Z</published>
    <updated>2010-07-06T06:50:46Z</updated>

    <summary><![CDATA[Hooo, boy, did I bang my head against a wall today. &nbsp;I did finally wrangle OpenGL into displaying some textures, some of the time, so I've sort of completed yesterday's goal, but not entirely. &nbsp;I can render the textures to...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[<div>Hooo, boy, did I bang my head against a wall today. &nbsp;I did finally wrangle OpenGL into displaying some textures, some of the time, so I've sort of completed yesterday's goal, but not entirely. &nbsp;I can render the textures to a quad okay, but I just can't get the faster draw_texture extension to work:</div><div><br /></div><div style="text-align:center" ;=""><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/hM0_XAUwKi8&amp;hl=en_US&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://www.youtube.com/v/hM0_XAUwKi8&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></object></div><div><br /></div><div>By the way, if you want to help with that, <a href="http://stackoverflow.com/questions/3183800/problems-with-gldrawtex-oes">speak up</a>; I'll appreciate the help. &nbsp;I... well, honestly, for all the time I spent on this today I didn't do that much more than that. &nbsp;Getting OpenGL into the correct state to display textures was a bit of a hassle. &nbsp;It all makes sense in retrospect, but if you've forgotten to call one little function (like say, specify which matrix you're modifying) here or there, it's a giant pain in the butt to remember every step you need to take (why would I need to enable 2D Textures? &nbsp;I'm already telling you to use them).</div><div><br /></div><div>Also, apparently, be it a feature of OpenGLES, or just the small number of stable libraries for the Android NDK, glu (An openGL utility library) was unavailable to me. &nbsp;So I had to implement my own version of gluPerspective. &nbsp;No biggie. &nbsp;Oh, gluPerspective uses glFrustum and I don't have that either? &nbsp;Guess I'll have to implement that, too... &nbsp;Big matrix refresher.</div><div><br /></div><div>I'm keeping a big list of things for Programmer Potpourri on Friday, so make sure you stay tuned. &nbsp;To entice you, here's an item that didn't make the cut: &nbsp;I made a couple of sourdough loaves yesterday, and they are&nbsp;<i>delicious</i>. &nbsp;I will miss them when they're gone. &nbsp;I really ought to stop messing willy-nilly with the recipe though, because substituting too much Whole Wheat flour tends to leave it a little dense / uncooked in the middle sometimes. &nbsp;Oh well.</div> ]]>
        
    </content>
</entry>

<entry>
    <title>Short(er) Entry Tonight (Maybe)</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/shorter-entry-tonight-maybe.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.21</id>

    <published>2010-07-05T08:00:42Z</published>
    <updated>2010-07-06T06:47:51Z</updated>

    <summary><![CDATA[I had set myself a goal for today of loading a texture and throwing it up on the screen.After uploading my video to YouTube yesterday, I noticed that the first two related items were in fact very related! &nbsp;I had...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[I had set myself a goal for today of loading a texture and throwing it up on the screen.<div><br /></div><div>After uploading my video to YouTube yesterday, I noticed that the first two related items were in fact very related! &nbsp;I had watched the first of these previously, and found that I agreed with a lot of what the guy said and found the rest to sound like useful tips, so it's good to see an updated talk.</div><div><br /></div><div><b>The 2009 Google I/O Android Games Talk:</b></div><div><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/U4Bk5rmIpic&amp;hl=en_US&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://www.youtube.com/v/U4Bk5rmIpic&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></object></div><div><br /></div><div><b>The Updated 2010 Google I/O Android Games Talk:</b></div><div><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/7-62tRHLcHk&amp;hl=en_US&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://www.youtube.com/v/7-62tRHLcHk&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></object></div><div><br /></div><div>So I watched through the second one of those and was feeling pretty good about myself. &nbsp;Then I got to work.</div><div><br /></div><div>What seemed pretty simple turned out to be waaay more complicated than I thought it&nbsp;</div><div>needed to be. &nbsp;I eventually found the documentation and the buried newsgroup post that explained the hoops I needed to jump through to find things in Java and then open them up in C. &nbsp;I think I'm getting a handle on this JNI thing, but I sure wish there was a bit more documentation sometimes (ironic, considering how much I was praising it earlier). &nbsp;For example: &nbsp;that there is a function to convert Java strings to C strings, and how to actually invoke it: neither of those was very obvious.<div><div style="text-align: center;"><br /></div><div style="text-align: center;"><img src="http://claytonhughes.com/img/64x64_angry.bmp.png" /></div></div><div><div style="text-align: center;"><br /></div><div>So, anyway, I did eventually manage to get a bitmap loaded, but only just now, and not in time to render it to the screen.</div></div><div><br /><div style="text-align: center;"><img src="http://claytonhughes.com/img/64x64_frowny.bmp.png" /></div><div><br /></div></div><div>So, after all that was said and done, I did actually accomplish a few things, despite not having any visual progress forward: &nbsp;I figured out how to get where my file lives in code, figured out how to read files embedded in it, figured out that I have to name all my files .png or .mp3 so they won't be compressed so I can open them some goofy way to pass them to my Native Code to fopen there.</div><div><br /></div><div>Figured out how to set up GL to draw a texture and to (sort of) query the gl Extensions string. I'm still not sure how you do the equivalent of glGenTexture in GLES1.0. &nbsp;But... maybe that's not needed. &nbsp;I'll have to double-check; I recently saw somewhere that Android 1.6 supports 1.1, so hopefully by the time I'm done those 1.5 devices will all be gone... right?</div><div><br /></div><div>Here I am being all technical again. &nbsp;In the downtime I had not directly researching Android stuff or spent coding/fighting, I did get to do some design work. &nbsp;I had a few great ideas, and I think I sort of like them. &nbsp;I dove into some UI diagrams to make sure I wasn't over-complicating things, and then I spent some time layout out a few game menu screens. &nbsp;I like what I came up with!</div><div><br /></div><div>I also like that I'm trying to analyze the decisions I'm making from a few different perspectives. &nbsp;I want to give the player the option to change item <i>x</i>&nbsp;to alter their strategies some, but I'm afraid it might be a little too powerful/easy/boring to always be changing it. &nbsp;So I want to limit the frequency that it happens. &nbsp;The first thought was to give the player an incentive to keep it the same, but that's no good because it essentially becomes <b>punishing</b>&nbsp;the player for switching to a more tactically sound strategy, and in fact encourages players to <b>not</b>&nbsp;switch their <i>x</i>&nbsp;around, stagnating the creativity and movement I wanted to have. &nbsp;So, I think the user will just have some slowly replenishing resource they have to use to change the thing. &nbsp;I've been thinking of something similar for other decisions, so really it won't be a big deal and should fit in. &nbsp;Also - hmm, maybe I should in fact push the player to switch up their <i>x</i>&nbsp;by <s>punishing not changing it</s>&nbsp;rewarding changing it. &nbsp;I originally thought of this as "let's make strategy <i>x'</i> weaker the longer they use it," but of course psychologically that's a terrible idea, and nowhere near as good as saying "let's make strategy <i>x''</i>&nbsp;stronger for a brief period after switching to it!" &nbsp;Same numbers behind the scene, different net psychological effect. &nbsp;So, ooo great, another idea!</div><div><br /></div><div>Thanks, blog.</div><div><br /></div><div style="text-align: center;"><img src="http://claytonhughes.com/img/64x64_smiley.bmp.png" /></div></div>]]>
        
    </content>
</entry>

<entry>
    <title>And they&apos;re off!</title>
    <link rel="alternate" type="text/html" href="http://claytonhughes.com/mega_great/2010/07/and-theyre-off.html" />
    <id>tag:claytonhughes.com,2010:/mega_great//1.20</id>

    <published>2010-07-04T06:30:20Z</published>
    <updated>2010-07-04T06:48:50Z</updated>

    <summary><![CDATA[I'll admit that things have gotten off to a bit of a slow start, but I got a good solid many&nbsp;hours in today, to the chagrin of my wife I think, and have made some definite progress.I got over my...]]></summary>
    <author>
        <name>Clayton Hughes</name>
        
    </author>
    
        <category term="JulNoGaMo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://claytonhughes.com/mega_great/">
        <![CDATA[I'll admit that things have gotten off to a bit of a slow start, but I got a good solid <i>many</i>&nbsp;hours in today, to the chagrin of my wife I think, and have made some definite progress.<div><br /></div><div>I got over my separation anxiety from Visual Studio and have been enjoying sublime pretty well. &nbsp;Still haven't figured out the hotkeys, and Suresh tells me there's one to switch between headers and source code. &nbsp;Gotta make that the first one to find.</div><div><br /></div><div>So the game! &nbsp;Boy, was debugging that frustrating. &nbsp;I eventually got it all to compile (although I had to turn off DISABLE_IMPORTGL (which makes sense... but then it <b>is</b>&nbsp;defined in the demo code I was referencing) and rewrite the import functions in my own code and just return dummy values (no idea why they wouldn't link across files. &nbsp;Some sort of deadstripping gone crazy?) &nbsp;And then after that it took me a few hours to figure out the Dynamic function loading was failing, and that specifically I had the following problems:</div><div><ol><li>The functions were the wrong name. &nbsp;They needed to spell out the package domain and be case sensitive so the JNI can find them. &nbsp;A-ha!</li><li>If the functions are going to be in compiled in C++, then they need to be forward declared as <b>extern "C"</b>, because the JNI isn't going to find them if they have C++ mangled names. &nbsp;Whoops.</li><li>When making new JNI functions, you really ought to have the first two arguments be pointers to the <i>JNIEnv </i>and the Java's <i>this</i>, because that's how JNI is going to call them. &nbsp;Whoops.</li></ol><div>So, I put it all together and I've got input being generated in Java and passed to C, and similarly render calls generated in Java being passed to C, where they're implemented in OpenGL. &nbsp;So far, not much going on rendering-wise, but I use the input values to set the clear color.</div></div><div><br /></div><div><b>Behold!</b></div><div><b><br /></b></div><div><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/p2TSzb3dU-8&amp;hl=en&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://www.youtube.com/v/p2TSzb3dU-8&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></object>
</div><div><br /></div><div>Ignore the trails on the mouse cursor there; that's just an artifact of the encoding process.</div><div><br /></div><div>Speaking of debugging being a nightmare: &nbsp;I have no idea how to use GDB. &nbsp;I've been having some difficulty getting it to connect to the process at all, and once I get in: &nbsp;what then? &nbsp;I can't imagine debugging through a command line; it sounds extremely painful.</div>]]>
        
    </content>
</entry>

</feed>

