Critical Gameplay Elements

Headhunter09

L1: Registered
Apr 29, 2012
47
10
I am an amateur Source mapper, with varying interest in the process. However, I'm also a very avid programmer. I was talking with one of my friends, and we came up with this idea:

I'm looking to create a genetic algorithm for generating balanced maps procedurally. The easy part is setting up the game with AI scripts and such to do thousands of games on a given map in a short amount of time. The hard part, for which I need the input of a large number of experienced mappers, is the breeding portion of the algorithm.

The algorithm needs to be able to change the map not brush by brush, but by altering fundamental gameplay elements. The question is, what is a fundamental building block?

So that's my question to this community: what are the smallest parts of a map that alter gameplay? The question is vague, so just go ahead and say what you feel the answer is. Keep in mind, I don't just mean "rooms". Routes, obstacles, holes, elevation? I could come up with some, but I want to see what you guys think.
 

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
Smallest parts that affect gameplay? Maybe textures or lights. Everything affects how a map plays in one way or another, that's why creating TF2 maps can take much longer than creating maps for other games.

I honestly doubt, though, that you'll be able to make a computer program that makes maps that play well. There are so many things that have to be taken into consideration that just listing all of them would take ages, much less how to use them properly.
 
Last edited:

Headhunter09

L1: Registered
Apr 29, 2012
47
10
I recognize that. It would be much more difficult to incorporate visual or aesthetic elements into an evaluation function. The idea is to generate a novel layout that has potential. Then a mapper can take the design and clean it up.
 
Mar 23, 2010
1,872
1,696
i don't think this can really work, i mean it could make a bunch of bad/mediocre maps and maybe it'll get lucky and make a great map but i doubt it.

these areas you want to be randomly generated have to flow into other areas pretty well and almost flawlessly. you cant put the badlands spire in the middle of 2fort courtyard, etc.. i suppose it'd be possible to make some pretty boring, kinda MEH maps that are just rooms of varying size and shape going into other rooms, but it doesn't seem worth the trouble to me. im not really sure what you want as a basic unit of map other than rooms/fighting areas.
 

Headhunter09

L1: Registered
Apr 29, 2012
47
10
The point of a genetic algorithm is that it creates lots of bad permutations, but then only recycles the ones that work. In this case, it would start out with a basic seed layout, and then make random modifications to the map areas. Those are the sort of small changes I'm looking for, but don't have the experience to identify.

Once the algorithm has slightly modified the base layout, it plays 2 bot teams against each other many times on the map, and evaluates the games, giving the map a "rating". The maps that are assigned the best ratings get to "breed" with each other, in which new maps are created that share commonalities between the two parent maps, but also have slight "mutations" (again, I'm looking for what sort of mutations should be made to make a difference).

Eventually a set of maps that receive a high rating consistently will emerge. Depending on the strength of the evaluation function, these maps could be good, or terrible. If you also have ideas about common things that happen in a game on a bad map, that input would be appreciated.
 

Trotim

aa
Jul 14, 2009
1,195
1,045
Depends on the game mode. I'm assuming you'd want to focus on KOTH first? Arguably the simplest, and its point could be reused for 5cp etc.
 

Zee

L1: Registered
Dec 30, 2009
34
16
Someone actually made something like this for Half life 1 maps. So it kind of reminds me of that.

Anyway, putting aside the should you or shouldn't you make it, I'd say the biggest problem you would face is height elevation. A huge flat mat just isn't very interesting. Even granary, although very flat, has quite a bit of height advantage.
 

Headhunter09

L1: Registered
Apr 29, 2012
47
10
I'd say the biggest problem you would face is height elevation. A huge flat mat just isn't very interesting. Even granary, although very flat, has quite a bit of height advantage.

Thanks for the input.
 

xzzy

aa
Jan 30, 2010
815
531
Granary is actually a pretty good study I'd think. It is a very boring and uninteresting map.. but it's also considered the gold standard of "competitive" maps.

Stripped down to essentials, a TF2 map is a bunch of hollow boxes connected by halls. Props and detailing are provided to break up lines of sight for long range classes and create close quarters areas for short range classes. Elevation changes are a little more subtle at creating advantages. They can be used to push players in certain directions as the high ground is almost always favored in a battle. Nooks and crannies are useful for sneaky classes and players seeking a break from the action.

All of this is within reach of a programmed algorithm, assuming you can quantify these features somehow.


The hard part is testing. TF2 bots are decent for what they are, but don't emulate humans all that well. A map that works and seems balanced with bots will probably still have significant issues once you include humans.
 

xzzy

aa
Jan 30, 2010
815
531
But such a progamm is nearly impossible.

Not impossible at all actually. Genetic algorithms can do some really neat stuff, it's really only a question of how much development time you want to put into it.

But you do have to manage your expectations somewhat. The results can be surprisingly effective, but will be quite a ways off from "perfect".
 

zpqrei

Theme Changer Extraordinaire
aa
Oct 19, 2008
1,067
1,150
Okay, I've actually gone away and thought about it for a few minutes, and I drew up some of my worries about it, and how I think it would be best to have it develop, instead of picking 'traits' and evolving the maps through breeding (because we know someone would breed Hoodoo with Turbine and get map which plays horribly and looks crap - and then everyone loses out).

8BPEN.jpg


Apologies for the crappy photo, but it should be just about legible.
 

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
a TF2 map is a bunch of hollow boxes connected by halls

If you want to look at TF2 that way, then everything, even real life, is just a bunch of hollow boxes and halls. Hell, aren't halls themselves stretched-out boxes?
 

xzzy

aa
Jan 30, 2010
815
531
Yes of course, but if you're going to attack mapping programatically, that's how you have to start.
 

Headhunter09

L1: Registered
Apr 29, 2012
47
10
Okay, I've actually gone away and thought about it for a few minutes, and I drew up some of my worries about it, and how I think it would be best to have it develop, instead of picking 'traits' and evolving the maps through breeding (because we know someone would breed Hoodoo with Turbine and get map which plays horribly and looks crap - and then everyone loses out).

*snip photo*

Apologies for the crappy photo, but it should be just about legible.

What you're suggesting is a "smarter" algorithm with a fairly greedy approach. This could work, but you have to consider the possibility in which two seperate areas reach an optimal layout, but the connecting areas are impossible to fix. In that case, having the two good areas is NOT the best solution.

Anyways, thanks for everyone's input. I might get around to working on something like this over the summer; I'll update this thread if I do.