Indievania is an online indie game marketplace for independent developers to sell their games directly to players, where 100% of the cost of the game goes to the developer. This allows developers to give the best promotions and deals possible to gamers. Customers can purchase games directly from the developers own merchant account, supporting the original developers and helping to fund further development.

Report RSS City of Steam Developer Journals - Coding 2012 01 11

Our latest Coding Developer Journal, very interesting.

Posted by on

Coding Dev Journal

Only just back from a long and glorious holiday in the wet and muddy Irish winter and immediately into the thick of the fray in the thoroughly tropical development ecosystem. The modeling and textual work for the World Mechanism project was completed in my absence, so now it’s full steam ahead to get the controlling and display code in place.

Which really should have been simple enough. User clicks on an area of the world surface, camera pans, travels and rotates to view the selected nation, and the flag and descriptions are populated. Nothing we’ve not done a dozen times before, including nice smooth camera acceleration.

Except the target point is moving. Ok, takes a little more thought to have the camera match velocities smoothly and catch up without either overshooting and doubling back (instant upset stomach for the motion-sickness prone) or decelerating and falling short, and having to accelerate and try again (which feels to me like someone having their very first driving attempt in a high performance antique race-car). But yes, the maths for “docking” with traveling bodies are a finished problem, and easily located online for anyone interested.

Except the target point is not traveling in a straight line. It’s circling the Pin (which I gather folks are calling “The Spire” now. Fair enough, though I preferred the watchmaker’s terminology over the religious).

So, circles… Ok, The guys at NASA deal with this continually. How hard can it really be? The target can be approaching, retreating or passing left to right (or right to left) or any where in between, so it’s got to be a universal solution. No subdividing depending on where it is relative to the camera.

Except the guys at NASA have it easy. Gravity just works automatically for them. And they don’t have poles twice as high as the diameter of their planet that get in the way. And the selfish blighters don’t share their work.

The solution took longer than it should have, and is best covered by a quick set of (oh so formal) dev notes…



So, yeah, eureka. Separate out the rotation, pretend it doesn’t exist and just accelerate/decelerate according to relative distance.

Except as far as the Unity Engine is concerned nothing in the scene is actually moving. It’s all one big animation. So determining the location of a given component or country on the map is not possible using the usual methods.


Sooooo… okay then… If that’s how it’s got to be…

Invisible objects attached as an anchor point on each clickable country using the same system as attaching weapons to character and monster hands (which obviously have to be tracked through the animations), and using those as target points…

Yay! Victory!

Which just leaves the question of how to add the cities and points of interest map entries for each region, so that the texts are correctly aligned, and the details can be shown/hidden effectively.

Well, that’ll be alright tomorrow.

I hope.

(There’s a reason the arts types hide their computers when I walk by).

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: