Archive for September, 2010

XNA Ray Picking Sample

26/09/2010 3 comments

Edit : The article is archived!, please refer to the myΒ XNA Picking Tutorial

Hello! πŸ™‚

This is a simple XNA 3.1 app that I wrote to demonstrate how picking 3D objects works :)…

Make sure you first check the official picking sample, you can find it here (XNA GS4).

Okay back to my app…
What makes my sample different is that you can actually see the camera frustum & the mouse ray, here’s a screen shot:

Ray Picking Sample
as you can see there are three viewports here:
1- Right : The main game scene, camera used : camera1…
2- Left : in this viewport the whole scene is rendered again and can be seen using a second camera (camera2), camera1 is visualized here, camera1 frustum, near/far planes and mouse ray are all rendered here so that you can see how picking works ;)…
3- Bottom : Instructions & info.

Both cameras are free look cameras similar to Counter-Strike free look cameras…

Here are the files:
RayPickingSample Executable
RayPickingSample Source

rev.1 : Fixed cam frustum bug where the tip of the frustum were stuck on some computers, fixed a typo.

Interested in programming details?

In this project you can find a free look camera class called Camera , there’s also a second camera class which is VisualCamera.
VisualCamera class inherits from Camera class and addsΒ  Read more…

How to change spawn time in Battlefield 2 & lots more! Part II

25/09/2010 10 comments


In Part I , I talked about changing the spawn time using two methods : console screen , changing game files, So you see you can do much by changing the game files…. πŸ™‚
In thisΒ  article (and the next one) I’m gonna show you how to make a weapon shoot whatever you like, change reloading times and more…
For example, you can make a pistol shoot a heat seeking missile, you can create walls with your gun!…
Before starting you must understand that almost every thing in the game is an Object!, bullets ,missiles ,grenades ,sand sacks…all these are objects.
So what we’re going to do is simply opening the .tweak file associated with a certain weapon and change the line that specifies the projectile object for that weapon…
Here’s the line that specifies the projectile object of the M4 rifle (used by USMC Special Forces Kit):

ObjectTemplate.projectileTemplate M4Projectile

What this line does is making the M4 rifle shoot projectiles of the type M4Projectile, By changing this line we can make this rifle shoot almost anything!.

Where can I find those .tweak files?

In your Battlefield2 root directory search for a file called Read more…

How to change spawn time in Battlefield 2 & lots more! Part I

19/09/2010 8 comments


Battlefield 2

Battlefield2 is an amazing shooting game, although the game is a little old (2004) it’s still worth playing! πŸ˜‰

The game is a military game, you can enjoy a collection of real weapons,vehicles and of course high graphics, you can play in many vast maps!

Changing Spawn Time:

Let’s say we want to change spawn time to 3 seconds! Two ways I’ve found:
Read more…

Happy Eid Muslims!

10/09/2010 Leave a comment

Eid al-Fitr is a festival celebrated by Muslims after fasting month of Ramadan πŸ˜€

Happy Eid! πŸ˜€

Categories: General & News

Working On Terrain

08/09/2010 Leave a comment

Right now I’m working on terrain manipulation & rendering…
I’ve done some basic terrain rendering in the past using the Brute Force approach, What I’m trying now is the LOD (Level Of Detail ) algorithm!
I’m having some difficulties now with the normals 😦
The quad tree implementation is almost finished, right now I’m rendering the terrain using the highest level of detail ( always going to the leaves of the tree & render them ), of course that will be fixed later after I’m done with some issues like normals & some optimization…After all, what benefit is LOD without increasing the performance? πŸ˜€

Here’s a screen shot, the terrain is rendered in wireframe! no one will stand the way it looks in the solid FillMode ( the normals issue 😦 )

I painted the height map using only Windows7 Paintο»Ώ

I hope that I can complete this project, then I might add some trees & grass ( It’s time I learned BillBoarding ) & of course fill the river with animating water!

If you’re interested in LOD you can check these links: : Realtime_Dynamic_Level_of_Detail : Continuous_LOD_Terrain_Meshing
Smart Terrain Rendering with XNA

Note: gamasutra articles are more than one page! you can view all pages within one browser tab, just click the printable version button

Categories: Graphics, XNA

Mediafire is under maintenance!

08/09/2010 Leave a comment

Hello 😦

As you can see, the server is under maintenance!

Usually I only upload my files to mediafire which makes sharing files easier, I have a free account there and it works fine! resume capability is available & the server is fast! πŸ˜€

The files are still there! It’s only a mater of time… πŸ™‚

Categories: General & News