Thursday 20 December 2012

DrumPuzzle: Source Code Released (Only RgsEngine)

My mission of creating a cool DrumPuzzle game for mobile has taken a turn with no more 'reinventing the wheels'. After squeezing lot of time from my personal life with going to the very basics to produce a creative work from scratch, I have realized that, I can be much more productive and creative if instead of going from scratch, I do connect existing pieces/open source/free software to create new solutions.

So I am freezing the coding/modelling everything for DrumPuzzle here, instead I am going to start using existing free/open source 3D SDK/Frameworks (I have few of them in my list) which provides easy port for multiple platforms including mobile with short learning curve. Will post separatly.


Details of the RgsEngine:
I created a basic engine with lot of goals in my mind earlier (Listed in my previous post) but with short of time could implemented the neccessary ones.


1. Load OBJ files exported by blender.
2. I couldnt invest time on integrating blender loader in the engine, so, created a naming convention for blender exported OBJ models to specify more information as an example:
rs=1;cs=0;sh=1;ctl=btn0;en=1;tag=sound_label;grp=options;
sh: Shader type
ctl: Control type
tag: Key to find specific model
grp: Group .e.g. to hide all controls falling in same group.

3. Texture based Shadowing technique to provide realism.
4. Mouse/Touch based 3D selection. The menu screen with the engine demos mouse click buttons and actions to give a 3D GUI experience
5. RenderTexture to update texture for various effects. Currently render texture is used for Shadows. Also I planned to add custom text rendering logic using RTs but I will do it in a different way with my next solution.
6. Portable on iOS/Android.  Though couldnt not build again for iOS/Android but I am sure there wont be issues other than shaders compilation, as GLES 2.0 emulators on different platforms are not so strict with producing  compilation errors.


NOTE: No Memory leaks checked, couldnt get time to clean/review the code.

The source code of the engine can be downloaded here:  Source: RgsEngine 
I have attached the source code with all the resources:  textures, models, blender, shaders etc. I have built and tested on Windows with VS 2008.

The code is small and easy to understand, almost 70-80% engine code is  fresh with few pieces imported from free/Open source software.



A brief intro about the implementation of the first screen shipped with RgsEngine: 

1. Each screen shown on a button click is a separate OBJ model.
2. Since GUI is not designed with generic design, so all other screens are hidden initially. When user clicks a button the other screens are hidden.
3. On Mode button click, screen shows option for multiple modes which sets a uniform variable to make a button appear selected.
4. Picture button shows 2 separate meshes on left and right walls with same texture ID assigned to both. One to show in selection screen, other to show currently selected/active picture.
5. Play button code is commented. This should trigger a scene change (in case of cocos2D).


The source code is free for any purpose. Idea is to share and spread knowledge. 



Sunday 9 December 2012

Drum Puzzle Progress update 2



Kind of final layout of the first screen (menu) of the DrumPuzzle game. Check Title carefully. This scene has most of the GUI logic implemented.
I have tried many effects like Bump Mapping/Reflections/Projections separately, all look awesome and after game is complete with required functionality, I will add those some  effects. Each button will have a glow effect in the first final version.

I have designed and implemented the core graphics engine part from scratch with special mesh naming convention to easily import .OBJ files in the engine exported by blender.
cocos2D-x cross platform 2D graphics/game engine provides the platform independence part which saves lot of energy from writing platform specific code.

Currently doing development on Windows 7.