Monday, October 25, 2010

3D Modularity and Animations

I spent some time on this but still not sure how to do it in XNA... the idea is to create some

parentModel.AddChild(childModel);

function that adds (attaches) a child 3d model to other parent 3d model. The coordinates of the child would be relative to the parent's one. If

parentModel.childModel.Position

is changed it will do that in regards to the center of the parent model but not change the parentModel position itself.
Then the beauty of all of it would be that moving or rotating the parent by changing

parentModel.Position
parentModel.rotate

would move or rotate all those 2 models together as one. By combining children and parents and changing their relative positions (rotations) would enable us to code in C# some cool animations or build complex models like we were able to do in our other class CS2420 with C++ OpenGL http://eng.utah.edu/~dusatko/CS2420-EAE/hw6.html (video shot).

Another example would be the automobile model. The automobile has wheels that turn independently when the whole model is moving (preferably wheels turning faster when car speeds up)

Thursday, October 21, 2010

Game Engine Ideas

I believe that introducing force will save a lot of time when working on effects or with the environment. Then we can introduce some more interesting game-play with puzzles. The only difference from the version we have now is that you put a Newton law between and calculate position and speed by it.

// this would be inside your Movable class (or defined by interface)
public void Move(float time)
{
position += velocity * time;
velocity += _force * inverseMass * time;
}

public void AddForce(Vector3 force)
{
_force += force;
}

public void ClearForces()
{
_force = Vector3.Zero;
}

Then from your game class inside your Update() you would just apply to certain (or to all, or to just one) Movable objects a force... this force can be anything... then if there are no forces it would just not move or stay moving in constant speed.

// Inside Update()
//whatever objects you decide to act force on
foreach (GameObject enemy in enemies)
{
//whatever force you decide
enemy.AddForce(GetGravityAt(enemy.position));
enemy.Move( 0.001f);
enemy.ClearForces();
}

aside from the movable class there would be collidable one making sure that everything explodes or bounces properly if their bounding boxes collide...

Some examples of use:

  1. ship's racket engine - just applying force in direction you want to move or in the opposite to break. Here is the example please notice how there is a lag when firing the engine and how the movements of the ship are smooth - this would not be possible without using forces http://eng.utah.edu/~dusatko/CS1410-EAE/asteroids.html (CS1410 class, forces used)
  2. simple AI - you can code it the way that your ship's position vector is passed to your enemies, enemy class then calculates its direction vector to your position and applies it as a force. If the enemy is already passing by your ship it will start circling around you, then if it gets to certain distance it can start shooting at you (you decide). Here is the example, sharks get the force applied so they are circling around you http://eng.utah.edu/~dusatko/CS2420-EAE/finalProject.html (CS2420 class, forces used)
  3. Tractor beam - lets say you want to pull some asteroid, just aim and push the button, this would create some long 3d cylinder object starting from you and if it touches your chosen asteroid then it would have a collision with it and trigger adding some force to it in your direction
  4. Sticky nebula - this would be position dependent, if you get between certain coordinates in whatever direction you are moving the small force (smaller then your engines have) would act in opposite direction of your velocity. This would go for all movable objects that get to this sticky area.
  5. Black hole - this would be also position dependent, once you create a black hole it will check the nearest objects and add forces to them so they move to it. There would be some effect when they collide with the actual bounding box of the black hole.
I believe we can come up with many more ideas how to use this force. I think it is ok without the forces but all effects will not come so naturally and we may actually spend more time just figuring them out how to do some hacks to the game
engine.

Wednesday, October 6, 2010

Possible Storyline and Game Levels

I was lately contemplating over the story that would fit our spacecraft game. Here are two options I think I may like:
  1. The player is fighting and at the same time running away from some evil corporation. The only way to win is to find enough evidence about the company and bring them to justice. The player wanders through the space following the scrums of information and getting closer to the final resolution. Similar to plot in the movie Firefly but with only one character. Hyper jumps available or just classic space travel between levels. Ship repair or upgrades available.
  2. The player is lost in space and with half damaged ship is trying to find the way back home to the Earth. Each hyper jump or classic space travel gets the player to other more difficult level but closer to the Earth. Similar to the plot in the movie Lost in Space. Ship repair or upgrades available.
From our other EAE game design classes I found the level creation to be the most difficult task. To give it an early start I am brainstorming some possible ones here:
  1. To train the pilot the 1st level would be just classical getting out of the asteroid field
  2. Asteroid field + dangerous radiation star - pilot hast to pass by the dangerous radiation star, the only possible defence against the radiation is to tractor the asteroid so the player stays in its shadow. The asteroids are being vaporized and when too small the pilot needs to find another one to stay hidden from radiation rays.

  3. Defend the passenger ship against evil robots - classical space shooter fight defending the helpless ship
  4. Red matter escape - to finish this level and get to the other one is to penetrate an asteroid field surrounding the red star and avoid the evil enemy robot ships and shoot the Red matter into the star. This would create the black hole and the hyper-jump to next level would be possible.


  5. Sticky nebula - again fighting the evil robot ships with possibility to get stuck in dangerous slowing down sticky nebula
The final level can be a spectacular battle (similar to Star Wars) combined with all above difficulties, boss ship possible...

Saturday, October 2, 2010

Red Matter Test

Here is the small test I did in XNA for a possible new weapon, it works similar to the StarTrek's red matter. When it is shot into the star it creates a "black hole". The same game engine can be used for a tractor beam. Only instead of pulling all stars it would pull the one that collides with some tractor beam 3D model (maybe something like a long cylinder?). Here is the footage of the red matter prototype, the red star is the black hole now and it slowly pulses...

Friday, October 1, 2010

Space the Final Frontier

So I am a new member of the Space team. I am quite happy with this choice since I am a hard core Sci-Fi fan.

I think the idea of the red matter from the new Star Trek movie is just awesome. It can be used as a weapon (shooting it into the planet or star close to the enemies) or as a mean of escaping through its black hole. Here is some video that shows how the black hole may look like
http://www.youtube.com/watch?v=gCwlj4XJPMo&feature=related

In regards to changing gravity, we just need to tweak the game engine a little bit... in addition to checking on collisions it would recalculate distances between the enemy ships and the location of the gravity pull. This would also quite easily enable us to have the tractor beam.

I started playing with 3D engine and I hope to simulate some gravity pull and have it ready for the next week.

Tuesday, September 28, 2010

Final Game Pitch

For the final pitch I added health bar functionality. The colors correspond to following:
  1. Red - hungriness (food)
  2. Blue - thirstiness (water)
  3. Green - environment or physical health (weather)
  4. Orange - psychological health (happiness)
The red and blue are steadily decreasing and need to be recovered by food and water. The green bar changes with weather or illness and it can be recovered by hiding in the shelter. The orange one should respond to the character's psychological state, or how happy he is. In this prototype it increases a little when the character drinks or eats, and increases quite a bit when builds something (hut). It should also increase when the character rests inside the hut.

Tuesday, September 21, 2010

Video of Shipwrecked 2D Gameplay

This is just a very rough 2D prototype showing the game mechanics, it should be edited in some movie editor. It's missing health bars, full screen menu, some weather effects like storms to show decreased environment health bar would be nice. The health bars should be hopefully added before the final pitch.



The X BOX controls are the Stick to move, X to collect, A to build. Player needs to collect 3 sticks to build the hut skeleton, and another 3 palm leaves to finish it. We believe that it is fairly easy to build 3D game with the same mechanics; it would be only more time consuming to create all 3D assets.

More ideas about the game:
  • When health bars are low too often the character will get sick, he will need to find certain herbs to get cured also he will be required more often visit his hut to stay alive
  • When encountering dangerous wild animals the player can climb the tree, the animal will leave after a while (assumes some simple AI for animal class). It will randomly choose if the near carnivore is hungry (will attack and be more persistent) or sleepy with its belly full.
  • Player can find and domesticate some animals and make collecting his food easier (goat-like, turkey-like,...)