Import Assets from Blender to Unity

In the last blog post I created a terrain with trees and hills in Unity and added a First Person Controller (FPS) to navigate it. In this blog post I will add an asset from Blender into Unity with all the textures preserved. The default export options in Blender do not package textures. In the export (to FBX) dialog, you need to set Path Mode to ‘Copy’ and turn on the button (next to the select box) to embed textures. See the video below.

In the above video, I add a house (with textures for roof, wall and floor) created in Blender into the Unity scene created in the blog post mentioned earlier. The player can navigate inside the house. To prevent the player passing though the walls, I add a mesh controller.

-Ram Kulkarni

Setting-up Unity FirstPersonController in Terrain

Recently I attempted navigation of the player in Unity using its FirstPersonController component in a terrain environment. I had created character controller from scratch for the player navigation earlier, but wanted to use FirstPersonController because it makes development easy and has many features which can be controlled using configuration settings. And I wanted to do this in a terrain environment using Unity Terrain tools.

I have documented my learnings and steps I took to implement the above in following sections and videos. The focus was more on “How To” than creating a beautiful game scene. The final outcome looked like this –

Continue reading “Setting-up Unity FirstPersonController in Terrain”

Running Jupyter Notebook in Ubuntu Docker Container

Recently I attempted to run Jupyter Notebook in Ubuntu Docker container for a project requiring OpenCV and PyTorch. Sharing the Docker configuration files I used here.

docker-compose.yml

version: "3"

services: 
  ml-docker:
    build: .
    container_name: ML-docker
    stdin_open: true
    tty: true
    ports:
      - '8888:8888'
    volumes: 
      - $PWD/shared:/shared

Jupyter notebook listens on port 8888 by default. So, I am mapping it to the same port on the host machine. I have also created a folder ‘shared’ in the same folder where above docker-compose.yml is located. And I have made this folder accessible to the container using volumes declaration. The above file instructs docker to build Dockerfile in the same folder. Content of the Dockerfile is as follows –

Continue reading “Running Jupyter Notebook in Ubuntu Docker Container”

Setting up Ubuntu for HuggingFace

Just wanted to document steps I took to successfully setup an Ubuntu machine for using models on HuggingFace. Refer to https://huggingface.co/docs/transformers/installation for installation instructions for using Transformers module.

Ubuntu comes installed with Python3. I started with creating a new environment for the project. I switched to the folder where I was going to create projects/files for using HuggingFace

Creating new Python Environment

  1. python3 -m venv .env
  2. source .env/bin/activate
Continue reading “Setting up Ubuntu for HuggingFace”

Feed-Fish Game

This is another Unity game I developed recently, may be a bit silly one but I enjoyed creating it and learned a few new things.

In this game you navigate the fish to ‘eat’ numbers. Higher the number the fish eats, bigger your score. Numbers appear and disappear randomly and you need to make fish eat them before they disappear. Use the navigation control at lower left to move the fist. Here is the demo of the game –

Click here to play the game. It won’t run in mobile browsers. If you want to run the game on any Android device then you can download and install this APK file by sideloading. I don’t plan to publish it on Playstore.

-Ram Kulkarni

Online Multiplayer Snakes & Ladders

I had previously blogged about the Snakes & Ladder Game I had created. That was a multiplayer game but was not an online game – i.e. multiple people could not play the game together remotely. I had planned to make a true online and multi-player version of the game since I created the earlier version. In the last few days, I have made sufficient progress on the online version of the game, that I can share it with you. Please watch the demo of the game below.

Since I am using the same server for the backend of the game as the one hosting my blog, I have limited the number of simultaneous sessions. There is also the session timeout of 10 minutes, if there is no activity in the session.

Creating the online version was certainly more complicated than the standalone version – I had to implement the backend logic to create and manage sessions and implement a broker to facilitate messages/events to and from multiple players. But I have done sufficient server-side programming in the past and was able to implement that part of the game fairly quickly. However, implementing the game client in Unity took some time. Implementing messaging protocol, making sure the UI is updated from multiple event handlers in the UI thread and in general synchronizing parallel event handling took some time. But overall, it was a great learning experience.

You can access the same at http://ramkulkarni.com/Games/Multi-SNL/. Try this on your desktop or laptop computer and not on mobile. It is not optimized for mobile and will not work properly.

Update (15th Jan 2024): Android version is now available on Google Play Store.

-Ram

Snakes & Ladders Game

I have implemented another game using Unity, after my first Unity game, Single Wicket Cricket. The new game is Snakes & Ladders. You can watch demo of the game in the following video.

You can play the game at http://ramkulkarni.com/Games/SNL. Though the game is multi-player, it is not truly online multi-player game. I do intend to work on that in future. Also, the game is not optimized for Mobile. It does not display correctly in portrait mode in the mobile browser and text input field does not trigger virtual keyboard. But it should work fine in non-mobile browsers, so give it a try.

-Ram Kulkarni

My blogs/videos on Adobe Animate

I managed Adobe Animate team for a couple of years and during that time wrote a few blog articles and created feature videos. These articles and and videos were published on Adobe blog and Animate YouTube channels. Here I am just providing links to them –

Blogs:

  1. Adding Interactivity to VR-360 Content in Animate 2019
  2. Creating VR-360 Content with Animate 2019
  3. Exporting glTF from Animate

Download links for FLA files in the above blogs are no longer working. But you can download them from –

Videos:

  1. HTML5 Canvas Game – A playlist of 5 videos
  2. Creating picture puzzles with Animate

-Ram Kulkarni

Single Wicket Cricket – A 3D Game

I tried my hand at a low-poly 3D game development with ‘Single Wicket Cricket’ game. This is not a typical Cricket where two teams play against each other. In this game you are the main player – the batsman, playing against a team.

Video demo of Single Wicket Cricket game

Tap/click Bowl to start bowling action. You will be able to ‘Hit’ the ball once it is released by the bowler. You will be able take a ‘Run’ only if bat touches the bat, so there are no byes or leg-byes.

By moving different sliders you can control position, rotation of the batsman, strength and direction (up/down) of the stroke. Tap/click ‘Help’ button for more details.

The game is available to run in Web Browser or as a standalone application on Android devices.

Click here to play the browser based version of this game. Or type http://ramkulkarni.com/Games/Cricket in the address bar. Make sure to run the game in Landscape mode for the best experience.

Click here to go to Google Play listing of this app. Or search ‘Single Wicket Cricket’ in the Google Play app.

-Ram Kulkarni

Third Edition of My Book ‘Java EE 8 Development with Eclipse’ Published

 

Third edition of my book ‘Java EE 8 Development with Eclipse‘ is now published.

I had completely re-written the previous edition of this book. The third (current) edition has three new chapters –

Chapter 12Microservices, describes how to develop and deploy microservices. It also covers the deployment of microservices in Docker container.

Chapter 13Deploying JEE Applications in the Cloud, describes how to deploy JEE applications in Amazon and Google Cloud platforms. Specifically, it describes the deployment of applications in AWS EC2, Beanstalk, Google Compute Engine, and Google App Engine. It also describes Eclipse tools that can be used for deployment to the Cloud.

Chapter 14Securing JEE Applications, describes how to secure JEE applications using authentication and authorization features of JEE containers. It also covers some of the JEE 8 security enhancements.

You can find more information about outline of each chapter at https://www.packtpub.com/mapt/book/application_development/9781788833776

– Ram Kulkarni

Social