Archive

Archive for the ‘Games Programming’ Category

Genetic Algorithms Lab

27/09/2014 Leave a comment

Genetic Lab

 

So a few years ago I did a project for the Genetic Algorithms assignment at college. My idea was to have tiny multi-cell organisms that have a simple goal: travel as far as possible! maybe to find new resources or escape from predators, you pick one 🙂
So the fitness of a creature is measured by how far it can go during its life span.

The creatures will start with random moving cells and evolve to more organized creatures with organized movements.

Please watch the video before reading. If the video failed to make you interested then I doubt that the text would succeed. You can also download the executable and the source code available at the end of this post.

 

Read more…

OpenGL ES 2 for Android: A Quick-Start Guide

08/08/2013 Leave a comment

So you want to make your first Android game or want to make a live wallpaper or just a simple 3D scene?
On Android, games use OpenGL ES 2 for rendering, which means you’ll have to learn it, even if you want to use a game engine it’s always good to know how stuff works on a low level.

By learning OpenGL ES2, you’ll be also learning WebGL since they both use the same set of functions.

OpenGL ES2 is cross-platform which means once you learn the API on a specific platform you will only need to know some platform-specific details to get your game to the other platforms.

While learning OpenGL ES 2, you will face challenges even if you have a good background in computer graphics! This is where books like OpenGL ES 2 for Android: A Quick-Start Guide shine.

Book cover

Learning OpenGL ES2 starts with a mountain that you have to climb even if you just want to render a single dot in a 3D world, it gets easier after that 🙂 .

The book has a unique approach which makes it easier to understand the process. Read more…

Simple Spring Physics

02/03/2013 8 comments

A few weeks ago (during exams period 😛 ) I was playing with spring physics, it turned out to be easy to implement and the results were cool enough for me to write a demo in Android, Microsoft XNA, and Javascript :D.

SpringLab img

Before I talk too much, here see the results for yourself, this is the web version :  SpringLab Web Version.

Reminds you of World of Goo 😀 ?

I came across this tutorial, from which I learned this lovely vector equation:

 F = -k(|x|-d)(x/|x|) - bv

I applied it to 2D springs and it gave amazing results especially when Read more…

Android Terrain Test 2 : Clouds

26/02/2013 11 comments

So I again went playing with OpenGL ES 2 on Android, this time I added clouds to the terrain:

Clouds_Screenshot

Not only that but I also learned new things about OpenGL ES 2 and fixed some deadly bugs in my previous code and reorganized the code in a better way.

Here are some screenshots showing the results of using different textures and different Read more…

Android terrain test

19/10/2012 18 comments

Hello :), a while ago I decided to learn OpenGL ES 2.0 in Android, so I decided to make a simple terrain, and now I want to share my thoughts about this experience :D.

Edit: after reading this post please take a look at Android Terrain Test 2 : Clouds where the code is better and bugs are fixed (clouds were added too 😛 ).

Terrain in landscape mode


  1. Difficulties
  2. Video
  3. Download apk and source
  4. WebGL Version!
  5. Helpful tutorials
  6. notes



Read more…

Hex Screen

18/11/2011 5 comments


Intro:

Hello, it’s been more than three months since my last post, it’s also been more than three months since I last opened Visual Studio :(. A few days ago I decided that I should write something with XNA, that’s when I decided to write Hex Screen :D.

Hex Screen?

Hex screen is a 3D screen made up from hexagons, the cool thing about this screen is that hexagons can be animated to give nice effects, hexagons can be rotated, moved and scaled.

Hex Screen

A screen made up of 42*20 Hexagons

Another screenshot 😀 :

Read more…

FuchsGUI Update

09/08/2011 Leave a comment

Hello there, sorry for being inactive lately but I don’t feel like programming or learning something new :(.

Anyway, I fixed the issue in FuchsGUI where some text was blurry, the reason was that the text was being rendered with floating point values for position, something like (20.3f,29.4), this meant that spriteBatch should split physical pixels :(.

Anyway, thanks to a guy named Fab who told me how to fix this, the solution was something like this:

position.X = (int)Position.X;
position.Y = (int)Position.Y;
// Render here

So, here’s the fixed version (XNA4 only):

   FuchsGUI v1.1 Source Bin XNA4 (Blurry Text Fixed)

I hope to see you later :)…