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

<channel>
	<title>Defining Awesome &#187; Coding awesomness</title>
	<atom:link href="https://mm.soldat.pl/category/coding-awesomness/feed" rel="self" type="application/rss+xml" />
	<link>https://mm.soldat.pl</link>
	<description>Michał Marcinkowski&#039;s: Gamedev Log &#38; Articles</description>
	<lastBuildDate>Mon, 25 Mar 2013 23:21:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.39</generator>
	<item>
		<title>The new game design philosophy</title>
		<link>https://mm.soldat.pl/inspirado/the-new-game-design-philosophy</link>
		<comments>https://mm.soldat.pl/inspirado/the-new-game-design-philosophy#comments</comments>
		<pubDate>Sun, 19 Feb 2012 11:26:19 +0000</pubDate>
		<dc:creator><![CDATA[MM]]></dc:creator>
				<category><![CDATA[Coding awesomness]]></category>
		<category><![CDATA[Inspirado]]></category>

		<guid isPermaLink="false">http://mm.soldat.pl/?p=1805</guid>
		<description><![CDATA[The goal of the Game Designer should not be to stage the game. That is a goal of a theater/movie director, a choreographer or even a writer. Game Designers should design what the player can experience and come up with game mechanics that will allow him to do that. Let me give an example. I&#8217;m [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The goal of the Game Designer should not be to stage the game.</p>
<p>That is a goal of a theater/movie director, a choreographer or even a writer.</p>
<p><span style="text-decoration: underline;">Game Designers should design what the player can experience and come up with game mechanics that will allow him to do that.</span></p>
<p>Let me give an example.<span id="more-1805"></span><br />
I&#8217;m currently playing a game called Zeno Clash. There is a level where there are these huge monsters and on top of them a boss/hunter rides them. You have to shoot him off the big monster while at the same time avoiding squirrels with dynamite that he throws at you.</p>
<p>The whole arena is staged. The hunter is placed on top of the monster from the start. The whole movement is scripted. You can shoot the hunter off the monster only when his health bar is depleted. The only freedom you have is how fast you shoot and kick the squirrels to avoid them exploding on you. You can&#8217;t even walk beyond what the level designer made. You have to sit at a specific place and be forced to do what someone thought was going to be fun. It is like theater not a game.</p>
<p>This would be fine if it was 1982. But we have 2012! A new era must start.</p>
<p>The way a game like that should be designed is for the game designer to make a checklist, of what he wants the player to experience:</p>
<ol>
<li>Battles with riding monsters</li>
<li>Shooting each other off the monsters</li>
<li>Exploding squirrels</li>
</ol>
<p>These should be as vague as possible, because you want the player to define the specific actions he wants to make. Let the player decide how he wants to kill the boss.<br />
So now the engineering department should make another checklist with things to code that will accomplish these experiences:</p>
<ul>
<li>Mount/dismount on big monsters</li>
<li>Collisions between squirrel/monster/player/enemy/explosion</li>
<li>AI that can chase/runaway/idle/attack</li>
<li>Gravity</li>
</ul>
<p>Does that sound hard? It is basic stuff that anyone that has coded at least one game will have to go through. The hard part is making them all work with each other, so that the player can discover the game mechanics himself and use them as he wishes to accomplish the goal (in this case kill the boss/hunter).<br />
Ironically this isn&#8217;t more work than scripting the whole thing in some fancy 100,000$ game tool. But the potential is enormous. Making all the elements work with each other will allow the player to experience a level where he can jump on a monster, kickback an exploding squirrels at the boss, explode the monster with the boss on top and make him fall dead and gib in full bloody glory.</p>
<p>I want to mount that monster and stomp the boss. Not  have to go through some chores that the game designer imposed on me and force me then to watch a scripted sequence that I feel I had no influence on. There is a way to do this better.</p>
<p>I feel a new era is beginning. Where video games are finally starting to detach from the archaic forms of entertainment of the past. I am beginning to understand this new path and if more people making games do too, we&#8217;re gonna have some amazing games waiting for us to experience in the future.</p>
]]></content:encoded>
			<wfw:commentRss>https://mm.soldat.pl/inspirado/the-new-game-design-philosophy/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>New engine part 1</title>
		<link>https://mm.soldat.pl/coding-awesomness/new-engine-part-1</link>
		<comments>https://mm.soldat.pl/coding-awesomness/new-engine-part-1#comments</comments>
		<pubDate>Thu, 20 Oct 2011 17:32:26 +0000</pubDate>
		<dc:creator><![CDATA[MM]]></dc:creator>
				<category><![CDATA[Coding awesomness]]></category>

		<guid isPermaLink="false">http://mm.soldat.pl/?p=1774</guid>
		<description><![CDATA[I need to clear my mind about some things and ask my long time readers for some opinions. You might have read the latest post on the King Arthur&#8217;s Gold blog. It&#8217;s called Adventures, Overworlds and the Full Version. If you have been following this devlog then you&#8217;ll see that there is nothing new there. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I need to clear my mind about some things and ask my long time readers for some opinions.<br />
You might have read the latest post on the King Arthur&#8217;s Gold blog. It&#8217;s called <a href="http://kagdev.tumblr.com/post/11648236484/adventures-overworlds-and-the-full-version">Adventures, Overworlds and the Full Version</a>. If you have been following this devlog then you&#8217;ll see that there is nothing new there. I&#8217;ve talked about these ideas <a href="http://mm.soldat.pl/ideas/seamless-servers">here </a>and <a href="http://mm.soldat.pl/ideas/weekly-battles">here</a>.</p>
<p>Why didn&#8217;t I do that with Link-Dead? </p>
<p>Because I was struggling with a solid foundation. This time, with KAG, I have a solid foundation and can build upon it.</p>
<p>Or can I?<br />
<span id="more-1774"></span></p>
<p>The problem I am facing now is that the KAG engine is terribly written. Because it is a mesh of Crimson Glory and Link-Dead code on top of which I basically &#8220;Ludum Dare&#8217;d&#8221; a completely new game. I am actually really proud of my development speed. It took me just 5 months to have a really deep fun game, a growing community and make money off of it.</p>
<p>But you know me. I am never satisfied with my work because I have haunting visions of the game I would REALLY want to play. And that game involves going on <em>non-scripted</em> adventures with your team-mates, building civilizations and waging war. </p>
<p>So now I&#8217;m trying to do that. The current engine is a mess and when I add something I need to spend the next 3 days fixing bugs after that. Which is OK and I will probably go on like this for the next couple months with the free/classic version of KAG. However for the full version this is unacceptable. This is why I have already announced <a href="http://kagdev.tumblr.com/post/11023615550/a-new-engine">A New Engine</a>.</p>
<p>The new engine will fix all the previous engine issues because I know how to engineer good code. Bad code was just my choice (I still highly recommend it!!!)</p>
<p>I wrote the basics of the engine when I encountered a roadblock. Mainly, the thought: if I&#8217;m gonna rewrite this game why not rewrite it in some nicer language than C++ and make it browser based? I&#8217;d love to have the game in a browser because that way I can reach out to a larger audience and it is cross-platform out of the box. Java came to my mind but I don&#8217;t like Java. I know something better, a language called Scala.</p>
<p>Scala is like SuperHeavy or the Travelling Wilbury&#8217;s or Ringo&#8217;s All Starr&#8217;s. It&#8217;s a blend of the best features of programming languages and it works on top of Java. So it can be launched as an applet and use all of Java&#8217;s gigantic libraries. Programming in Scala feels like smooth sailing compared to hitting rocks with a hammer (C++).</p>
<p>So Scala is nice but the problem is &#8211; I am not efficient in it. I just haven&#8217;t learned it well and I need to code with documentation in hand, which is sloooow. I figure it would take me about a year to become efficient in Scala and the next year would be actually making the game. Too long, taking into account that the world is gonna exist only for a year longer.</p>
<p>So I ditched Scala and am back to C++.<br />
I should get back to writing the new engine but again I am facing an obstacle &#8211; the possibility of actually largely refactoring the current engine. Something like live organ transplant in the programming world.<br />
I have to go out, so I&#8217;ll write a second part later&#8230; cya</p>
]]></content:encoded>
			<wfw:commentRss>https://mm.soldat.pl/coding-awesomness/new-engine-part-1/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Bad code &amp; release dates</title>
		<link>https://mm.soldat.pl/coding-awesomness/bad-code-release-dates</link>
		<comments>https://mm.soldat.pl/coding-awesomness/bad-code-release-dates#comments</comments>
		<pubDate>Sat, 02 Jul 2011 20:22:49 +0000</pubDate>
		<dc:creator><![CDATA[MM]]></dc:creator>
				<category><![CDATA[Coding awesomness]]></category>

		<guid isPermaLink="false">http://mm.soldat.pl/?p=1746</guid>
		<description><![CDATA[Some requested a definition of good/bad code in the thread below. Archont is right with &#8220;good code&#8221; : works as expected. But I have a slightly different view. Suppose you want something expected to work on a release date (can be a major release in 6 months or just a patch in 3 days). Good [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Some requested a definition of good/bad code in the thread below.<br />
Archont is right with &#8220;good code&#8221; : works as expected. But I have a slightly different view.<br />
Suppose you want something expected to work on a release date (can be a major release in 6 months or just a patch in 3 days).</p>
<p>Good Code:<br />
Any code that moves you closer to the release date.</p>
<p>Bad Code:<br />
Any code that moves you further away from the release date.</p>
<p>With this we see that if you don&#8217;t set a release date you cannot measure how good or bad is your code. So your development time increases infinitely because you might spend time rewriting and &#8220;perfecting&#8221; code that already works. Of course there are some companies that say it&#8217;s done &#8220;when it&#8217;s done&#8221; (like Valve, Id, 3D Realms RIP). I believe they just don&#8217;t announce a release date. I&#8217;m sure someone disciplined like Carmack sets release dates that are kept even for himself (like setting milestones). There is a paragraph in &#8220;Master&#8217;s of Doom&#8221; where it&#8217;s noted that Carmack after releasing Quake locked himself for a week in a hotel room to experiment with some technology. Doing that sets a deadline of 7 days. After that you expect to have something awesome working. It doesn&#8217;t matter what is inside the source code or how it looks.</p>
<p>My favorite release date approach is a deadline of 1 day. When I start work on that day I say to myself: today I will make a physics engine or today I will make a particle engine. I work only on that during that day and usually at the end I have something working. Code made this way is usually the best code I make. If I tweak it or add stuff later it usually makes the code worse and less elegant. Doing a big chunk of code in 24 hours makes you remember the whole thing in your head. So you work the whole code in your head. The next day you will forget most parts of the code. If you return in a couple weeks there is nothing left of your understanding of the code. In 1 day it is possible to understand every bit of the code. </p>
<p>Try it, instead of working on every piece of the game from time to time. Just take one segment of the game and try to code it in 1 day. If you fail, erases it, and try again.</p>
]]></content:encoded>
			<wfw:commentRss>https://mm.soldat.pl/coding-awesomness/bad-code-release-dates/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>How to program independent games</title>
		<link>https://mm.soldat.pl/coding-awesomness/how-to-program-independent-games</link>
		<comments>https://mm.soldat.pl/coding-awesomness/how-to-program-independent-games#comments</comments>
		<pubDate>Tue, 28 Jun 2011 19:35:52 +0000</pubDate>
		<dc:creator><![CDATA[MM]]></dc:creator>
				<category><![CDATA[Coding awesomness]]></category>

		<guid isPermaLink="false">http://mm.soldat.pl/?p=1743</guid>
		<description><![CDATA[Soldat is good because it has shit code. It wouldn&#8217;t ever be good if it had good code. Why? http://the-witness.net/news/2011/06/how-to-program-independent-games/ Presentation by creator of Braid. I could have done a similar presentation, lots of great stuff here.]]></description>
				<content:encoded><![CDATA[<p>Soldat is good because it has shit code. It wouldn&#8217;t ever be good if it had good code. Why?</p>
<p><a href="http://the-witness.net/news/2011/06/how-to-program-independent-games/">http://the-witness.net/news/2011/06/how-to-program-independent-games/</a><br />
Presentation by creator of Braid. I could have done a similar presentation, lots of great stuff here.</p>
]]></content:encoded>
			<wfw:commentRss>https://mm.soldat.pl/coding-awesomness/how-to-program-independent-games/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Packing floats</title>
		<link>https://mm.soldat.pl/coding-awesomness/packing-floats</link>
		<comments>https://mm.soldat.pl/coding-awesomness/packing-floats#comments</comments>
		<pubDate>Mon, 21 Feb 2011 13:58:52 +0000</pubDate>
		<dc:creator><![CDATA[MM]]></dc:creator>
				<category><![CDATA[Coding awesomness]]></category>

		<guid isPermaLink="false">http://mm.soldat.pl/?p=1570</guid>
		<description><![CDATA[This is a post for coders. Here are 4 useful inline routines to decrease the size of a float by 50% (from 4 bytes to 2 bytes). I use them to pack every float in the game that doesn&#8217;t need big precision. Actually none of them do. So positions, velocities, cursor points are all packed [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This is a post for coders.</p>
<p>Here are 4 useful <em>inline</em> routines to decrease the size of a float by 50% (from 4 bytes to 2 bytes). I use them to pack every float in the game that doesn&#8217;t need big precision. Actually none of them do. So positions, velocities, cursor points are all packed (starting from the next version).</p>
<p><code>typedef unsigned short u16<br />
typedef signed short s16<br />
typedef float f32</p>
<p>// packs floats in the range of 0.f -> 32776.f/base;<br />
// in this case base = 100.0f so range 0.f -> 327.76f<br />
// when packing floats in this way you need to make sure they stay in this range<br />
// that is the cost of packing</p>
<p>inline void packfloatu16( f32 x, u16 &#038;y, f32 base = 100.0f)<br />
{<br />
	assert( x <= 32776.f/base );
	x = min( 32776.f/base, max( 0.0f, x ) );
	y = x * base;
}

inline void unpackfloatu16( u16 x, f32 &#038;y, f32 base = 100.0f)
{
	y = (f32) x / base;
}

// the same routine as above for signed characters
// this is very good for packing velocities, since they rarely
// become very large

inline void packfloats16( f32 x, s16 &#038;y, f32 base = 100.0f)
{
	assert( x <= -0.5f*32776.f/base );
	assert( x >= 0.5f*32776.f/base );<br />
	x = min( 0.5f*32776.f/base, max( -0.5f*32776.f/base, x ) );<br />
	y = x * base;<br />
}</p>
<p>inline void unpackfloats16( s16 x, f32 &#038;y, f32 base = 100.0f)<br />
{<br />
	y = (f32) x / base;<br />
}</code></p>
<p>If assert() doesn&#8217;t work on your system, replace it with ASSERT or whatever the equivalent is. You can also remove it entirely since it is only for debug.</p>
]]></content:encoded>
			<wfw:commentRss>https://mm.soldat.pl/coding-awesomness/packing-floats/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
