Posted at 11:52 pm on December 16, 2012
Jonas Kyratzes has this thing where he writes pretty good: he and his games first won me over with
His latest —
Play
Posted at 11:52 pm on December 16, 2012
Jonas Kyratzes has this thing where he writes pretty good: he and his games first won me over with
His latest —
Play
Posted at 12:19 pm on December 1, 2012
WARNING: This is a rather technical post about something completely different and not at all about
Several Ludum Dares ago, I made a game called
Surprisingly, it turns out that it’s not all that easy to run around town escaping wifi hotspots while holding a laptop with an old and dying battery.
Cue the rise of mobile, wifi-enabled devices, however, and things get interesting. I’m an Android man myself, and since I’m slowly coming to terms with Unity, I started some tests in getting the latter to call functions from the Android API.
It was not straightforward.
The tutorial on Unity’s site gave a number of techniques for calling Android’s basic Java functionality from within Unity’s C# context, through JNI and C/C++. Unfortunately, even after reading it through multiple times, I still felt that, while it gave a lot of background information, it wasn’t as prescriptive as I was hoping.
Long story short: after patching that tutorial together with several dozen desperate and increasingly-confused online searches, I managed to gain access, in Unity, to the information polled from my Android device’s wifi manager.
I present those steps here for truth, justice, and the American whey. Hope it’s useful, and do call me out on the inevitable errors.
public class MainActivity { // does not “extend” anything
private Context m_context;
private WifiManager m_wifiMgr;
// ———————————————————- CONSTRUCTORS
public MainActivity(Context c) {
m_context = c;
m_wifiMgr = (WifiManager)m_context.getSystemService(Context.WIFI_SERVICE);
return;
}
// ————————————————————— METHODS
public boolean isWifiEnabled() {
return m_wifiMgr.isWifiEnabled();
}
}
include $(CLEAR_VARS)
# override strip command to strip all symbols from output library; no need to ship with those..
# cmd-strip = $(TOOLCHAIN_PREFIX)strip $1
LOCAL_ARM_MODE := arm
LOCAL_PATH := $(NDK_PROJECT_PATH)
LOCAL_MODULE := libjavabridge
LOCAL_CFLAGS := -Werror
LOCAL_SRC_FILES := jni/YOUR_FILENAME_HERE.cpp
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
And Application.mk:
APP_OPTIM := release
APP_ABI := armeabi
APP_PLATFORM := android-8
APP_BUILD_SCRIPT := jni/Android.mk
[DllImport("your_lib_name")]
private static extern bool _cppbridge_isWifiEnabled();
Note that “your_lib_name” is the name of the LOCAL_MODULE variable in your Android.mk file, without the “lib” prefix; or, it’s the name of the .so file you generated with ndk-build, but without the “lib” prefix or “.so” suffix. Also, the extern reference refers to the exact name of the C/C++ function we defined in our .cpp file.
Right. I think that’s just about complete, but feel free to give me a shout if something is missing/unclear/incorrect.
Now excuse me whilst I go rest my eyesies.

Posted at 4:41 pm on November 24, 2012
I’ve been doing a lot of work on the back end of
Most of the work was pretty much FPS fundamentals: that is, walking and pointing at things. This week, however, I finally got around to merging the old planetary rendering code from the teaser into this new framework.
Feels good to be back.
Posted at 1:30 pm on October 27, 2012
Physics and physics and physics again.
My calculations indicate that for a Stanford torus with a radius of 20m, simulating Martian gravity (3.711m/(s*s)) requires an angular velocity of around 2RPM. Which is right stately.
And walking around inside of one presents all sorts of interesting challenges to a physics engine.
Posted at 5:36 pm on September 29, 2012
So that’s a month then, is it. Strangely,
Work has been steady, if less than glamourous. At first, there was about a week of trying out new IDEs (I claim that MonoDevelop, faults aside, has probably the best autocomplete ever) and attempting to get a 64-bit Linux distro to compile 32-bit dependencies for a 32-bit OGRE library — with a few days to give up and just install a 32-bit Ubuntu on the laptop (and come up against the same linker problems regardless); a week or so of trying out physics engines — I desperately wanted to use Newton (for obvious reasons), but Bullet turned out to be a bit more mature and actively maintained (and more easily integrated with OGRE); a week of re-familiarising myself with Blender for eventual content creation (I swear, I’ve learnt the tool around five times already — at least now I have a longer-term reason to stick with it); &c &c &c.
In short, it’s been yet another sequence of black triangles commingled with the shaking of fists at the majority of things.

Otherwise, KO-OP business is moving along briskly. Saleem is essentially constantly engaged with bankers and bureaucrats, and/or sweeping cat hair (note to self: Disney movie/game tie-in called
So while the tasks are a bit mundane, this is still the first “steady” “job” I’ve held down with like-minded people. That’s motivating in its own right, and the fact that I’m seeing progress on the ground (however low-level) is the gravy on top of the cherry on top.
