Skip to main content

Posts

H5 Engine Comparision

Recently i was trying to get a game out for the mobile web. I wanted something that would be able to publish light weight game and had a good workflow for artists and developers to get things going as soon as possible. Requirements: Support for Mobile Web GUI for level design Workflow for UI animation Support for 3D games Ability to publish for Native Mobile [Good to Have] The candidates: Unity (unity tiny)  Cocos Creator PlayCanvas Three.js I understand that other than the first two most of others don't have a way to publish to native mobile but the reason i choose them is because mobile web was the first priority and all of them seemed to have good support for it. Criteria Unity Tiny Cocos Creator Play Canvas Three.js 3D WebGL ❌ ✔️ ✔️ ✔️ UI Animation ✔️ ✔️ ❌ ❌ Particle Systems ✔️ ✔️ ✔️ ❌ Editor Support ✔️ ✔️ ✔️ ✔️ Custom Shaders Exp Exp ✔️ ✔️ Native Mobile ❌ ✔️ ❌ ❌ Based on ...

HTML5 games with Python

I am a big fan of HTML5 games. I understand their limitations but given the trend of high powered mobile devices and ubiquitous nature of the web, i believe it's one of the best ways to distribute simple and light weight games. I've been participating in PyWeek for a while now and have been trying to pickup and use different libraries available in python for game dev. The last two times i participated in PyWeek, i added partial support for cocos-creator in cocos (python version of cocos2d-x). This helped me accelerate the Development but i was always stuck with making builds that would fail on different operating system due to library handling etc. This is when i started to look for deploying Python code to web.. the first time around the only thing that i came across was pyjs/pyjamas which i was unable to get started with as they were blocked at python 2.7.* I needed something that worked with the latest of python. Recently though i came across " Transcrypt " ...

Network Time Sync

Synchronizing the time between client and server is pretty complex, I initially naively thought that using System.getCurrentTimeMillis() would somehow magically solve my problem. I realized quickly that this was not going to work as this is dependent on the current system time setting. The most appropriate solution to the problem is to use a common NTP server and ensure that the time is set right, but this is rarely a viable option when you have to deal with consumer level apps. We have to therefore resort to re-implementing or approximating the time sync. After searching through the web, this is the simplest one i could find and is what worked immediately and fixed our issues with time sync. TimeSync Equations Based on the above equation, we are able to calculate the time difference between client and server time stamps and hence reduce the errors in physics calculations. 

Thinking in ECS

If you have been following the new developments in the Unity Game engine, you would have found that they have been focusing on performance and modular code. One of the outcomes of this is a new way of writing code called "Entity Component System" where "Systems" operate on "Entities" which have various "Components" within them.  The ECS name is specific to Unity naming convention this "paradigm" also goes by the name of "Data oriented Programming". This could easily be mapped to how "C" programming works, or in general any functional programming works i guess.. "Systems" == "Functions" "Entities" == "Structures" "Components" == "Data Types / Unions" If we had to write a game engine in C i believe any reasonable programmer would write it this way, there would be an array of structures which contain the "position, rotation, scale" informatio...

Bone Rush (PyWeek26)

I've been a regular participant in the pyweek contest. The last time i participated, i tried to use cocos-creator to work as editor for cocos2d (python) and was fairly successful in creating a clone of Reigns (a mobile game about making choices). This time i wanted to replicate the rush fight game, where the faster you tap the faster the game moves. It's pretty fun mechanic and would fit well with the theme "flow". So i got to work with the same workflow i had before, create characters in inkscape and create sprites to be used in game. For a while i pondered about supporting skeletal animation using cocos-creator setup but was not sure if i was going to find time to do it, so i choose to go with sprite animations instead. Creating the sprites was a big deal as i was not sure if i wanted to setup the character in blender / cocos-creator / Inkscape for capturing the animation images. Inkscape quickly fell apart as an option as there was no way i could keep track...

Unity Game (WebGL) as a Firefox Extension

Firefox is known for its' extensions. That's in fact one of the main reasons people still use it. They had to take a bunch of bold steps in the recent times to stay relavant, like ending support for older extensions, changing the security model and the api. Firefox  announced a new contest for addons, The Firefox Quantum Extensions challenge. I thought ill' give it a shot. I quickly looked up the documentation for creating an extension and looked pretty simple, there was this game for 2048 i was super excited to put games as extension, quick access short games might workout  i thought.. I wanted to check if i could use my existing game dev tools to create an extension.. hence Unity for FF Extension. I quickly exported unity game as WebGL and tried loading it as an extension. I ran into issues with something called CSP i don't remember seeing it before but here it was preventing me from loading the unity webgl game as firefox extension. After a bunch of mucking arou...