fbpx
You are here:Home-Arts-Creating virtual 3d world | Khurram Waris | Ioteach

Creating virtual 3d world | Khurram Waris | Ioteach

Innovation in Game Coding

I remember, a while back just after having finished A-Levels, when I set out to code my first game ‘shooter’. Game coding was also considered an art of a genius back then. In those days, most of the coding was done from scratch with little API, ‘Engines’ or frameworks that are available today to build the games. One had to be very imaginative with strong mathematics, physics, graphics designing skills not to mention good at coding to create a functional game. On contrary, today – the designers do not necessarily need to be adept at these skills nor do the games take longer to code. Innovation in game coding frameworks has its pros and cons. It is indeed beneficial to start teaching kids early without getting bogged down in to the unnecessarily details which they might not find engaging in the first place. The setback is the deprivation of fundamental knowledge and principles of essential maths, physics and other disciplines which are also essential for any career path including arts, drama, philosophy to name the few. For instance, mathematics, algebra, trigonometry has its applications in law, business, theatre.

Today, students do not have to learn equations, Pythagorus theorem, newton’s motion laws to work out Field Of View for the player. Ready-made, downloadable game engines and frameworks are available for students to start creating their own games. A notable precedent is Recroom which takes care of all the logic calculation for players to ‘Room-Around’ the field map. The earlier versions of recroom also dubbed ‘Circuits’ was slower executing less than 10 times per second. However, the later version, Circuit V2, implements advanced programming architectures to execute player’s interrupts, very close to real-time. Coders design rooms using ‘Event-Driven’ techniques which basically puts the processor to sleep during no activity or keys actioned by the player.

How I coded my first game in 2012

When I designed shooter, I did not use game engine or frameworks back then. I had an idea of how I could code and just found so hard to identify an easier platform. I took few photographs of sky, ground, walls, plants. I took all images that I wanted to experience around the player.

Then, after some initial editing in photoshop, I planned down in my head a full 2d/3d field map. I then added the images of sky, ground, walls around the field map. I identified starting position of player ‘shooter’ and other characters.

I wanted to use standard keyboard to manoeuvre the player. So I used numeric keys ‘4, 8,6,2’ for left, front, right, back movements. I was lucky to find the keyboard dll and used its ‘functions’ to identify pressed keys using corresponding ASCII characters. Likewise, I used spacebar for shooting. I managed to find a function written in C to load sound files which were also played every-time I hit the spacebar.

Player Field-Of-View and field map was dynamically calculated in terms of pixel values based on trigonometry equations. This was the hardest part but as long as field map and initial field view is completed, the remainder calculation is merely difference based on which keyboard ‘direction’ key is pressed. In principle, every-time a key is pressed, player navigates around the field map by fixed proportion and RGB is recalculated for the field map and reconstructed on to the picture display.

Ioteach Coding courses

Ioteach is innovating methodologies to teach coding and computer science using our unique approach. Our blend of tailored packages would assist with developing the core skills yet at the same time enjoying learning, creating and playing. If you would like to know more then get in touch.

By |2020-09-27T12:08:24+01:00September 18th, 2020|Categories: Arts|Tags: , , , , , |0 Comments

About the Author:

Khurram Waris
I am the administrator of the site

Leave A Comment

Go to Top