<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="http://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:5ury3</id>
  <title>Vince Castellano</title>
  <subtitle>Vince Castellano</subtitle>
  <author>
    <name>Vince Castellano</name>
  </author>
  <link rel="alternate" type="text/html" href="http://5ury3.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://5ury3.livejournal.com/data/atom"/>
  <updated>2006-12-14T08:44:16Z</updated>
  <lj:journal userid="11606467" username="5ury3" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://5ury3.livejournal.com/data/atom" title="Vince Castellano"/>
  <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:5ury3:2140</id>
    <link rel="alternate" type="text/html" href="http://5ury3.livejournal.com/2140.html"/>
    <link rel="self" type="text/xml" href="http://5ury3.livejournal.com/data/atom/?itemid=2140"/>
    <title>Soon I'll Have More Time</title>
    <published>2006-12-14T08:43:25Z</published>
    <updated>2006-12-14T08:44:16Z</updated>
    <category term="sdl_scroller"/>
    <lj:music>More Sopranos</lj:music>
    <content type="html">Maintaining UML, while ideal, may turn out to be too much work. But it has provided me with a VAST amount of insight on the internals of our engine, so it may be worth it.&lt;br /&gt;&lt;br /&gt;Our classes are a mix of hacked in C code, half inheritence, half composition. We have a lot of clean up work todo, but Phillip's initial work on Input should help a lot, now we can be considered "interactive"? Though that needs to be reworked, it's a good start. After finals this week, we should be able to really get something interesting going, so bare with us (not that anyone is following it =P).&lt;br /&gt;&lt;br /&gt;Two major barriers right now is a gddf (Game Definition Data File) which may be an ini file, and a sddf (Sprite Definition Data File), which can be a little more lean, but doesn't have to be. We need a config class, which I may tackle tomorrow after my psych final.&lt;br /&gt;&lt;br /&gt;I've been using sqlite at work for a configuration backend, so I may consider evaluating that for a backend. But maybe not, requirements are getting fat as it is (though sqlite is rather tiny, and can be used for all sorts of runtime database stuff like scores, save states, etc). That may be worth considering actually...</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:5ury3:1996</id>
    <link rel="alternate" type="text/html" href="http://5ury3.livejournal.com/1996.html"/>
    <link rel="self" type="text/xml" href="http://5ury3.livejournal.com/data/atom/?itemid=1996"/>
    <title>I no longer think UML is a pointless waste of time.</title>
    <published>2006-12-11T05:25:54Z</published>
    <updated>2006-12-11T05:25:54Z</updated>
    <category term="sdl_scroller"/>
    <lj:music>Red Hot Chili Peppers - Breaking The Girl</lj:music>
    <content type="html">The fruits of my UML work this weekend, it's gone through many many changes and refactoring. So there's a lot more work behind it then it looks. I have not incorporated the work on Collision detection I talked about yet, as I have not had a chance to think about that.&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;img src="http://surye.datamachine.net/sdl_scroller/sdl_scroller_uml-20061210.png"&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:5ury3:1673</id>
    <link rel="alternate" type="text/html" href="http://5ury3.livejournal.com/1673.html"/>
    <link rel="self" type="text/xml" href="http://5ury3.livejournal.com/data/atom/?itemid=1673"/>
    <title>Few more Collision Detection notes</title>
    <published>2006-12-11T03:46:27Z</published>
    <updated>2006-12-11T03:46:27Z</updated>
    <category term="sdl_scroller"/>
    <lj:music>Cradle Of Filth - Beneath The Howling Stars</lj:music>
    <content type="html">Interesting reads:&lt;br /&gt;&lt;a href="http://www.harveycartel.org/metanet/tutorials/tutorialA.html"&gt;http://www.harveycartel.org/metanet/tutorials/tutorialA.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.gamedev.net/reference/articles/article1026.asp"&gt;http://www.gamedev.net/reference/articles/article1026.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Luckly with the system we are creating, we can dynamically implement new algorithms without breaking any code.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:5ury3:1392</id>
    <link rel="alternate" type="text/html" href="http://5ury3.livejournal.com/1392.html"/>
    <link rel="self" type="text/xml" href="http://5ury3.livejournal.com/data/atom/?itemid=1392"/>
    <title>Musings of Collision Detection</title>
    <published>2006-12-11T02:35:12Z</published>
    <updated>2006-12-11T02:37:23Z</updated>
    <category term="sdl_scroller"/>
    <lj:music>Watching the Sopranos</lj:music>
    <content type="html">Need to get this thought out, without ruining my current UML.&lt;br /&gt; &lt;br /&gt; Thinking about ways to handle collision detection polymorphicly, so that we can define the algorithm at runtime in the game definition file. However, though my first pass will will work, I may have a better idea.&lt;br /&gt; &lt;br /&gt; First, I'm using a Stratagy Pattern approch, implementing a common CollisionBehavior interface, and using composition to give the sprite class it's own object providing an isColided(Sprite otherSprite) method:&lt;br /&gt; &lt;br /&gt; &lt;img title="" height="589" src="http://surye.datamachine.net/ljimages/Sprite-Strat-Pattern.png" width="763" /&gt;&lt;br /&gt; &lt;br /&gt; Now I am starting to rethink this. Collision detection does not have to be absolutly one algorithm or another, it can be layered, based on something closer to a Decorator pattern. Wrap them, passing a pass/fail to the next algorithm up, and passing through the result. Something like this:&lt;br /&gt; &lt;br /&gt; Start with a Bounding Box algorithm. If that fails, break out and return false to isCollided. If it's true, then go to something more precise, like a bounding circle. If that comes back true, broken rectangles. If that comes back true, pixel perfect detection. We can then specifiy the most precise algorithm we want for a given sprite. We could generate the decorated CollisionBehavior something like this:&lt;br /&gt; &lt;pre&gt; switch(collisionLevel) {
&amp;nbsp; &amp;nbsp; case CollisionBehavior::PIXEL_PERFECT:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m_collisionBehavior = PixelPerfectCollision(m_collisionBehavior);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Fall through to the next level
&amp;nbsp; &amp;nbsp; case CollisionBehavior::BROKEN_RECTANGLES:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m_collisionBehavior = BrokenRectCollision(m_collisionBehavior);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Fall through to the next level
&amp;nbsp; &amp;nbsp; case CollisionBehavior::BOUNDING_CIRCLE:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m_collisionBehavior = BoundingCircleCollision(m_collisionBehavior);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Fall through to the next level
&amp;nbsp; &amp;nbsp; case CollisionBehavior::BOUNDING_RECT:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m_collisionBehavior = BoundingCollision(m_collisionBehavior);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Fall through to the next level
&amp;nbsp; &amp;nbsp; default: // Don't do collision detection
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m_collisionBehavior = NullCollision(m_collisionBehavior); // Simply always returns false, may be inefficient, but this prevents
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // having to have knowledge of the algorithm.
} &lt;/pre&gt; &lt;br /&gt; Then we can simply call m_collisionBehavior-&amp;gt;isColided(otherSprite), and it just unravels, however, as is, it would unravel backwards. =P But that can be fixed with a little more thinking. This way we never have to do more then a quick and fast bounding box on two sprites that are not even near eachother, even if you want pixel level collision.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:5ury3:1125</id>
    <link rel="alternate" type="text/html" href="http://5ury3.livejournal.com/1125.html"/>
    <link rel="self" type="text/xml" href="http://5ury3.livejournal.com/data/atom/?itemid=1125"/>
    <title>5ury3 @ 2006-11-29T00:33:00</title>
    <published>2006-11-29T08:33:27Z</published>
    <updated>2006-11-29T08:33:27Z</updated>
    <category term="sdl_scroller"/>
    <lj:music>Led Zeppelin - Heartbreaker</lj:music>
    <content type="html">SDL_scroller has a &lt;a href="http://surye.datamachine.net/projects/sdl_scroller/"&gt;Trac&lt;/a&gt;! Websvn to go away tonight.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:5ury3:963</id>
    <link rel="alternate" type="text/html" href="http://5ury3.livejournal.com/963.html"/>
    <link rel="self" type="text/xml" href="http://5ury3.livejournal.com/data/atom/?itemid=963"/>
    <title>First Build From Make!</title>
    <published>2006-11-28T23:47:15Z</published>
    <updated>2006-11-28T23:47:15Z</updated>
    <category term="sdl_scroller"/>
    <lj:music>Freezepop - I Am Not Your Gameboy</lj:music>
    <content type="html">&lt;pre&gt;surye@loki ~/projects/programming/sdl_scroller $ make
g++ -c -Wall -I./include -I/usr/include/SDL/ src/Sprite.cpp -o src/Sprite.o
g++ -c -Wall -I./include -I/usr/include/SDL/ src/SpriteBase.cpp -o src/SpriteBase.o
g++ -c -Wall -I./include -I/usr/include/SDL/ src/sdl_scroller.cpp -o src/sdl_scroller.o
g++ -lSDL -lSDLmain src/Sprite.o src/SpriteBase.o src/sdl_scroller.o -o sdl_scroller&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Joy, looks like this may get some attention after all =D It's building from windows and linux now.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:5ury3:635</id>
    <link rel="alternate" type="text/html" href="http://5ury3.livejournal.com/635.html"/>
    <link rel="self" type="text/xml" href="http://5ury3.livejournal.com/data/atom/?itemid=635"/>
    <title>O'Reilly Does it Again</title>
    <published>2006-11-28T02:34:38Z</published>
    <updated>2006-11-28T02:34:38Z</updated>
    <category term="sdl_scroller"/>
    <category term="learing"/>
    <category term="c++"/>
    <lj:music>Xiu Xiu - Luber</lj:music>
    <content type="html">Well, I suppose this is my first real entry in here, and it will be about sdl_scroller, design patterns, and C++. &lt;br /&gt;&lt;br /&gt;SDL_Scroller is my primarily active project right now, current authors are me and &lt;span class='ljuser ljuser-name_eiclectis' lj:user='eiclectis' style='white-space: nowrap;'&gt;&lt;a href='http://eiclectis.livejournal.com/profile'&gt;&lt;img src='http://l-stat.livejournal.com/img/userinfo.gif' alt='[info]' width='17' height='17' style='vertical-align: bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='http://eiclectis.livejournal.com/'&gt;&lt;b&gt;eiclectis&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;. It's a side-scroller engine, to practice and get some experience in OO game programming. We have big plans for it, but implementation and work has been slow, mostly due to work and school. You can check out the source code over at .... damnit. Websvn isn't working on the new FreeBSD host. *gets frusterated with bsd's inputrc and vimrc defaults, throws a fit, and copies them from the gentoo cvs* Okay, there we go, for some reason /usr/local/bin/ wasn't in php/apache's path. Anyways, you can check out what we have so far here: &lt;a href="http://surye.datamachine.net/websvn/listing.php?repname=SDL+Scroller&amp;path=%2Ftrunk%2F#_trunk_"&gt;http://surye.datamachine.net/websvn/listing.php?repname=SDL+Scroller&amp;path=%2Ftrunk%2F#_trunk_&lt;/a&gt; (note, it's nothing at all to be honest). Websvn is the only anonymous access at this point, we will open up svn for anon ro.&lt;br /&gt;&lt;br /&gt;I've been reading a new book, &lt;a href="http://www.oreilly.com/catalog/hfdesignpat/"&gt;Head First Design Patterns&lt;/a&gt;. I have been really lacking in the OO design methodologies, and figured it's high time I start learning the standard design patterns. The book opens up with solving a problem step by step, that eventually evolves into the "Strategy Design Pattern". I must say, I am quite impressed thus far with the book, it is very easy to follow, and the information sticks well. I'm already seeing ways to implement Strategy Design Pattern in sdl_scroller to fix the issue of the ever growing complexities of the sprite superclass. I'm part of the way there, but I'm really not using encapsulation and polymorphism to the extent I could be.&lt;br /&gt;&lt;br /&gt;This brings me to my next topic, interfaces in C++. They don't exist... not really anyways. You can create a pure virtual ABC, but even then, I believe there is behavior difference from Java/C#'s interfaces. But I found this to aleast help with creating interfaces:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#define Interface class

#define DeclareInterface(name) Interface name { \
&amp;nbsp; &amp;nbsp; public: \
&amp;nbsp; &amp;nbsp; virtual ~name() {}

#define EndInterface };

#define implements public&lt;/pre&gt;&lt;br /&gt;And then use it as such:&lt;br /&gt;&lt;pre&gt;DeclareInterface(IFace)
virtual void test() = 0;
EndInterface&lt;/pre&gt;&lt;br /&gt;This works, but you have to remember to create all pure virtual functions, and it does not enforce all the requirements of an interface (though it does enforce a virtual destructor, which is the only reason I would even consider using this method). It reminds me of pascal programmers #define start #define end, and it kinda makes me cringe. =/ But it will have to do, Or I just create pure virtual ABCs, which I may just end up doing. MSVC7 and up support __interface keyword through an extension, which properly enforces the interface, but gcc lacks it, so blah :(.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:5ury3:486</id>
    <link rel="alternate" type="text/html" href="http://5ury3.livejournal.com/486.html"/>
    <link rel="self" type="text/xml" href="http://5ury3.livejournal.com/data/atom/?itemid=486"/>
    <title>To set the mood</title>
    <published>2006-11-14T09:50:12Z</published>
    <updated>2006-11-14T09:50:12Z</updated>
    <content type="html">Excerpt from &lt;b&gt;"Dirk Gently's Holistic Detective Agency"&lt;/b&gt; by Douglas Adams&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Richard  continued,  ‘What I  mean  is  that if  you really  want  to understand something, the best way is to try and  explain  it to someone else.  That  forces  you to sort it out  in your own mind.  And the more slow and dim-witted  your pupil,  the more you have to break things down into  more and more  simple  ideas. And that’s  really  the  essence  of programming.  By the  time  you’ve  sorted  out a complicated  idea into little steps that even a stupid  machine can deal with, you’ve certainly learned something  about  it  yourself. The  teacher usually learns more than the pupil. Isn’t that true?’ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;‘It  would be hard to learn  much less than  my pupils,’  came a  low growl  from somewhere  on the  table, ‘without undergoing a  pre-frontal lobotomy.’ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;‘So I  used to spend  days  struggling  to write  essays on  this 16K machine that would have taken  a  couple of hours on  a typewriter, but what was fascinating to me was the process  of trying to  explain to the machine what it  was  I wanted it  to do. I virtually wrote my  own word processor in BASIC.  A simple  search  and  replace  routine would  take about three hours.’ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;‘I forget, did you ever get any essays done at all?’ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;‘Well,  not as  such.  No actual essays, but the reasons why not were absolutely fascinating. For instance, I discovered that...’ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;He broke off, laughing at himself.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I could not have put it better myself.</content>
  </entry>
</feed>
