C# nanorc

May 22nd, 2012

Sometimes I need to edit .cs (C#) files from the command line. I couldn’t find a decent .nanorc file to highlight C# syntax in nano, so I’ve written one. I figure that someone out there might find it useful one day, so here you go.

## voxel's c# nanorc
## http://www.thomaspurnell.com/csharp-nanorc/

## Colours similar to visual studio environment, but grouped logically for easy recolouring -
## don't say I never do anything for you.
syntax "csharp" "\.cs$"

# Keywords

# types
color cyan "\"
# modifiers
color blue "\"
# statement
color blue "\"
# method
color blue "\"
# namespace
color blue "\"
# operator
color blue "\"
# conversion
color blue "\"
# access
color blue "\"
#literal
color blue "\"

# Comments
color green "//.*"
color green start="/\*" end="\*/"
color brightgreen start="/\*\*" end="\*/"

LD23: TerraBellum post-mortem

May 12th, 2012

Play TerraBellum here

As is traditional with my ludumdare entries, my most recent attempt was a bit crap, but was a good learning experience for working with Unity3D, the engine I implemented the game with.

I spent forever trying to come up with a decent idea for the theme ‘Tiny World’. Initially thought I might try and create a happy ecosystem game but decided I really wanted some explosions instead, so I went for something a little more violent.

What went right

The game looks reasonably nice. Very close to how I envisioned it. (Initial visual mockup)

Core gameplay mechanics were implemented in time. The player can build and edit their island and then send their island off to war. Serverside code for saving, loading, authenticating etc all turned out reasonably robust   (though you could cheat with a little effort).

What went wrong

Everything else. Most of what I did with this game was new ground for me in terms of Unity implementation, so took longer than I would have liked to get working. That said, I learnt a whole lot of new things, and discovered that some of my ideas of how Unity deals with basic things like prefabs and object hierarchies were quite wrong.

 

I used tilt-shift blur to try and make the worlds look tiny, but I don’t think it worked very well. It looks more like a shonky depth of field, and it doesn’t play nice with the particles. I think the models were too low poly, and there wasn’t enough variation in distance to make the tilt-shift work. Perhaps if I’d gone with a more realistic look for the islands it might have turned out better.

The editor is incomplete and is buggy. Islands can be built in invalid configurations, sometimes money seems to mysteriously disappear or be created from thin air.

Audio didn’t get much attention, last minute job with (the ever useful) bfxr, and I didn’t have a chance to even attempt music (probably for the best).

The battles. Damn. What a joke. Needed at least three or four more hours to sort the fighting out. If I’d started immediately on this game idea I might have had time, but who knows. The turrets don’t aim and just shoot (almost) straight forward, with a little random deviation. I thought people would just modify their island designs to compensate, but instead they just quit when they realise their guns aren’t going to hit anything. The battles time out after approximately 30 seconds, so they shouldn’t have to wait long, but apparently the lack of feedback suggesting that a timeout would occur doesn’t help people wait patiently.

Mostly though the game lacked sufficient feedback. It’s not obvious what is happening within the system unless you wrote the system.

The Future

TerraBellum deserves to be cleaned up, debugged and made available for play. I’d like to play the game myself even, so it can’t be completely worthless. Perhaps after ludumdare voting ends the pain of coming last will motivate me to fix the game up (because LudumDare is all about winning and losing).

I’d quite like to expand the game a bit further too, add some additional complexity through additional building types, the ability to upgrade turrets ala tower defence.

 

Connectors

April 10th, 2012

Use left click on blue power sockets to make connections, left click cables to remove, scrollwheel on lever to control generator speed.

Experimenting with a connection mechanism for transmitting power. Currently all objects have an energy capacity so a power outage does not immediately power down the devices.

Solar one

March 19th, 2012

Quick solar system demo to test a few things out in Unity. Float accuracy is going to cause some issues with astronomical distances, will need to find a Happy Scale at which to simulate. Too large and accuracy goes out the window at distance and minimum increments become too large, meaning that any movement at a significant distance from the star will be really jumpy. Too small and accuracy problems occur on the other end of the spectrum. Obviously the naive approach is not the best here. Suspect I’ll have to manage local sets of imposters for stellar bodies, but it’s going to make all the various views much more complex to write :(

Rambling non-update

February 5th, 2012

So at the moment I have a Normal Job. It’s completely unrelated to game-dev, but it is only a 4 minute walk from my home, so that’s a plus. I’d say that the job takes all my time leaving me without a chance to do any game-dev, but I’m normally home by 5PM. Honestly I’m just a bit lazy with it all lately.

I have grand ideas (don’t we all?) about The Game that I need to create. I make occasional progress and then start over when it looks like it might actually be approaching something playable.

But each iteration is better than the last.

The current attempt is in Unity. So much potential with Unity. So much easier for a single person team to get things happening without spending spending forever cobbling together an engine. But Unity isn’t perfect. The free version is tauntingly hobbled with the pro features dangled just out of reach. Particularly frustrating is the lack of full screen shaders in the ‘lite’ version, and also real time shadows. Shadows never seem that important until you actually see a scene come together and realise that everything appears to be floating without the shadowy visual cue indicating ground contact.

But what the free version makes available is substantial. I’ve written a custom material shader for some deformable, procedurally generated terrain (not at all like Minecraft, I assure you). The networking components seem robust (when used properly, unlike in my Ludum Dare 22 entry :) ). Blender importing doesn’t work well for me with new versions of Blender, but exporting to .fbx from Blender and dragging the file into Unity for an instant import is quick and painless, I’ve not run into any of the problems I’ve experienced exporting from Blender to Panda3D. Unity’s .net reflection magic near-instant super-compiling is amazing (or is so the 99.9% of the time that it doesn’t bug and require a unity restart) and makes for a tight code-test-code cycle, comparable to interpreted python with Panda3D.

Anyway, I’m writing a game. It’s huge and might never be finished, but it is the game I want to play. So I’ll keep writing a method or two every chance I get and someday maybe you’ll play it for a couple of minutes :)

Have a not very exciting screenshot of my shader doing what it does best, shading.