For the final project I chose
to implement a Virtual Arcade using some of the the techniques learned in class. I started
the project by locating models for my arcade (as I wasn't about to create all
the models on own!). A quick Google search lead me to a MAME front end
know as 3DArcade. The folks here were nice enough to post their models for all
I then converted these MAX models to 3DS and created a 3DS supporting class using some 3DS loader code found on the GameTutorials.com website. I managed to find a couple of bugs in their code, resolved them and got the class running smoothly. I'm not very impressed with the 3DS format. It doesn't support a lot of the nice features that newer modeling formats do. (Multi-texturing or having objects with multiple textures on different faces) I tried exporting the models as OBJ's but 3DS Max kept crashing (sigh) so I was forced to hand edit every model to make sure that they appeared correctly. All in all it looked acceptable but proper exporting would have made them look much nicer...
(Note: The antialiasing factor was set resonable low for the purpose of taking these pictures. Adjusting these settings would make the environment look much smoother and remove many of the hard edges)
One of the goals to this
project was to also be able to play acual videos of the games being played on the games' monitors themselves.
Once again I went to the MAME community and was
able to find a rater large collection of MAME attract videos, which depict what
the games look like during their attract modes. I then went to the NeHe
site and grabbed the AVI tutorial code. Using that as a base I developed code to support AVI rendering through texturing. I tried playing my AVIs but it
crashed as it wasn't able to get frames. I quickly determined that I
didn't have the proper codec installed. Installing the MS MPEG4-V2 codec
solved this problem. (I included the codec in my submission in case you
have the same problem). Lastly, I took these 2 classes (Arcade game modeling class and AVI supporting class) and created a super
class to represent a complete arcade game.
The arcade game knows which texture is mapped to its monitor and can send the AVI texture to this object so that the videos are displayed properly.
The next step was to create a
floor with a groovy disco lighting effect. I did some quick searching
about this effect and found that to create it properly, I would probably have
to create a 3D light map. Since the due date was upon me I chose to take
the safe route and stick to 2D lights maps. What does this mean?
You will only see the disco effect on the floor and walls and not on the
games. When I have more time I would love to revisit this. I'd love
to get the 3D effect truly working and create a tutorial for others to use.
I created a light map in Paint Shop Pro and made a simple floor class to encapsulate the drawing of the floor and blending of the light map. Some use multitexturing, but since I want the entire light map on the floor to appear to be spinning, I found it made more sence to use blending.
I love the way this looks... I downloaded an amusement carpet sample off the web to use as my texture and the colors look great when the light moves across them.
(It looks best when the games are disabled)
Here's what the floor looks like before the light map is applied:
Here's what it looks like after it's applied:
Once the wall was stable I copied the class code to create a wall class. The only difference being that the light map scrolls on the walls whereas it rotates on the floor.
I had intended to get the sound effects by simply using the audio included in the AVI's. The sounds' volumes would be modulated as a function of the distance between you and a given game. As you walk closer to a specific game it's volume would increase. However I hadn't been able to find info on how to get the audible data from the AVI into a usable format and time was short so plan 'B' was to find some ambient arcade sounds and have them playing in the background using Audiere.
As soon as I loaded my arcade full of games my system began to crawl.. The disco lighting looked as if it was barely moving and the videos were noticeably skipping a lot of frames. As I dug through my code it occurred to me that I was rendering a ton of games that weren't even in view. So I quickly modified the code so that anytime the camera is moved, the games are checked to see which ones are in view: if a game is in view it is rendered, if not it is disabled. I also enabled surface culling to prevent reverse surfaces from rendering. This sped things up dramatically. It's not perfect but it's not supposed to be Quake3 either. :-)
The following keys allow you to
move about the arcade:
w - up
s - down
a - left
d - right
By clicking and dragging with the left mouse button the user can rotate the camera.
Just about every feature can be enabled/disabled buy bringing up the GLUT menu (click the right mouse button)
I enabled culling as well so that you can move behind the south wall and look into the whole arcade.
What can I say about this class other than it was honestly
one of the best classes I have ever taken. I was extremely impressed to
Prof Sannier's expertice in his field and was also extremely grateful that he
took the time to teach it to us in a way that we would understand and
apply. The education I obtained in the areas of 3D modelling and environment generation, linear computation and matrix manipulation was unmatched.
I honestly feel that this class has provided a solid
foundation for me to excel my skills in game development, graphics design and all things OpenGL related.
And with that... thanks again for an amazing semester, have a great holiday and new year!