BLACKISH DEV BLOG Support
 

 

2010++;

2010 has been a pretty damn good horrible year for me.
Age of Curling sold extremely well (at least for a game about curling), I got married, became a father, moved to the countryside and learnt that I’d have to undergo brain surgery again.
The year started out with me working on a prototype for the next Battle Bears game for Skyvu and releasing a PC/MAC port of Age of Curling. I knew I didn’t want to do all the coding on another BB game all by myself, so I got some very competent help, and a couple of weeks later, when I learnt that my brain was acting up again, I left it for him to finish and took a long while off to prepare for the baby and nurture a well-deserved depression. (You know, I kept telling people that I’d rather kill myself than go through that again, but now that I was about to be married – with a child on the way – it was no longer that simple… but well, I guess it never actually is that simple anyway…)
Eventually I managed to convince myself that it could be much worse and at least this time I’ll be prepared for what’s to come. And so I got back to work and started working on some prototypes… Most notably (as in: I hope to finish this one someday) a SciFi adventure.
When the baby came I took a few weeks off to support my wife, and afterwards I didn’t want to start any big projects because I though I was going to be called in for the operation any day. So I started working on smaller stuff and reusable pieces and that’s how GameAssets.net happened.
When it became apparent that the OP wasn’t going to happen in 2010, I finally decided to start fulltime work on a new game. And this is where I am now. Working fulltime on a new game.
My super-secret plans for 2011? Embrace open development, finish the new game, survive, recover and maybe even finish another new original game after that.
3 Comments

Lightmapped Planets

And this is why I needed that shader. Lightmapped rotating planets where the lightmap rotates in the opposite direction of the mesh (I’m animating the TextureOffset of the Material)
3 Comments

Unity: Minimal Lightmapped Shader

With some nice help from the #unity3d IRC channel, I managed to build a Minimal Lightmapped shader. All it does is multiply a lightmap with a texture. And nothing else. No lighting, nothing.


Shader "Minimal Lightmapped" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_LightMap ("Lightmap (RGB)", 2D) = "white" {}
}

SubShader {
Tags { "RenderType"="Opaque" }
Pass {
SetTexture[_MainTex]
SetTexture[_LightMap] {
Combine previous * texture
}
}
}

}

Any suggestions for a good book about shader programming? I’d like to get into it some more eventually…

1 Comment

Unity: Easy mistakes to make: NPOT GUI textures scaled to POT

If you import non-square images into Unity 3 it automatically sets the texture import setting Non Power of Two to ToNearest. This will cause your image to be scaled to fit the nearest power-of-two dimensions. Now it can be compressed – yay! Or wait… If you want to use for a button or box or something in a GUISkin, then this will break your GUISkin since your carefully measured values will no longer be valid and it might not be immediately obvious why it looks wrong…
Well, you could deliberately set them to a certain POT size and calculate values that would work with that size, but I’ll always prefer uncompressed GUI images over compressed once. (or at least until memory runs out…)
Note to self: Add to list of things to do once I retire: Write a script that automatically calculates and adjusts the border values of all elements where a NPOT image has been scaled to a POT.
Leave a comment

Unity iPhone 1.7 with SDK 4.1

Problem: I have SDK 4.1 installed and try to make a build with Unity iPhone 1.7 (iPhone SDK version set to Unknown). The build doesn’t work on iPhone 3G, because it says it was only made for armv7 architecture and the device is too old to run it.

Solution:
• Select Targets and Unity iPhone in the left pane of XCode and click the info button (or right-click and choose Get Info)
Build Tab – Set Architectures from Optimized (armv7) to Standard (armv6 armv7) - Hint: you might want to also set the iOS Deployment Target as low as possible while you’re in there…
• In the menu choose Project > Set Active Architecture > armv6
• Build and run on iPhone 3G!
Leave a comment

The downsides of using middleware

Unity 3.0 is out! yay! and nooo! Because this will be the death of Unity iPhone 1.7. “No problem, just upgrade your project to 3.0″ you say? “Well, it’s not that simple” I answer.

A lot of stuff changed, a ton of great stuff was added in 3.0. But PhysX was upgraded to a newer version and behaves very different now. On Age of Curling I spent a lot of time tweaking the physics, so upgrading the project to 3.0 breaks it completely and this won’t be easy to fix.
So two options for me: Do I spend a lot of time trying to upgrade the project, just so I can continue to release updates? or do I continue to work in 1.7 until the day comes where Apple has added enough changes to the SDK and 1.7 will finally no longer cut it?
I chose the second option for now and just hit the first hurdle. I’ll probably make a new post about it and delete this angry mumbling of a post… Or maybe I’ll post it just so the last 15 mins don’t feel completely wasted.
Leave a comment

GameAssets.net

An old new project of mine finally came to life:
GameAssets.net Logo
Top quality assets for indie game developers – so far only interface-related things though.
Visit GameAssets.net and/or follow us on twitter
1 Comment

Unity: Have scripts run while the game doesn’t

There’s a way to force scripts to run even if the game is not running in the Editor:

In Javascript, simply put this on the top of the script:

@script ExecuteInEditMode()

And for C#:

[ExecuteInEditMode()]

2 Comments

Unity: Dates

An example of how to deal with dates (more info here):

var day1 = new System.DateTime(2010, 3, 12); // Year, Month, Day
var day2 = System.DateTime.Today;
var timeframe = System.TimeSpan(8,0,0,0); //Days, Hours, Minutes, Seconds

print(day1); //output: 03/12/2010 00:00:00
print(day2); //output: 03/17/2010 00:00:00

print(day2 - day1 + " < " + timeframe + " ?"); //output: 5.00:00:00 < 8.00:00:00 ?

if(day2 - day1 < timeframe) {
print("Within time period");
} else {
print("Time period exceeded");
}
Leave a comment

Maximum Texture Size

All textures bigger than 1024×1024 show up black on old graphic-cards. The game runs normally, but it seems to ignore those textures. It would be easy to fix – I could just make the textures smaller – but that’s not a perfect solution…

So I searched for some way of getting the maximum texture size that the system is capapble of displaying, but I found nothing.
The best solution I have so far is to have the lower res texture on by default and only if(QualitySettings.currentLevel == QualityLevel.Fantastic) I load the bigger one from the Resources into the material.
Got a better solution? Please let me know! :)
Leave a comment