I just started porting Honor and Money to the Mac yesterday. Having not used Torque for almost a year, there have been tons of WTF moments trying to get the it working. Initially I wanted to do a straight port, but I figure I should also fix a lot problems while adding a few more features:
- Potential for Multi-player support. Right now the codebase makes many single player assumptions. I need to re-thinking and rework some of the scripts and engine code to make it ‘work’ again with networking support
- Move save system to something better the script files, probably sqlite.
- Cleanup the script. While I will never be free of it, much of the scripts have alot of junk in it. Same with the assets
- Migrate from 1.4 to 1.5.2 Torque Game Engine. I’m not even thinking of getting it on iOS at all, well unless people ask for it and it makes sense business wise. It’s a old engine, but the game itself has great art and graphics so shouldn’t need to do much but find a high quality splash screen logo;P
Working with Honor and Money has given me flashbacks on how Garage Games killed their own goose though but releasing multiple engine versions on the same platform. There was seldom an upgrade path(or it had a lot of fine print) and the convenient excuse of ‘You have source’ doesn’t go well while plowing through the code. A Game Engine is a cumbersome beasty even if you have written yourself already.I tried using Torque Game Engine Advanced, the Advance Engine they promised to develop for the longest time then they dropped it and started selling Torque3D which was their ‘new engine’. That was the last straw for me. I am sure they comforted themselves by saying that other people shipped stuff before on it which is OK if you can get support rather than step trace debugging through code to try to understand it.
Enough with the ranting…Here is the moment of Zen…1 level loaded…working but horrible hacked camera….
Components are being used in most modern game engines. My favorite (because of it makes sense to me is the PushButton Game Framework). I like the design behind it. So when faced with developing a game using Cocos2D, I tried figuring out how to approach it architecturally.
Cocos2D is a fairly mature framework and you might as why put something on top of that. I had the choice between choosing a Model View Controller Architecture and a Component (Composition Approach). I chose Components easily. I’ve only been working with the framework for a few days but I have already got that “wow” that makes more sense now feeling.
For example, here is some code to add a entity with a sprite renderer:
_entity = [[BBREntity node] retain]; BBRImageRenderComponent *renderComponent = [BBRImageRenderComponent node]; [renderComponent loadImageFromFile:@"test_image.png"]; [_entity addComponent:renderComponent name:@"Render"]; _entity.position = ccp(100,100); [self addChild:_entity];
And then here is how you add a touch component to it to make it do something when you click on it:
_entity = [[BBREntity node] retain]; _entity.name = @"Entity 1"; BBRImageRenderComponent *renderComponent = [BBRImageRenderComponent node]; [renderComponent loadImageFromFile:@"test_image.png"]; [_entity addComponent:renderComponent name:@"Render"]; BBRTouchEntityComponent *touch = [BBRTouchEntityComponent node]; [_entity addComponent:touch name:@"touch"]; _entity.position = ccp(100,100); [self addChild:_entity];
Simple huh. Each entity is added to the layer and that added to the scene. You can see the similarities to the PushButton Game Framework ;P
I have also implemented a way to add/remove/dispatch events inside of components plus a hash lookup system to manage entities.
Next on my list is to implement some audio components then I can start using it to build my game. Unfortunately no physics components yet because the game I am working on doesn’t need it.
After a fair brief stint of working on a Native Objective C App (A Non-Game…Shock and Horror), I am finally back to working on games. The 2 or so months I spent ‘learning’ Objective C was actually a nice break from normal development and gave me a greater sense of confidence in being able to add/extend functionality when need to on iOS devices. Prior to that I was very much looking at things purely from a C++ point of view and trying to ‘avoid’ using any Objective C.
The best big of strangeness was making sure I got my head wrapped around Objective C memory management. With C++ it was new/delete and life was easy or you could use Boost to smart ptrs and so on. With Objective C, I couldn’t figure out why my memory was going out of scope (Oh you do a retain), the way it handles private instance variables and a hours of going “Oh that’s what you want me to do”.
Now i’m back to Game Development, I am using Cocos2D for development. The biggest reason is to keep the footprint small because I am looking at how games instead of strictly always running stand alone can be packaged with other Non-Game Apps.
What I learnt from Last Call, is that there is just too many games out there on the iTunes. They are all fighting for space and customers simply don’t have the time to try them all. With this is mind (and being the new year and all), I thought a more prudent approach was to look at what customers are interested in first of all. You know real people, you want to reach with your games. For example interests such as food, fashion, cars, sports etc all need Apps done. With In-App purchase you could package a game with a clothing theme in a Fashion App.
Well that’s what I think anyways. I’ll let you know how this new company strategy when the Apps come out.