Index

Create New

Title Content Category
Website Upgrade <p>Hello once again,</p><p>Welcome to the new look, the new site has been written from scratch using .Net Core, it's been a bit of a rushed experiment and there are a few teething issues.&nbsp;&nbsp;</p><p>Over the coming weeks I'll endeavour to move the old site's content across and fix all the broken images and links.</p> Website Edit | Details | Delete
Red Alert 2 and Yuris Revenge on Windows 7 <p>In this post I aim to explain how to get Red alert 2 and Yuri's revenge working on Windows 7</p><br><h1>Contents:</h1><br><p>1. Running on win 7</p><br><p>2. Lan Play</p><br><p>3. Lan Patch issues</p><br><p>4. Copyprotection</p><br><p>5. Maps</p><br><br><p>more</p><strong>Getting RA2/YR to run on Windows 7:</strong><br><br><p>If when starting RA2:YR on Windows vista or Windows 7 you are greeted with:</p><br><p>***FATAL*** String Manager Failed to Initialize Properly</p><br><br><strong>Vista<br></strong><p>In vista the simple trick was to right click and run the game as an administrator. This allowed the game to access the stringmanager dlls.</p><br><br><strong>Windows 7<br></strong><p>For me only disabling User account control (UAC) worked. This is because uac is a lot more forceful in windows 7 and won't allow RA2.exe to access the string manager .dll's in the windows directory.</p><span style="color: black; font-size: 10pt;"><span style="font-family: Arial;"><br></span></span><br><br><span style="color: black; font-size: 10pt;"><span style="font-family: Arial;">&nbsp;</span><span style="font-family: Verdana;"><em>To do this fix:</em></span></span><br><br><p>1) Open control panel</p><br><p>2) Click users</p><br><p>3) Click Modify User access control settings.</p><br><p>4) Set the status to "Never notify"</p><br><p>5) Accept the series of warnings.</p><br><p>6) Reboot your machine.</p><br><br><p>You can now run RA2:YR once your computer reboots.</p><br><p>If this fails to work first time, It might be an idea to enable windows 2000 compatibility mode on every exe in the ra2 folder.</p><br><p>After playing Yuri its recommended you turn UAC back on, Repeat the steps above, setting it back to the default setting:</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/041712_1833_RA2andYuris111.png" alt="" data-proportion="true" data-align="none" data-file-name="041712_1833_RA2andYuris111.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><h1>Lan Play</h1><br><em>Without the fuss of Hamachi 2.0</em><br><br><p>At the time of Vista, Microsoft had stopped supporting the IPX protocol, which is required by RA2 to perform network play. Luckily some bright sparks managed to hack the games code to make it run on the UDP protocol, which all machines support!</p><br><p>This is dubbed as the lan patch.</p><br><p>There are 2 ways to obtain the lan patch (depending on your boxed copy)</p><br><br><strong>First Decade Patch<br></strong><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/041712_1833_RA2andYuris212.jpg" alt="" align="left" data-proportion="true" data-align="none" data-file-name="041712_1833_RA2andYuris212.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="1" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><p>If you have "The first decade" version of Yuri, its easiest if you get the unofficial 1.03 patch. Google "TFD 1.03" or click below.</p><br><p>This allows you to play without the need of the TFD disk (unbelievably useful)!</p><br><p>More importantly, it contains the lan patch, and installs it all for you! It replaces the network dll (wsock.dll) to use UDP instead of IPX.</p><br><em>Download:</em><br><a href="http://www.fileplay.net/file/4289/the-first-decade-patch-1-03">http://www.fileplay.net/file/4289/the-first-decade-patch-1-03</a><br><br><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/041712_1833_RA2andYuris312.jpg" alt="" align="right" data-proportion="true" data-align="none" data-file-name="041712_1833_RA2andYuris312.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="2" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><strong><br></strong><br><br><strong>RA2:YR Boxset<br></strong><br><br><p>If you are lucky enough to have the orignal box set, you'll need the stand alone IPX-&gt;UDP patch.</p><br><p>Download below, unzip, and place the wsock.dll in the ".../westwood/ra2" folder overwriting the existing wsock.dll.</p><br><p>Download:</p><br><a href="http://jackdye.co.uk/Uploads/ts_ra2_lanpatch_1_00.zip">http://jackdye.co.uk/Uploads/ts_ra2_lanpatch_1_00.zip</a><br><br><br><br><p>However, both methods share the same drawback:</p><br><p>2 modified wsock.dlls cannot talk to eachother in Internet play (lan play is fine however).</p><br><p>If you try, your game will disconnect as soon as you exit the game lobby with a black screen.</p><br><br><p>A simple fix however:</p><br><br><strong>To Play over the internet:<br></strong><p>Rename wsock.dll in the ra2 folder to disable it (i.e wsock.dis)</p><br><br><strong>To Play over a LAN:<br></strong><p>Then name wsock.dis back (wsock.dll)</p><br><h1>Units blow up at the start of the game?</h1><br><p>If your units blow up every time you start the game, you have to reinstall.</p><br><p>This is due to the anti piracy switch in the game; If same 2 cd keys see each other (LAN or Internet), as they will trigger the switch causing your units to blow up at the start of every game. I'm not sure if there's a registry key to revert the change without having to reinstall.</p><br><br><p>But for me a quick reinstall works, or you could download a crack to remove the piracy switch altogether.</p><br><h1>Maps</h1><br><p>If you ever want to install additional maps, Simply place the map file (.mix) in the ra2 folder:</p><br><br><em>".../westwood/ra2"</em><br><br><p>If you wish to make your own maps for Red Alert 2 Yuri's revenge, a official map editor exists:</p><br><br><a href="http://jackdye.co.uk/Uploads/FA2YR101.zip">http://jackdye.co.uk/Uploads/FA2YR101.zip</a><br><br><p>Using the map editor, you can create levels for Yuris Revenge and Red alert 2 in both single player and multiplayer.</p> Tutorials Edit | Details | Delete
Collision Detection 1 - Introduction <h2>Preface</h2><p><span style="color: black; font-size: 12pt;">I&nbsp;</span>started writing these collision tutorials as I have recently learnt some of these techniques, and found many tutorials completely useless at explaining the core concepts to a novice. In this I aim to show you how I got my head around the concepts of collision detection, and response. Instead of providing you with code to blindly copy and paste, I hope this will give you enough information to go on to create your own code, and know&nbsp;<strong>how it works</strong><span style="color: black; font-size: 12pt;"><strong>.</strong></span></p><h2>Stuff you should already know:</h2><br><div style="text-align: center; margin-left: 7pt;"> <table style="border-collapse: collapse;" border="0"> <tbody valign="top"> <tr> <td style="border: solid #777777 0.75pt; padding: 8px;" valign="middle"> <br> <p style="text-align: center;"><span style="color: black; font-size: 10pt;"><strong>Parallel</strong><br> </span></p> <br> <p style="text-align: center;"><span style="color: black; font-size: 10pt;">&nbsp;</span></p> <br> </td> <td style="border-top: solid #777777 0.75pt; border-left: none; border-bottom: solid #777777 0.75pt; border-right: solid #777777 0.75pt; padding: 8px;" valign="middle"> <br> <p style="text-align: center;"><span style="color: black; font-size: 10pt;"><strong>Perpendicular</strong></span></p> <br> </td> <td style="border-top: solid #777777 0.75pt; border-left: none; border-bottom: solid #777777 0.75pt; border-right: solid #777777 0.75pt; padding: 8px;" valign="middle"> <br> <p style="text-align: center;"><span style="color: black; font-size: 10pt;"><strong>Normal</strong>&nbsp;</span></p> <br> </td> </tr> <tr> <td style="border-top: none; border-left: solid #777777 0.75pt; border-bottom: solid #777777 0.75pt; border-right: solid #777777 0.75pt; padding: 8px;" valign="middle"> <img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe1.png" alt="" data-file-name="042912_1001_CollisionDe1.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-index="0"> </td> <td style="border-top: none; border-left: none; border-bottom: solid #777777 0.75pt; border-right: solid #777777 0.75pt; padding: 8px;" valign="middle"> <span style="color: black; font-family: Arial; font-size: 10pt;">&nbsp;<img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe2.png" alt="" data-file-name="042912_1001_CollisionDe2.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-index="1"> </span> </td> <td style="border-top: none; border-left: none; border-bottom: solid #777777 0.75pt; border-right: solid #777777 0.75pt; padding: 8px;" valign="middle"> <img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe3.png" alt="" data-index="2" data-file-name="042912_1001_CollisionDe3.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey=""> <span style="color: black; font-family: Arial; font-size: 10pt;">&nbsp;</span> </td> </tr> </tbody> </table> <br> </div><div><br> </div><ul> <li>Most 3D maths problems can be flattened into 2 Dimensional problems, If your stuck, solve it in 2D then move into the 3rd dimension.</li> <br> <li>Use a pen and paper to draw problems out.</li> <br> <li><a href="https://en.wikipedia.org/wiki/Unit_vector">Unit or normalised vector</a> (Wikipedia makes it sound way more complicated than it is, just know the X and Y values fall only in the range of -1 to 1.<br> Think of this as a percentage of direction, (1,0) will be 100% right 0% up, (-1,-1) will be moving bottom left at 100%.</li> <br> </ul><br><h2>Next:</h2> Tutorials Edit | Details | Delete
Hacking memory sticks <span style="font-family: Arial;"><span style="font-size: 18pt;">Into the unknown...</span><span style="font-size: 10pt;"><br></span></span><br><br><span style="font-family: Arial;"><span style="font-size: 12pt;">About a year ago, Humberside police were handing out free memory sticks, at our uni's fresher's fare. Great! I thought i'll have one of them. 1GB stick for nothing, can't go wrong...</span><span style="font-size: 10pt;"><br></span></span><br><br><span style="font-family: Arial;"><span style="font-size: 12pt;">So, I got it home, plugged it in, boom, fullscreen&nbsp;power point slideshow&nbsp;on how to protect your property......&nbsp;borderline adaware!&nbsp;Into the draw the usb went and lived. Another fresher fare came and went and I got another 2 of these usbs, 3gb total, which I&nbsp;couldn't use without being shafted&nbsp;a load of adverts every time I plugged them in.</span><span style="font-size: 10pt;"><br></span></span><br><span style="font-family: Arial;"><span style="font-size: 12pt;">These 'promo' sticks worked by having 2 partitions, a CDFS partition (for the adverts)&nbsp;and a normal FAT32 partition (for files). As the name suggests the CDFS partition is derived from cds, with cds being read only, windows will&nbsp;not allow you to modify the partition;&nbsp;to the extent you cannot format the partition to kill it off. Another&nbsp;ghastly feature of&nbsp;CDFS is the autorun ability,&nbsp;which it's only use is to spread malware, in the form of Sony's spyware that appeared on a number legitimate cd's&nbsp;in 2005, to more recent appearing of household virus' spread via usb's.</span><span style="font-size: 10pt;"><br></span></span><br><br><span style="font-family: Arial;"><span style="font-size: 12pt;">For the purpose of promotion, this ugly feature was used to autorun the power point presentation.<br></span></span><span style="font-family: Arial;"><span style="font-size: 10pt;"><br></span></span><br><br><span style="font-family: Arial; font-size: 18pt;">Opening up...</span><br><br><span style="font-family: Arial;"><span style="font-size: 12pt;">So I sought to look onto how to remove the partition once and for all, grabbing a screwdriver I pried open the usb to get a look at the manufacture of this nobranded usb.</span></span><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img alt="" src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/041912_2131_HackingMemo1.jpg" data-proportion="true" data-align="none" data-file-name="041912_2131_HackingMemo1.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><span style="color: black; font-family: Arial; font-size: 10pt;"><br></span><br><br><span style="color: #dfdfdf; font-size: 12pt;"><span style="font-family: Arial;">Captured using a life cam&nbsp;HD</span><span style="color: #9f9f9f; font-family: Times New Roman;"><br></span></span><br><br><span style="font-size: 12pt;"><span style="font-family: Arial;">We can see the manufacture is 'chipsbank' with a model code of 'CBM2091' digging around Google, I came across many forum posts asking how to get rid of the promo.&nbsp;</span><span style="font-family: Times New Roman;"><br></span></span><br><br><span style="font-family: Arial;"><span style="font-size: 12pt;">I eventually stumbled across the manufacture tool that's given to companies to flash their promo material onto the sticks.</span><span style="font-size: 10pt;"><br></span></span><br><br><span style="font-family: Arial; font-size: 18pt;">Fixing the unfixable...</span><span style="font-family: Times New Roman; font-size: 12pt;"><br></span><br><br><span style="font-family: Arial;"><span style="font-size: 12pt;">This is called UMP Tool, not sure of the acronym, but never-the-less, I managed to obtain a copy for my chip (2091), simply by googling UMP tool 2091, which lead me to to a Russian site and finally the program itself (UMP TOOL V1.9.5). The current version of UMP tool goes to 4.1, however each version is specific to the version of the flash chip (so you'll need to open each usb, to get the chip version, to get the correct flasher).</span><span style="font-size: 10pt;"><br></span></span><br><br><span style="font-family: Arial;"><span style="font-size: 12pt;">Started the baby up, and being unflattered by the initial layout of the program, I went into the settings, and was quite blown away with the diversity of options:</span></span><br><br><span style="color: black;"><span style="font-size: 12pt;">&nbsp;<div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img alt="" src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/041912_2131_HackingMemo2.png" data-proportion="true" data-align="none" data-file-name="041912_2131_HackingMemo2.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="1" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div></span><span style="font-family: Arial; font-size: 10pt;"><span style="color: #9f9f9f;"><br></span></span></span><br><br><span style="font-family: Arial;"><span style="font-size: 12pt;">As you can see, you can do quite allot, from making a password protected usb (which normally&nbsp;adds&nbsp;£5/£10 to the price of a retail&nbsp;stick) right up to tinkering the flash rate of the usb when its being read.</span><span style="font-size: 10pt;"><br></span></span><br><br><span style="font-size: 12pt;"><span style="font-family: Arial;">Excitedly, I flashed my first 'home brand' usb, which destroyed the evil promotional partition and gave me full access to the disk. Success! It worked. I could format it again burning an ISO as a CDFS partition, quite exciting stuff.&nbsp;</span><span style="font-family: Times New Roman;"><br></span></span><br><br><span style="font-size: 12pt;"><span style="font-family: Arial;">But. not as exciting as when I got to my 2nd and 3rd usb....</span><span style="font-family: Times New Roman;"><br></span></span><br><br><span style="font-family: Arial; font-size: 18pt;">Hidden Secret...</span><span style="font-family: Times New Roman; font-size: 12pt;"><br></span><br><br><span style="font-size: 12pt;"><span style="font-family: Arial;">During formatting, I noticed it had 2048 blocks, and it would show the number of blocks as being corrupt/unusable.<br>Fine I thought, flash memory is prone to having a certain %age of corrupt/bad blocks.<br></span></span><span style="font-size: 12pt;"><span style="font-family: Arial;">&nbsp;The manufacture had to compensate for this, had installed 2048 blocks (2GB). </span></span><span style="font-size: 12pt;"><span style="font-family: Arial;">This allowed for a 50% corruption rate and still maintain the advertised 1GB to the consumer.<br></span></span><span style="font-size: 12pt;"><span style="font-family: Arial;"><br>Now, here comes the fun part, by flashing using the UMP tool, It gave me access every single block that wasn't corrupt! Making my 1GB stick's grow to 1.46GB and 1.86GB! </span></span><span style="font-size: 12pt;"><span style="font-family: Arial;">(having about 25% and 8% bad blocks)</span><span style="font-family: Times New Roman;"><br></span></span><br><br><span style="font-family: Arial;"><span style="font-size: 12pt;">Quite a daunting realization occurred; people pay for the 2GB chip, but are only allowed 1GB of it, making a </span><span style="font-size: 13pt;">theoretical&nbsp;</span><span style="font-size: 12pt;">loss of 50% on their purchase. </span></span><span style="font-family: Times New Roman; font-size: 12pt;"><br></span><br><p style="padding-left: 30px;">&nbsp;<span style="font-size: 12pt;"><span style="font-family: Arial;"><em>A consumer con?&nbsp;</em></span><span style="font-family: Times New Roman;"><br></span></span></p><br><span style="font-family: Arial;"><span style="font-size: 12pt;">Well... due to the high volatility of flash memory, I can see why manufactures would rather guarantee 1GB than give consumers room to complain about their random amount of memory between 1GB and 2GB, after all it is at the customers expense.&nbsp;</span><span style="font-size: 10pt;"><br></span></span><br><br><span style="font-size: 12pt;"><span style="font-family: Arial;">But I'm left with a thought, how much unused &amp; hidden memory is in your shiny stick?<br>At this ratio, could a&nbsp;8gb stick secretly contain a&nbsp;16gb chip?</span><span style="font-family: Times New Roman;"><br></span></span><br><br><span style="font-size: 12pt;"><span style="font-family: Arial;">If you find out let&nbsp;me know!</span><span style="font-family: Times New Roman;"><br></span></span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;">&nbsp;<div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img alt="" src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/041912_2131_HackingMemo3.png" data-proportion="true" data-align="none" data-file-name="041912_2131_HackingMemo3.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="2" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br></span><br><br><span style="font-size: 12pt;"><span style="font-family: Arial;">Don't trust what's on the tin, after all you paid for what's on the inside.</span><span style="font-family: Times New Roman;"><br></span></span><br><br><span style="font-family: Arial; font-size: 10pt;"><em>Stick on the left now is enjoying life as a music usb for my car stereo, with it formatting to the largest size.</em></span><span style="font-family: Times New Roman; font-size: 12pt;"><br></span><br><br><span style="font-family: Arial; font-size: 10pt;">Sources:</span><span style="font-family: Times New Roman; font-size: 12pt;"><br></span><br><br><span style="font-size: 12pt;">UMPTOOL 1.95 For chip Version 2091:</span><span style="font-family: Arial; font-size: 10pt;"><br></span><br><br><a href="http://flashboot.ru/old/index.php?name=Files&amp;op=view_file&amp;lid=81"><span style="color: blue; font-family: Arial; font-size: 10pt; text-decoration: underline;">http://flashboot.ru/old/index.php?name=Files&amp;op=view_file&amp;lid=81</span><span style="color: black; font-family: Arial; font-size: 10pt;"><br></span></a><br><br><p>UMPTOOL 4.02 (Not sure if backwards compatable with 2091)</p><br><br><a href="http://www.filecrop.com/v4.02.rar-umptool.html">http://www.filecrop.com/v4.02.rar-umptool.html</a><br><br><span style="font-size: 12pt;">I also got a 2093 version for the v2.0 stick on the left from rapidshare.<br>I'm unsure on the legality of these tools, so I'm unable to host them myself, but a quick google for "UMPTool" and your CB number should point you where you need.&nbsp;</span><br><br><p>You can also check out the flashboot.ru directory for a flasher if you have another other brand of USB:</p><br><a href="http://flashboot.ru/iflash/">http://flashboot.ru/iflash/</a> Tutorials Edit | Details | Delete
Motion Capture FPS <p>This is an extract from my 3<span style="font-size: 9.75px; vertical-align: super;">rd&nbsp;</span>year dissertation</p><strong>Introduction<br></strong><p>Using a Vicon optical motion capture suite (which was available for use in my university) I wanted to take motion capture beyond the movies, and implement a fully interactive gaming experience in which the player is the controller, This allows 6 Degrees of freedom for the player to move in, so leaning around corners, ducking, view freedom from your gun and blind firing, are realised and more immersive than a traditional keyboard and mouse setup could ever be.</p><p>more</p><p>The Vicon suite was one of my primary reasons for choosing the University Of Hull, and I am beyond thrilled to be able to use it for my undergraduate dissertation.</p><br><p>The initial specification I drew up over the summer was for the player to wear a Head mounted LCD display, which allows 3D stereoscopic viewing of my virtual environment, attached to the HMD and gun are fiducial markers that enable optical tracking, the player aims with the toy gun (Which is modified with a wireless mouse) to shoot down virtual enemies.</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042012_2119_MotionCaptu1.png" alt="" data-proportion="true" data-align="none" data-index="0" data-file-name="042012_2119_MotionCaptu1.png" data-file-size="0" origin-size="0,0" data-origin="," data-size=","></figure></div><br><br><p>Game engine progress</p><br><p>My game engine has been created from scratch in OpenGL and C++.</p><br><p>It Currently features:</p><br><ul><br> <li>3D Stereoscopic rendering</li><br> <li>First person tracking support (for HMD's)</li><br> <li>Paralax Motion Head tracking support (for monitors/projectors)</li><br> <li>GLSL shader support, with bump mapping and per fragment lighting</li><br> <li>Skybox shader</li><br> <li>OBJ model loader and texture support</li><br> <li>Collision detection for the world, AI and gun (Ray-Sphere, AABB, OBB)</li><br> <li>AI enemies which seek out the player avoiding world objects.</li><br> <li>TCP communication with a Vicon motion capture suite</li><br> <li>&nbsp;Configurable files for tracking data transformations</li><br></ul><br><p>It has been particular intensive in matrices with&nbsp;converting from the tracking coordinate system to OpenGL's co-ordinate system, I&nbsp;learnt openGL's shader pipeline to enable shaders that I created from my</p><a href="http://temp.icepick66couk.officelive.com/GLSLBattlefield.aspx">GLSL battlefield</a><p>to work within the engine. Wrote an&nbsp;AI collision avoidance and steering algorithm based on vector maths.</p><br><br><p>Tools used</p><br><p>Visual Studio C++</p><br><p>FreeGlut</p><br><p>GLSL</p><br><p>Wavefront OBJ</p><br><p>Render Monkey - Shader design</p><br><p>Blender - Gun model design &amp; model cleanup/UV mapping</p><br><p>Google Sketchup - Level design</p><br><p>Sculptris - Charater models</p><br><p>Photoshop - General texturing</p><br><p>Vicon Real time emulator</p><br><br><p>Screenshots</p><br><br><p>These screenshots are now outdated (See below!)</p><br><br><p>Clockwise: Spectator camera view of level, First person View, 'Flyray' flying enemy with bumpmapping</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042012_2119_MotionCaptu2.png" alt="" data-proportion="true" data-align="none" data-index="1" data-file-name="042012_2119_MotionCaptu2.png" data-file-size="0" origin-size="0,0" data-origin="," data-size=","></figure></div><br><br><p>Close up of the players area in which they have to defend</p><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042012_2119_MotionCaptu3.png" alt="" data-proportion="true" data-align="none" data-index="2" data-file-name="042012_2119_MotionCaptu3.png" data-file-size="0" origin-size="0,0" data-origin="," data-size=","></figure></div><br><br><p>10/03/11 Update</p><br><br><p>Rooftop level progress (Google Sketchup)</p><br><p>Google sketchup makes an interesting tool for level design, with the use of a 3rd party OBJ explorer the CAD tool could export models directly into my game, The texture mapping and dynamic&nbsp;geometry&nbsp;features of sketchup pretty much sold it to me as my weapon of choice to create my 3D rooftop.</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042012_2119_MotionCaptu4.png" alt="" data-proportion="true" data-align="none" data-index="3" data-file-name="042012_2119_MotionCaptu4.png" data-file-size="0" origin-size="0,0" data-origin="," data-size=","></figure></div><br><br><p>20/03/2011 Update</p><br><br><p>Level is fully complete, Textures were aquired online, and bump maps were created using Nivida's Normal map plugin for photoshop. The GLM model class was modified to support 2 textures and a bumpmaped phong shader, with a fallback shader if there is no normal map for a texture. Normal maps are defined in the models .mtl file.</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042012_2119_MotionCaptu5.png" alt="" data-proportion="true" data-align="none" data-index="4" data-file-name="042012_2119_MotionCaptu5.png" data-file-size="0" origin-size="0,0" data-origin="," data-size=","></figure></div><br><br><p>30/03/2011 Update</p><br><br><p>The HMD idea was scrapped due to the age of the hardware, mainly the LCD screens offered poor contrast.</p><br><br><p>Instead the game now runs on a 5x3m 3D Rear projection wall in the Vicon suite, and makes use of paralax motion tracking (Inspired from:</p><a href="http://www.youtube.com/watch?v=Jd3-eiid-Uw">http://www.youtube.com/watch?v=Jd3-eiid-Uw</a><p>). It makes use of 3D ontop of the paralax to give an incredible effect of the world ajoining through the screen.</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042012_2119_MotionCaptu6.jpg" alt="" data-proportion="true" data-align="none" data-index="5" data-file-name="042012_2119_MotionCaptu6.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size=","></figure></div><br><br><p>Video showing the paralax motion in action, notice how the effect is lost when tracking is lost in the 5th seccond. Although this is recoreded in 2D, the mouse seems to float far infront of the world purely by the paralax illusion. In 3D this effect is hightened, and the gun appears to float far infront of the screen as if the user is holding it.</p><br><br><p>[youtube=http://youtu.be/HEabUd_E-UM]','Motion Capture Parallax FPS</p> Projects Edit | Details | Delete
Astral Catapult <span style="color: black; font-family: Arial; font-size: 10pt;"><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone wp-image-239" style="border: 0px;" title="AstralCatapultLogo" src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/AstralCatapultLogo-300x120.png" alt="" width="300" height="120" data-proportion="true" data-align="none" data-file-name="AstralCatapultLogo-300x120.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto"> </figure> </div></span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;">Physics based Platformer for PC and Windows Phone 7<br> </span><span style="color: black; font-family: Arial; font-size: 10pt;">Game design by Jack Dye, developed by Silicon foundry (Matthew Harris, David Hart, David Armstrong, William Dann, Ashley Eglin, Jack Dye)</span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;"><strong>Design<br> </strong></span><span style="color: black; font-family: Arial; font-size: 10pt;">The basic design was formed in a response to a brief set by aim higher, which was to create a short game to inspire prospective students the benefits of university education and debunk some urban myths about the type of people who go to university.</span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;">The game begins with the player as a ball on a starting platform, the player must execute a series of jumps to bypass obstacles and land on green safe platforms, the objective of the game is to make it through the level without dying.</span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;">The player loses if the ball lands on spikes, lava, or rolls to a stop without landing on a green platform.</span><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042412_1835_AstralCatap2.png" alt="" data-proportion="true" data-align="none" data-file-name="042412_1835_AstralCatap2.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="1" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><span style="color: black; font-family: Arial; font-size: 10pt;"><br> </span><br><p><br> </p><span style="color: black; font-family: Arial; font-size: 10pt;"> <a title="Level Designs" href="http://jackdye.co.uk/Uploads/leveldesigns.pptx">Level Designs</a><br>To make the game more interesting 8 Powerups were designed to enhance gameplay:</span><br><div style="text-align: center; margin-left: 6pt;"> <table style="border-collapse: collapse;" border="0"> <tbody valign="top"> <tr> <td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;"><strong>Subject </strong></span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: solid 0.5pt; border-left: none; border-bottom: solid 0.5pt; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;"><strong>PowerUp Effect </strong></span> </td> </tr> <tr> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid 0.5pt; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Chemistry </span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Sticky Ball (sticks to walls and ceilings) </span> </td> </tr> <tr> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid 0.5pt; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Physics </span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Adds an Aiming guide </span> </td> </tr> <tr> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid 0.5pt; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Maths </span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Calculates Reflections on wall collisions </span> </td> </tr> <tr> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid 0.5pt; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Geography </span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Displays a Mini Map of off-screen platforms </span> </td> </tr> <tr> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid 0.5pt; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Art </span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Adds partial effects to balls motion </span> </td> </tr> <tr> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid 0.5pt; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Re </span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Restores the ball from X turns ago </span> </td> </tr> <tr> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid 0.5pt; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">History </span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Shows Previous shot"s guide </span> </td> </tr> <tr> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid 0.5pt; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Biology </span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: none; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">X% chance of bird saving ball when falling </span> </td> </tr> <tr> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid 0.5pt; border-bottom: solid 0.5pt; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Music </span> </td> <td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid 0.5pt; border-right: solid 0.5pt;"> <span style="color: black; font-family: Arial; font-size: 12pt;">Subwoofer blast from below gives the ball a "double jump" </span> </td> </tr> </tbody> </table> <br> </div><br><span style="color: black; font-family: Arial; font-size: 10pt;">Along the way when the player collected powerups the player will be shown information about continuing the subject in higher education, a combination of powerups would adjust the possible degrees that can be taken with the a levels and in turn give different career paths.</span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;">The powerups are stackable so collecting more of a powerup increases its effectiveness.<br> </span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;"><strong>Game:<br> </strong></span><span style="color: black; font-family: Arial; font-size: 10pt;">The game was developed over a month with a university set deadline which we had to meet.<br> </span><span style="color: black; font-family: Arial; font-size: 10pt;">Our team was split up into 3 programmers, 1 graphics artist, 1 tool programmer and a documenter.</span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;">At the end of development, we had a fully functioning game with 5 levels, 5 powerups,&nbsp;6 platform types&nbsp;and&nbsp;a level editor.<br> </span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;">I coded most of the physics, ball, powerup and platform behaviors, and created 3 of the levels.<br> </span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;"><strong>Download:<br> </strong></span><a href="http://jackdye.co.uk/Uploads/AstralCatapult.zip "><span style="color: black; font-family: Arial; font-size: 10pt;">http://jackdye.co.uk/Uploads/AstralCatapult.zip</span>&nbsp;</a><br><br><span style="color: black; font-family: Arial; font-size: 10pt;"><strong>Screenshots:<br> </strong></span><span style="color: black; font-family: Arial; font-size: 10pt;"><strong>[gallery link="file"]<br> <br> </strong></span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;"><strong>Level Editor<br> </strong></span><span style="color: black; font-family: Arial; font-size: 10pt;">The level editor is fully functioning, with a test mode to directly start the game in the current level, and is used to place platforms and powerups, and change the level size and background allowing quick deployment of a large number of varying levels</span><br><br><span style="color: black; font-family: Arial; font-size: 10pt;">&nbsp;<div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042412_1835_AstralCatap8.png" alt="" data-proportion="true" data-align="none" data-file-name="042412_1835_AstralCatap8.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="2" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><br> </span> Projects Edit | Details | Delete
Collision Detection 3 - Ray Plane <h2>Ray - Plane</h2><br><p>One of the most fundamental algorithms in 3D games is being able to calculate the arbitrary distance between a point with direction&nbsp;and a plane.</p><p><br></p><br><p>A few key concepts to understand is:</p><br><ul><br> <li>The plane is <strong>infinite</strong> in length</li><br> <li>Unless the ray is parallel to the plane, the ray will <strong>eventually</strong> hit the plane (due to it being infinitely long)</li><br> <li>Despite the guarantee of hitting the plane the ray still may hit the plane behind the point you started your ray from.</li><br></ul><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe9.png" alt="" data-proportion="true" data-align="none" data-file-name="042912_1001_CollisionDe9.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>more</p><br><br><p>You can see we have 4 Vectors:</p><br><span style="color: #ff0000;"><strong>Ray Origin</strong></span><p>– Is where the ray is starting from (I.E the end of the barrel in a gun)</p><br><span style="color: #ff0000;"><strong>Ray Direction</strong></span><p>– Is a normalised vector describing which direction the ray points</p><br><span style="color: #339966;"><strong>Plane Normal</strong> </span><p>– The inverse slope of the plane in normalised length (similar to the Ray Direction)</p><br><strong>Plane Translation</strong><strong>(<span style="color: #0000ff;">Plane Origin</span>)</strong><p>– I say translation because if the plane wasn't positioned it would always intersect at the origin, so it has to be moved in the world to where we want our plane to be, Its best not to think it as a point (as the plane has infinite points along it) but a translation of the whole plane from the origin.</p><br><br><p>Mathematicians at this point would love to get out their algebra and differentiate the equations to find out when these 2 'lines' meet, but it computer graphics it's often way too slow and cumbersome to bother with algebra solving. Instead we stick to the basics of physics and maths.</p><br><br><p>We start of by using a Dot product:</p><br><p>Basically the dot product can be used to tell us&nbsp;how 2 normalized vectors converge with each other, in that if a dot product&nbsp;gives 0 it means the&nbsp;both vectors are</p><strong>perpendicular</strong><p>to each other (I.e. not moving towards one another), if -1 or 1 they are</p><strong>parallel</strong><p>(Moving towards or away each other at full 'speed'), and all values in-between show the rate at which they are pointing to each other. Remember this is a scalar value, so think in 1 dimension:</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe10.png" alt="" data-proportion="true" data-align="none" data-file-name="042912_1001_CollisionDe10.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="1" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/fixDP.png" alt="" data-proportion="true" data-align="none" data-file-name="fixDP.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="2" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>If we dot product the</p><span style="color: #ff0000;">Ray</span><p>direction with the</p><span style="color: #339966;">Plane&nbsp;Normal</span><p>, we get a scalar value of how the direction is moving towards the</p><span style="color: #3366ff;">plane</span><p>, if it is 0 we know the direction is parallel to the</p><span style="color: #3366ff;">plane</span><p>(90 degrees to the plane's normal), and thus the ray will never hit the plane (We can stop the detection here if this is the case). However any value other than 0, the direction vector is moving at that amount towards the plane, and will hit eventually.</p><br><br><p>Anyone who has experience in physics will know the basic equation of</p><strong>Distance = Speed * Time.</strong><br><br><p>We can use this to find out when our</p><span style="color: #ff0000;">Ray</span><p>is going to hit the plane, if it takes negative time, we know the origin of the</p><span style="color: #ff0000;">Ray </span><p>started past the plane and wont intersect it.</p><br><br><em>But our ray does not have speed?<br></em><p>This is true, but speed is a fancy word for</p><strong>Rate of change,</strong><p>so by substituting the scalar value from the dot product, you get the</p><strong>Rate of change</strong><em>towards</em><p>the plane.</p><br><em>Because of this, it is important to note that Time should not be considered 'time' at all, but rather a value that represents how much 'rate of change' we need to cover a distance (distance/speed).</em><br><br><p>Now you might think you can get the distance by subtracting the</p><span style="color: #0000ff;">plane origin</span><p>and</p><span style="color: #ff0000;">ray origin</span><p>. However, the</p><span style="color: #0000ff;">plane</span><p>is infinite in length, and the plane origin is actually just a random point on the plane - which could be anywhere. What we need is the point on the</p><span style="color: #0000ff;">plane</span><p>that is</p><span style="color: #ff6600;"><strong>closest</strong>&nbsp;</span><p>to the</p><span style="color: #ff0000;">ray origin</span><p>, then we can measure the time it takes to travel this distance.</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img class="alignnone size-full wp-image-902" src="http://jackdye.co.uk/wp-content/uploads/2012/04/cp-1.png" alt="" width="417" height="313" data-proportion="true" data-align="none" data-file-name="cp-1.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="3" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>We can actually skip a step at this stage and directly work out the correct distance to the closest point by using the dot product of the</p><span style="color: #339966;">Plane normal<span style="color: #000000;"> and&nbsp;<span style="color: #ff0000;">orig</span><span style="color: #0000ff;">ins</span></span></span><p>.</p><br><br><p>Like So:</p><br><strong>DistanceToNearestPointOnPlane = Dot(<span style="color: #339966;">PlaneNorm</span>, <span style="color: #0000ff;">PlaneO</span> - <span style="color: #ff0000;">RayO</span>)</strong><br><br><strong>SpeedTowardsPlane = Dot(<span style="color: #ff0000;">RayDir</span>,<span style="color: #339966;">PlaneNorm</span>)</strong><br><br><p>Substituting and rearranging:</p><br><strong>T = D/S</strong><br><strong>Time =&nbsp;DistanceToNearestPointOnPlane / SpeedTowardsPlane</strong><br><br><p>This Time value will now represent the amount of</p><span style="color: #ff0000;">RayDir</span><p>needed to get between the</p><span style="color: #ff0000;">RayOrigin</span><p>and the P</p><span style="color: #0000ff;">lane.</span><br><ul><br> <li>If its negative, the Ray origin was behind the plane, and so the Ray does not intersect the plane</li><br> <li>If it is positive, a collision occurs, at this value along the ray.</li><br></ul><br><h2>Collision Point</h2><br><p>To get the exact point at which the ray hits the plane is easy:</p><br><br><strong><span style="color: #ff0000;">RayOrigin</span> + (Time * <span style="color: #ff0000;">RayDir</span>) = Collision Point (XYZ)<br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe12.png" alt="" data-proportion="true" data-align="none" data-file-name="042912_1001_CollisionDe12.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="4" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div></strong><br><br><p>The above image shows how the calculation works if Time was equal to 3. The blue dot being the RayOrigin. (It has been flattened into 1 Dimension for illustration)</p><br><br><strong>Tip:<br></strong><p>If your</p><span style="color: #ff0000;">RayDirection</span><p>is of unit length, you can directly compare lambda/time values from multiple Ray-Plane calculations to see which occurs first.</p><br><br><p>Also this works for 2D lines EXACTLY the same way! just omit the Z value in calculations or leave it 0;</p><br><br><p>[display-posts category="collision" posts_per_page="-1" include_date="true" order="ASC" orderby="title"]</p> Tutorials Edit | Details | Delete
Air Luggage - Dev Diary <p>Here is a quick rundown of the month in which I built Air Luggage, and how I went from concept to release.</p><br><br><p><strong>New Year"s Resolution</strong></p><p>Seeing a post the game dev&nbsp;<a href="http://reddit.com/r/gamedev" style="background-color: rgb(255, 255, 255);">sub-reddit</a>&nbsp;advertising the One game a month challenge (<a href="http://www.onegameamonth.com/" style="background-color: rgb(255, 255, 255);">#1GAM</a>) with the title "Make games not excuses" got me thinking about all the projects in 2012 I had eagerly started, but a few weeks later abandoned as the enthusiasm dropped. As a new year"s resolution I decided to put an end to this, and set myself to completing a game within a month as part of the challenge rules. This meant, no feature creep, no bloat, no "it would be awesome if it did this....".</p><p><br> </p><strong>Game Idea<br> </strong><p>I wanted the game to be as simple as possible for not only players, but for me to be able finish during the tiny timescale (I only had evenings and 4 weekends to complete it in).</p><br><p>Whilst coding my previous game, in which the player had to keep traffic flowing in a city, I created a way point system for cars to follow, the way points had junctions in which the cars would randomly choose which direction to go in.</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="size-medium wp-image-410 " alt="DevTest02" src="https://files.jackdye.co.uk/images/DevTest02-300x168.png" width="300" height="168" data-proportion="true" data-align="none" data-file-name="DevTest02-300x168.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><p>Screen-shot of Traffic (2012, Unreleased)</p><p>This was when I had the idea for a game where the player controlled which direction the traffic would flow by setting the direction of each junction. This idea was more arcade based than the puzzle game you see today, the bags would appear in random colours constantly and the player had 10 lives to direct the bags into each gate, the rate at which the bags entered would slowly increase until the player ultimately lost. Using this I wrote up the game description as below:</p><br><blockquote> <br> <p dir="ltr" id="internal-source-marker_0.5906488537072863"><strong>Concept</strong></p> <br> <p dir="ltr">Using nodes from Traffic, create a new junction switching mechanism to control Y Junctions</p> <br> <p dir="ltr">Idea is for the player to solve fast paced puzzles of getting coloured luggage to the correct gate</p> <br> <p dir="ltr">Luggage can be directed onto different treadmills using the switch gates, there is a central feeder system that keeps unsolved luggage in a loop.</p> <br> Player has to complete each level by surviving the day with minimum of x losses. <br> <br> &nbsp;</blockquote><br><p>At this point of development the games focus involved in changing the junction gates as the bags were moving rather than setting up the gates beforehand. and involved filling up a "progress meter" to complete the level.</p><br><br><h2>The Problem</h2><p><em></em>The trouble with the arcade style was making it fun and varied, once you"ve completed a level, the next would just look a little different, I wanted and needed puzzle solving.<br></p><p>However, I could not find a reasonable way to mesh both ideas together, if the player could change the orientation of the gates at any point, it would mitigate any puzzle as they could just wait until the correct bag came around and flip it accordingly to win. I needed a way to prevent this, and unfortunately this meant letter the player setting up the gates beforehand, and then watching the outcome. I hated this Idea, there was no live interaction or feedback and thus there wasn"t any room for fun game play. After a few days of sleeping on the prospect of removing the arcade element entirely it started to grow on me, and I decided to focus on making a puzzle game.<br></p><p>I started designing the levels and at that point it was clear I made the right decision.<br></p><br><br><strong>Level Design<br> </strong><p>This was surprisingly fun&nbsp;and at the same time a chore, I opted to use a spreadsheet to design the level due to the 2D grid matching the game"s 2D grid. There was no real process involved, except trial and error, and iterating on the previous level adding new elements, Initially I had 2 ideas for junction gates, the "accurator" (count gate) and the flip flop, I designed 5 levels for each thinking later levels will combine both elements to make another 5 levels.</p><p><br></p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="size-medium wp-image-412" alt="Google Docs Level Design" src="https://files.jackdye.co.uk/images/LuggageSpreadsheet-211x300.png" width="211" height="300" data-proportion="true" data-align="none" data-file-name="LuggageSpreadsheet-211x300.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="1" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><p>Google Docs Level Design</p><br><br><p>The hard part was making sure the puzzle was solvable without being too easy or obvious, often I"d relook at a level and realize how to solve it without even using half the gates (this was especially true of the accurator tiles when I decided the players could set the starting direction as well as the number of bags it"ll let though. I also made the mistake of not taking into account the timings of each conveyor, which proved to cause a lot of headaches in development when bags would try and occupy the same tile if the player did not take the "happy path".</p><br><br><p>I enjoy being able to see behind the scenes so here is the development copy of the Level doc for your viewing pleasure:</p><br><a href="https://docs.google.com/spreadsheet/ccc?key=0Amsgz6GXShi-dDVMSG9JblNsdWU0M2cyUGd2TEg3clE&amp;usp=sharing">https://docs.google.com/spreadsheet/ccc?key=0Amsgz6GXShi-dDVMSG9JblNsdWU0M2cyUGd2TEg3clE&amp;usp=sharing<br> </a><p>You"ll also notice some symbols near tiles (this was to help me remember how to solve my own puzzles)</p><br><br><strong>Code Development<br> </strong><p>The conveyors were the main focus of the game, so the prototype had a way to place conveyor tiles in 4 directions and have a bag follow the conveyor path, there were no physics or animations at this point, the bag would jump to the next tile every second</p><p><br></p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="size-medium wp-image-411" alt="3 Hours" src="https://files.jackdye.co.uk/images/3-Hours-300x190.png" width="300" height="190" data-proportion="true" data-align="none" data-file-name="3-Hours-300x190.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="2" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><p>3 Hours - Bag moving prototype</p><br><br><p>If you used the editor in the game, you"ll notice it has not changed much from this screenshot.</p><br><br><p>I continued developing this prototype adding the flip flop gate and count gate, and tested each of my levels in the level doc, to which I noticed quite a few were unsolvable, or had overlapping bags.</p><br><p>(Sadly I don"t have any screen shots from this point)</p><p><br></p><br><h2>Getting&nbsp;physical</h2><p>One thing that was sitting at the back of my mind was how to make the bags move along the conveyor, I could moved them linearly across tiles, however I was stuck on what happened when 2 bags tried to occupy the same tile, which bag had priority, did they overlap, did they collide?</p><br><p>I knew a way to solve all my problems with 1 stone, but having never properly implementing a 3rd party physics engine before I was very hesitant given my timescale, if it wouldn"t play nice. I opted for&nbsp;<a href="http://farseerphysics.codeplex.com/">farseer</a>, due to it being the de facto for XNA.</p><p><br> </p><p>Many hours of setting the collision boxes,&nbsp;masses and friction were needed to try and get more than 1 bag around 90" corners without getting stuck, but boy did it look good.</p><p><br> </p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="size-medium wp-image-414" alt="Farseer Physics" src="https://files.jackdye.co.uk/images/farseer-300x161.png" width="300" height="161" data-proportion="true" data-align="none" data-file-name="farseer-300x161.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="3" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><p>Farseer rotating and colliding the bags</p><p><br> </p><p>There"s actually a lot more going on than first appearances to get the effect the bag is travelling on the conveyor, and there is little to no information on the web about how to achieve such movement.</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-full wp-image-415" alt="bagForces" src="https://files.jackdye.co.uk/images/bagForces.png" width="48" height="48" data-proportion="true" data-align="none" data-file-name="bagForces.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="4" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><p><br> </p><p>Each bag has 4 points at the edges that are separately checked to see which conveyor they are on, and which direction the conveyor is moving, this allows the subtle rotation of the bag as it changes direction, the direction each point should be moving is stored as a unit vector, and the following code is used to work out how much impulse to add to the angle (all the further rotations and movement is handled by farseer)</p><br><blockquote> float forceLength = Force.Length(); //Force = Direction the corner should be moving in <br> Vector2 curVel = AttachedBody.LinearVelocity; <br> <br> Force /= BagCollisonBoxes[0].Count; // Divide the direction force scale by the number of points we re checking (this case it"s 4) so its 25 % influence over the bags direction <br> <br> <div> float power = Vector2.Dot(curVel, Force) / (forceLength); // Work out how much impulse is needed to make the bag move in this direction (this is already scaled by 25%) </div> <div> if (power &lt; forceLength)//apply if we"re not at 100% speed&nbsp;</div> <div>&nbsp;{</div> <div>&nbsp;&nbsp;&nbsp;&nbsp; Force *= (forceLength - Math.Max(power, 0)); //Difference between our desired vel and current vel </div> <div>&nbsp;&nbsp;&nbsp;&nbsp; Force *= AttachedBody.Mass;&nbsp;</div> <div>&nbsp;&nbsp;&nbsp;&nbsp; AttachedBody.ApplyLinearImpulse(ref Force, ref worldPos); //apply force directly at the point </div> }</blockquote><br><p>The force values and max speed were fine tuned to match roughly the conveyor animation speed, the world has no gravity which completes the top-down look.</p><p><br></p><p>Another problem I encountered was that farseer objects tend to bump off of joins in the solid tiles, so if a bag was sliding along the conveyor wall, between each tile it"ll bounce and rotate off the wall as if it had a dent in the wall. I had to write a collision hull generator that looked across tiles to create a single large solid plane for the bags to collide, each time a level is played this is created on the fly:</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-medium wp-image-417" alt="collisionMesh" src="https://files.jackdye.co.uk/images/collisionMesh1-236x300.png" width="236" height="300" data-proportion="true" data-align="none" data-file-name="collisionMesh1-236x300.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="5" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><br><br><p>As you can see here, the green collision boxes have been simplified if 2 tiles are adjacent to each other. The white arrow shows where the simplification process hasn"t been applied (I didn"t take into account vertical joins as they"d always be a block to the left of this tile to join to in a real level). The hull generation process also has the added benefit of reducing the number of collision meshes the physics engine has to process making it a lot faster. Each tile has it"s own meta-data on what collision edges it has and a simple formula marches though the tiles drawing connected boxes.</p><br><br><p>The game play code was pretty much complete once the physics engine was in, was just a case of telling each bag a different direction to travel in for the flipflop and other special tiles.</p><br><br><strong>Artwork<br> </strong><p>I am not an artist, in fact I"m hopeless at art, which is a big problem when making games by yourself. Lucky I get around this by using vector art, which works in a very different way to pixel art (Photoshop etc), every texture in the game is made using lines. Vectors means you can zoom in indefinitely and never get pixel blur, which gives the game a crisp look, vectors are also adjustable, allowing the assets to be tweaked over and over until it looks decent. I also rigorously used color theory, keeping the backgrounds dark and low contrast, and making game objects colourful with dark pin lines to separate them away.</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="size-medium wp-image-388" alt="More Tiles" src="https://files.jackdye.co.uk/images/Promo5-300x180.png" width="300" height="180" data-proportion="true" data-align="none" data-file-name="Promo5-300x180.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="6" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><p><br> </p><br><p>The Menu color pallets where created using http://colorschemedesigner.com/ which use color theory to pick complementing colors.</p><br><br><p>The tiles were just made with a big tile sheet to keep things simple, I started exploring overlays later in development to do the walls for each tile etc (this is the only tile with fixed collision edges)</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-medium wp-image-418" alt="AccuratorTileset" src="https://files.jackdye.co.uk/images/AccuratorTileset-300x150.png" width="300" height="150" data-proportion="true" data-align="none" data-file-name="AccuratorTileset-300x150.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="7" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><br><br><strong><br> January ends</strong><br><br><p>I"m so close to finishing, yet I could not release the game in time for the January deadline, I was still missing the last 5 levels, and knew I needed another tile type to keep things interesting. I had a huge holiday booked in February and in the week I was home I did not have time to do the finishing touches.</p><strong></strong><br><br><strong>March</strong><br><br><p>The project looked to sit on the shelf for all eternity, I still had not come up with a new tile type (How many directions can the bags move) nor had any new level ideas. Eventually I forced myself to sit down and code something, this was the Teleport tile, which allowed matching bags to appear in another location in the level. With another week of work and 2 weekends the game was finally ready to be released.</p><br><br><strong>Release<br> </strong><p>I submitted the game to the #1GAM march&nbsp;<a href="http://www.onegameamonth.com/games">game list</a>&nbsp;and&nbsp;<a href="http://gamejolt.com/games/puzzle/air-luggage/13347/" style="background-color: rgb(255, 255, 255);">GameJolt</a></p><p>.</p><p>At the time of writing it"s got 200 views and 55 plays on Game Jolt and a 5/5 rating, which is about average given the time on game jolt. For me it"s a personal success being able to finally release a full game, nothing quite beats the feeling of shipping something.</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-medium wp-image-419" alt="Release" src="https://files.jackdye.co.uk/images/Release-300x238.png" width="300" height="238" data-proportion="true" data-align="none" data-file-name="Release-300x238.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="8" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-medium wp-image-420" alt="1gam" src="https://files.jackdye.co.uk/images/1gam-300x173.png" width="300" height="173" data-proportion="true" data-align="none" data-file-name="1gam-300x173.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="9" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""> </figure> </div> Projects Edit | Details | Delete
Collision Detection 4 - Ray Sphere <h2>Ray - Sphere</h2><br><p>Here's quite a neat trick to calculate if a ray if you have the Ray-Plane collision down. I'm not sure how fast it is compared to other algorithms, but to me it was a logical step from Ray-Plane that I worked out on paper.</p><br><p>First rule of thumb, make the problem 2 Dimensional:</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe13.png" alt="" data-proportion="true" data-align="none" data-file-name="042912_1001_CollisionDe13.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>more</p><br><br><p>As the Sphere is the same shape from all sides, it can easily transform into a 2D circle. Next pretend we are looking at the 2D image of the Sphere from the view of the RayDirection, so the Ray casts downwards into the circle from above.</p><br><p>We can imagine a plane at the centre of the circle with its normal pointing towards the inverse of the ray direction so the plane faces us (The RayDirection). Hopefully now you can see how to solve this once we have the collision point on the plane.</p><br><br><p>To get the collision point we just do a simple Ray-Plane test with:</p><br><strong>RayOrigin</strong><p>being the rays origin,</p><br><strong>RayDirection</strong><p>being the rays direction</p><br><strong>PlaneOrigin</strong><p>being the spheres origin</p><br><strong>PlaneNormal</strong><p>being (-1)*RayDirection (So it's pointing towards the ray direction)</p><br><br><p>You may notice that the Ray direction and Plane normal will always point towards each other so they can never be parallel, and the ray will always hit the plane.</p><br><br><p>What will be returned from the Ray-Plane test is a collision point. This can be subtracted from SphereOrigin to find the distance between the ray collision point and Sphere Origin (Using Pythagoras):</p><br><br><strong>CollisonDistance&nbsp;= Sqrt((SphereOrX - RayColX)² + (SphereOrY - RayColY)² + (SphereOrZ - RayColZ)²)<br></strong><br><p>If Collision distance is greater than the spheres radius, then the ray does not intersect the sphere, if it's less than the radius of the sphere, it intersects.</p><br><h3>Getting the location of the collision</h3><br><p>To retrieve the point of collision on the surface of the sphere (which is 3D and constantly changes) We simply find how far the collision point is from the edge of the sphere:</p><br><br><strong>Difference = Radius - Collision Distance<br></strong><br><p>And subtract this from our lambda time calculated from the ray-Plane calculation:</p><br><br><strong>CollisonPosition = RayOrigin + ((time - difference)*rayDir)</strong><br><br><p>Voilà! We have the precise position of an intersection on the surface of a 3D sphere using only a 2D circle and the D=ST equation.</p><br><br><p>[display-posts category="collision" posts_per_page="-1" include_date="true" order="ASC" orderby="title"]','Collision Detection 4 - Ray Sphere</p> Tutorials Edit | Details | Delete
Collision Detection 2 - Point Circle <h2>Point - Circle</h2><br><p>Perhaps one of the most fundamental aspects to collision testing is to see if a point in space is within the bounds of a circle or sphere.</p><br><p>This is done by collapsing the line between the centre of the circle and point into a scalar length, and then comparing it with the radius of the circle.</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe4.png" alt="" data-proportion="true" data-align="none" data-file-name="042912_1001_CollisionDe4.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="0"></figure></div><br><br><p>more</p><br><br><p>Here we have 2 positions (Marked by the black dots), the Origin (Centre) of the circle and the Point. If we split the X and Y coordinates we can make a triangle. Pythagoras can then be used to get the Hypotenuse, giving us the length between the 2 points:</p><br><br><strong>A</strong><p>² =</p><strong>B</strong><p>² +</p><strong>C</strong><p>²</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe5.png" alt="" data-proportion="true" data-align="none" data-file-name="042912_1001_CollisionDe5.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="1"></figure></div><br><br><p>So:</p><br><span style="color: #ff6600;"><strong>CircleOriginToPoint</strong><span style="color: #000000;">²</span></span><p>=</p><span style="color: #339966;">(<strong>CircleOriginXToPointX</strong>)<span style="color: #000000;">²</span></span><p>+</p><span style="color: #ff0000;">(<strong>CircleOriginYToPointY</strong>)<span style="color: #000000;">²</span></span><br><br><p>Fill in the X and Y Distances:</p><br><strong><span style="color: #ff6600;">CP</span>² = <span style="color: #339966;">(Cx – Px)</span>² + <span style="color: #ff0000;">(Cy – Py)</span>²<br></strong><br><br><p>To get</p><span style="color: #ff6600;">CP</span><p>from</p><span style="color: #ff6600;">CP</span><p>² we have to square root:</p><br><br><strong>√(<span style="color: #ff6600;">CP²<span style="color: #000000;">)</span></span>&nbsp;= <span style="color: #ff6600;">Length of the Circle Origin to Point</span></strong><br><br><p>We can now compare this</p><strong>length</strong><p>to the</p><strong>radius</strong><p>of the circle, If</p><strong>CP &lt;= Radius</strong><p>a collision occurs as the point is inside the circle.</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe8.png" alt="" align="left" data-proportion="true" data-align="none" data-file-name="042912_1001_CollisionDe8.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="2"></figure></div><br><br><span style="color: #ff9900;"><strong>CP</strong></span><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/04/042912_1001_CollisionDe7.png" alt="" align="left" data-proportion="true" data-align="none" data-file-name="042912_1001_CollisionDe7.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="3"></figure></div><br><br><strong>Radius</strong><br><br><p>In our example no collision occurs</p><br><br><p>This same method can be done with a sphere in 3D, we just add&nbsp;Z values in the Pythagoras step</p><br><br><strong><span style="color: #ff6600;">CP</span>² = <span style="color: #339966;">(Cx – Px)<span style="color: #000000;">²</span></span> +<span style="color: #ff0000;"> (Cy – Py)</span>² + <span style="color: #3366ff;">(Cz - Pz)</span>²</strong><br><br><strong>TIP:<br></strong><p>You can increase performance of the distance calculation by negating the square root (Which is expensive), and instead squaring the radius for comparison. BE WARNED: know your limits when doing this, the max value of a square on int32 is about 2,000,000,000 that sounds a lot, but its only 46,340 squared, depending on your scale this could be as little as 460meters before your calculations will no longer work!</p><br><p>Remember the sphere's radius is largest at its origin no matter what direction the ray comes from, which allows the problem to be converted into a 2D point in Circle test.</p><br><p>[display-posts category="collision" posts_per_page="-1" include_date="true" order="ASC" orderby="title"]','Collision Detection 2 - Point Circle</p> Tutorials Edit | Details | Delete
Photoshop Sprite Map Script <p>I was recently searching for a good sprite map / sprite sheet script for Photoshop, and came across this script:</p><br><a href="http://boxhacker.com/blog/2011/05/23/a-little-spritesheet-script-for-photshop/">http://boxhacker.com/blog/2011/05/23/a-little-spritesheet-script-for-photshop/</a><br><br><p>However his approach assumed a graphics engine would take any size image as a sprite map, with myself working in XNA I needed a sprite map that generated images in powers of 2 (32, 64, 128 etc.)</p><br><br><p>With some tweaking, and learning of JavaScript, I have modified the original to output power of 2 sprite maps:</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/05/051812_2020_PhotoshopSp1.png" alt="" data-proportion="true" data-align="none" data-file-name="051812_2020_PhotoshopSp1.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>The script comes in 2 flavors;</p><br><ol><br> <li>Square centric with the generated map being the closest power of 2 in a box layout (Top)</li><br> <li>Dimension aware, and filling the maximum possible horizontal texture size before extending vertically (Bottom)</li><br></ol><br><p>more</p><br><br><p>The script is compactable with Adobe Photoshop CS3, CS4, CS5 and will have you making animations in no time.</p><br><p>Here I've taken the export images from blender and converted them into a transparent sprite map.</p><br><h2>Download</h2><br><ol><br> <li><a href="http://jackdye.co.uk/Uploads/SpriteMapClosestSquare.jsx">http://jackdye.co.uk/Uploads/SpriteMapClosestSquare.jsx</a></li><br> <li><a href="http://jackdye.co.uk/Uploads/SpriteMapBoundsFit.jsx">http://jackdye.co.uk/Uploads/SpriteMapBoundsFit.jsx</a></li><br></ol><br><p>These are completely free to use/modify; Why pay the ridiculous prices some SpriteMap plug-ins charge, if you only need the basic feature?</p><br><h2>Method</h2><br><strong>Step 1:<br></strong><p>Import all your sprite images as layers using Photoshop's batch stack script:</p><br><p>Go to File-&gt;Scripts-&gt;Load Files into stack</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/05/051812_2020_PhotoshopSp2.png" alt="" data-proportion="true" data-align="none" data-file-name="051812_2020_PhotoshopSp2.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="1" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>Click Browse then select all your files, then click OK and wait a few minutes for it to process:</p><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/05/051812_2020_PhotoshopSp3.png" alt="" data-proportion="true" data-align="none" data-file-name="051812_2020_PhotoshopSp3.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="2" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>You should then have a layerd Photoshop image that looks rather ugly:</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/05/051812_2020_PhotoshopSp4.png" alt="" data-proportion="true" data-align="none" data-file-name="051812_2020_PhotoshopSp4.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="3" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><strong>Step 2:</strong><br><br><p>Now click File-&gt;Scripts-&gt;Browse</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/05/051812_2020_PhotoshopSp5.png" alt="" data-proportion="true" data-align="none" data-file-name="051812_2020_PhotoshopSp5.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="4" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>Select the Script you downloaded above, double click to run:</p><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/05/051812_2020_PhotoshopSp6.png" alt="" data-proportion="true" data-align="none" data-file-name="051812_2020_PhotoshopSp6.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="5" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>You should now have a sprite map for your images:</p><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/05/051812_2020_PhotoshopSp7.png" alt="" data-proportion="true" data-align="none" data-file-name="051812_2020_PhotoshopSp7.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="6" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><strong>Step 3:</strong><br><br><p>If you need to set the max dimension of the SpriteMapBoundsFit.jsx, open it up in notepad and edit these lines:</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="http://www.jackdye.co.uk/wp-content/uploads/2012/05/051812_2020_PhotoshopSp8.png" alt="" data-proportion="true" data-align="none" data-file-name="051812_2020_PhotoshopSp8.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="7" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><h2>Limitations</h2><br><p>You should only use source images that are a power of 2 and are all the same size</p><br><p>The sheets are ordered from bottom to top</p><br><h2>Credits</h2><br><p>Thanks to box hacker who initially wrote the script, support him by visiting his site above!</p> Releases Edit | Details | Delete
Calculate an area under a curve programmatically <p>Calculating the area under a curve is a little tricky in computing languages such as c++ or c# due to there not being any direct functions to allow integration. Not wanting to write a whole intergrall solver to complete my project I opted to use an approximation method.</p><br><br><p>The method I opted for way Riemann sum, invented by a German mathematician, uses many rectangles to approximate the area:</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img class="alignnone size-medium wp-image-349" title="reimman" src="http://www.jackdye.co.uk/wp-content/uploads/2012/06/reimman-300x224.png" alt="" width="300" height="224" data-proportion="true" data-align="none" data-file-name="reimman-300x224.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><br><br><p>The great thing about using the rectangle approximation is that its incredibly fast to do, as a result many iterations can be used to give a pretty accurate result.</p><br><br><p>Riemann sum in C++:</p><br><p>The y=x function in the example below represents a deceleration curve an object has to follow (y= Speed, x = Time). I needed to calculate the total distance traveled by the object, &nbsp;as Distance = Speed * Time, the area under the curve equals the total distance traveled.</p><br><blockquote><br><pre>#define NUM_OF_RECTANGLESTOUSE 10 //The more rectangles used the greater the accuracy<br>double startX = 0; //starting position on the curve<br>double endX = 1; //end position on the curve<br><br>double AreaOfCurve = 0;<br>double lengthX = endX - startX;<br>double rectangleWidth = lengthX / NUM_OF_RECTANGLESTOUSE;<br>for(double x=startX+(0.5*rectangleWidth); x &lt; endX; x += rectangleWidth)<br>{<br> //Curve function multiplied by the width goes here: (I've used y=((1/decelTime²) * (decelTime - x)²))<br> AreaOfCurve += rectangleWidth * ((1.0/(lengthX*lengthX)) * ((lengthX - x)*(lengthX - x)));<br>}</pre><br></blockquote><br><p>A great tool to help visualize the Riemann sum and see the difference between the approximation and the actual value can be found on wolfram alpha:</p><br><a title="Here" href="http://mathworld.wolfram.com/RiemannSum.html">Link</a><br><br><p>Other approximation methods can be used for greater accuracy, such as the trapezium rule, see</p><a title="Wikipedia - Riemann Sum" href="http://en.wikipedia.org/wiki/Riemann_sum#Methods">WikiPedia</a><p>for a full list</p> Tutorials Edit | Details | Delete
Air Luggage <div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img class="size-full wp-image-402 alignleft" alt="AirLuggageTab" src="http://www.jackdye.co.uk/wp-content/uploads/2013/03/AirLuggageTab.png" width="64" height="64" data-proportion="true" data-align="none" data-file-name="AirLuggageTab.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div><p>Logic based puzzle game for PC Windows featuring music by Chelnov and Mattashi</p><p><br></p><strong>About</strong><br><br><p>Created in January in the ‘One game a month’ challenge</p><a title="#1GAM" href="http://www.onegameamonth.com/"> #1GAM</a><p>, Air Luggage is a game where the player must solve puzzles by delivering the correct luggage to each departure gate. To do this the player has to program a series of logic gates to change the flow and order of the incoming bags.</p><br><br><strong>Features</strong><br><ul><br> <li>18 Levels Ranging in difficulty</li><br> <li>Teleports , flip flops, directors and counters to control the flow of bags</li><br> <li>Star based level performance awards up to 3 stars a level.</li><br> <li>Relaxing Soundtrack</li><br> <li>Colour Blind Mode</li><br> <li>In-Build Level Editor</li><br> <li>Farseer Physics</li><br></ul><br><strong>Credits</strong><br><br><em>Game Design, Art &amp; Programming</em><br><a title="Jack 'Icepick66' Dye" href="http://jackdye.co.uk">Jack ‘Icepick66’ Dye</a><br><em>Music</em><br><a title="Chelnov" href="http://chelnov.newgrounds.com/">Chelnov</a><br><a title="Mattashi" href="http://mattashi.newgrounds.com/">Mattashi</a><br><br><strong>In-Depth<br></strong><p>After hearing about the #1GAM challenge I set myself with the goal of actually completing a game I started. I decided a puzzle game would be nice and easy to complete within a month, forking off an idea I came across during a previously project, that focuses on directing the flow of objects. Being a programmer the concept of logic gates made sense to control flow.</p><br><p>I spent a few days stripping the ‘fat’ from the base idea and came up with the 4 gates we see in the game today. Despite spending nearly every night in January as a sole developer the game just missed the mark of a Feb 1</p><sup>st</sup><p>Release and this project looked like it was doomed to the ‘nearly done’ bin. However, despite all odds here is V1.0.</p><br><br><p>In a few days I’ll write up the journey from start to finish of my first full game. I’d like to give a big thanks to Chelnov and Mattashi from newgrounds.com for kindly letting me use their songs and freesound.org for some of the sound effects in the game.</p><br><br><strong>Download<br></strong><a title="Download (Windows)" href="http://www.jackdye.co.uk/Uploads/AirLuggage.zip">http://www.jackdye.co.uk/Uploads/AirLuggage.zip</a><br><br><p>(Requires</p><a href="http://www.microsoft.com/en-us/download/details.aspx?id=20914"> XNA Framework Redistributable 4.0</a><p>[6.7mb])</p><br><br><strong>Screenshots</strong><br><br><p>[gallery ids="384,385,389,388,387,386"]</p> Releases Edit | Details | Delete
Raspery Pi Arcade Table - Part 2 <div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="size-thumbnail wp-image-527 alignleft" alt="WP_20131116_10_36_46_Pro" src="https://files.jackdye.co.uk/images/WP_20131116_10_36_46_Pro-150x150.jpg" width="150" height="150" data-proportion="true" data-align="none" data-file-name="WP_20131116_10_36_46_Pro-150x150.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="0"> </figure> </div><p>My raspberry PI Arcade table has been completed!</p><p><br> </p><p>Check out the final stages of the build after the jump</p><p><br></p><p>The joysticks and buttons are now all wired up, using about 10m of cable and a load of 4.8mm spade connectors.</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-full wp-image-517" style="color: rgb(51, 51, 51); font-style: normal; width: 350px; height: 262px;" alt="WP_001921" src="https://files.jackdye.co.uk/images/WP_001921.jpg" width="1536" height="1152" data-proportion="true" data-align="none" data-file-name="WP_001921.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="350px,262px" data-rotate="" data-rotatex="" data-rotatey="" data-index="1"> </figure> </div><br><br><p>All the cables lead into the GPIO board, there are a total of 5 Ground lines (P1 Joystick, P2 Joystick, P1 Buttons, P2 Buttons, Start/Select/Coin In Buttons) and the switch simply connects each output to the ground.</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-full wp-image-516" style="color: rgb(51, 51, 51); font-style: normal; width: 350px; height: 263px;" alt="WP_001920" src="https://files.jackdye.co.uk/images/WP_001920.jpg" width="1536" height="1152" data-proportion="true" data-align="none" data-file-name="WP_001920.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="350px,263px" data-rotate="" data-rotatex="" data-rotatey="" data-index="2"> </figure> </div><br><br><p>A script provided by Adafruit (</p><a href="https://github.com/adafruit/Adafruit-Retrogame">RetroGame</a><p>), scans the raspberrys GPIO pins and converts them into virtual keyboard presses</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-full wp-image-515" style="color: rgb(51, 51, 51); font-style: normal; width: 350px; height: 263px;" alt="????????????????????????????????????????????????????????????????????????????????????" src="https://files.jackdye.co.uk/images/WP_001919.jpg" width="1536" height="1152" data-proportion="true" data-align="none" data-file-name="WP_001919.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="350px,263px" data-rotate="" data-rotatex="" data-rotatey="" data-index="3"> </figure> </div><br><br><p>The screen was made Dust Tight using electrical tape over both the table edges and the screen bezel, the electrical&nbsp;tape layers then creates a nice seal between each other</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-full wp-image-518" style="color: rgb(51, 51, 51); font-style: normal; width: 350px; height: 263px;" alt="WP_001928" src="https://files.jackdye.co.uk/images/WP_001928.jpg" width="1536" height="1152" data-proportion="true" data-align="none" data-file-name="WP_001928.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="350px,263px" data-rotate="" data-rotatex="" data-rotatey="" data-index="4"> </figure> </div><br><br><p>The perspex was then fitted ontop, using 4 screws and a dipped washer. Some posters found in a local supermarket were cut up and used to theme the table.</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-full wp-image-519" style="color: rgb(51, 51, 51); font-style: normal; width: 350px; height: 263px;" alt="WP_001929" src="https://files.jackdye.co.uk/images/WP_001929.jpg" width="1536" height="1152" data-proportion="true" data-align="none" data-file-name="WP_001929.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="350px,263px" data-rotate="" data-rotatex="" data-rotatey="" data-index="5"> </figure> </div><br><br><p>The final result, cringe worthy memes included:</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-full wp-image-514" style="color: rgb(51, 51, 51); font-style: normal; width: 350px; height: 263px;" alt="WP_001932" src="https://files.jackdye.co.uk/images/WP_001932.jpg" width="1536" height="1152" data-proportion="true" data-align="none" data-file-name="WP_001932.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="350px,263px" data-rotate="" data-rotatex="" data-rotatey="" data-index="6"> </figure> </div><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-large wp-image-529" alt="WP_20131116_10_42_20_Pro" src="https://files.jackdye.co.uk/images/WP_20131116_10_42_20_Pro-1024x576.jpg" width="584" height="328" data-proportion="true" data-align="none" data-file-name="WP_20131116_10_42_20_Pro-1024x576.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="7"> </figure> </div><br><br><br><br><strong>Summary</strong><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="size-thumbnail wp-image-530 alignright" alt="WP_20131116_10_33_01_Pro" src="https://files.jackdye.co.uk/images/WP_20131116_10_33_01_Pro-150x150.jpg" width="150" height="150" data-proportion="true" data-align="none" data-file-name="WP_20131116_10_33_01_Pro-150x150.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="8"> </figure> </div><p><strong><br></strong></p><strong> Total Time</strong><p>: 50hrs over 1 Month</p><br><strong>Total Cost:</strong><p>£150</p><em>(Excl Tools)</em><br><strong>Tools:</strong><br><ul> <br> <li>Jigsaw, Fine metal blade and wood blade</li> <br> <li>Meter Ruler</li> <br> <li>Sander</li> <br> <li>Glue Gun</li> <br> <li>Cordless drill</li> <br> <li>Stepped Drill Bit</li> <br> <li>Stanly knife</li> <br> <li>Crimper</li> <br> <li>Pliers</li> <br> <li>G Clamp</li> <br> </ul><br><strong>Parts:<br> </strong><br><ul> <br> <li>10m Wire</li> <br> <li>Raspberry PI GIPO Adapter</li> <br> <li>Raspberry PI</li> <br> <li>2x Joysticks</li> <br> <li>9x Buttons with LED"s</li> <br> <li>12v Phone Charger</li> <br> <li>USB Hub</li> <br> <li>USB laptop cooler</li> <br> <li>USB Speaker</li> <br> <li>HDMI -&gt; VGA Adapter With audio out</li> <br> <li>4 Way Extension Cord</li> <br> <li>USB WIFI Adapter</li> <br> <li>Ikea LACK Table</li> <br> <li>2x1.5m Plexiglas</li> <br> <li>Cable Ties</li> <br> <li>20"" Monitor</li> <br> <li>2.8mm Spade Connectors</li> <br> <li>5.2mm Spade Connectors</li> <br> <li>Floral Foam block</li> <br> <li>Electrical tape</li> </ul><p><br></p> Projects Edit | Details | Delete
Generating a Bitcoin address in C# <p>I recently needed to write a C# app to convert a Bitcoin public key to a human usable addresses to send coins to, using the example on</p><a href="https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses">https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses</a><br><br><p>I hate using external libraries, so my main aim with this was to not require any 3rd party libraries, although you"ll need&nbsp;<strong>.Net framework 4.5&nbsp;</strong>for the BigInteger classes.</p><p>Please note the full process of generating a valid bitcoin address is defined as:</p><p><br> </p><p>Private Key &gt; Public Key &gt; Address</p><br><p>This tutorial concentrates on the&nbsp;<strong>last step.&nbsp;</strong></p><p>If you want to generate a Private/Public pair you can use a&nbsp;bitcoin wallet or look into using&nbsp;http://www.bouncycastle.org/csharp/ to create a valid pair within C#.</p><br><h1>9 Steps verbose</h1><br><p>Here we have all 9 steps as per the technical background document written in C#. Each step is written to the console to show the progress of making the address.</p><br><pre class="prettyprint">static void Main() { string HexHash = "0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6"; byte[] PubKey = HexToByte(HexHash); Console.WriteLine("Public Key:" + ByteToHex(PubKey)); //Step 1 byte[] PubKeySha = Sha256(PubKey); Console.WriteLine("Sha Public Key:" + ByteToHex(PubKeySha)); //Step 2 byte[] PubKeyShaRIPE = RipeMD160(PubKeySha); Console.WriteLine("Ripe Sha Public Key:" + ByteToHex(PubKeyShaRIPE)); // Step 3 byte[] PreHashWNetwork = AppendBitcoinNetwork(PubKeyShaRIPE, 0); // Step4 byte[] PublicHash = Sha256(PreHashWNetwork); Console.WriteLine("Public Hash:" + ByteToHex(PublicHash)); // Step5 byte[] PublicHashHash = Sha256(PublicHash); Console.WriteLine("Public HashHash:" + ByteToHex(PublicHashHash)); //Step 6 Console.WriteLine("Checksum:" + ByteToHex(PublicHashHash).Substring(0, 4)); //Step 7 byte[] Address = ConcatAddress(PreHashWNetwork, PublicHashHash); Console.WriteLine("Address:" + ByteToHex(Address)); //Step 8 Console.WriteLine("Human Address:" + Base58Encode(Address)); //Step 9 <div>}</div></pre><br><br><h1>Shorthand Function</h1><br><p>The entire function can be written in short for live (non debug) use:</p><br><pre class="prettyprint">public static string CreateAddress(string PublicKey) { byte[] PreHashQ = AppendBitcoinNetwork(RipeMD160(Sha256(HexToByte(PublicKey))), 0); return Base58Encode(ConcatAddress(PreHashQ, Sha256(Sha256(PreHashQ)))); } </pre><div><br></div><h1>Additional Functions</h1><br><p>I've used some helper functions along the way, they are very verbose (Some unnecessary) but it make it a lot easier to read and understand.</p><p><br> </p><p><span style="color: inherit; font-family: inherit; font-size: 1.5em; font-weight: 700;">HexToByte</span><br> </p><br><p>Hex to Byte converts the Hexidecimal string to a byte array, it"s simple as taking the 2 characters and converting it into base 256.</p><br><pre class="prettyprint"><div>public static byte[] HexToByte(string HexString) </div><div>{ <br></div><div> if (HexString.Length % 2 != 0) <br></div><div> throw new Exception("Invalid HEX"); <br></div><div> byte[] retArray = new byte[HexString.Length / 2]; <br></div><div> for (int i = 0; i &lt; retArray.Length; ++i) <br></div><div> { <br></div><div> retArray[i] = byte.Parse(HexString.Substring(i*2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture); <br></div><div> } <br></div><div> return retArray; </div><div>}</div></pre><br><strong>ByteToHex</strong><br><br><p>Byte to hex converts a&nbsp;byte into a hexadecimal string</p><br><pre class="prettyprint">byte[] data = { 1, 2, 4, 8, 16, 32 }; <br><div><div>string hex = BitConverter.ToString(data);<br></div></div></pre><br><h2>SHA256</h2><br><p>Sha256 uses Microsoft"s security cryptography include, and by default takes a byte array (this function is bad in the sense It creates duplicate instances of the sha manager, which we probably shouldn"t do as we could reuse the same instance for the 3 times)</p><br><pre class="prettyprint">public static byte[] Sha256(byte [] array) <br><div>{ <br></div><div> SHA256Managed hashstring = new SHA256Managed(); <br></div><div> return hashstring.ComputeHash(array); <br></div><div>}<br></div></pre><br><h2>RipeMD160</h2><br><p>Again this function uses Microsoft"s security cryptography include and is pretty much identical to the Sha256 function.</p><br><pre class="prettyprint">public static byte[] RipeMD160(byte[] array) <br><div>{ <br></div><div> RIPEMD160Managed hashstring = new RIPEMD160Managed(); <br></div><div><div> return hashstring.ComputeHash(array); <br></div></div><div>}<br></div></pre><br><h2>Append Bitcoin Network</h2><br><p>AppendBitcoinNetwork simply pre-appends a byte onto the beginning of an array of bytes</p><br><pre class="prettyprint"><div>public static byte[] AppendBitcoinNetwork(byte[] RipeHash, byte Network) </div><div>{ <br></div><div><div> byte[] extended = new byte[RipeHash.Length + 1]; <br></div></div><div> extended[0] = (byte)Network; <br></div><div> Array.Copy(RipeHash, 0, extended, 1, RipeHash.Length); <br></div><div> return extended; <br></div><div>}</div></pre><br><h2>Concat Address</h2><br><p>Concat address appends the last 4 bytes of the hash onto the end of the RipeMD160 value</p><br><pre class="prettyprint">public static byte[] ConcatAddress(byte[] RipeHash, byte[] Checksum) <br><div><div>{ <br></div></div><div> byte[] ret = new byte[RipeHash.Length + 4]; <br></div><div> Array.Copy(RipeHash, ret, RipeHash.Length); <br></div><div> Array.Copy(Checksum, 0, ret, RipeHash.Length, 4); <br></div><div> return ret; <br></div><div>}<br></div></pre><p><br></p><h2>Base58</h2><br><p>I"ve hacked together my own c# Base58 encoder based off the C++ code by Satoshi, notice it uses BigInterger, this is a new Microsoft class in C# that allows math operation on arbitrary big numbers, so we"re no longer limited to a 32 or 64 bit integer, see more here:</p><a href="http://msdn.microsoft.com/en-us/library/system.numerics.biginteger(v=vs.110).aspx">http://msdn.microsoft.com/en-us/library/system.numerics.biginteger(v=vs.110).aspx</a><br><pre class="prettyprint"><div>public static string Base58Encode(byte [] array) </div><div>{ <br></div><div> const string ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; <br></div><div> string retString = string.Empty; <br></div><div> BigInteger encodeSize = ALPHABET.Length; <br></div><div> BigInteger arrayToInt = 0; <br></div><div><br></div> for (int i = 0; i &lt; array.Length; ++i) <br><div><div> { <br></div></div><div> arrayToInt = arrayToInt * 256 + array[i]; <br></div><div> } <br></div><div> </div><div> while (arrayToInt &gt; 0) </div><div><div> { <br></div></div><div> int rem = (int)(arrayToInt % encodeSize); <br></div><div> arrayToInt /= encodeSize; <br></div><div> retString = ALPHABET[rem] + retString; <br></div><div> } <br></div><div> </div><div> for (int i = 0; i &lt; array.Length &amp;&amp; array[i] == 0; ++i) </div><div> retString = ALPHABET[0] + retString; <br></div><div> return retString; </div><div>}</div></pre><em>Note: You"ll have to manually add references to the Microsoft.Numerics library to your project to get the BigInteger class.</em><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-full wp-image-547" src="https://files.jackdye.co.uk/images/sysNumerics.png" alt="sysNumerics" width="482" height="408" data-proportion="true" data-align="none" data-file-name="sysNumerics.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="0"> </figure> </div><br><h1>Conclusion</h1><br><p>Hope this helps anyone looking to write Bitcoin/Litecoin C# applications. Any questions/improvements please leave a comment.</p> Tutorials Edit | Details | Delete
Fix YouTube Restricted mode in Windows 10 <p>If Youtube is hiding videos when searching due to "Restricted Mode", Like this:</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-large wp-image-574" src="https://files.jackdye.co.uk/images/tut0.png" alt="tut0" width="584" height="106" data-proportion="true" data-align="none" data-file-name="tut0.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="0"> </figure> </div><br><h2>Fix</h2><p>You can try turning it off at the bottom of the Youtube page by clicking on the "Restricted Mode" button.</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-large wp-image-572" src="https://files.jackdye.co.uk/images/tut1.png" alt="tut1" width="584" height="233" data-proportion="true" data-align="none" data-file-name="tut1.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="1"> </figure> </div><p><br></p><h2>Still not working?</h2><p>If this is not saving and restricted mode keeps turning back "ON" &amp; you have a Windows 10 PC - you might have family mode enabled, To turn this off, type settings in the start menu and open the main settings dialog (See Picture Below). Click Accounts (the picture with the person)</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-full wp-image-571" src="https://files.jackdye.co.uk/images/tut2.png" alt="tut2" width="819" height="633" data-proportion="true" data-align="none" data-file-name="tut2.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="450px,348px" data-rotate="" data-rotatex="" data-rotatey="" style="width: 450px; height: 348px;" data-index="2"> </figure> </div><br><br><p>In the accounts dialog you"ll need to click "Sign out of Microsoft Account and use Local Account Instead". You"ll need to provide your Microsoft account password and then make a new password for your PC.</p><p><em>This will disconnect you from all family settings</em></p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-large wp-image-575" src="https://files.jackdye.co.uk/images/tut3.png" alt="tut3" width="584" height="451" data-proportion="true" data-align="none" data-file-name="tut3.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="469px,362px" data-rotate="" data-rotatex="" data-rotatey="" style="width: 469px; height: 362px;" data-index="3"> </figure> </div><p><br></p><br><p>Now try turning off restricted mode again (from the bottom of the Youtube page), and you"ll see the setting now saves!</p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-large wp-image-573" src="https://files.jackdye.co.uk/images/tut4.png" alt="tut4" width="584" height="134" data-proportion="true" data-align="none" data-file-name="tut4.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="638px,146px" data-rotate="" data-rotatex="" data-rotatey="" style="width: 638px; height: 146px;" data-index="4"> </figure> </div> Tutorials Edit | Details | Delete
Mini Golf Mod <div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img class="alignleft wp-image-612 size-full" src="https://files.jackdye.co.uk/images/GoGolfLogoMain.png" alt="GoGolfLogoMain" width="256" height="128" data-proportion="true" data-align="none" data-file-name="GoGolfLogoMain.png" data-file-size="0" origin-size="256,128" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="0"></figure></div><p>For the past 6 months I"ve been working part time to port my golf mod&nbsp;from CS:S to&nbsp; Counter Strike Global Offensive</p><p>As of today, on the 10 year anniversary of my delving into modding counter strike the mod is released.</p><p>Released along side is the first map to work with the plugin - Go Golf, a 18 hole course set in rural Massachusetts:</p><h1>Released on Steam</h1><a href="https://steamcommunity.com/sharedfiles/filedetails/?id=712966992">https://steamcommunity.com/sharedfiles/filedetails/?id=711504961</a><h1>Website</h1><a href="http://jackdye.co.uk/gogolf">https://files.jackdye.co.uk/gogolf</a><h1>Screenshots</h1><div><br></div><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px; width: 300px; height: 188px;"><a href="https://files.jackdye.co.uk/images/Lobby01.jpg" target="_blank" data-image-link="image" data-rotate="0" data-proportion="true" data-size="300px," data-align="none" style="width: 300px;"><img src="https://files.jackdye.co.uk/images/Lobby01.jpg" alt="" data-image-link="https://files.jackdye.co.uk/images/Lobby01.jpg" data-file-name="Lobby01.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="300px,188px" data-rotate="0" data-rotatex="" data-rotatey="" data-align="none" style="width: 300px; height: 188px; transform: rotate(0deg);" data-proportion="true" data-index="1"></a></figure></div><div><br></div><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><a href="https://files.jackdye.co.uk/images/Western01_thumb.png" target="_blank" data-image-link="image" data-rotate="0" data-proportion="true" data-size="300px," data-align="none" style="width: 300px;"><img src="https://files.jackdye.co.uk/images/Western01_thumb.png" alt="" data-image-link="https://files.jackdye.co.uk/images/Western01_thumb.png" data-file-name="Western01_thumb.png" data-file-size="0" origin-size="350,219" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-align="none" data-percentage="auto,auto" style="" data-proportion="true" data-index="2"></a></figure></div><div><br></div><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><a href="https://files.jackdye.co.uk/images/Dark01.png" target="_blank" data-image-link="image" data-rotate="0" data-proportion="true" data-size="300px," data-align="none" style="width: 300px;"><img src="https://files.jackdye.co.uk/images/Dark01_thumb.png" alt="" data-image-link="https://files.jackdye.co.uk/images/Dark01.png" data-file-name="Dark01.png" data-file-size="0" origin-size="1680,1050" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-align="none" data-percentage="auto,auto" style="" data-proportion="true" data-index="3"></a></figure></div><div><br></div><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><a href="https://files.jackdye.co.uk/images/Dark02.png" target="_blank" data-image-link="image" data-rotate="0" data-proportion="true" data-size="300px," data-align="none" style="width: 300px;"><img src="https://files.jackdye.co.uk/images/Dark02_thumb.png" alt="" data-image-link="https://files.jackdye.co.uk/images/Dark02.png" data-file-name="Dark02.png" data-file-size="0" origin-size="1680,1050" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-align="none" data-percentage="auto,auto" style="" data-proportion="true" data-index="4"></a></figure></div><div><br></div><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><a href="https://files.jackdye.co.uk/images/Aztec01_thumb.png" target="_blank" data-image-link="image" data-rotate="0" data-proportion="true" data-size="300px," data-align="none" style="width: 300px;"><img src="https://files.jackdye.co.uk/images/Aztec01_thumb.png" alt="" data-image-link="https://files.jackdye.co.uk/images/Aztec01_thumb.png" data-file-name="Aztec01_thumb.png" data-file-size="0" origin-size="350,219" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-align="none" data-percentage="auto,auto" style="" data-index="5"></a></figure></div><div><br></div><div class="se-component se-image-container __se__float-none" contenteditable="false" style=""><figure style="margin: 0px;"><a href="https://files.jackdye.co.uk/images/Birch01_thumb.png" target="" data-image-link="image" data-rotate="" data-proportion="true" data-rotatex="" data-rotatey="" data-size="," data-align="none" data-percentage="auto,auto" style=""><img src="https://files.jackdye.co.uk/images/Birch01_thumb.png" alt="" data-image-link="https://files.jackdye.co.uk/images/Birch01_thumb.png" data-file-name="Birch01_thumb.png" data-file-size="0" origin-size="350,219" data-origin="," data-size="," style="" data-proportion="true" data-align="none" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" data-index="6"></a></figure></div><div><br></div> Releases Edit | Details | Delete
Love Bites <p>My entry for the Indie vs Gamers Game Jam, a 48 hour game Jam<br></p><p><br><a href="https://gamejolt.com/games/love-bites/80868">https://gamejolt.com/games/love-bites/80868</a></p><p>Love bites is a take on the classic arcade game Tapper with a dose of clinger zombies.</p><figure class="wp-block-image"><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure class="wp-block-image" style="margin: 0px;"><img src="https://i.gjcdn.net/data/games/1/118/80868/screenshots/screenshot03-tu7idrwz.png" alt="" data-proportion="true" data-align="none" data-file-name="screenshot03-tu7idrwz.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-index="0" data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style=""></figure></div></figure><p></p> Releases Edit | Details | Delete
Shed Championships <div class="wp-block-cover has-background-dim" style="background-image:url(http://jackdye.co.uk/wp-content/uploads/2019/07/Jumbo_Square.png)"><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <a href="https://www.microsoft.com/en-us/p/shed-championships/9pj4bvm87mpk?activetab=pivot:overviewtab" target="" data-image-link="image"><img src="https://files.jackdye.co.uk/images/Jumbo_Square-300x300.png" alt="" data-rotate="" data-proportion="true" data-rotatex="" data-rotatey="" data-size="," data-align="none" data-percentage="auto,auto" data-file-name="Jumbo_Square-300x300.png" data-file-size="0" origin-size="300,300" data-origin="," style="" data-index="0" data-image-link="https://www.microsoft.com/en-us/p/shed-championships/9pj4bvm87mpk?activetab=pivot:overviewtab"></a></figure> </div> <p><br> </p> </div><p>Shed championships is an reimagining of the classic card game Shit Head, one of my favourite card games from my school days<br> </p><p><a href="https://www.microsoft.com/en-us/p/shed-championships/9pj4bvm87mpk">Available&nbsp;on&nbsp;the&nbsp;Microsoft&nbsp;Store</a></p><p><br> </p><p>This story based card game follows the young James and his friend on night they"ll never forget</p><p>Features&nbsp;</p><ul> <li>10 Levels</li> <li>Tutorial Mode</li> <li>and a Quick Play</li> <li>Free to download and play!</li> </ul><p>Shed was developed using game maker studio, assets were developed in inkscape.</p><p><br> </p><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <a href="https://files.jackdye.co.uk/images/Screenshot_03.png" target="" data-image-link="image"><img src="https://files.jackdye.co.uk/images/Screenshot_03-300x169.png" alt="" data-rotate="" data-proportion="true" data-rotatex="" data-rotatey="" data-size="," data-align="none" data-percentage="auto,auto" data-file-name="Screenshot_03-300x169.png" data-file-size="0" origin-size="300,169" data-origin="," style="" data-image-link="https://files.jackdye.co.uk/images/Screenshot_03.png" data-index="1"> </a> </figure> <figure style="margin: 0px;"> <a href="https://files.jackdye.co.uk/images/Screenshot_04.png" target="_blank" data-image-link="image"><img src="https://files.jackdye.co.uk/images/Screenshot_04-300x169.png" alt="" data-rotate="" data-proportion="true" data-rotatex="" data-rotatey="" data-size="," data-align="none" data-percentage="auto,auto" data-file-name="Screenshot_04-300x169.png" data-file-size="0" origin-size="300,169" data-origin="," style="" data-image-link="https://files.jackdye.co.uk/images/Screenshot_04.png" data-index="2"> </a> </figure> </div><p><br> </p> Releases Edit | Details | Delete
Alphabetical Sorting without eating RAM <p>I was looking for a method to sort a really large data-set alphabetically without eating all a user’s RAM, or using disk space, nor have a user sit and wait for N² comparisons.</p><p>I found the answer in the form of a Trie-tree, a neat data structure that flattens ASCII characters into... well a tree.&nbsp;<br> </p><p> <br> Lets say we have the following words:<br> </p><ul> <li>Ape</li> <li>App</li> <li>Apple</li> <li>Orange</li> <li>Ore</li> <li>Pear</li> </ul><p>A Trie Tree would represent the data in the following way:<br> </p><p><br></p><div class="se-component se-image-container __se__float-none" contenteditable="false" style=""><figure style="margin: 0px;"><a href="https://files.jackdye.co.uk/images/TrieTree.png" target="_blank" data-image-link="image" data-rotate="" data-proportion="true" data-rotatex="" data-rotatey="" data-size="," data-align="none" data-percentage="auto,auto" style=""><img src="https://files.jackdye.co.uk/images/TrieTree.png" alt="" data-image-link="https://files.jackdye.co.uk/images/TrieTree.png" data-index="0" data-file-name="TrieTree.png" data-file-size="0" origin-size="466,466" data-origin="," data-size="351px,351px" data-rotate="" data-rotatex="" data-rotatey="" style="width: 351px; height: 351px;" data-align="none"></a></figure></div><p><br></p><p>Each node represents a character which can have 26 children (or more depending on the character set). A node can be marked as an endpoint (in red) to signal the completion of a character string. Duplicate starting characters in similar words only use one node between them, as seen with A P for <strong>ap</strong>e, <strong>ap</strong>ple and <strong>ap</strong>p, this has the wonderful side affect of compressing the sort data-structure. Our input data-set contained 24 characters, the tree only contains 17 characters.<br> </p><p>To retrieve an alphabetically sorted list of words, you can traverse the tree taking the left most node, checking if its an endpoint (marked in red) if it is - return this, if not - explore the left most child, unless there is no more children, then travel up to the parent and explore the next adjacent child.<br> </p><p>Some caveats,<br> </p><p>1. It"s <strong>not </strong>going to be great for supporting the full unicode character set. A binary tree would probably work better.<br> 2. There is a overhead traversing the structure to add and retrieve the items, but compared to other sorts this isn"t extreme.<br> 3. In this implementation only one copy of each word is returned. This can easily be fixed by keeping a counter at each endpoint for duplicates.<br> 4. Features like #3 eat ram in every node. This adds overhead to the tree and the compression is less efficient.<br> </p><p><br> </p> Tutorials Edit | Details | Delete
Big CSV Editor <p>I'm pleased to announce the new CSV Editor is now available on the Microsoft Store.<br></p><p><a href="https://www.microsoft.com/en-gb/p/big-csv-editor/9n5qhqm5rvrg" style="background-color: rgb(255, 255, 255);" target="">Available on the Microsoft Store</a></p><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img src="https://files.jackdye.co.uk/images/Promo02.png" alt="" data-rotate="" data-proportion="true" data-rotatex="" data-rotatey="" data-size="514px,289px" data-align="none" data-file-name="Promo02.png" data-file-size="0" origin-size="1366,768" data-origin="," style="width: 514px; height: 289px;" data-index="0"></figure></div><p><br></p><p>CSV Editor is a full featured large comma separated list file editing program.</p><p>Using sophisticated skim reading and data streaming huge files can not only be viewed, but edited too, even if there would not normally be enough RAM.</p><ul><li>​<a href="http://torrent.jackdye.co.uk/Blog/Post?id=24" target="">Smart Columns</a> allow the user to programmatically add additional columns using adjacent data and formula<br></li><li>Filtering can be done on a per-column basis</li><li>Sorting can be done numerically, alphabetically and by currency</li><li>Does not mangle leading zeros like many other programs.</li></ul><p>Get what you need fast</p> Releases Edit | Details | Delete
Gallery for Wordpress <h3>Want to manage your blogs photos directly from your desktop, phone or tablet?</h3><p><br> </p><p>Gallery for WordPress is a great tool to Upload, Update and post Images, it integrates into windows share so&nbsp;you can show the world your photo&nbsp;or latest creation with a single click.</p><br><ul class="c-list" dir="ltr"> <br> <li class="">Displays your blog as a "share" destination in any supported windows app.</li> <br> <li>Compose and publish image posts directly to your blog feed.</li> <br> <li>Supports multiple blogs simultaneously.</li> <br> <li>Effortlessly keep your metadata up to date.</li> <br> <li>Drag &amp; drop uploading</li> <br> <li>Automatic image resizing for the web</li> <br> <li>Robust secure image uploading</li> <br> <li>Compatible with wordpress.com</li> <br> </ul><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="alignnone size-large wp-image-883" src="https://files.jackdye.co.uk/images/apps.43226.14511385967371436.1b89ffd5-9d88-455c-aa4f-2236af6d0665-1024x576.jpg" alt="" width="584" height="329" data-proportion="true" data-align="none" data-file-name="apps.43226.14511385967371436.1b89ffd5-9d88-455c-aa4f-2236af6d0665-1024x576.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="538px,303px" data-rotate="" data-rotatex="" data-rotatey="" style="width: 538px; height: 303px;" data-index="0"> </figure> </div><br><br><p>Available for free on the Microsoft store:</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px; width: 116px;"> <a href="https://www.microsoft.com/en-gb/p/gallery-for-wordpress/9p1h7dt3zrrp" target="" data-image-link="image"><img src="https://assets.windowsphone.com/85864462-9c82-451e-9355-a3d5f874397a/English_get-it-from-MS_InvariantCulture_Default.png" alt="Get it from Microsoft" width="200" data-proportion="true" data-align="none" data-file-name="English_get-it-from-MS_InvariantCulture_Default.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="116px,42px" style="width: 116px; height: 42px;" data-index="1" data-image-link="https://www.microsoft.com/en-gb/p/gallery-for-wordpress/9p1h7dt3zrrp"></a></figure> </div> Releases Edit | Details | Delete
Smart Columns <h1>Introduction</h1><p>Smart columns are a great way for you to quickly calculate sums on your entire dataset, and have them just as editable as any other column!</p><h1>Caveats</h1><p>There are a few things you should bear in mind,</p><ul> <li>The formula can only lookup values in the current row.</li><li>Smart columns evaluate from left to right.<em>If you want to reference another smart column, the referenced column should be to the left. This is to ensure there are no circular dependencies.</em></li><li>Deleting a source column will result in a #REF lookup error, save the file to commit the smart columns and you can then delete source columns.</li></ul><h1>Operators</h1><p>The formula syntax supports these basic operations, the syntax&nbsp;is parsed in a left to right approach (not BODMAS). Please use brackets to achieve desired functionality.</p><table class="table" style="width: 100%;"><tbody><tr><th class=""><div> Operator </div></th><th class=""><div> Description</div></th></tr><tr><td> + </td><td class=""><div>Add</div></td></tr><tr><td> - </td><td class=""><div>Subtract</div></td></tr><tr><td> / </td><td class=""><div>Divide</div></td></tr><tr><td> * </td><td class=""><div>Multiply</div></td></tr><tr><td> % </td><td class=""><div>Modulus</div></td></tr><tr><td> &amp; </td><td class=""><div>Concatenate (Strings)&nbsp;</div></td></tr><tr><td> ( </td><td class=""><div>Start group</div></td></tr><tr><td> ) </td><td class=""><div>End group</div></td></tr><tr><td> A-Z </td><td class=""><div>Reference column</div></td></tr><tr><td> 12.3 </td><td class=""><div>Decimal</div></td></tr><tr><td> FUNC(a,b) </td><td> Functions (see below) </td></tr></tbody></table><h1>List of functions</h1><p>The formula box provides access to many functions that can be useful</p><strong>Decimal Functions</strong><table class="table"><tbody><tr><th> Function </th><th> Description </th></tr><tr></tr><tr><td> CONCAT(a,b) </td><td> Appends b onto a </td></tr><tr></tr><tr><td> LEFT(a,x) </td><td> First x characters of a </td></tr><tr></tr><tr><td> RIGHT(a,b) </td><td> Last x characters of a </td></tr><tr></tr><tr><td> SUBSTITUTE(a, b, c) </td><td> Replaces all instances of b with c located in a </td></tr><tr></tr><tr><td> ADD(a,b) </td><td> Adds b to a </td></tr><tr></tr><tr><td> SUBTRACT(a,b) </td><td> Subtracts b from a </td></tr><tr></tr><tr><td> MULTIPLY(a,b) </td><td> Times a and b </td></tr><tr></tr><tr><td> DIVIDE(a,b) </td><td> Divides a by b </td></tr><tr></tr><tr><td> MOD(a,b) </td><td> Remainder of a by b </td></tr><tr></tr><tr><td> MAX(a,b) </td><td> Greater of a or b </td></tr><tr></tr><tr><td> MIN(a,b) </td><td> Lesser of a or b </td></tr><tr></tr><tr><td> ROUND(a,x) </td><td> Rounds a to x decimal places </td></tr><tr></tr><tr><td> POW(a, b) </td><td> Takes a to the power of b </td></tr><tr></tr><tr><td> IF(a, b, c) </td><td> Checks a is true, returns b otherwise returns c </td></tr><tr></tr><tr><td> COL(x) </td><td> Returns the Xth column </td></tr><tr></tr><tr><td> AND(a,b) </td><td> Checks if a and b are both true </td></tr><tr></tr><tr><td> OR(a,b) </td><td> Checks if a or b are either true </td></tr><tr></tr><tr><td> XOR(a,b) </td><td> Checks if one of a or b is true </td></tr><tr></tr><tr><td> EQUALS(a,b) </td><td> Checks if a and b are the same value </td></tr><tr></tr><tr><td> NOTEQUALS(a,b) </td><td> Checks if a and b are different values </td></tr><tr></tr><tr><td> NOT(a) </td><td> Checks if a is true, returns false, vice versa </td></tr><tr></tr><tr><td> GT(a,b) </td><td> Checks if a is greater than b </td></tr><tr></tr><tr><td> LT(a,b) </td><td> Checks if a is less than b </td></tr><tr></tr></tbody></table><strong>String Functions</strong><table class="table" style="width: 100%;"><tbody><tr><td> Concat(string1, string2) </td><td> Appends string2 onto string1 </td></tr><tr><td> Left(string, No characters) </td><td> First X characters of the string </td></tr><tr><td> Right(string, No characters) </td><td><div> Last X characters of the string </div></td></tr><tr><td><div> Substitute(string, old, new) </div></td><td><div> Replaces all instances of old with new located in string </div></td></tr><tr><td><div>Len(string)</div></td><td><div>Returns the number of characters in a string</div></td></tr></tbody></table><strong>Conditional Functions</strong><table class="table"><tbody><tr><td> IF(condition, true, false) </td><td> Returns the true value or false value depending on the condition equalling 1 </td></tr></tbody></table><strong>Lookup Functions</strong><table class="table"><tbody><tr><td> Col(index) </td><td> Returns the value in the specified column </td></tr></tbody></table><h1>Examples</h1><h3>Add a £ symbol to the A column values</h3><pre class="prettyprint">\"£\"&amp;A </pre><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img class="alignnone size-medium wp-image-910" src="https://files.jackdye.co.uk/images/SmartHelp_Example1-300x91.png" alt="" width="300" height="91" data-proportion="true" data-align="none" data-file-name="SmartHelp_Example1-300x91.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="0"> </figure></div><h3>Total a row and add a £ symbol</h3><pre class="prettyprint">\"£\"&amp;A+B+C </pre><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img class="alignnone size-medium wp-image-911" src="https://files.jackdye.co.uk/images/SmartHelp_Example2-300x48.png" alt="" width="300" height="48" data-proportion="true" data-align="none" data-file-name="SmartHelp_Example2-300x48.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="1"> </figure></div><h3>Find the average of a set of columns</h3><pre class="prettyprint">(A+B+C)/3 </pre><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img class="alignnone wp-image-913 size-medium" src="https://files.jackdye.co.uk/images/SmartHelp_Example3-1-300x47.png" alt="" width="300" height="47" data-proportion="true" data-align="none" data-file-name="SmartHelp_Example3-1-300x47.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="2"> </figure></div><h3>Add 20% tax to a column</h3><div>A*1.2 </div><div class="se-component se-image-container __se__float-none" contenteditable="false"><figure style="margin: 0px;"><img class="alignnone size-medium wp-image-915" src="https://files.jackdye.co.uk/images/SmartHelp_Example4-300x87.png" alt="" width="300" height="87" data-proportion="true" data-align="none" data-file-name="SmartHelp_Example4-300x87.png" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="3"> </figure></div> Tutorials Edit | Details | Delete
Raspery Pi Arcade Table - Part 1 <div class="se-component se-image-container __se__float-none" contenteditable="false"> <figure style="margin: 0px;"> <img class="size-medium wp-image-492 alignleft" alt="WP_001824" src="https://files.jackdye.co.uk/images/WP_001824-300x225.jpg" width="300" height="225" data-proportion="true" data-align="none" data-file-name="WP_001824-300x225.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="auto,auto" style="" data-index="0"> </figure> </div><p>After owning my Raspberry PI for aR year, I decided it was time to actually do something useful with it.</p><br><p>I"ve decided to ruin my girlfriends coffee table and convert it into a fully functioning arcade cabinet for entertaining guests.</p><br><p>The Victim,&nbsp;the table is a £16 IKEA Lack table. its filled with cardboard making it very easy to work with. Here you can faintly see I"ve roughly drawn lines to cut out for the monitor. Shockingly I did this with a 30cm ruler<br> </p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-481" alt="WP_001697" src="https://files.jackdye.co.uk/images/WP_001697.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001697.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="1"> <figcaption> <div>Insert description</div> </figcaption> </figure> </div><p><br> </p><br><p>Very badly cut hole. The cardboard can just be pulled out using your hands</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-482" alt="WP_001698" src="https://files.jackdye.co.uk/images/WP_001698.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001698.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="2"> </figure> </div><br><br><p>I scored a cheap monitor off Ebay, unfortunately it was VGA only, meaning It wasn"t so cheap after buying a HMDI to VGA adapter for the PI. The resolution is pretty poor, but for old arcade games it does not matter at all, in any case it should help speed the games up with having less pixels to render.</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-480" alt="WP_001692" src="https://files.jackdye.co.uk/images/WP_001692.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001692.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="3"> </figure> </div><p><br> </p><br><br><br><p>The monitor unfortunately had it"s transformer inbuilt, unlike newer monitors have a power brick (Should of done my research!). A hole had to be cut to hold this in place and allow air circulation.</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-483" alt="WP_001713" src="https://files.jackdye.co.uk/images/WP_001713.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001713.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="4"> </figure> </div><p><br> </p><br><p>Once in, it did not look too shabby, and allowed easy access to the vga port to plug in a laptop etc.</p><br><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-484" alt="WP_001712" src="https://files.jackdye.co.uk/images/WP_001712.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001712.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="5"> </figure> </div><p><br> </p><br><p>The next step was drilling the holes for the buttons, it was looking quite expensive for all the hole cutters I"d need, in the end I read up on people using a stepped drill bit, which worked out loads cheaper, and saved many headaches later on with the plexi glass. It"s finish isnt the smoothest, but the button caps hide that.</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-485" alt="WP_001762" src="https://files.jackdye.co.uk/images/WP_001762.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001762.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="6"> </figure> </div><p><br> </p><br><p>Some more holes were drilled for the player 1 &amp; 2 start buttons,, and here I"m testing a wooden mount for the monitor.</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-486" alt="WP_001767" src="https://files.jackdye.co.uk/images/WP_001767.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001767.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="7"> </figure> </div><p><br> </p><br><p>Next came the joysticks, I spent a long time looking up on how to mount them without any screw holes on the surface, in the end I opted to glue some wood to the underside of the table.</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-487" alt="WP_001804" src="https://files.jackdye.co.uk/images/WP_001804.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001804.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="8"> </figure> </div><p><br> </p><br><p>The joysticks then screw into the wood holding them in place.</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-489" alt="WP_001810" src="https://files.jackdye.co.uk/images/WP_001810.jpg" width="768" height="1024" data-proportion="true" data-align="none" data-file-name="WP_001810.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="9"> </figure> </div><br><br><p>I found a GIPO extender in maplin, it handily allows you insert raw wire into the pins, all 14 buttons will run into this block, a simple script on the pi translates the GIPO signals to a keyboard key presses (</p><a title="Adafruit" href="http://learn.adafruit.com/retro-gaming-with-raspberry-pi/buttons">http://learn.adafruit.com/retro-gaming-with-raspberry-pi/buttons</a><p>)</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-501" alt="WP_001695" src="https://files.jackdye.co.uk/images/WP_001695.jpg" width="1536" height="1152" data-proportion="true" data-align="none" data-file-name="WP_001695.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="10"> </figure> </div><p><br> </p><br><p>Laying out the Rasperry Pi, the VGA converter and the GIPO pin board</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-488" alt="WP_001805" src="https://files.jackdye.co.uk/images/WP_001805.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001805.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="11"> </figure> </div><br><p><br> </p><p>I brought some LED arcade buttons off ebay:</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-490" alt="WP_001819" src="https://files.jackdye.co.uk/images/WP_001819.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001819.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="12"> </figure> </div><p><br> </p><br><p>Joysticks and buttons assembled:</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-491" alt="WP_001821" src="https://files.jackdye.co.uk/images/WP_001821.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001821.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="13"> </figure> </div><p><br> </p><br><p>Top view:</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-492" alt="WP_001824" src="https://files.jackdye.co.uk/images/WP_001824.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001824.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="14"> </figure> </div><p><br> </p><br><p>Time for some LED action, I used an old 9v mobile phone charger wired in parallel for each player to power the buttons.</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-493" alt="WP_001828" src="https://files.jackdye.co.uk/images/WP_001828.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001828.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="15"> </figure> </div><p><br> </p><br><p>Feels like Christmas:</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-494" alt="WP_001830" src="https://files.jackdye.co.uk/images/WP_001830.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001830.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="16"> </figure> </div><p><br> </p><br><p>To protect the screen I opted to cover the table in plexiglass brought from homebase. a lesson to be learnt is you can never scour it enough when cutting it down to size, the first cut show here was perfect, but my second break was not so much, and I was left with some fragments still attached which I had to jigsaw down leaving it very ugly.</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-495" alt="WP_001835" src="https://files.jackdye.co.uk/images/WP_001835.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001835.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="17"> </figure> </div><br><br><p>Using a scrap bit of plexiglass It dawned on me just how hard this stuff is to drill, if you cut just a little too much at once it cracks, I practiced at least 12 holes before daring with the reel stuff. Main lesson I learnt was to take it very slow, and take breaks to Hoover the waste regularly (this sometimes melts and acts a sort of glue between the drill and the sheet resulting it in cracking.)</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-496" alt="WP_001838" src="https://files.jackdye.co.uk/images/WP_001838.jpg" width="768" height="1024" data-proportion="true" data-align="none" data-file-name="WP_001838.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="18"> </figure> </div><p><br> </p><br><p>After a week of drilling every night using the stepped drill bit I finally had the holes cut without any cracks, it was painfully slow. next time I"d probably opt for a design that has the control panel uncovered</p><br><br><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-497" alt="WP_001847" src="https://files.jackdye.co.uk/images/WP_001847.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001847.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="19"> </figure> </div><p><br> </p><br><p>I scrapped my wood mount for the monitor after finding&nbsp;some tough foam in a pound shop, &nbsp;this was a lot easier to mold into mounts with the stepped edges I wanted. The steps were glued at the base.</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;"> <figure style="margin: 0px; width: 100%;"> <img class="alignnone size-full wp-image-498" alt="WP_001851" src="https://files.jackdye.co.uk/images/WP_001851.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001851.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="20"> </figure> </div><p><br> </p><br><p>Wired up, mounted and now testing the monitor with big picture. One thing you cant see is that the monitor is mounted upside down, due to the viewing angles (I learn"t this trick at work!), the videocard rotates the image and no one is the wiser!</p><div class="se-component se-image-container __se__float-none" contenteditable="false" style="width: 50%;height:100%"> <img class="alignnone size-full wp-image-499" alt="WP_001859" src="https://files.jackdye.co.uk/images/WP_001859.jpg" width="1024" height="768" data-proportion="true" data-align="none" data-file-name="WP_001859.jpg" data-file-size="0" origin-size="0,0" data-origin="," data-size="50%," data-rotate="" data-rotatex="" data-rotatey="" data-percentage="50," style="width: 100%;height: 100%" data-index="21"> </div><p><br> </p><br><p>I"m currently wiring up the board and controls to the pi, so more pictures are soon to follow!</p><br><br><p><a title="PiCade Table Finished!" href="Post?id=15">See the final part</a></p> Projects Edit | Details | Delete