Sunday, 27 April 2014

[LD29] Gold Diver

Here is my entry for Ludum Dare 29. Unfortunately the game is not finished. It's kinda workable, but misses a lot of features and packs a lot of bugs. I guess you can still get a little kick out of it with the proper alchool level in the blood, and the proper sleep deprivation ;)

Ludum Dare entry
Mac64
Win64
Flash
Sources
The game is not finished, but I hope you's like to check it out. It's a spin on the AntEater ardace game. The diver has to get passed the obstacles to get the gold treasures. Hit the action button to rewind the breating pipe and go back to the boat.

Keyboard Controls:
arrows+spacebar

Gamepad controls:
direction+A button

A lot of things are missing on what I was planning:
  • missing animations/graphics for sharks and crabs
  • missing sound overall
  • harpoon for the diver
  • droping the treasure when shooting harpoon or when getting hit.
  • Shark is attacking the diver and not the breathing pipe, but crab where supposed to attack the breathing pipe and not the diver. forcing to get some strategy to get to the loot.
  • Moving slower when bearing a treasure.
  • ....
My main problem that made me fail the Jam: I'm still not fluent enough with Haxe and HaxePUNK. I'll still recommend HaxePUNK despite all the problems I had with it.

Thursday, 10 April 2014

I'll be there for you - Insanity Jam 2014

Last week I participated in the Insanity Game Jam. The goal was to generate a random crazy game idea from the generator and make a game out of it. My generated idea was "An indie game where you resurrect your friends with your friends.". The result is a puzzle game where you transplant organs from one friend to another in order to get everyone alive.
You can download the game here: Mac (x64) Win (x64)
The game entry for the jam is here.

Thursday, 27 March 2014

Fighting Games History v1.0

As a toy project for learning HTLM5/CSS and JavaScripts I created a timeline that represents the history of all the fighting games. You can check the source code everything is in there. Be warn it's pretty ugly yet, i'm still learning. But I think it's not that bad. All the data is the HTML document, the core layout is handled with CSS, and Javascript is used to handle fine positioning of the elements and adding eye-candy graphics using canvas. It is a first version, I intent to add more games and more features like displaying additional informations on user interaction.

Friday, 5 July 2013

Code reviews of horrors

This made me bang my head on my desk so hard I almost broke my glasses:

lock (new Object())
{
    // Code exprected to be thread safe...
}

Don't think it needs more explantation.

Wednesday, 15 May 2013

Building Cairomm on windows

Just a quick post to document the few troubles I had building cairomm on Window. Here is my setup:
- Windows 8
- Visual Studio express 2012

I started using this awesome post that details the procedure step by step. It's globally still valid but as time goes there are a few tweaks that have to be done. Here is an updated procedure.

Setup

Install MinGW. Assuming you installed MinGW in "C:\MinGW" type the following command to install MSYS and all the tools for development:
mingw-get install msys-dvlpr

Download the sources for the following components:
- zlib
- libpng
- pixman
- cairo
- libsigc++
- cairomm
I recommend decompressing the source trees in the same directory next to each other, and removing the version information. For example rename the libpng-1.5.15 directory to just libpng. It will save some Makefile edition.

Open a cmd.exe terminal and run "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat". This will set-up the proper environment for building with Visual Studio tools.

Building Zlib

Go in Zib directory and run:
nmake /f win32\Makefile.msc

Building libPNG

Go in libPNG directory and run:
nmake /f scripts\makefile.vcwin32
The script is hard coded to find zlib and will work if you named the directory as told.

Building pixman

Now we have to use MSYS. The Makefile will still use VS compiler, but it is not suitable for nmake. Open a MSYS console by running the command:
c:\MinGW\msys\1.0\msys.bat
In this console navigate to you sources directory (use "cd /c/Path" instead of "cd C:\Path"). Go in the pixman sources an run:
make -f Makefile.win32

Building Cairo

Still in the MSYS console, go in the Cairo sources directory and run:
make -f ../Makefile-cairo.win32 CFG=release

Build libsigc++

Now we are going to use Visual Studio for building our components. You can just open and build the project using libsigc++\MSVC_Net2010\libsigc++2.sln

Building Cairomm

Now is the build part. We have to manually configure the Visual Studio project in cairomm\MSVC_Net2010\cairomm.sln.
In Configuration Properties>C/C++>Genereal>Additional Include Directories add path to:
- cairo\src
- libsig++
- libsig++\MSVC_Net2010
In Configuration Properties>Linker>Genereal>Additional Library Directories add :
- cairo\src\release
- libpng
- zlib
- libsigc++\MSVC_Net2010\Win32\Release
In Configuration Properties>Linker>Input>Additional Dependencies add :

- cairo.lib
- libpng.lib
- zlib.lib
- msimg32.lib
- sigc-vc100-2_0.lib


When building cairomm-1.10.0 I had the following error:

Error 11 error LNK2019: unresolved external symbol "public: __thiscall Cairo::Device::Device(struct _cairo_device *,bool)" (??0Device@Cairo@@QAE@PAU_cairo_device@@_N@Z) referenced in function "public: class Cairo::RefPtr<class Cairo::Device> __thiscall Cairo::Surface::get_device(void)" (?get_device@Surface@Cairo@@QAE?AV?$RefPtr@VDevice@Cairo@@@2@XZ) C:\Users\antoine\Documents\Visual Studio 2012\Projects\PuillotPouillot\cairomm\MSVC_Net2010\cairomm\surface.obj cairomm-1.0

After investigation it turns out there was a missing file in the solution. In project cairomm-1.0 under Source Files click Add>Existing Item... and select the file cairomm/device.cc. This should fix the problem and end building the project.

Hope this will help.


Thursday, 3 November 2011

MAME on your Mac right now

Seriously all Mac MAME front-ends are dead projects. To get a proper MAME application for my Mac I had to bundle it myself. To spare you the same trouble here is MakeMame4Mac. It's a set of files that download and build everything to make a MAME application bundle that runs smoothly on your Mac. Just download the archive, uncompress it and run make. It is tailored for 64 bits processors (core2), so you may need to tweak the configuration if you have a different processor. The Makefile will download and build SDL and MAME and bundle the whole package in a nice Application Bundle. You will end with a Mame.app, just copy that in your /Application directory and you're good.
Note this is just a simple bundle for MAME, not a front-end. To configure the location of your ROMs you will need to edit the make.ini file by yourself. This file will be located in your $HOME/Application/Mame/mame.ini. It's just the standard make.ini file, check the MAME documentation to set it . If the $HOME/Application/Mame directory is not here, just run Mame.app once and quit, this will create it. All the different vnram files and co. will also be created under $HOME/Application/Mame so you won't get anything .

Project is available here.
A build for Mac OS X 10.7 Core2 proc is available here.

Enjoy!

Thursday, 27 October 2011

Make a Mac OS X application bundle for your Linux app

That's something pretty handy and no so much documented. I mean you have plenty of examples on how making you Xcode project into a nice Mac OS X application, but when making a cross platform application using the good old Make, you don't really want to have two building systems on you hands. Plus you will need to embed somehow the dependency libraries that are not provided by Mac OS X. But rejoice, you can build a Mac OS X application bundle from scratch without to much of a hassle.

For this solution, I heavily inspired from the GTK+ application bundler. The principe is quite simple, you need to create an application bundle directory structure as described here. Place you executable in the directory Content/MacOS, and all your libs in Content/Resources. Now the Info.plist. This file will be the entry point for running you application bundle. It can do a lot of things, but we will use the bare minimum here (define the startup executable and the icon):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
  <dict>
    <key>CFBundleName</key>
    <string>PouillotPouillot</string>


    <key>CFBundleDisplayName</key>
    <string>Pouillot Pouillot</string>


    <key>CFBundleIdentifier</key>
    <string>com.PouillotPouillot</string>


    <key>CFBundleVersion</key>
    <string>0.0.2</string>


    <key>CFBundlePackageType</key>
    <string>APPL</string>


    <key>CFBundleSignature</key>
    <string>puyo</string>


    <key>CFBundleExecutable</key>
    <string>launcher.sh</string>


    <key>CFBundleIconFile</key>
    <string>pouillotpouillot.icns</string>
  </dict>
</plist>


The icon must be in the Content/Resources directory. You noticed here we don't directly use the binary to startup the application, but a launcher script. This is the key element of this bundle. It's a neat trick to save us the pain of creating a Framework bundle with all the libs required by our application. Let me show you this script:

#!/bin/sh
name="`basename $0`"
tmp="`pwd`/$0"
tmp=`dirname "$tmp"`
tmp=`dirname "$tmp"`
bundle=`dirname "$tmp"`
bundle_contents="$bundle"/Contents
bundle_res="$bundle_contents"/Resources
bundle_lib="$bundle_res"/lib
bundle_bin="$bundle_res"/bin
bundle_data="$bundle_res"/share
bundle_etc="$bundle_res"/etc


export DYLD_LIBRARY_PATH="$bundle_lib"


exec "$bundle_contents/MacOS/pouillotpouillot"

This where the magic happens. We retrieve the bundle directory, and its various sub-directories, and then set the DYLD_LIBRARY_PATH variable to be able to load properly the different libraries in the Resources directory. This script does the bare minimum, I encourage you to check the launcher script of the GTP+ app bundler.

That's it we're done, but you still have to be very careful with the loading of your libs with the other from Mac OS X. There can be conflicts. For instance if your application embeds libpng you can get this kind of error at startup:

dyld: Symbol not found: __cg_png_create_info_struct
  Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: ///Users/antoine/progs/pouillotpouillot/PouillotPouillot.app/Contents/Resources/lib/libpng15.15.dylib
 in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO

What happened is your application loads its libpng library, then loads ImageIO frameworks, and ImageIO framework itself uses libpng. But instead of getting the libpng from /usr/X11/lib that was expected, it gets the one from your application bundle. And yours is different from the one from the system. So you better use the one from the system. In case you really need your version and avoid the library from the system, or seems you can use DYLD_FALLBACK_LIBRARY_PATH, but i didn't tried it yet.

Hope this will help you make more cross-platform applications. It's still a pity to see nice apps not available for your beloved system ;)