<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Liberation Circuit (was Invincible Countermeasure)</title>
		<link>http://www.allegro.cc/forums/view/616382</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 12 Jul 2016 16:27:38 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A while ago I released a beta version of a game called Invincible Countermeasure, a kind of hybrid RTS and programming game. A number of people were very helpful with comments and patches, but ultimately IC just didn&#39;t work very well as a game.</p><p>Even though it wasn&#39;t very fun, I think the basic idea of the game was sound. So I&#39;ve taken the engine I wrote for Invincible Countermeasure and turned it into a new game with a focus on gameplay rather than conceptual purity. It&#39;s still the same kind of game, but with a vastly simpler API, a GUI-based process (unit) designer and an autocoder for player-designed units that lets it be played without any coding at all.</p><p><a href="https://www.youtube.com/watch?v=1i6DHUiJd44">Here&#39;s a video of some gameplay.</a></p><p><a href="https://sourceforge.net/projects/liberation-circuit/files/alpha_1/">Here&#39;s the version page on Sourceforge.</a> I&#39;ve uploaded a zip containing source code, another one containing data files (everything needed to run the game other than the executable and the Allegro dll) and one with Windows binaries (includes everything needed to run the game).</p><p>All comments welcome!</p><p>Edit: here&#39;s a screenshot, too:</p><p><span class="remote-thumbnail"><span class="json">{"name":"tCL4TgW.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/5\/d5aceacfcddfe31b6e46bb4cac0c3cdd.png","w":762,"h":632,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/5\/d5aceacfcddfe31b6e46bb4cac0c3cdd"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/d/5/d5aceacfcddfe31b6e46bb4cac0c3cdd-240.jpg" alt="tCL4TgW.png" width="240" height="199" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Tue, 05 Jul 2016 19:21:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You say it&#39;s a RTS. I assume that means I can&#39;t pause the game to give orders? I don&#39;t like feeling so rushed when I play a game. I like the strategy aspect more than the real-time aspect. This reminds me of another game you made that was very similar, about 5 years ago or so? I don&#39;t remember what it was called, but I don&#39;t think there was any programming involved, only space battles. I liked that game but it was too hard for me.</p><p>If I have time, I&#39;ll try to give your game a whirl.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 06 Jul 2016 00:34:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can pause the game (by pressing &#39;p&#39;) and give orders while it&#39;s paused. It&#39;s definitely not a game of twitch reflexes.</p><p>Is the other game you&#39;re thinking of Angry Moth?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Wed, 06 Jul 2016 02:40:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh good! Thank god for pause. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>I think that was the game, yes. Good game, but I wasn&#39;t very good at it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 06 Jul 2016 02:45:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Don&#39;t you know SourceForge is dead to the world? <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" /></p><p><b>Append:</b></p><p>Here&#39;s a simple bash script (use at own risk; SourceForge is linking to the downloads without TLS) to fetch and build for you in Linux (based on a Monolith shared object for Allegro 5).</p><div class="source-code"><div class="toolbar"><span class="name">gogogo.bash</span><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="p">#!/bin/bash</span>
<span class="number">  2</span>set <span class="k3">-</span>e<span class="k2">;</span>
<span class="number">  3</span>fbase<span class="k3">=</span>LibCirc_alpha1<span class="k2">;</span>
<span class="number">  4</span>ubase<span class="k3">=</span>http:<span class="c">//downloads.sourceforge.net/project/liberation-circuit/alpha_1;</span>
<span class="number">  5</span>data<span class="k3">=</span><span class="s">"${fbase}_data.zip"</span><span class="k2">;</span>
<span class="number">  6</span>src<span class="k3">=</span><span class="s">"${fbase}_src.zip"</span><span class="k2">;</span>
<span class="number">  7</span>names<span class="k3">=</span>allegro_monolith-5<span class="k2">;</span>
<span class="number">  8</span>wget <span class="s">"$ubase/$data"</span><span class="k2">;</span>
<span class="number">  9</span>wget <span class="s">"$ubase/$src"</span><span class="k2">;</span>
<span class="number"> 10</span><span class="n">7</span>z x <span class="s">"$data"</span><span class="k2">;</span>
<span class="number"> 11</span><span class="n">7</span>z x <span class="k3">-</span>oLibCirc<span class="k3">/</span> <span class="s">"$src"</span><span class="k2">;</span>
<span class="number"> 12</span>cd LibCirc<span class="k3">/</span><span class="k2">;</span>
<span class="number"> 13</span>cflags<span class="k3">=</span><span class="k2">(</span><span class="k3">-</span>Isrc <span class="k3">-</span>olibcirc <span class="k3">-</span>Wall $<span class="k2">(</span>pkg-config <span class="k3">-</span><span class="k3">-</span>cflags $names<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>libs<span class="k3">=</span><span class="k2">(</span>$<span class="k2">(</span>pkg-config <span class="k3">-</span><span class="k3">-</span>libs $names<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>gcc <span class="s">"${cflags[@]}"</span> src<span class="c">/*.c -lm "${libs[@]}";</span>
</div></div><p>

If all goes well you&#39;ll end up with LibCirc/ and inside will be the binary, libcirc. Change to it and run it (I&#39;m assuming the current working directory must be the root of LibCirc/).</p><div class="spoiler"><p>
GCC reveals some warnings that the OP should look into addressing.</p><pre class="terminal scroll">src/c_compile.c: In function ‘add_print_string’:
src/c_compile.c:1173:2: warning: format not a string literal and no format arguments [-Wformat-security]
  snprintf(temp_string, string_length, source_string);
  ^
src/c_compile.c:1173:2: warning: format not a string literal and no format arguments [-Wformat-security]
src/d_draw.c: In function ‘draw_design_help_strings_for_help_button’:
src/d_draw.c:1065:3: warning: format not a string literal and no format arguments [-Wformat-security]
   al_draw_textf(font[FONT_BASIC].fnt, colours.base [COL_GREY] [SHADE_HIGH], base_x, line_y, ALLEGRO_ALIGN_LEFT, design_help_st
   ^
src/d_draw.c: In function ‘draw_design_help_strings_for_help_more_button’:
src/d_draw.c:1103:3: warning: format not a string literal and no format arguments [-Wformat-security]
   al_draw_textf(font[FONT_BASIC].fnt, colours.base [COL_GREY] [SHADE_HIGH], base_x, line_y, ALLEGRO_ALIGN_LEFT, design_help_st
   ^
src/t_draw.c: In function ‘draw_template_panel’:
src/t_draw.c:173:58: warning: format not a string literal and no format arguments [-Wformat-security]
    snprintf(file_path_string, TEMPLATE_FILE_PATH_LENGTH, draw_templ-&gt;source_edit-&gt;src_file_path);
                                                          ^
src/t_draw.c:173:58: warning: format not a string literal and no format arguments [-Wformat-security]</pre><p>
</p></div><p>

I couldn&#39;t remember Invincible Countermeasure, though I certainly remember playing it and liking it. It took a couple of seconds after starting the first mission to recognize it. I&#39;m glad that the idea hasn&#39;t been abandoned. Looks good.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Wed, 06 Jul 2016 09:37:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks for the bash script. I have to admit that I am mostly ignorant of such things.</p><p>Sourceforce does have its problems (although I think it changed ownership a few months ago and the new owners have at least claimed that they&#39;ll try to clean it up) but I&#39;ve had trouble finding a good alternative. Everyone seems to use Github these days, but it&#39;s not ideal for binary distribution; all I want is a place to upload zips with source code and Windows binaries and at least Sourceforge lets me do that without too much trouble.</p><p>Has anyone used FossHub? It looks like it might be okay as a substitute.</p><p>(I&#39;ve set up an allegro.cc project, but they tend to take a while to start working)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Wed, 06 Jul 2016 16:03:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Github supports the zipped binary distribution <a href="https://help.github.com/articles/about-releases">https://help.github.com/articles/about-releases</a> (But I have not used it).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gameovera)</author>
		<pubDate>Wed, 06 Jul 2016 17:02:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The game is not quite what I expected. It&#39;s not bad, but there are some explanations of basic gameplay missing. For example, I&#39;m not sure what the difference between an mbuild and a harvester is. What does a harvester do? How do I get more data? By using mbuilds? I&#39;m just a little confused.</p><p>It would be nice if there were more movement options, like stationary rotation, strafing, and wheeling. It feels dumb that ships accelerate away from targets if they are facing away from them instead of just turning to face the attacker.</p><p>I never got into the programming aspect of it, as I was too busy trying to figure out basic gameplay.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 07 Jul 2016 04:23:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>gameovera: Thanks, I didn&#39;t know that. I&#39;ll have another look at Github, although I think to use it properly I would need to start using Git.</p><p>Edgar Reynaldo: <br />Thanks for trying it! To get more data you need to harvest it from a data well then process it at a unit which has an &quot;allocate&quot; object (which looks like a little windmill and can only be placed on an immobile unit). </p><p>The &quot;base&quot; unit has both a harvest object and an allocate object, so you can build a new base at a data well (using an mbuild) and harvest data directly. Or you can build a harvester to go and get data from another data well and bring it back to a base for allocation (it will automatically do this if you tell it to move near a data well). That&#39;s slower, but a harvester is cheaper than a base and can retreat if attacked.</p><p>You&#39;re right that this isn&#39;t very well explained. I&#39;ll add an extra step to the tutorial to better explain harvesters and data.</p><p>The way that units move is determined by the roughly Newtonian physics model. The little two-engine attacker units need to move forwards to turn around because the only way they can turn is by operating one engine more than the other, which generates torque. A unit with some forward-facing engines (like the &quot;destroy&quot; unit you can build) is able to turn more sharply.</p><p>The movement options are limited to avoid making the autocoder too complicated or the code it generates too long. Units can definitely be coded to move in other ways, though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Thu, 07 Jul 2016 15:51:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Wait, if you&#39;re not using Git, what are you using?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (MiquelFire)</author>
		<pubDate>Thu, 07 Jul 2016 17:51:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Windows Explorer&#39;s &quot;Send to compressed folder&quot; function is all the version control I need.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Thu, 07 Jul 2016 18:26:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/616382/1023778#target">Linley Henzell</a> said:</div><div class="quote"><p>Windows Explorer&#39;s &quot;Send to compressed folder&quot; function is all the version control I need.</p></div></div><p>
^<br />100% of the coders who lose everything in hard drive failure agree with this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Audric)</author>
		<pubDate>Thu, 07 Jul 2016 20:03:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Nah, I have backups in various places. I just don&#39;t use a version control system.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Thu, 07 Jul 2016 20:24:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The beautiful part of version control is being able to review what you&#39;ve changed and restore various states easily. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> Even if all you ever do is &quot;add . &amp;&amp; commit -m snapshot&quot; you&#39;ll benefit from having various states. <b>And</b> they&#39;re stored more efficiently than the zip files.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Thu, 07 Jul 2016 20:37:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I guess I just learned to code without it, so I have coping strategies.</p><p>Anyway, I got an email from someone saying that the game doesn&#39;t use the X11 keyboard layout (I&#39;m guessing he uses a non-QWERTY European keyboard) so he can&#39;t use the editor. Does anyone know if there&#39;s an automatic way of dealing with non-QWERTY keyboards? Searching around suggests that earlier versions of Allegro dealt with this but I&#39;m not sure Allegro 5 does.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Fri, 08 Jul 2016 06:47:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m not sure, but perhaps if you provide UI to customize the inputs by letting the user pick an &quot;action&quot;, signal that they&#39;ll type an input, and then you reading the next input to fill in that slot would let such users customize the input to match their keyboard... I doubt that the <i>layout</i> matters. It probably has more to do with the actual &quot;characters&quot; not matching what you&#39;re expecting. I&#39;m guessing. Providing a UI for the user to enter their own might suffice (this is assuming that the Allegro API will give you a means to visualize arbitrary keyboard inputs, but I suppose you could always display low-level codes at the worst...). /dunno
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Fri, 08 Jul 2016 07:24:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Actually, after looking into European key layouts a bit more I suspect the problem is that my own input code is set up to interpret shifted keypresses on the assumption that the keyboard is a QWERTY one, and isn&#39;t treating the Alt Gr key correctly (before a minute ago I didn&#39;t even know what an Alt Gr key was).</p><p>Looks like I&#39;ll need to fix this myself, probably by adding an init file option allowing the user to set a non-QWERTY keyboard. I can&#39;t really expect the user to customise the input key-by-key as the IDE requires so many punctuation keys.</p><p>Does anyone know how to map the ALLEGRO_KEY_* codes to keys on a non-QWERTY keyboards? E.g. looking at the <a href="https://en.wikipedia.org/wiki/File:KB_Germany.svg">QWERTZ layout</a>, I see there is a + key where the [ or ] key would be on a QWERTY keyboard. But there&#39;s no ALLEGRO_KEY_PLUS in the <a href="https://www.allegro.cc/manual/5/keyboard.html">list of key codes</a>.</p><p>Any ideas?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Fri, 08 Jul 2016 10:25:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>For your purpose, I think you just need to accept both AltGr and Alt as modifiers for your ALT-something shortcuts.</p><p>For shortcuts based on physical locations, use the keycode (ex: W A S D will be the right keycodes on any keyboard for cursor-type movement, 1234567890 are the 10 top keys - even on AZERTY keyboards where, without SHIFT, they type &amp;é&quot;&#39;(-è_çà</p><p>For shortcuts based on an actual letter (Ctrl-M -&gt; <b>M</b>ove), test for the keyboard.unicode value.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Audric)</author>
		<pubDate>Fri, 08 Jul 2016 13:55:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hm, it turns out that he&#39;s using a &quot;Neo&quot; German keyboard, which looks <a href="http://neo-layout.org/index_en.html">like this</a>. So the incompatibility goes a little deeper than a couple of letters and AltGr. Some google searching indicates that this is a bit of a recurring problem for Neo keyboards.</p><p>The only way I can think of to fix it would be to include new keyboard remapping code in my game, which would be simple if I knew which Allegro keycodes corresponded to which Neo keys but not so simple otherwise.</p><p>Is the keyboard.unicode value an Allegro thing? For this game, it&#39;s the actual letter being pressed (not the position on the keyboard) that matters.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Fri, 08 Jul 2016 19:16:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I mistyped, it&#39;s the field <i>keyboard.unichar</i> from event ALLEGRO_EVENT_KEY_CHAR :<br /><a href="http://liballeg.org/a5docs/trunk/events.html#allegro_event_key_char">http://liballeg.org/a5docs/trunk/events.html#allegro_event_key_char</a><br />The event includes the modifier flags (+Ctrl, +Shift, etc.).</p><p>If DirectX works correctly with these keyboards, &quot;character-emitting&quot; keys will cause this event, with the right ünicode character.<br />Should be simple in your case : The unicode id of all a-z A-Z letters has the same value as the ASCII codes, so you can test <span class="source-code"><span class="k1">if</span> <span class="k2">(</span>event.keyboard.unichar <span class="k3">=</span><span class="k3">=</span> <span class="s">'a'</span><span class="k2">)</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Audric)</author>
		<pubDate>Fri, 08 Jul 2016 21:12:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/616382/1023804#target">Linley Henzell</a> said:</div><div class="quote"><p>
But there&#39;s no ALLEGRO_KEY_PLUS in the list of key codes.
</p></div></div><p>
It&#39;s under ALLEGRO_KEY_EQUALS, because that&#39;s the lower character on the plus key on a QWERTY keyboard.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 09 Jul 2016 00:44:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/616382/1023815#target">Audric</a> said:</div><div class="quote"><p>I mistyped, it&#39;s the field keyboard.unichar from event ALLEGRO_EVENT_KEY_CHAR</p></div></div><p>

Thanks - that looks like exactly what I need. I&#39;ll give it a try.</p><p>Edit: And it worked! Cheers for that.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Linley Henzell)</author>
		<pubDate>Tue, 12 Jul 2016 16:27:38 +0000</pubDate>
	</item>
</rss>
