Monday, November 15, 2010

Development diaries - October 2010 archive

Still haven’t found a satisfactory tool for curve creation. Fooled around with cocos2d bezier curve functionality a bit. It seems ok and it allows you to combine many curves to make a long, complex motion. The only trouble is, it is not very intuitive to create bezier curves in code. I found a java applet on the Internet that allows parametrization of cubic bezier curves using 4 control points.

Maybe we could use this tool to create a series of bezier curves which would then concatenate in the runtime for complex ship animation? 

Added support for bezier curves for animations. Using this framework along with the java tool below we can work out an animation solution which is data driven. I am still not convinced how intuitive the whole thing is though.

Committed latest build with non-linear animations 

Used Nick’s tilemap, after some formatting to make it adhere to the game’s rules, and it works fine. Just uncomment the related code line in GameLayer.m (method initMapAndEntities). I also implemented the “get me out of here” mechanic, now the player can quickly move her ship out of a tight spot by tapping at the desired target locations. I also added some padding in order for the player’s ship not to touch the screen borders. Does not work perfectly for some boundary conditions must look into this.

I also noticed that CCLabels absolutely kill performance (minus 15-20 fps)! I disabled them for the moment, must look at an alternative to render text to screen. Committed changes with commit #40. 

I had a discussion with Nick concerning how to create the tilemap/game backgrounds. He pointed out that the current implementation (one large image background and a layer for parallax) is not sufficient to create a real “depth” effect. He suggested that the background layer should be completely static, on top of that we could have a set of large sprites for planets and other large objects and finally just a single tileset for structures on planets. 

On top of all these we can add a particle effect to convey the feeling of motion. I can see his point, the mockup he has created with GameMaker (which does exactly what I described above) has a much better feeling of depth than the current implementation. Additionally, we will lose a tilemap layer which is always good performance-wise!

I will make some modifications to the code and to the way the game understands the tilemap description. In the meantime I have replaced the placeholder spaceship art with Nick’s spaceships and committed the changes. They look good, although a bit small. 

I have started implementing the changes we discussed with Nick. This entailed a few changes to the way the level is designed in Tiled as we will only have one tileset layer and the rest will be simple object layers for celestial bodies. Almost finished, no commit yet.

On a side note, Tiled is not very good as a level design tool... I would like to be able to see the textures of the objects I add, it is very hard to design a level with empty squares of undefined sizes... Also cocos2d seems to adjust objects positions as it loads them from the Tiled file to account for the change in origin (Tiled is top-left, iPhone is bottom-left), which threw me off for a few moments. 

Finished implementing new background/layer design. Now the parallax and depth effect is much improved and “realistic”. The way we design a level in Tiled has changed as well, see tilemap_test.tmx as an example of how it is done now. Must update Tiled document as well.

Nick suggested we turned off antialiasing (bi-linear interpolation) for as many textures as we can because hand-painted graphics are very detailed and many of the details get lost during filtering. I used nearest neighbour filtering for the player ship and it makes a noticable difference, so I will check other textures as well. Committed everything with commit #42 (i think) 

Started working towards restoring Tiled-game connection after the major changes we did to the way the level is designed. “tilemap_test.tmx” now is quite close to the way the level is specified, although it is missing some definitions for bonuses etc. Currently I have restored weapon, spawner and enemy definitions. Also the speed of the layers and horizontal motion range is specified in Tiled as well.

Committed changes, lost track of the commit no. I must update Tiled-howto to document those changes. Monday I will be off all day, I will continue work on Tuesday. 

Did a few changes to the game including changing the way the camera is handled and improved the grabber game mechanic. The camera is now fixed while the “world” moves beneath it in the Y direction. It is probably easier to understand and specify layer motion this way. The alternative way to create the parallax effect would be to specify each layer’s speed as a percentage of the camera speed (the closer to the camera the layer the larger the percentage). 

Also changed the way the grabber mechanic behaves near the screen borders, now the camera moves along the captured debris to allow for more space. When debris are release the camera returns to its original position. Saw the effects Nick created to the grabber effect, they are pretty good! I think the game will be impressive at least graphics-wise when complete.

No commit yet, I have to iron a few things first. Next major update will include the ability to set up entities in XML files external to the Tiled file. And I must start implemented Nick’s effects.

Kostas Anagnostou

No comments:

Post a Comment