Sunday, December 26, 2010

TF2 Map Making: What Makes a Good Map?

Recently, I have been investigating how to create a good map in Team Fortress 2 (TF2) . I found a few good tutorials on You Tube -

Below you can find some hints that Ubercharge.net talks about how to create a good map here (http://www.ubercharged.net/2008/11/14/tf2-design-theory-what-makes-a-good-map/). 

TF2 Design Theory: What makes a good map?

Not all maps are created equal. Even among the high-quality Valve maps, there are winners, like Dustbowl, and there are absolute failures, like 2fort.
Something sets the best maps apart from the mundane, and it isn’t the blessing of the Almighty Train God, either.
It’s teamwork. Teamwork is undoubtedly the most important aspect of good maps. Let me repeat: it’s all about encouraging teamwork.
A map that encourages teamwork ensures that all (or most) classes can contribute wholly to the team’s offense or defense. This is the biggest shortcoming of symmetrical CTF and CP maps. If a team has to simultaneously worry about attacking and defending, the team splits: the engineers hole up in their bases building impenetrable sentry nests while the rest of the team blindly rushes the other side. Rather than focusing its entire manpower on pushing forward, the team needs to leave a few people behind to defend against the threat of a single scout or spy far behind their lines. The very idea of the game being called Team Fortress 2 fails.
Let me qualify – there are excellent symmetrical maps out there, and there are terrible attack/defend maps, too. I’m only drawing attention to the fact that symmetrical maps require a team to split offensive and defensive responsibilities – as a result, an entire team cannot be involved in an offensive push, even if the team is winning.
Assault maps, however, avoid that problem entirely by ensuring that all players on a team are focused solely on either offense or defense. The remainder of this post will focus on assault map theory, but most of what I’m writing can be applied to symmetrical maps as well.

Teamwork in assault maps

The best fun maps tend to emphasize teamwork. Generally, this means creating a challenge formidable enough that an entire team must work together to win. This helps discourage deathmatch players – solo players rarely stand a chance against an entire team.

CASE STUDY: Gravelpit B


Gravel pit Roof
Let’s admit that Gravelpit doesn’t have the greatest rapport with players, and the statistics show that it isn’t even being played the way it was intended. Most defensive teams abandon point A, focusing on an strong defense at point B. It may just be because of this attitude that Gravelpit has a 55% win rate for BLU. Who knows.
Nevertheless, Gravelpit is one of the most perfectly designed maps I’ve ever played. It’s probably the only fun official map that represents each class perfectly; it’s also very well balanced.
Capture point B can be attacked from between 2 and 3 sides: the attackers can attack from behind using the C route and through the two main routes from the spawn. It’s more or less open – making it good for snipers, soldiers, and scouts; but it has only small healthpacks (pyros and medics thus carry a lot of weight here). There are enough dark and/or out of the way places for spies to (de)cloak and disguise, especially under the ramp at the C connecting tunnel. Heavies are very effective here, because there are enough short-to-medium-range firefights that occur here. Finally, the roof is accessible to only scouts, soldiers and demomen; however, the lack of health packs up there make them rather vulnerable. The windows of the building allow demomen to make a good effort to destroy the inevitable sentries inside.
Thus, every single class is well represented here. Moving on to teamwork – offensive pushes here need support. Standing out in the open areas of this zone is signing a death sentence unless one is well-supported by the rest of the team (snipers will have their dots trained on you, sentries will be targeting you, and let’s not forget the pyros that will inevitably show up to ruin your sentry-clearance operation).
B is protected against solocaps by a very long control point timing. In addition, the long control point timing means that the players inside the building capturing the point need to be able to stage a quick defense (hold the point) against a RED onslaught. When inside the building, attack can come from anywhere – even from above! Capturing Gravelpit B is a difficult ordeal, requiring almost complete control of the entire B zone. Clearly, only a determined team effort (or a terrible defense by a RED team that, admittedly, does not have much teamwork) can allow BLU to win this capture point.

Alternate routes

Of course, encouraging teamwork isn’t everything; in addition, teamwork is also a very intangible quality. As a result, let’s move to a more concrete level. Another common feature between all of the best maps: the presence of alternate routes.This theoretically should decrease frustration for both teams. It also allows scouts and spies to be much more effective, by giving them different routes to sneak behind enemy lines with. Finally, it allows a team the element of surprise: attacking through unexpected and undefended routes can be crippling to a poor defense.

No one is safe

To prevent the defense from entrenching themselves too deeply, it is essential that the defense is vulnerable at all times. This goes without saying, obviously, but unless someone is in the spawn, they should never be safe – if they are at a place inaccessible to the other team / other classes, but where they can still attack the enemy, there should be no cover. Essentially, the layout of a map must keep everyone wary of their surroundings.

CASE STUDY: Goldrush, Final Stage

OK, I admit it. Goldrush has nothing on Gravelpit in terms of game balance and equal class representation – RED wins this map almost 80% of the time, after all. At the same time, it’s one ridiculously fun map. I’ve almost certainly spent more time on Goldrush than any other map.
Goldrush, despite its shortcomings, is great for teamwork, because that’s essentially the only way for BLU to win. Based on my experience, it takes more than a heroic team effort from BLU to win the notoriously lopsided first stage.
RANDOM: Ribozyme – now that’s a nerdy, yet classy name. Bio nerds like me rejoice.
But, anyway, let’s skip over to the final capture point. Firstly, the green circle denotes an alternate route. Sadly, hardly anyone actually ends up using this route offensively, despite the fact that a strong offensive push there can absolutely destroy defense. Nevertheless – it provides a fantastic way for spies to slip past the inevitable rocket/grenade/bullet spam clogging the main cart route. Also, it provides a great place for offensive engineers to build forward bases. Trust me on this one, it’s a killer tactic for the last stage – setting up a strong offensive base in that area and maintaining it will increase the BLU team’s chances of winning tenfold.
Having no direct connection to the ground, BLU would definitely find it hard to get up to the sniper deck, and the narrow path into the last zone gives BLU snipers a very narrow view of the deck. However, snipers are far from invulnerable here. The discrete pile of rubble (circled in red) allows spies to sneak up to the sniper deck and wreak havoc. (I once got accused of hacking because I dominated an engineer who repeatedly tried to build up there).

Aesthetics!

There is a reason why this map…
(I’m very sorry to bash your map here, whoever made this, but it admittedly isn’t too great).
…doesn’t hold a candle to this map (cp_boulder_v3 by mapper MrMof).
Aesthetics are a very important part of TF2. After all, most of the charm of the game comes from the cartoony characters and landscapes. It just happens that maps that don’t look good or fit the style of TF2 just aren’t as fun to play. I’m not too fond of some of the community maps, being a total attack/defend junkie myself. However, all of the popular community maps use the TF2 style and use it well. CP_Boulder uses it very skillfully, which is just one of the reasons I’m so fond of the map. CP_Steel also stays in the TF2 style, despite its very unique gameplay mechanics.

Conclusion

The game isn’t called Solo Fortress, is it? Teamwork is an integral part of TF2, and probably the most important aspect of any map. Alternate routes to an objective help keep a map moving and facilitate teamwork by allowing all classes to participate – as opposed to bottlenecks, where only combat classes can be of use. Finally, aesthetics play a very important role in the fun factor of a map. Generally, maps that look good are far more immersive than badly styled maps.
Of course, these are by no means the only things that give substance to a map. It’s up to you to find out what makes TF2 tick and keep that in mind next time you’re in Hammer.
With that said, I really encourage you to try out cp_boulder when you can. It’s on our rotation at theubercharged.net TF2 server.

Adventures in the Land of Python!


I recently was invited to work on a pro-bono project (created by a Chemist Professor @ Rice) with several colleges from UT Business School & Computer Science, called Cure for the Needy. I am assisting in developing a Python/Django website for chemist's all over the world; hence, providing the users a method to collaborate on molecule synthesis creation. The website's purpose is to generate new and cheaper solutions so that pharmaceuticals can produce needed drugs for diseases. Project website is found here: http://www.cureforneedy.org/.

This is a great learning opportunity for me because I have very little to no knowledge in either of these two languages (Python & Django). I have recently been considering going into the game development field upon graduation from UT. Here I hope to get some experience in the artificial intelligence realm of computing.

Here are some great resources found for Python:

I have experience in several programming languages: C,C++,Java, asymbly, VHDL, HTML ... After a few days with Python, I am quickly coming to the realization that this language is undoubtedly one of the most powerful and easy-to-use languages that I have come across yet.

Tuesday, December 7, 2010

Open Source Software Helps Computers Use Graphics Chips for General Processing

Just in case you cannot read the picture above from the IEEE Computer magazine, December 2010. 

An Academic research team has developed an open source software tool that lets computers use the processing power of graphics processing units for purposes other than rendering and manipulating images.

North Carolina State University scientists are continuing to work on their optimizing compiler tool, which would let developers write simple application code without needing to know how to program specifically for GPUs. 

In essence, the tool takes an application and translates it into another program that does the same thing, more efficiently on a GPU. Computers use GPUs to generate the complex, data-intensive graphics seen in games, virtual reality, data visualization, and other applications, explained North Carolina State associate professor Huiyang Zhou. 

GPUs are much better than CPUs at vector processing-- handling mulitple sets of numeric operations on large arrays of structured data in parallel, explained Nathan Brookwood, Research Fellow with market-analysis firm Insight 64. They can thus offer considerably more performance than CPUs. 

Generally, mainstream general-purpose CPUs offer a peak performance between 20 and 150 Gflops, while mainstream GPUs perform between 500 and 1,500 Gflogs, he said. 

GPUs have been used to accelerate general programs for several years, and researchers are looking for ways to improve the process. The chips are fast in part because they process data in parallel. They thus mus work with applications written to compute this way. 

A key challenge is managing parallelism so that the chips stay busy by efficiently handling various threads they work with. Also challenging, are the effective use of on-chip and off-chip memory, and the even distribution of off-chip memory access to avoid over using memory controllers while leaving others idle. 

Zhou's tool compiles the application code optimally to both manage parallelism and efficiently utilize GPU memory. It enables a single memory access to load what would otherwise be multiple memory accesses, which makes data loading quicker and more efficient, thereby improving performance. 

The tool then checks the code to determine if it can handle high-performance memory features such as memory coalescing, which lets a GPU efficiently handle memory-access requests from multiple threads in a single process. If so, the tool recompiles the code so that it can implement these features. It subsequently determines whether data can be reused within and across threads. If so, the tool stores data in on-chip shared memory for fast reuse.

Finally, Zhou explained, the tool recompiles the code so that when system accesses off-chip memory, the accesses are evenly and efficiently distributed among multiple memory controllers. 

Zhou said tests by his research team showed that programs automatically translated by the new tool operated more efficiently than those manually optimized. 

Brookwood said the North Carolina State tool works similarly to Nvidia's CUDA and AMD's ATI Stream Technology, proprietary applications that enable GPUs to accelerate genreral-computing operations. It appears that Zhou's technique optimizes code more aggressively, he noted. Also, because the approach is not proprietary, it works with any hardware platform.

According to Zhou, his approach is more efficient because it yields optimized code that is better at parallelism management and memory utilization.

He said he eventually plans to release his tool as open source software.

Sunday, December 5, 2010

Freakonomics Trailer

This is one of the books I want to read-- Freakonomics (2005 non-fiction book) from authors Steven D. Levitt and Stephen J. Dubner. Yes, I have been in the engineering game for awhile. Sometimes you just loose site of the little-things, like economics. Economics, is the founding factor on which our nation is based upon (capitalism).

Wikipedia gives the following overview:

The book is a collection of 'economic' articles written by Levitt, an expert who has already gained a reputation for applying economic theory to diverse subjects not usually covered by "traditional" economists; he does, however, accept the standard neoclassicalmicroeconomic model of rational utility-maximization. InFreakonomics, Levitt and Dubner argue that economics is, at root, the study of incentives. The book's topics include:
One example of the authors' use of economic theory involves demonstrating the existence of cheating among sumo wrestlers. In a sumo tournament, all wrestlers in the top division compete in 15 matches and face demotion if they do not win at least eight of them. The sumo community is very close-knit, and the wrestlers at the top levels tend to know each other well. The authors looked at the final match, and considered the case of a wrestler with seven wins, seven losses, and one fight to go, fighting against an 8-6 wrestler. Statistically, the 7-7 wrestler should have a slightly below even chance, since the 8-6 wrestler is slightly better. However, the 7-7 wrestler actually wins around 80% of the time. Levitt uses this statistic and other data gleaned from sumo wrestling matches, along with the effect that allegations of corruption have on match results, to conclude that those who already have 8 wins collude with those who are 7-7 and let them win, since they have already secured their position for the following tournament.
The authors attempt to demonstrate the power of data mining. Many of their results emerge from Levitt's analysis of various databases, and asking the right questions. Authors posit that various incentives encourage teachers to cheat by assisting their students with multiple-choice high-stakes tests. Such cheating in the Chicago school system is inferred from detailed analysis of students' answers to multiple choice questions. But first Levitt asks, "What would the pattern of answers look like if the teacher cheated?" The simple answer: difficult questions at the end of a section will be more correct than easy ones at the beginning.
Recommended by some friends. I hope to check this book out over the winter break.

Friday, December 3, 2010

Testing the Waters of Game Design

Obviously, I enjoy a good game. In particular, I enjoy playing Team Fortress 2, Counter Strike, Star Craft 2, Left 4 Dead 2, or really anything.

On my common server that I play on, 2Fort2Furious (http://forums.2f2f.net/), some of the players have a particle effect around their hats. Today, I had a crazy idea-- create new particles for hats for Team Fortress 2.This has already been done, however I do not know how to do it. So, my engineering reflexes kicked in--- and I Googled it.

Here is some of my preliminary findings from FPSBANANA found here (http://www.fpsbanana.com/tuts/10318).

How to Test Out Particle Effects on Any Hat (that you own)!

Tools:
GCFScape or GCFExplorer
Notepad, Notepad++ or any other .txt editor
Team Fortress 2
Basic knowledge

Steps:
1. Open up GCFScape and navigate to your Steam\steamapps directory.
2. Open "team fortress 2 content.gcf"
3. Within the GCF, navigate to tf\scripts\items and extract items_game.txt somewhere. Preferably somewhere that's easy to access (like your desktop).
4. Open up items_game.txt with your text editor.
5. Use ctrl + F to find a hat you'd like to make unusual.
6. Add the following line to it:
"attributes"
{
"attach particle effect"
{
"attribute_class" "set_attached_particle"
"value" "10"
}
}
7. Substitute the "10" with the value of the particle you want to be used.

1 = burningplayer_red
2 = burningplayer_flyingbits
3 = particle_nemesis_burst_blue
4 = community_sparkle (given to community contributor's weapons)
5 = halopoint (the glow used on the Cheater's Lament)
6 = superrare_confetti_green (Green Confetti unusual effect)
7 = superrare_confetti_purple (Purple Confetti unusual effect)
8 = superrate_ghosts (Ghosts unusual effect)
9 = superrare_greenenergy (Green Energy unusual effect)
10 = superrare_purpleenergy (Purple Energy unusual effect)
11 = superrare_circling_tf (Circling Logo unusual effect)
12 = superrare_flies (Flies unusual effect)
13 = superrare_burning1 (Burning Flames unusual effect)
14 = superrare_burning2 (Scorching Flames unusual effect)
15 = superrare_plasma1 (Searing Plasma unusual effect)
16 = superrare_plasma2 (Vivid Plasma unusual effect)
17 = superrare_beams1 (Sunbeams unusual effect)
18 = superrare_circling_peacesign (Peace Sign unusual effect)
19 = superrare_circling_hearts (Circling Heart unusual effect)

8. Save the resulting file in your Steam\steamapps\stevethegamerist\team fortress 2\tf\scripts\items directory.

9. Boot up TF2 and try it out! It only works in offline mode, obviously. But you can check out how different hats look like!

10. This can also be used to apply effects to weapons in thirdperson (not on viewmodels)! Awesome!


Also, here are some pictures of the process...