Tuesday, December 20, 2011

Backup Tool for Unity non-Pro, Areca Backup For Mac

I found this nifty tool called Areca Backup that does differential/incremental backups. I haven't used it extensively yet, but I'm hoping it plays nicer with Unity non-Pro than SVN does. It doesn't keep metadata on each folder like SVN, so it won't mess up if Unity messes with the file organization.

But because of that, it can't track changes between file moves. It can't even track changes anymore if you rename the file. But the old unrenamed file is still there in the old backup entries, so if you need to get back to it you can do so.

This is slightly better than the manual method of zipping up your project everytime you want a new backup. A version control system is the most ideal but we all know its not possible with Untiy non-Pro.

https://sourceforge.net/projects/areca/

I did some few fixes to have it running on Macs: http://dl.dropbox.com/u/25260770/Areca/Areca-7.2.3.dmg

Its not perfect, it may hang when you try to exit it. But I've tested it and backing up does work properly.


At first, the backing up didn't work. It turns out the exceptions stem from the fact that Mac and Linux have different ways of showing the output of ls.

In DefaultMetaDataAccessor.java, ls -ald1 seems to print the file without any info (filenames only). I had to change it to ls -ald. Furthermore, Mac's ls prints out a file size total as its first output, so I needed to skip that if found.

There are further problems with the way the output of ls is handled. Mac's ls puts an @ sign when the file has extended attributes (ACL, etc.) and that needed to be taken into account.

Currently the program may hang when you unselect an entry at the leftmost list.

I get this:


java.lang.NullPointerException
 at com.application.areca.launcher.gui.composites.TargetTreeComposite.handleEvent(Unknown Source)
 at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
 at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
 at org.eclipse.jface.window.Window.open(Window.java:796)
 at com.application.areca.launcher.gui.MainWindow.show(Unknown Source)
 at com.application.areca.launcher.gui.Application.show(Unknown Source)
 at com.application.areca.launcher.gui.Launcher.launchImpl(Unknown Source)
 at com.myJava.system.AbstractLauncher.launch(Unknown Source)
 at com.application.areca.launcher.gui.Launcher.main(Unknown Source)
11-12-20 22:09 - ERROR
java.lang.NullPointerException
 at com.application.areca.launcher.gui.composites.TargetTreeComposite.handleEvent(Unknown Source)
 at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
 at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
 at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
 at org.eclipse.jface.window.Window.open(Window.java:796)
 at com.application.areca.launcher.gui.MainWindow.show(Unknown Source)
 at com.application.areca.launcher.gui.Application.show(Unknown Source)
 at com.application.areca.launcher.gui.Launcher.launchImpl(Unknown Source)
 at com.myJava.system.AbstractLauncher.launch(Unknown Source)
 at com.application.areca.launcher.gui.Launcher.main(Unknown Source)

Source code: http://dl.dropbox.com/u/25260770/Areca/areca-7.2.3-mac-src.zip

Monday, December 19, 2011

Collaborative Diffusion/Influence Maps For Obstacle Avoidance

There was in the Unity forums, a post asking about how to implement flanking behaviour obstacle avoidance. I took interest because I've been wondering how to do that also.

Another user posted a link to a page explaining Collaborative Diffusion. From what I understand, its like influence maps, but once an agent passes through a node, that node's influence becomes zero, signifying its impassable now that he's there.


So I tried implementing it in Unity here: http://dl.dropbox.com/u/25260770/PathfindingTest/WebPlayer.html (you'll need to install the Unity plugin for your browser).

Left click to set the new attraction point or whatever its supposed to be called.

I'm pretty sure some of my code is a bit naive. Its only in certain situations do the agents will exhibit flanking behaviour. Some agents end up stuck, and I don't like the bee-like zig-zag movement they make.

Also I think it would be better to couple this with typical A*, such that, the path created by the A*, the area of the influence map that that path takes up, will be set to zero influence. Its as if the agent will be saying "to my allies, this is the path I'll take, don't cross it, its mine only. find your own path".

Angry Birds

I overheard my father talking about how he's appreciating playing a game. I'm surprised my father is starting to understand the depth of fun and strategy to be had in playing a video game. I'm more surprised that the game he mentioned was Angry Birds.

I never payed much attention to Angry Birds because I find the basic premise of the game mechanics boring. But after overhearing my father I figured there is much thought and depth that the developers added to the game. More than what I would have considered at first draft of a design document.

It turns out each bird has special abilities. There's one that can dive, one that drops eggs as bombs, one that speeds up, and probably a bunch of other stuff that I don't know. Each bird's ability is useful in a certain situation. The blue one is suited to breaking ice as I heard. Its not simply "this bird does 25% more damage on ice objects". Its with the fact that it breaks up into three smaller birds (not sure why) and you'd have an easier time shattering through multiple layers of ice that way.

Contrast that with the last game I've released, Zombie Fields, and Angry Birds is looking like its got more strategical depth in it, disguised in a veneer of the visuals of a kid's story book.