Sunday, January 25, 2015

Global Game Jam 2015

About the Game:
This year's theme was "What do we do now?"

The Maze is ALIVE.. ALIVE.. you hear ?
You and your friend have to escape alive and sane.

There are multiple exits. Some are blocked, some are not. You (green color coded) have to exit through your exits (green color coded). Your friend (red color) has to exit via their designated exits (red color). But there are door blocks stopping you from escaping via some of your exits.

Oh! look there is switch some where in the maze to make those obstacles disappear. But you cannot pull its trigger. Nope. Your partner (other player) has to do that for you. And vice versa, you (blue) can tap the switch to destroy the door blocks for your friend's exits(red).

There are some unhindered exits, that you can escape through. But what about your play pal? If they cannot escape from the maze because all of their exits are blocked, and you got selfish and left them to die in maze, you don't win either. You both have to escape in order to win the game and laugh about it later.

The maze is alive and crazy. It can make you lose track of yourself and think you are invisible. You have to count your steps( imagine proper movement count) to exit when invisible on screen.

Sounds Easy?
You have to escape, and you have to help escape your friend,  in exactly half a minute. Just 30 seconds.


Technical aspects:

Maze is procedurally generated every time game restarts, by using perfect maze generation algorithm (Recursive Division). Number of exits change each time, and door blocks change location and exit doors on each run. Switch's location and players' location changes randomly at every restart.
Simple collision exits, where the players if they bump into each other, cannot proceed, and one has to leave way for the other. After all, this is a cooperative game play mode.

First Game Jam for me. And first time I am using Unity for a concrete , non prototype game.

Code here : https://github.com/swtsvn/GGJ15Sujatha
Global Game Jam Page here : http://globalgamejam.org/2015/games/haunted-maze

Page is yet to be complete. Check back soon.

Thursday, February 13, 2014

Beginners GPU Debugging with Visual Studio 2013

I decided to try out the new GPU debugging option with VS 2013 Professional. It was also available in VS 2012. But couldn't get a chance to try it out with 2012.

So here goes my experience. Hope this helps out anyone else interested in GPU debugging with Visual Studio.
Please Note:
I am assuming people who are reading this blog would have beginner's level knowledge about GPU debugging. If not, I would suggest getting acquainted with GPU debugging using any tools including AMD'S GPU Perf that is available for free for GPU debugging on Windows platform, or "PIX for windows" by Microsoft, before continuing to read this blog. This is not to say that this blog is of any different level. This blog is again beginners level GPU debugging with Visual Studio 2013. . This is to just inform that prior knowledge is required and can be gained using Freewares provided by GPU Chip Giants like AMD and NVIDIA and Microsoft.

Also the GPU debugging is a feature supported only in VS Pro and higher models of VS

------------------------------------------------------------------------------------------------------------

1. GPU Debugging had to be enabled for the project. I used the instructions here http://msdn.microsoft.com/en-us/library/hh873126.aspx
-The option for accelerator in my project said GPU Software Emulator though. The code was not written with accelerator::direct3d_ref accelerator in mind.

2. Ctrl+F10 (Run to Cursor) Debug option did not work as expected. Did not break anywhere, not sure if it is because the project had disabled cursor in its code, or due to some other reason.

3. Debug -> Graphics -> Start Diagnostics Started the Game, and allowed to capture frame by hitting "Print Screen" button.

4. Once the project is exited, now it is time to debug those captured frames.

5.Double clicking any frame, leads to draw calls display, for that frame. The API calls could be searched within that Graphics Events List Window.

6.Double clicking on each draw call displays RenderTarget with the objects drawn so far in the window marked "Graphics Experiment.vsglog until that draw call, like any other good GPU Debugging tool.

7.Clicking on the link ID3D11DeviceContext shows the context, textures, raster state etc in D3D11 Device Context Window.

8. The pixel shader and vertex shader did not show the source code, most likely because the shaders were not compiled with debug info.

9.I wanted to verify why a certain object did not render on screen, so I right clicked the draw call in the Graphcis Event List and invoked "Pipeline Stages" Window

10. Clicking on Vertex Shader Play button Brings up the Shader debugging window. It shows disassembly code now because the shader was not compiled for debug. Same goes for pixel shader.

11. Looks like the mesh drawn is of size 0, meaning Scale was set to 0 in code. Debugging into code, the issue was fixed happily. Thanks to VS 2013 GPU Debugging.

12. There are other cool features as well and much more to experiment with.  For e.g. you can view frame rate for that frame (Vertex Shader.png -> Advanced tools -> View -> Frame Rate).

------------------------------------------------------------------------------------------------------------

All of this is pretty cool. The reasons given by Microsoft as to why we need VS GPU debugging when there is PIX for Windows (as part of DirectX SDK), is that we can also add code to capture frames, for applications that run on tablets or devices that do not have visual studio, then later debug those captured frames using Visual Studio, which sounds pretty good in terms of flexibility and in terms of game development or application development for mobile platforms. If you have tried this feature, please do share feedback on how this flexibility scores in your opinion.

One major concern would be running out of memory in VS 2013/VS 2012. Big projects that run fine in 2010 seem to crash VS in 2012/2013. High RAM consumption was always an issue with Visual Studio. But that is a altogether totally different topic. So lets not dive into that here deeper. But if you have experienced it, feel free to share your opinions on it.

Ending my blog here. I will update as much frequently as I can.

Monday, February 22, 2010

It is interesting to learn about development of facebook app "Farmville" and other Zynga games. I personally liked farmville because it always came up with new stuff to interest and retain players. Just when I would think that clicking each tree to harvest was kind of a cumbersome task, farmville team would launch a new cool feature like adopt a lonely reindeer, or christmas tree, or pet cats and gain ribbons to keep me hooked on to the game. It is refreshing to hear the same thought from the Chief-game-designer of farmville: Brian Reynolds. Please watch the video below to learn more about farmville-behind the scenes information.

Monday, February 8, 2010

Usability: the least you can do

The following is a video that I found interesting on common simple things to do about website usability that could possibly increase market value and viewer rate of a website. Here goes the video of Steve Krug's presentation

Tuesday, September 22, 2009

2.5D

learn a technical term:

what is 2.5D?
2.5 D means 2D graphics manipulated to provide 3D effect. the graphics is not actual 3D but 2D, programmed in such a way to make the user think the scene is in 3D

Examples:
increasing the size of an object makes it look like the camera is moving towards the object

placing billboards of texture at different sizes gives a feeling of depth. for e.g placing grass blades at different sizes give a feel of whole grass plains

why 2.5D?
3D graphics computation is expensive in terms of time and memory. hence create 2.5D to give cheap 3D effects, and making the human brain think that the scene is 3D

games using 2.5D:
Outrun (1986), the car moves in a single direction, while palm trees on left and right side of road are placed at different sizes to simulate depth.

Sonic the Hedgehog for the Sega Mega Drive (Sega Genesis in the US) uses parallax scrolling (placing different 2d background images as different layers, to create 3d effects)

Nvidia's PhysX

I am developing a game for one of my courses, and for that I am planning to create a physics world. Well why? you may ask. i dint come across a game that did not use any sort of physics engine especially when it is a physics based tower building game.

So I am researching different physics engines like box2D, bullet and Nvidia's Physx.
Here is what should be done to install and use Physx in Windows Vista from scratch. I have sequenced the steps after many trial and error operation on my computer as decribed after this section.

1. update drivers through laptop manufacturer, as folows:
computer->properties->device manager->display adapter->update driver.
Mine was Dell with windows vista

2.nvidia does not seem to give drivers for laptops, it provides drivers only for desktop, or so i heard. Scan your system for nvidia recommended driver by going to nvidia download driver home page, and using option 2. This option works only in IE/firefox. Download and install whatever driver package that nvidia suggests for your computer.

3.installing the nvidia driver automatically installs physx system software, so no need to do it seperately. however if you still want to manually install it for some reason, then go to http://www.nvidia.com/object/physx_9.09.0814.html to install physx system software

4. install physx sdk from http://developer.nvidia.com/object/physx_downloads.html

5.goto programs->nvidia corporation ->physics control panel, and see if demo works fine on your system. or run physx viewer to see if it runs properly on your system.

-----------------------------------------------------------------------------

Here is what i did to install and try out the Physx sdk 2.8.1 in Windows Vista.

1. install physics system software v9.09

2. install phsyx sdk v 2.8.1

after installing both softwares, I went to Physx control panel only to see the following screen.
Demo:

which should look something like this

The settings tab looked like this

which should have looked something like this since i have Geforce 8400 MX video card


hence i went to http://www.nvidia.com/Download/index.aspx?lang=en-us to install nvidia drivers for vista v190.62, since obviously they are missing in my system.
But during setup the following problem occurred


After researching the net, i found out that the drivers first has to be installed through Dell's website for some weird reason. Hence went to computer->properties->device manager, and right clicked display card to select "update device driver"



after the driver got updated through Dell, i restarted my system, and ran nvidia driver installation package again to get the same error, but this time after the setup exited, it gave me option to "install using recommended settings" which i selected. It gave me the following error.

researching the net, i found that nvidia drivers are for desktop machines, and not for laptops. for laptops, the drivers has to be installed through manufacturers, which i already did. so why did it not give me support for physx yet?
I did a system scan from the driver download page of nvidia, to see what it suggests for my system, and if it is different from the one i tried to install.
the results as shown in image below

image

indicate that my system needs version 186.81 drivers. I downloaded the exe file (which took more than 30 mins to get downloaded), and ran it. luckily it did not give any error, and installed required drivers on my machine. Then i restarted the system, and ran physx control panel to see Nvidia's control panel working properly. Then i ran physxviewer and it also ran properly. yay. now i can play with my physx.

Wednesday, August 12, 2009

Mingw + DirectX

I am currently a student at University of Illinois, Chicago doing masters in Computer Science with focus on graphics programming. I decided to learn directx and what could be a better way to do that other than programming it?. I have microsoft Visual c++ installed on my system. But I am a big fan of g++. Hence I decided to do a small project with directx graphics and mingw compiler.

Trouble starts here. There is very little information on the internet about combining directX and mingw. Most of the users seem to use DevCPP or visual c++. Anyways without losing hope, I searched and found this useful website by link. Having this page as foundation I started the installation process. I thought to myself "what if there is little or no information about this topic on the net? I will experiment and write a blog about it" and here it goes.

I already have mingw's latest version. To learn more about Mingw with Opengl please visit my "Mingw + glsl" blog. I also have mingw utilities to use the reimp tool. Now reimp tool is used to convert *.lib files to Mingw compatible *.a files.

Next I downloaded directx sdk for windows Vista ( And yeah I have Vista) . Installed directx to C:\Program Files\Microsoft DirectX SDK (March 2009). Now to make directx libraries compatible with Mingw, I used reimp tool to convert all the *.lib files of C:\Program Files\Microsoft DirectX SDK (March 2009)\Lib\x64 to *.a files. I moved those reimp'ed files from to C:\MinGW\lib\directx. Created a new folder directx under lib for directx libraries.

Then I moved header files (*.h) files from C:\Program Files\Microsoft DirectX SDK (March 2009)\Include to C:\MinGW\include\directx. Directx folder will not be there under include, so created one.

Now in the program, include the header file as #include and while running compile command include the library as -ld3d9 for e.g:
g++ demo.cpp -ld3d9

I ran my first directX "hello world" sorta program from http://www.directxtutorial.com/ and it compiled and ran successfully. looking forward to learn more about DirectX

hope this piece of information helps you with g++ and DirecX combination.