jueves, 17 de noviembre de 2016

Gladiator Heroes 1.4.7 Released in iOS & Android (In Spain so far)

After several months working hard on the online features, tools and gameplay, we have released version 1.4.7

We are getting close to the global launch, which is exciting and challenging at the same time.

Thankfully, I have been learning a lot about online programming, Unity, C# and gamesparks. I hope soon I have some time to write a post about the things  I've learnt. Maybe it will be useful for someone, maybe not. At least I will have a place to check all the things I don't want to forget :)

Enough talk, here you have the game:



jueves, 25 de agosto de 2016

Gladiator Heroes 1.4.1 released in Australia!

Very good news!

This is the first version with the online gameplay features I have been developing during the last 6 months: now you can play with friends and compete in the rankings and  discover new player division.

I have been using GameSparks to achieve it, a remarkable tool I'd recommend to everyone.

It has been hard and there is a lot of work to do, but I can say I am happy with the result!


jueves, 29 de octubre de 2015

Pirates: Treasure Hunter has been finally released

After 7 years, Virtual Toys, a Spanish company I worked for, has released this awesome MOBA.

In this project, I worked on gamplay features and physics for more than a year.


Well done guys!

lunes, 21 de septiembre de 2015

Resources Manager

Working 15h per day and updating a blog is not quite compatible. Anyway, the other day I saw tons of Resources manager code and I decided to play a bit with template to tidy things:

template <typename T> class ResourcesManager
ResourcesManager() {}

virtual bool Init() = 0;
void DeInit(void(*UnloadImpl) (T*))
for (std::map<const char*, T*>::iterator it = m_ResourcesMap.begin(); it != m_ResourcesMap.end(); ++it)


void Load(T*& pIn, const char * szName, void(*LoadImpl) (T*&, const char *))
std::map<const char*, T*>::iterator it = m_ResourcesMap.find(szName);
pIn = NULL;

if (it == m_ResourcesMap.end())
LoadImpl(pIn, szName);

if (pIn != NULL)
std::pair<const char*, T*> newPair(szName, pIn);
pIn = it->second;
std::map<const char*, T*> m_ResourcesMap;

Implementing LoadImpl and UnloadImpl for your specific resources should be enough to use it.

lunes, 10 de agosto de 2015


When you are trying to gold a game, crunching time for months and you find tons of leaks, bad designs, loosy code, you look back trying to figure out how you got here.

But that's futile, you have to deliver, and then these tools are really useful:


Thanks to DrMemory and Cpp Check teams, I owe you one.

martes, 27 de enero de 2015

Oculus Rift Dev: Day #4

8. Rendering to the Oculus Rift

The Oculus Rift requires split-screen stereo with distortion correction for each eye to cancel the distortion due to lenses. Two ways of doing it:

  • SDK distortion rendering approach: library takes care of timing, distortion rendering, and buffer swap. Developers provide low level device and texture pointers to the API, and instrument the frame loop with ovrHmd_BeginFrame and ovrHmd_EndFrame.
  • Client distortion rendering: distortion rendered by the application code. Distortion rendering is mesh-based. The distortion is encoded in mesh vertex data rather than using an explicit function in the pixel shader. The Oculus SDK generates a mesh that includes vertices and UV coordinates used to warp the source render target image to the final buffer. The SDK also provides explicit frame timing functions used to support timewarp and prediction.
8.1 Stereo Rendering concepts
IPD: Inter pupillar distance. 65mm on average
Reprojection stereo rendering technique: (left and right views generated from a single fully rendered view), is usually not viable with an HMD because of significant artifacts at object edges.

Distortion: The lenses in the Rift magnify the image to provide a very wide field of view (FOV), to counteract pincushion distortion, the software must apply equal barrel distorsion, plus chromatic aberration correction (color separation at the edges caused by the lens). 

The Oculus SDK takes care of all necessary calculations when generating the distortion mesh, with the right parameters (they depend on lens characteristics and eye position).

When rendering for the Rift, projection axes should be parallel to each other and the left and right views are completely independent of one another.The two virtual cameras in the scene should be positioned so that they are pointing in the same direction (maching real world direction) and with an separated by a IPD (adding the ovrEyeRenderDesc::HmdToEyeViewOffset translation vector to the translation component of the view matrix or using ovrHmd_GetEyePoses which performs this
calculation internally and returns eye poses)

8.2 SDK distortion rendering

The Oculus SDK provides SDK Distortion Rendering. Developers render the scene into one or two render textures, passing them into the API. Beyond that point, the Oculus SDK handles the rendering of distortion.


1. Initialization
  • Modify your application window and swap chain initialization code to use the data provided in the ovrHmdDesc struct e.g. Rift resolution etc.
  • Compute the desired FOV and texture sizes based on ovrHMDDesc data.
  • Allocate textures in an API-specific way.
  • Use ovrHmd_ConfigureRendering to initialize distortion rendering, passing in the necessary API specific device handles, configuration flags, and FOV data.
  • Under Windows, call ovrHmd_AttachToWindow to direct back buffer output from the window to the HMD.
2. Frame Handling
  • Call ovrHmd_BeginFrame to start frame processing and obtain timing information.
  • Perform rendering for each eye in an engine-specific way, rendering into render textures.
  • Call ovrHmd_EndFrame (passing in the render textures from the previous step) to swap buffers and present the frame. This function will also handle timewarp, GPU sync, and frame timing.
3. Shutdown
  • You can use ovrHmd_ConfigureRendering with a null value for the apiConfig parameter to shut down SDK rendering or change its rendering parameters. Alternatively, you can just destroy the ovrHmd object by calling ovrHmd_Destroy.

Oculus Rift Dev: Day #3

After many tries, it seems the oculus doesn't work on my laptop... fair enough. At least I had the chance to test it on my girlfriend's PC.

So I will keep taking notes from the documentation to allow my clarify how the oculus works:

7.1.2 User input integration

7.2 Health and Safety Warning
The warning will be displayed for at least 15 seconds for the first time a new profile user puts on the headset and for 6 seconds afterwards.

To support it:

  • ovrHmd_GetHSWDisplayState: reports the state of the warning described by the ovrHSWDisplayState structure, including the displayed flag and how much time is left before it can be dismissed
  • ovrHmd_DismissHSWDisplay: called in response to a keystroke or gamepad action to dismiss the warning.
(sample code attached)

To use the Oculus Configuration Utility to suppress the Health and Safety Warning, a registry key setting must be added for Windows builds:

(32 bits)
HKEY LOCAL MACHINEnSoftwarenOculus VR, LLCnLibOVRnHSWToggleEnabled

(64 bits)
HKEY LOCAL MACHINEnSoftwarenWow6432NodenOculus VR, LLCnLibOVRnHSWToggleEnabled