Wednesday, December 29, 2010

Reimporting Blender Models

Have been busy these last few days putting the finishing touches on the new and improved city museum for the game and have begun reimporting already-developed models. I will be using the opportunity to change the format of the textures from .png to .jpg as the latter seems to be much smaller in size and Unity can handle them better. Here's a screen capture of what I've got so far:

Once I get a spare moment I will make a video of a walk-around to better illustrate the virtual space. Broke my hand - again - so I'm having to manage Blender and Unity with a left-mouse configuration; at least for the next four or so weeks. Good thing I already have most of the development work already done. 

Saturday, December 18, 2010

Blue Window Frames and FRAPS Test

Finally got the second floor of the museum finished, including all textures and the final changes to the meshes. Although I will be adding several more models for the prototype test (e.g., medieval tower and some traffic signs one would normally find in a pedestrian zone in Germany), I wanted to do a quick test to see how the framerate for the game was. I exported what I had as a Windows executable file, ran the game from my laptop (Dell XPS M1730) in 1280x 1024 windowed format, set the graphics quality for "beautiful," and let FRAPS record the information for me. This is what I got:

Frames: 2739
Time (ms): 48159
Min fps: 49
Max fps: 76
Avg fps: 56.874

Still a better framerate than television (~30 fps). And here is a screenshot of the test, showing the completed second floor of the museum and the remaining meshes that need to be textured:

I noticed in earlier tests that the .png texture format was just too large and caused the game to slow down too much; I switched all textures to .jpg format, which seems to render much more quickly. All in all, a pretty good test, I suppose, although I wonder what the framerate will be on my students' computers when they test the game next semester. They may have to set the graphics quality for "good," or perhaps the game will lag too much. One other thing to test out before the prototype is deployed.

I thought a day or so about what I should do with the second floor window frames on the museum. Although I could have done them in a regular brown wood texture, I didn't know whether this would be as optically interesting. Then again, I didn't want to add something that one wouldn't perhaps find in Germany. So, after searching a while "Fachwerk Fenster" in Google Images, I discovered this nice picture:

I thought the blue color added a nice touch, so I sampled the color inside GIMP and created a texture map for the windows. I didn't put too much effort into the frames, however, since I'm guessing that most players won't spend too much time looking at the second floor of the museum and I needed to quickly move on to other aspects of the project, such as programming the whole thing in C#.

Tuesday, December 14, 2010

Fachwerk Imported and Pontification on the State of Second Language Studies

After making some minor tweaks to the museum model inside of Blender, I was finally able to texture- and bump-map the exposed timber work meshes and import them into Unity. Once I got the workflow down, the whole process went very quickly. Main points to remember: (1) make modifications to meshes in Edit Mode, not Object Mode inside of Blender; (2) break up larger mesh objects into smaller ones (select vertices you wish to separate in edit more and then press P-Key); (3) create one base object, apply texture- and bump-maps, and *then* make copies of the mesh (Shift-D in Edit Mode). So far, this is what I got:

Front View, Entire Project

Side View, Close-Up

Back View, Close-Up

Now that the timber work is in, I'll be focusing on getting the window frames completed and perhaps texturing the second floor of the museum. Once that is done, I'll maybe do a quick walk-around in a video.

Finally, a bit of pontification. I've been watching the support and study of second languages at the university level slowly unravel under the weight of the economic recession, with programs at the University of Albany SUNY, University of Toronto, University of Southern California, and elsewhere either get "streamlined" or eliminated altogether. Although I certainly bemoan this trend, I wonder if language professionals have not, in some small part, helped to bring this calamity on their own heads. I was surprised, for example, that at the recent 2010 ACTFL conference in Boston, no panel discussions or exhibitors were addressing the impact the iPads and similar devices could potentially have on the teaching of literature. If second language professionals were more engaged with new and emerging technologies, and actively conducting research (and writing grants) to evaluate this technology in instructional settings, would we be more relevant for a wired world? Would it help to revitalize our profession?

Friday, December 10, 2010

Vertical Beams Completed

Just finished getting all the vertical beams inserted into the mesh, which I have highlighted in this screen capture in white:

All the beams were based on one root mesh object, to which I applied both a color and bump map channel. Once this was done, I made a copy of the mesh inside Edit Mode (Shift-D) and then dragged the copied mesh to the new position. So that the same face of the beam was not facing out on each beam, I rotated the copied mesh object 90 degrees on its z-axis. On every fourth rotation I would rotate the mesh object on its y-axis. This provides a possibility of eight "unique" faces for each beam, hopefully giving the viewer a sense of variety while not increasing the work load of the designer (me, that is) too much. Next development task: the horizontal beams.

Thursday, December 9, 2010

CATL Scholar Award and Bump-Mapped Beams

Now that the semester is almost officially over (one more final to give, to the regret of my students), I have had more time to catch up on small project minutiae and make some substantial progress on my project. One thing I forgot to mention in prior posts is the Center for the Advancement of Teaching and Learning (CATL) Scholar Award, which was announced back at the beginning of November and which will help support the DigiBahn Project as develops one complete level of a 3D digital game-based learning environment for second language acquisition. The award will provide course release time to assist in project development, purchase hardware and software, and grant access to technical training and new conference venues.

I've been making progress these last few days on getting the exposed vertical beams in the second floor of the model in place:

If you read my earlier posts below, you will recall that I complained that the color and bump maps could not be applied to all the beams after they had all been created and that I had to start from scratch again. However, I found out that if channels for color and bump maps are created in the original object, and copies of this object are then made, all subsequent changes to these channels propagate across all already-made copies of the original object. So, in a sense, copied meshes inside of Blender are object-oriented, provided that the root object of these meshes contains all the information required. In sum, changes to copies of an object cannot be applied retroactively.

I've also been having some fun with the bump map channel inside of Blender:

The color for the beams was sampled in GIMP from a photo of exposed timber work on a German building and the bump map, which was also created in GIMP, was selected from a photo of wood grain. The result, I hope, shows old rough-cut wood beams that, over numerous generations, have been painted over. I'm not sure how I can get the bump maps into Unity 3D, and this is something that I will need to work on.

Wednesday, December 8, 2010

Textured Beams On the Way!

Seems to be either feast or famine when it comes to blog postings with me. Now that the semester is officially over (besides the final I still have to administer), I have a lot more time to do game development. Wish I would just be able to spend more time on doing background research on the use of 3D digital game-based learning environments, but I figure that if I don't get the game developed I won't have anything to test anyway.

After creating the model completely, I discovered that you can't apply a texture to one instance of an object (say, a vertical beam) and expect it to be applied to all instances of vertical beams in the game object. So much for a true object-oriented paradigm. So, what I have had to do is delete all instances of vertical beams (except for one), apply a texture to this object, and then make copies of it:

To ensure that there was some variety in the textures visible to the player, I would copy a beam, rotate it 90 degrees, make another copy, and repeat the process. This ensures that at least four different faces are visible; hopefully players won't look too closely or they will discover the pattern. But at least it is better than the same face for every beam. So, in the coming days I will be working on getting all the textures applied to the model and then importing it into Unity 3D.

Full Museum Model Finished

Well, I should add that the full museum model is almost finished - I still have to add the door handles to both doors. Otherwise, how will people be able to get in and out of the building? Although I still need to get a handle on how to light a scene most effectively in Blender, I made a few quick untextured renders to provide an overall impression of the building:

Front View

Back View

Minus the door handles, the model consists of 3731 vertices, which I hope Unity 3D will be able to handle once I import the model. As this will be the only model in the game with a high vertex count, I'm hoping that the game engine won't take a big hit. We'll just have to wait and see. In the coming days, I hope to make another turnaround render of the model and post the video.

Wednesday, December 1, 2010

Exposed Timber Work (Fachwerk)

Since I started redesigning the city museum model, I thought I would add a few extra features that were not in the original. If you check my earlier posts (see below), you will notice in the screen shots that the exposed timber work (Fachwerk) on the second floor of the museum is simply painted on in the textures; there is no real 3D "feel" to this aspect of the model. I thought about adding the exposed timber work for some time now, wondering if the extra vertices would slow down the game at all. But it is exactly this feel that makes, in my opinion, the real Fachwerk so interesting when you see these buildings in Germany:

So, now that the semester is starting to wind down and I have a little extra time on my hands, I thought that I would start adding the Fachwerk to the second level of the city museum. After checking a few sources online about how these buildings were constructed, I came up with the following (untextured) addition:

I think the addition adds much more to the real "feel" of the model, although I'm not sure what type of performance hit the game engine will take with the extra vertices. Oh well, that's what prototypes of for, I suppose. I particularly like the crisp edges of the model, although this is obviously lacking in the original buildings, which have an old, weathered look to them and a more "organic" feel; as if they have grown rather randomly through the ages. The next thing for me to work on in the coming weeks.