Apr 17, 2012

Game Designing in UDK

I preferred UDK game development as I provided lots of tools and nice front-end for content modeling.  When I try to content creation with UDK, I understand that I am lack of comfortable with its tools and functions. Hence I followed these tutorials. For me, those are quite comprehensive.I did not wast my time for training with all the tutorial. I did my homework only for get to familiar with it. :)

Navigation 

  • LMB - Right/Left/Forward/Back Movements
  • RMB - Rotate, Look Around
  • LMB+RMB - Up/Down
  • Load map from ; C:\UDK\UDK-2012-03\UDKGame\Content\Maps
  • Red builder brush act as template for creating BSP ( Binary Space Partitioning) geometry. This red builder brush does not shown in the game. BSP is used to quickly create playable space. 
  • Static Meshes is what you'll be using to detail the environment.
  • The most of the environment consists with static meshes and BSP geo.

Scale Reference 

  • Use scale reference to scale entire environment. (character - x=32, y=32, z=96) 
  •  If geometry is not visible go to wire frame and set order to 'last'.
  •  If position is changed -> build geometry again.
  • View port tools (G mode, P, Real time, Camera speed, Play mode..)

Map Template

  • Edit SimpleMap file name in C:\UDK\UDK-2012-03\UDKGame\ConfigC:\UDK\UDK-2012-03\UDKGame\Config\DefaultEditorUDK.ini
  •  InterpActor is a form of static mesh. This is dynamic actor that models sky sphere.
  •  Dominant directional light takes to illuminate the environment. Primary lighning in the map no fall off
  • ExponentialHeightFog (better HighFog) is distance fog. This is more dynamic version of the fog and creates more density at low places ans less density at higher places. We can use two colors to better visual placing in the world.
  •  View -> World proprieties to look changes in the environment and set default values. 
  • Create own custom template and show it when starts.  
  •  Add player from the content browser as the scale reference.
  • Build the room.
  • Open Geometry tools and edit flour size in grid mode. 
  • Duplicate the room and put windows around. 
  • Adding a light to illuminate the scene. (with light mass volume)
  • Use static meshes for the newly created environment
  • Use 'END' key to place static mesh in the flour. 
  • Scaling the static mesh (use space-bar or x,y,z values) 
  • Note - duplicating static meshes will not effect performance. 
I think UDK is the best gaming engine for rapid development. Try it...and Enjoy... :)

Apr 11, 2012

Getting start with OGRE

I loved programming in C++ a lot. So why shouldn't try OGRE engine for my gaming development? I tried several ways with OGRE. It was hard at the beginning...But when you learn thing better it is not hard. If I compare OGRE with UDK, I think UDK is better according to my experience. So let's see the resources I followed to learn OGER. 



Is there any sufficient way to creation on OGRE? I have download the OGRE engine in order to try out it myself.  I followed the configuration tutorial but it has not enough details. Therefore I have fount a good video tutorial and it works fine for me. I followed visual studio configuration from here.

Apr 10, 2012

Rapid virtual world creation on OpenSim

One beauty of the opensimulator is import and export capability. With a viewer like imprudence we can easily build up the virtual world. It is very good way to start tutorial from opensim artist home. A good collection of OpenSim compatible creations can be found from here. Those are available for  download and just need to give the path of .xml file in extracted folder.
Go to file-> Import+Upload of the viewer.


It will take sometime to upload the file. Once it is done, we can placed it in a preferred position. The other important thing is that we can set up any reusable virtual environment instantly. I have download one of these virtual terrain and using a single command I was able to load that terrain.
terrain load terrain-apple.png 

Finally it is also possible to reuse available world rather try one by one. I try the virtual world called "Tiki Summer Sim" on my own risk. It really easy to be use and just a single line of command is required. Just past with load function + whatever the file name as bellow.
load oar xxx.tgz




 Make sure that what is exactly needed by the simulation. Unnecessary beauty of the scene will be reduce the simulation performance significantly. This example simulation has been consisted around 4275 primes which consumes 1GB memory.. :) 

Apr 8, 2012

GlovePIE: wiimote tracking

One of the sub goal of my project is to track the user's head direction and orientation. And I am mostly preferred low cost approach although there are many commercial trackers which are obviously outer range of undergraduate research budget.
When I was conducting my survey, I found many RnD work on affordable head tracking. Among them wiimote tracking is highlighted (and we already have such resource). Therefore I am trying on some APIs which allows wiimote tracing. One such good application is GlovePIE. I have follow some tutorials via the internet and also there is a descriptive documentation with GlovePIE. I have shortlisted some practicals which I have tried myself.

If you have a good oo programing knowladge like c++, this is not that much hard. A comprehensive tutorial can be found here.

So let's take an example expression.  It will emulate wii mote right button to the right arrow key of the keyboard.
Key.Right = Wiimote.Right            //This can be identified as an object or a variable.
a = var.A                                        //makes a variable A which is equal to the letter a.

In programming syntax,

LValue  =  expression                    //set the LValue to the value of the expression.
  • GlovePIE is constantly looping through your script. 

Hello World Program

The 'debug' command will out put next to the stop/run button.
debug = "Hello World!"

This debugger tool is very powerful and it allows us to figure out what is going on in the emulator.

Check Wiimote's Availability and Battery

debug = "Wiimote On:" + Wiimote1.Exists + " Wiimote Battery Level:" + Wiimote1.Battery

 Wiimote1.Exists -  will be True or False based on whether or not wiimote is ever connected.
 Wiimote1.Battery - put up wiimote Battery Level with a number from 0-192 (192 being a full battery).

example output: Wiimote On:True Wiimote Battery Level:104

Calculate Degree of  Wiimote is at

  • Roll -   debug  =  "Wiimote Roll:" + Wiimote1.Roll 
  • Pitch -  debug  =  "Wiimote Pitch:" + Wiimote1.Pitch
  • Yaw -   debug  =  "Wiimote Yaw:"  + Wiimote1.Yaw
Also note that you should consider the amount of data communicated via Bluetooth.


So up to now I got some basic knowledge to calculate the coordinates of wiimotes. As I have inspired with GlovePIE I have also tried out following stuffs.
  • If condition then statement [ ; ]
 if(Wiimote1.A) then
debug = "Button A is pressed"
else
debug = "Other button is pressed"
endif

Once you press a button 'A', it will print  "Button A is pressed" and "Other button is pressed" otherwise. According to above example I tried extend it further hence I can figure out what is actually going on in my code.

Can we port this to a game controller ?

 if(Wiimote1.A) then
         debug = "Accelerate"
else if(Wiimote1.B) then
         debug = “Break..!”
else if(Wiimote1.Up) then
         debug = “Drive”
else if(Wiimote1.Down) then
         debug = “Reverse..!”
else if(Wiimote1.Left) then
         debug = “Turn Left”
else if(Wiimote1.Left) then
         debug = “Turn Right”
else
         debug = "Constant velocity"
endif

Now I thought this conceptual game controller. It will make easier me to debugging.. :)

Apr 7, 2012

First experience with wiimote

I have no practical experience with wii mote although I have read a lot about it. There are a lots of tutorials have been available for deal with wii mote. But I am rather happy to share my own experience with you.

Firstly you have to make sure the wiimote is properly connected via Bluetooth with your PC. There are different Bluetooth drivers have been available, called Bluetooth stacks. But if you are using windows, Microsoft Bluetooth stack is preferred. As I showed my previous post, you should keep pressing 1 & 2 buttons on the wii mote for a while, to connected with your PC. In my case I have to take several attempts to make install drivers properly.

Then you may need an input emulator which emulates input devices by using other input devices. I used GlovePIE as the input emulator. But unfortunately the site has been hacked by the exploiters. However I have the last updated version. :) You can fined many tutorials to learn about the GlovePIE emulator.

I just interested about it because it can be easily configured for wiimote's inputs. Flowing code I have used for transform wii mote inputs to keyboard interrupts.  

GlovePIE script for wii mote


If the wii mote is connected properly its LEDs should be turn on, just after you are running the emulator code. Now emulator maps each wii mote inputs to specified key board inputs. This is smiler to the functionality of PreTranslateMessage in windows API. You can also know about this of you have MFC programming knowledge. 

Now go to the notepad. And press 1 or 2 button of the wiimote and you will see 'a's and 'b's will be typed on the notepad. If it so, yes you are done.


Now run your openSim region on your favorite viewer. I used imprudence as it has may functionaries. Once you loin just pressing the up/down buttons of the wii. Yes, there you are...Now you can move your avatar with wii mote. :) 


Apr 6, 2012

Connect Wii Remote to the Computer

Nintendo RVL-CNT-01

It was taken some time me to connect wii to my own PC. But it was not too hard. Just you have to be remember that you must make it discoverable when computer searches for the device. Press 1 and 2 button consecutively so that it can be detected by the computer.
If your wii is working properly the LED lights should be blinking on each pressing. Also it is better if you can use rechargeable AA-batteries.

After few days I have encountered another problem when connecting wii to my laptop.Although it is working properly previously now it always try to update the driver via internet. I set windows to automatically update and install but wiimote is not like to be connected. So I disconnect the internet so that I was able to connect wii without any problem.