Tuesday, July 31, 2012

End game

Today I made an end game!  By that I mean that there is now a "game over" scene that plays when the time runs out in any level.  There also can be different game over scenes for each level, if the designer so chooses and can be made to happen via the introscene config file.

Here is a quick video of the game over screen, along with its ability to return to the main menu once the user has seen the game over screen for a defined amount of time:


Monday, July 30, 2012

Late start

Today I was only able to work for 2 hours, so not as much was done as I would have liked.  In that time, I did add some more options to some of the config files.  For example, a "height" option in the placement shapes config file that does exactly what it says, it adds individual heights to objects.  Before, I just manually placed all the objects read in from the config file at "-10" in the Y axis, so that they were all below the map.  Individual heights lets objects overlap each other in predictable ways, but on different planes in height (all of which must be below the map!).  I also did some other smaller tasks, none of which are really worth mentioning though. 

Thursday, July 26, 2012

Fixes and cleanup

Today I fixed some of the problems I was having along with cleaning up and documenting my recent code.

I fixed the issue where, when the camera was tilting forward, the camera would lose altitude.  The camera physics engine I built has a parameter for its update function that requires the looking direction of the camera.  When the camera was tilted up or down, that vector changed, causing problems.  I fixed it by removing the y-component of that vector, a temporary fix but it works for now.

Further, I found that the webstart works and have updated the build on my server to the most recent one.  Enjoy: http://moe006.cs.csusm.edu/
NOTE: I changed the keys to control the altitude and have not updated the intro screen that tells you the keys yet. 
KEYS:  W,A,S,D will move the helicopter forwards, backwards, left, and right.
              Q, R will rotate the helicopter right and left.
              +, - will raise and lower the helicopter in altitude.

Wednesday, July 25, 2012

More Helicopter Like

Today I got around to making the camera have a tilting effect, so it appears more helicopter like.  Instead of trying to describe in words what it looks like, here is a short clip of it in action!

I only have one problem to fix with this: the camera loses altitude now when moving forward.  I'm sure this is from tilting the camera's orientation forward, so "move forward" for the camera is now slightly towards the ground.  Another thing to fix!

Tuesday, July 24, 2012

Civilization

First off, I was able to solve the black screen problem I was having earlier.   I did this by using a different way of accessing the assets.  I was using old code is what the problem boiled down to.  Once I found a new way to load in the assets, the problem went away.

Today I was able to finish what I wanted to do before the black screen problems.  I am putting objects into the levels to give the game more than just flat ground.  Here are some pictures of my town:




EDIT: looking at the pictures now, the shadows appear to be too intense.  I put the game light about where the sun is in the cube map (the picture in the background), which is why the shadows are this intense.  I think I will raise the game light up a bit tomorrow!

I have not yet hooked the model upto the physics engine to prevent the helicopter from flying through the buildings.

Loading trees into the game now will not be hard at all, though I have not yet decided on a way to put trees into the game.  Making Vector3f (three float values) coordinates for each tree in a level is a daunting task.  I still am thinking of different ways to do this, hopefully some googling will turn up something!

Friday, July 6, 2012

First level

Today I designed and created the first level for the game.  Here is a quick fly around of the level, though it is shrunken from what it is going to end up being:



I have some models that I found online and have loaded into the game engine that I want to spread throughout the level, however I have come across a problem.  If I attach any of these models to the root node, I get a black screen in the game.  I have tried scaling and moving the models away from the camera to make sure it is not an issue with the camera being inside the object, but that is not it.  Here is a video showing the bug I have:


Hopefully this problem will not take much longer to figure out, and some time away from it will make the solution more obvious to me.

Thursday, July 5, 2012

invisible shapes!

Today I finished up two mechanics.

The first is the "invisible placement map" mechanic, although I had to use 3d shapes now instead of a map.  This is the mechanic for when a user tries to place a wind farm somewhere, the camera position is checked against these invisible shapes, and if a shape is under the user then that shape represents a reason for not placing that wind farm there.

I had to switch from a map to shapes because I ran into a problem with the map idea.  My original plan was to try and lay an invisible image onto the terrain, much like a height map, and check the values of this map for why you should or should not build here.  The advantage of this was that the image should stretch with the terrain if a programmer wanted to stretch the terrain to make it bigger.  Also it would be very easy to create this map, since you could use a painting program to make and modify it.  However, JME3 does not like unknown maps at all, and would throw exceptions when a map that did not have the correct name was added.  Further, if I tried to replace some other map that was not being used with my placement map, JME3 would turn on that unused map and the terrain would look very strange.  This is the reason I decided to go with 3d shapes instead.  I made another txt file reader that reads in from a config file all the different shapes that are in any level.  Then, in a class I wrote, these objects are spawned through out the world according to the config's parameters.  Then it is simple to do a ray cast straight down from the camera to see if any of these shapes are hit.

The second mechanic I accomplished is to make a system for displaying the remaining time left in the level.  I decided to add this to the HUD on the cockpit, since it looked nice this way.  There isn't an end game screen yet, but it should be simple to make as it is just like the starting screens I made a few days ago.

Both of these new features can be seen in this video.  Note: The output of why a user cant build there on the HUD is just for testing.  The final way for the user to get this information will be from an interactive beacon that he must go near (and eventually land on) to get this information.



Monday, July 2, 2012

A Game Is Forming

First, I ended up switching out two of the milestones for the week.  It turned out that the two I had for today was too much, so instead I added sound today and also an intro scene.

First off, I created a system for adding intro scenes for each level.  The scenes are just pictures that can have anything on them, that should tell the story of that particular level.  To demonstrate I just put some text on a .png file, but before release these should be replaced with nice images.  The scene its self is all loaded from config files, so it is easy to add more scenes for new levels.

One pitfall that took me a while to figure out which shouldn't have was trying to load in the images using the JME3 asset manager.  In short, it turns out for some reason firefox was naming my files ".png" while GIMP was naming my edited files ".PNG", which I did not immediately pick up on and does in fact cause JME3 to freak out and not load that file.  What a face-palm moment when I saw the extension difference.

Second up is sounds.  JME3 makes it easy to implement sounds.  Since the importing and memory management is all taken care of, I went on making a very nice handling class (SoundsManager) for all the sounds that will be in my game.  This class initializes and manages all the sounds, and other classes just have to call my functions to do all kinds of things with any of the sounds.

Here is a video showing what was accomplished today:

NOTE: I had trouble recording sounds and video playing on my desktop and had to resort to holding up my mic to my speakers, so the sound quality is poor in this video.



Last Week Crunch

This is the last week I have for this summer project, so it is time to get as much done as I can!

For this week, I plan on creating enough game mechanics to have a functioning game.  My plans are to accomplish one major mechanic a day.

Today I plan on making two mechanics.  The first is the mechanic that tells the user if they should build the wind farm where they currently are or not through the use of the HUD.  I will use an "invisible map" to look up what problems the user would face building a wind farm where they are.  For example, "You can't build here, the land costs too much!"  Or something like that would appear if they tried to build on the coast line.  The second mechanic is an opening scene of some kind to inform the player what the objective of the level is.  I was thinking of using multiple 2d screens to tell a quick story about each town and why they need wind power fast!  It would be sort of like a book telling of the story before they jump into the 3d world.

Tuesday I plan on getting sounds into the game to give the player a better experience.  Also for a smaller project, i want to get a visible timer so the player can see how much time they have left to build the wind farm.

Thursday I plan on using what I have created so far to make a well designed level (or more depending on how long it takes), with models for the city and scenery like trees.  The level will also include the invisible map of where the player can or cant build the wind farm.

Friday will be for general improvements and bug fixes, along with anything else that comes up.