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.

Tuesday, September 6, 2011

About Me

I made a forum post in Unity 3d which had me going on how I started in the game industry. Here it is:
______________________________________________


Where are you coming from?

I've always wanted to make videogames ever since I was a kid seeing one for the first time when my brother showed me. Ever since, I've studied what it took to make a game so I got into programming and 3d art.

As a child, I've shown a natural inclination in art, but I also persevered with programming, and I'd say it paid off.

I would usually learn a programming language earlier than my peers in school, only to find out that what I studied was too advanced for my expected level. I remember being a freshman in highschool when two seniors were at awe when I started writing private variables and public functions in C++.

My very first game was a turn-based RPG combat in QBASIC, which I threw away because I thought it sucked. I regret doing that.

I've dabbled in other stuff over the years: sketching, 3d art, graphic design, Flash and web programming.

Game development is a very risky proposition here in my country as its not as established as other fields like advertising or information technology. Nevertheless, I always jump on the chance to go into game development because its what I love to do, stable jobs be damned.

My very first major project was an online game with Torque, and it was quite stressful being the only programmer in the team. I worked there for two years and eventually left from burnout. There was a point when I questioned myself and didn't want to do programming anymore (I thought about being a novelist), but that's all water under the bridge now. As a compromise, I'm making a videogame where I'm also writing the story.

Now I work in a start-up company making videogames hoping to establish ourselves in the local industry.

I'm also active in the Unity developer community sharing code in the wiki and forums. You can find me hanging out in the Unity IRC chat channel occasionally as AnomalusUndrdog.



Which languages are you working with in Unity?

I come from C++, so C# was a no-brainer to me, after finding out the equivalents to the STL data structures and whatnot.



What do you enjoy about using these languages in Unity?

Its what I'm used to, and no more need for pointers.



What do you find annoying?

Mostly not the language but the IDE, MonoDevelop is a weird one, double-clicking on an error doesn't focus the MonoDevelop window, its slow, and crashes sometimes. So I use Notepad++ when on a Windows machine and Unitron on Mac.

I'm mostly vexed with the fact that I can't afford Unity Pro for the foreseeable future. This has me tempted to try out UDK.

Monday, August 15, 2011

Blending Problems

So I got these indicators to know when a unit is selected or where he's going to move:


Its a projector, its not the fastest, but it looks good. Its blend equation is set right now to multiply. That's fine but:


Multiply darkens the blend, making it hard to see in dark places. So, I try an additive blend:


So that looks better. Only it does the opposite: in bright areas, its hard to see:


More so in very bright areas:


So in the end, I am forced to use a normal alpha-blend equation. It looks plain, but is sure to be visible in both bright and dark areas:



Unfortunately, you can't emulate the blend types in Photoshop like Overlay, because blending equations in videocards are fixed-function.

Here's the Unity shaderlab code for alpha-blended projectors:

Shader "Projector/Diffuse" {
	Properties {
		_Color ("Main Color", Color) = (1,1,1,1)
		_ShadowTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
	}
	Subshader {
		Tags { "RenderType"="Transparent"  "Queue"="Transparent"}
		Pass {

			ZWrite off
			Fog { Color (0, 0, 0) }
			Color [_Color]
			ColorMask RGB
			Offset -1, -1

			Blend SrcAlpha OneMinusSrcAlpha

CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_fog_exp2
#pragma fragmentoption ARB_precision_hint_fastest

#include "UnityCG.cginc"

sampler2D _ShadowTex;
float4x4 _Projector;
fixed4 _Color;

struct v2f {
	float4 vertex : SV_POSITION;
	float4 texcoord : TEXCOORD0;
};

v2f vert (appdata_tan v)
{
	v2f o;
	o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
	o.texcoord = mul(_Projector, v.vertex);
	return o;
}

half4 frag (v2f i) : COLOR
{
	return tex2Dproj(_ShadowTex, UNITY_PROJ_COORD(i.texcoord)) * _Color;
}
ENDCG
		}
	}
}

Wednesday, August 10, 2011

MeleeWeaponTrail: Another Unity Asset Store Submission

This is my second Unity Asset Store submission, a weapon trail effect for your character attacks. Props go to Forest Johnson (Yoggy) and xyber for the original code.



You can find the wiki page here: http://unifycommunity.com/wiki/index.php?title=MeleeWeaponTrail

UPDATE: Asset Store submission accepted! http://u3d.as/content/anomalous-underdog/melee-weapon-trail/2ck

Web build demo here: http://dl.dropbox.com/u/25260770/MeleeWeaponTrailDemo/WebPlayer.html

Tuesday, June 14, 2011

Funny



I hardly go out.

During the times that I go out, things hardly happen.

Today something happened.

I went out today to buy some PS3 games, and, funny thing, there's this person at the store, looks about at least 20 years old, and keeps on talking about American McGee's Alice.

He kept on asking questions and making conversation with anyone within his reach. What's up with this guy? From the way he speaks, you could tell he's not quite right in the mind, but well enough that he can go to a store by himself, and have his own cellphone. You can imagine that creates some problems everywhere he goes.

Eventually he reaches me, then goes on to say about American McGee, then about Suda51, about the origin of the 51 in his name, then about how its the same with how the word Konami came out to be. I'm mildly surprised Madness Returns came out already; I hadn't checked the release date at all.

He picks a copy of Duke Nukem Forever, goes on about the fact that it was 15 years in the making, "close to 20" he says. Talks about how the game's different: Duke, he's not eeemmo, he says, because the aliens took his... his girls.. he's fighting for his... uhuh pleasure, yeahhh.

He was obviously recounting what he heard in the developer interviews (I know, I saw those too). In that brief moment it made me think about what I'm making. I had better make sure Garwolf is a well-rounded character and I hope he won't be labeled "emo".

Because labels are dicks.

Even while I was finishing my purchase at the cashier he was still going at it. Me and the store people smile knowingly. Oh boy, we thought.

I do my best in not being a dick and even engage in conversation a few times; I was surprised Suda51 worked on an EA game, though I think he didn't get that I meant that.

Out of that guy's hearing, the store guy talks about how that person actually went through all of the store's branches, and that he even punched another person once, supposedly trying to recreate some scene in a game. Oops.

Walking home I thought, I'm just as much as a loser as that guy. The only difference is, his ignorance is his bliss.