Skip to main content

Posts

Showing posts from 2019

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