Skip to main content

Posts

Showing posts with the label game dev

Importing Collisions UE5

Setting up colliders for static meshes within the engine is possible but is super cumbersome due to the UI limitations. The Static Mesh editor in UE5 isn't as full fledged as lets' say Blender. I've been trying to see if there was a way for me to import the collisions into UE5 without actually editing them in the UE5 editor.  I assumed i would have to build a custom pipeline to export these colliders from blender and import them into UE5, but its' not needed. UE5 while importing static meshes, is able to import and set colliders if you name them right.  Supported prefixes: UBX_ Box collision UCP_Capsule collision USP_ Sphere collision UCX_ Convex collision And if you want to add multiple colliders to a mesh, you just add _01, _02 ... suffix to the name of the collider. Here is an example of how its' done for a simple mesh named "Table" when imported into UE5 and open the Table static mesh, you should see something like this.. when you enable simple collisi...

GameDev on Steam Deck

I've got the 64GB og steam deck, After almost a year of using it i had to start using the deck as a development machine as well not just for gaming. I wasn't sure how it would pan out, theoretically everything should be possible but i had couple of major blockers .. I was running out of internal storage I needed to make sure that the engines i use work on SD. Cocos Creator (Windows / Mac) Godot Engine (Windows / Mac / Linux) Unreal Engine (Windows / Mac / Linux) Unity Engine (Windows / Mac / Linux??) The Internal Storage: Since this was a 64 GB version, i kept running into the disk space issues, i had to take the leap and upgrade the ssd. Fortunately i was able to find one on amazon which decently priced. I followed the IFixit's guide to upgrade the ssd: https://www.youtube.com/watch?v=GSvdsic4_dk This was crucial if i wanted to use the deck without thinking too much about what i was going to install on OS. So if you are like me and are really afraid of breaking something ...

Multiple sub-domains on a single lightsail instance

 I've been using lightsail to host a personal website which is great with the pre-configured lamp stack. It comes installed with bitnami package which comes with tools that make hosting an https server easy.  bncert-tool is the command line tool which is present in " /opt/bitnami/ " this is useful for setting up certificates for the website from letsencrypt,org . Bitnami on lightsail is installed using packages, so it comes pre-configured with the virtual hosts enabled. This is huge because it removes a bunch of steps that need to be done for hosting multiple subdomains on the same instance.  Setup Multiple Domains So the first step for getting started is to create a lightsail instance //or some other instance with the bitnami packages installed. I've picked lightsail with LAMP stack. This is pretty cheap at $3.5 per month on the lowest configuration and you can set it up for getting command line access.  Like i mentioned before bitnami when installed through system...

Tiny Town Racing

 I have finally released the Tiny Town Racing game on itch.io with donations enabled. I am hopeful this will bring in some revenue stream. Would be  great to have a steady steam of income through this channel.  It was a fun experience to go through  the process of building the customizations. I especially loved the state machine stuff and that i should stick to using it even if the game is small. The tradeoff for amount of code is worth it just because it is so manageable as the project goes on.  Enjoy the game online at Poki.  https://poki.com/fr/g/tinytownracing

Post Processing Effects (Cocos Creator 3.2)

Adding post processing effects to a game helps you change the visuals dramatically with fairly low effort. So when i wanted to change the look of the game that im making using Cocos Creator i couldn't find a well documented way to do it :( The only documentation available asks us to create a flow and im' not entirely sure where that plugs in as its' surprisingly light on details.  Check for yourself   Post-processing · Cocos Creator While I was searching for answers I found somebody suggest that this should be done the old-school way.  Render to Texture and a Full-Screen Textured Quad .  Fortunately this setup was pretty easy to do within Cocos Creator. Create a Render To Texture Resource Set the game Camera target render as this resource.  Add a new Camera and a Quad to the scene (set the flags to be different from the original game objects/cam hierarchy)  Create a new post-process material for assigning to the Quad.  Create a new Post-Process Ef...

Tiled TMX Objects to Physics Objects (CocosCreator3.2)

So i've been using the Tiled editor for creating the background for the pixel art game i am making. Somewhere down the line i decided it made sense to have the walls of the level be automatically generated based on the tiled Editor instead of setting it up in the Cocos Creator. So how do you do it? 

CocosCreator 3.2 Touch to Local co-ordinates 2D

There could be scenarios where you would want to understand the position of touch within the local co-ordinate system of a 2D node. Use-cases where this is useful Moving sprites within a confined location Virtual JoyStick implementation.  So in 3.2, you first need to convert the screen coordinates to 3D coordinates then convert the 3D world co-ordinate to the Local Co-ordinate of the node. This can be done as follows.  //in touch callback.      let   touchLoc  =  event . getLocation ()      let   screenTouchLoc  =  v3 ( touchLoc .x,  touchLoc .y,  0 )         let   screen2World  =  this .stageCamera. screenToWorld ( screenTouchLoc )         let uitComponent = this .node. getComponent ( UITransform )?           let   touchLocInNode  =...

Building an Endless Jumper using Godot engine

Godot has a lot of features that are specifically designed for the 2D game development. This also means that there is almost always more than one way to implement a game.  You can play online before you read any further: https://vkrishna.itch.io/color-jump Things I wanted to achieve: Flexibility to design chunks of gameplay Build a procedural system to use these chunks A workflow for quickly treating it the chunk changes Attempt 1: I created an array of strings which would represent each rite if the world. Though this sounds ridiculous at first it works for a jumper game as the horizontal movement is limited. var block = [ “[___________]”, “_______” ] The advice structure worked fine but I quickly ran into a problem. It was getting hard for new to visualise  what The chunk was going to look like. So I wanted to leverage the tile map editor from engine to do the level design as well Attempt 2: I had good format for describing the chunk but it ...

King (Flat Character)

Continuing from my previous work, I was able to put together a different character. I'm not sure if this looks good enough to pass as a viable asset for games, but here it is: King Atlas   King Character Ref for characters Denim guy Atlas

Customizable Characters

I've been following a lot of flat design trends for characters. I love the simplicity of the shapes used to convey motion. I wanted to take a stab at it and here are the results. Template Character Atlas for the character After creating this in inkscape, the next big question was to figure out how to animate. There were too many options around to achieve this (since i wanted to use this in games) Unity 2D Animation Tools Godot  Dragon Bones  Spine  And many more i probably don't know yet :) I eventually went with Dragon Bones even though it was a pain to get to work with it due to some "login" issues. Eventually worked with an older version which seems to be solving my purpose.  After spending a couple of hours tweaking and tuning the animation, here is what i have :) I've got a couple of more variants coming up stay tuned. 

Making games with cocos creator

I've gotten on to my second game using cocos creator and the experience has been pretty good so far. The UI is intutive, and the best part is that the engine is modular. you can literally strip away the pieces that you don't want and build a lean build that is perfect for the mobile web. The first game i created was an endless runner with a car in it to put mildly :) One major issue we have been facing was figuring out the particle system. There is a 2D particle system that can render as a flat plane in the 3D world. Fortunately it rotates in 3D and can be positioned in 3D. We had to tinker around but were able to get it to look the way we wanted it to. The second game is a rolling cube game, with some puzzle elements in it. I've been toying around with the idea of creating these "scenarios" for each section of the game and the user goes through them in a random order and it creates a good feel of randomness. This will eventually be used for creating a scena...

EnvMap in CocosCreator

We wanted to get envmap effect implemented to ensure that we are able to show shiny surfaces. Since it wasn't clearly defined or showcased for cocos creator, i assumed it might not work. I wanted to make sure its' easy to setup so we don't loose a lot of time setting up a whole new renderer. Fortunately, the cocos creator engine has already setup the required pieces in place to get this working. I've been able to get this working on Cocos Creator 2.2.2. Here is the gist for implementing the same. Here is how it looks in action :

Google Analytics in Cocos Creator Web Games

Integrating google analytics for a web hosted cocos game is similar to integrating GA in normal websites. Add analytics.js download code to index.html use "ga" object to track events in the game.  This gets tricky if you want to do the same for a game that is running from within a mobile app. i.e, if you are embedding the web build from cocos creator into an android / ios app and loading it from disk for displaying in webview.  Add analytics.js download code to index.html Make GA use localStorage if you are not allowing cookies in webview. Disable the protocol detection in GA  Following is the code snippet to do it: Hope this helps anybody who is trying to achieve the same :)

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...

VUI's impact on Development

Ever since the introduction of computers GUI (Graphical User Interface) has dominated the HCI (human computer interaction) space. This basically required that your development team had a developer + an artist this has been consistent across all development platforms Desktop / Web / mobile. For the first time in a while we might be seeing that configuration change to a developer + musician or a voice actor to address the new and up coming VUI (Voice User Interface). This just struck me as an interesting change because for most developers art has been a limiting factor, with voice user interface and the voice assistants being able to change their tone / voice on the fly a developer might be enough to deliver an engaging experience for the user. In other news, my first alexa skill has gone live.. not sure how it will perform as discovery is already a big problem for alexa skills but here is hoping for the best.  Here is the link to my skill on alexa skills store if you are interes...