Saturday, May 12, 2007

Screen Shot Anyone? A screen shot of my progression!

Well, I usually don't support screen shots especially in early development of games, and especially when they're as young as the development o this game is right now, but I have gotten a lot of work done for this game. I am looking for a graphic artist who is exceptionally well with 2d graphics. I need some characters, and some other game objects for the game. Hopefuly I can get some type of Alpha, or Beta release by next month. Most likely the way I have been developing this 2d game engine (yes a game engine, that has a collision detection, physics engine, and uses SDL to render the graphics) a game engine, and the game itself I'll only have an Alpha ready. After going through much menu's and other ideas for the menu's this is the final menu for the game.

What If Mode Latest Screen Shot Update: I am currently working on using the Xbox360, and thinking about making this game in Java using the LWJGL (Light Weight Java Game Library) and make it for Nintendo DS. Both which I have devkits, and libraries for, but I have realized that if I want to implement the Xbox360 controller and the Wiimote, and have some type of huge impact in the game then it would be different using the Nintendo DS, so I'll se what I can do.


I have been working an average of 3 hours a day on the game engine, the game itself, writing the story, or the game dev doc while programming everything. I am by myself on this project. If you're a 2D artist then please contact me.

Thanks,

c.s. Finch

What Controller? What Controller?

I've decided to take in consideration on what Controller shall be used in the game, or what choices of what controllers should be in the game. I have come across the idea of implementing the Xbox360 controller since it has vibration in the game, and the Wiimote (Wii Remote) in the game since it has that 3Space motion sensor whatever they call it as support of movement.

I have done some research and found out that it is as easy as Using the XInput.h header included in the DirectX SDK (I have the February 07 build) in any project you're working on. And the methods used to utilize the Xbox360 are prettys straight forward.

I have also done some research and found out that there is a library called WiiYourself! which is a C++ library extension you can add to your project to utilize the Wiimote in any project. However, I haven't worked with the WiiYourself! library yet, for I have been trying to complete the Xbox360 controller input in my game first, and then work on the Wiimote, and do some more research for other controllers liek the 6 axis tilt PS3 controller. Both links can provide a good foundation on the files you'll need a good tutorial that I've been reading on how to use both libraries.



I must warn you that I have not tried the WiiYourself! library, but I do know that there are some limitations and very specific bluetooth technology that you have to either have, or specific bluetooth technologies that you can't use.
I hope this gives people some sorta of direction on how to utilize these 2 great controllers in their game. Both seem to be pretty straight forward.

In the upcoming blogs I will post some more examples of SAT, and examples of how to program the Xbox360 controller in your games once I have finished implementing it into my game. One of my demos will be having a SAT fast collision detection demo that uses the xbox360 for controller the objects in the environment.

Enjoy!

.

Sunday, April 29, 2007

An Example of SAT

SAT has 3 main advantages and is the reason why I have choosen to use it. The 3main advanages are;

  • Allows to perform good looking physics simply and accurately, like bouncing, friction, deals with slopes in an automated fashion.

  • The collision detection is more accurate for high-speed sprites. In a sprite-based system, the objects can potentially jump past each other in a time frame if they move too fast.

  • It is based on vector math, so it can be extended to 3D; therefore, SAT itsn't limited to just strictly 2D like sprite collision



    The method of SAT is the heart of "What If Mode" for "What If Mode" (which will call the game something, but for now please excuse me if I over use it) is all about physics in the sense that it does matter what gravity is, or what the friction of the ground is, or the elasticity force between 2 particles, or it depends on the angle between 2 vectors, for whatever purpose of you being able to advance, or not advance to the next level. SAT can take into consideration all of these physics variables and supply a very accurate collision detection with these in effect since it uses vectors. Before I discuss SAT in depth I would like to give you a couple of examples of SAT and show you how it works.

    The basic idea of SAT is very simple, and easy to implement into any game. I'll show you SAT through an example of 2 boxes tested for collision.
    collision of 2 boxes

    The algorith tries to determine if it is possible to fit a plane between the 2 boxes if so then they're seperated. To determine if they're seperated it is as easy as projecting their intervals onto the normal plane and compare if they overlap or not. It's true that there are an infinite number of planes that can be drawn between 2 objects in 2D space, but think about how many we need to check? We only need to check for 4 planes. Out of the 4 planes you just have to check when atleast one is seperated, and once that has been checked you return a no collision flag else they're interested. So instead of checking for intersection at 4 corners, and 4 faces, and then if this, and if that you just have to check when they're seperated, and when all 4 come back false else they've collided.

    I will continue this section of my blog and come back later this weekend with an example of polygons, and a number of objects on the screen at once, and show you how easy it is to check for SAT. Until then...

    Friday, April 27, 2007

    Seperating Axis Theorem "The Theory"

    After much thought and much research on how a collision engine would work in "What If Mode" I finally pulled out my Calculus 3 book, Math & Physics in Game Programming, and many articles on Gamedev.net, and Gamesutra.com I have come across the solution. It is called the "Seperating Axis Theorem" the theorem states that for any objects lying ing a plane one can put a line between 2 convex shapes if and only if "iff" they're not intersecting. This seperating axis theorem can be applied for fast collision between 2 polygons where each face's normal is used as a seperating axis. For increased efficiency, parallel axes may be calculated as a single axis. -Wiki

    How can this be applied to "What If Mode" Let's say that in our level the objects are constantly being formed, mis-shaped, and there constanly being changed this is called polymorphism in our game which isn't suppose to be confused with polymorphism in OOP. If we had polymorphic objects in a game not only would there have to be a fast collision detection, but the physics that simulated the collision of the polymorphic objects would have to concur with each other, and the collision detection must have some overlying rule that all objects obeyed. If this didn't happen then you would constantly have many algorithms asking which object is hitting which, and then have some type of sorting, or machine state based coding that asked after the algorithms told you which objects were about to collide or check for let's check for their collision. This could be many lines of code just to achieve a very simple concept.

    Seperating Axis Theorem solves this problem by means of creating these axis on all the objects faces and check for intersection from there axis.

    I'm going to create a demo of this seperating axis theorem simulation throw polygon shapes that form into other polygon shapes at random, and then work from their by means of applying actual images, and game objects. I shall continue this update through this blog, and will show all of my progressions and failing points while creating this demo.

    Thursday, April 26, 2007

    An Example of What If Mode

    I wanted to provide a small example of "What If Mode", so people don't try and misconstrue it with other game mods, engines, ideas, etc...
    Let's imagine that in a "mario like" game that there is a switch in a high place that normally using newtonian physics you couldn't reach, but there are 2 random objects in the level that might help you out. There is a gravity gun, and a bouncy ball, but furthermore we don't know what the ellastic forces, normal forces, friction, or the gravity are in that level.

    First let's start with the gravity gun. Could we use the gravity gun to either shoot the ball up and kill the switch, or use the gravity gun to shoot other objects in the game that would make the switch turn off? If we took this approach then what has to be the forces of the enviroment for us to accomplish this simple task? What does gravity have to be? What does the elastic forces have to be? Do we have friction in the level? Is it a concern at all? We simply have to experiment.

    However, there is a bouncy ball in the level as well. What can we do to the bouncy ball other than the idea of using the gravity gun Could we kick it? Could we bounce on top of the ball? Could we throw the gravity gun on top of the ball if gravity was light enough and kill the switch?

    Now let's talk about the forces of the level. The forces of the level either increases, or decreases the options we have to complete a simple task in each level. But what if they're never what we expect them to be? What if for a second gravity is as we know it the constant of 9.815, and friction is close to .250 in a specific level, but then all of a sudden they switch, or they're 1/3, 1/16, their size, or they're 3x, or 16x their constants? What if these constants in the level were to alternate momentarily, or continuously, or until you completed the game, or seemed that there were no constants at all.

    Having these random variables that make up the physics of the world makes the game more interesting, fun, and challenging all at the same time. The game is never the same, so you could just play level 1 over and over and over again without having to advance to level 2.

    Or could you? This is what I'm going to find out.

    The Beginning of What If Mode

    Hello, this is the beginning of the project "What If Mode". Rather if it has been done, or not it is purely for the benefit of my gamedev team to see if we can come up with creative ideas, and turn them into video games. Before I explain to you what the Project of "What If Mode" some history must be known about "What If Mode".

    It started as a special mode by my team leader who we call Jesus (we all have nicknames) that in our 3D game that we are continuously designing while in school, and won't start development until after school as a special mode that ask the simple question "What if this happens?" The idea, and possibilities of the game taking off in weird, quarky, funny directions are endless in "What If Mode". As we were discussing it; me, being the only programmer I just joked around asking the team "Do you know what a programmers headache is? It's when Jesus starts talking about his ideas for video games, because a programmer just has a baffled, some-what ridiculous look on their face asking; 'Are you insane'? "

    Well, after much pondering about if What If Mode was possible I just simply told myself I would never know unless I tried it. Now, I'm not going to create a "What If Mode" mod for game like HL 2, in Source Engine, or Unreal 03 when it comes out using Script I'm simply going to make a 2D "What If Mode" game "mario style" just to see what it would take to make something that can be so random and so interactive with how you play the game, and is never the same after ran once.

    So here I go wish me luck.

    Thanks,

    c.s. Finch