Random Map Generator

Avatar
ciken
22 Posts
Posted Apr 20, 2013

Hi folks,
I wrote a computer program that can generate random portal 2 maps (cooperative).
This is its first attempt to create a highly complicated map:

http://steamcommunity.com/sharedfiles/f ... =140236196
The program also generates a solution, which I uploaded to

http://www.superiki.de/portal2/solution19Apr2013.html
I verified the solution step by step.
The design is very plain, because the program is still in its alpha stage.
Any suggestions and comments are highly appreciated.

Advertisement
Registered users don't see ads! Register now!
Avatar
Ultiman9711
118 Posts
Posted Apr 20, 2013
Replied 2 hours later
Sweet! I'll have to give this a try - I've been always hoping somebody would come up with something like this considering puzzle design is a pain sometimes.
Avatar
BenVlodgi
633 Posts
Posted Apr 20, 2013
Replied 6 hours later
did you use that PTI library that was uploaded here a few months ago?
this sounds pretty cool, I'm interested in how you went about doing this
Avatar
ciken
22 Posts
Posted Apr 21, 2013
Replied 11 hours later

BenVlodgi wrote:
did you use that PTI library that was uploaded here a few months ago?
this sounds pretty cool, I'm interested in how you went about doing this

The generator is written completely in Java without any additional libraries (I used the p2c file format descriptions that are available, in particular the one here at ThinkingWithPortals). All maps that it generates have the same voxel topology and they differ only in entity placement. This might change in later versions. By placing glass, laser walls, fizzlers, and buttons, and by deciding where portals can be placed, the genenator can construct complicated puzzles. At the moment, these are the only items that it uses, because their logic is fairly simple and was easy to implement.
The generator has a method to determine the "complexity" of a map and it tries to build maps with a high complexity. The generation time of this particular map was several hours.
My friend and I were unable to solve it within a reasonable time frame, so the generator seems to be able to construct pretty complicated maps.

Avatar
FelixGriffin
2,680 Posts
Posted Apr 21, 2013
Replied 1 hour later
Wow, this sounds really cool! I'll have to try it. Do you plan to post the source code to this ever?

Now, I wonder if anyone can make a program that takes a P2C and figures out the solution?

Avatar
CamBen
973 Posts
Posted Apr 21, 2013
Replied 4 hours later

FelixGriffin wrote:
Wow, this sounds really cool! I'll have to try it. Do you plan to post the source code to this ever?

Now, I wonder if anyone can make a program that takes a P2C and figures out the solution?

Blindruns will no longer be "blind"

Avatar
ciken
22 Posts
Posted Apr 21, 2013
Replied 3 hours later

Ultiman9711 wrote:
Sweet! I'll have to give this a try - I've been always hoping somebody would come up with something like this considering puzzle design is a pain sometimes.

I have not thought about that, but one could use the generated levels as a basis and then modify them to turn them into nice maps.

FelixGriffin wrote:
Wow, this sounds really cool! I'll have to try it. Do you plan to post the source code to this ever?

I think that I want to play around with it some more before cleaning the source code up and releasing it. I might add support for more different testing elements and a more complex map topology.

FelixGriffin wrote:
Now, I wonder if anyone can make a program that takes a P2C and figures out the solution?

I think that solving arbitrary p2c maps would be significantly more difficult than solving these very simple ones. But I would really like to see this done.

Avatar
FelixGriffin
2,680 Posts
Posted Apr 21, 2013
Replied 3 hours later
I suppose a program could come up with some sort of dependency map--the laser emitter requires the button, the button requires the cube, the cube requires the switch--but it probably couldn't do anything with portal placement. For example, I'm not sure how a program could figure out that you need the reversed tractor beam over the goo to save the cube.
Avatar
ciken
22 Posts
Posted Apr 22, 2013
Replied 5 hours later

FelixGriffin wrote:
I suppose a program could come up with some sort of dependency map--the laser emitter requires the button, the button requires the cube, the cube requires the switch--but it probably couldn't do anything with portal placement. For example, I'm not sure how a program could figure out that you need the reversed tractor beam over the goo to save the cube.

Using Dijkstra's algorithm in the state space, the program is already really good at figuring out where and when to place a portal, as you can see from the example map in this thread and its solution. It would be harder for the program to answer the following questions: How fast can a player run / bunny hop? How high can a player jump? How high can a player jump if a cube is available? What surfaces can a player see when using a faith plate? How far can players jump using orange/blue gel? Et cetera.
A program that solves p2c files would have to be able to answer such questions.

Avatar
Lpfreaky90
2,842 Posts
Posted Apr 22, 2013
Replied 3 hours later
pfff this was what I feared most for when the PTI came out.

There is a huge difference between a map and a properly designed; thought out map.
The PTI made it a lot easier to make a simple map without much design philosophy or experience, and this is the next step: we make maps for you. I would hate to see the workshop being flooded with these kind of maps.

All in all it's a nice programming concept but the potential outcome scares me.

Avatar
ciken
22 Posts
Posted Apr 22, 2013
Replied 1 hour later

Lpfreaky90 wrote:
There is a huge difference between a map and a properly designed; thought out map.

I agree with you on that point and one might see this program as a proof of concept. Agreed, the maps it generates are a bit ugly, but have you played the example I provided? Keep in mind that this is still the alpha version.

Lpfreaky90 wrote:
The PTI made it a lot easier to make a simple map without much design philosophy or experience, and this is the next step: we make maps for you.

Indeed, without the PTI it would have been harder to put this together.

Lpfreaky90 wrote:
I would hate to see the workshop being flooded with these kind of maps.

I understand your concerns and I ensure you that I have no intention to flood the workshop.

Avatar
FelixGriffin
2,680 Posts
Posted Apr 22, 2013
Replied 40 minutes later
That sounds awesome!

About the fear of this flooding the workshop: here's an idea...what if it generated slightly mangled P2Cs, so you couldn't just start generating them and publishing them? I wonder if it would compile without the exit door, or the primary observation room, for example.

Avatar
tile
380 Posts
Posted Apr 23, 2013
Replied 1 day later
GLaDOS: perfect, i've finally finished self-coding the best automated test-building algorithm yet.
guy who made this: join the club.
Avatar
BenVlodgi
633 Posts
Posted Apr 24, 2013
Replied 5 hours later
LP is right to be afrade of this, but I still think it is kickass
I really wanted to write a program like this however I know of the limitations that would be present, like the things you mentioned before, and I certainly did not want to tackle those problems.
Any particular reason you chose Java (besides that then anyone could use it).. for performance sake, I love C#
Avatar
ChickenMobile
2,460 Posts
Posted Apr 24, 2013
Replied 48 minutes later
Who knows, the complete randomness of it might create some interesting concepts!

I doubt it would be good just to randomize and play though.

Avatar
ciken
22 Posts
Posted Apr 29, 2013
Replied 5 days later

FelixGriffin wrote:
That sounds awesome!

About the fear of this flooding the workshop: here's an idea...what if it generated slightly mangled P2Cs, so you couldn't just start generating them and publishing them? I wonder if it would compile without the exit door, or the primary observation room, for example.

I don't quite see the point there. If it generates broken maps, then you cannot play them.

BenVlodgi wrote:
LP is right to be afrade of this, but I still think it is kickass
I really wanted to write a program like this however I know of the limitations that would be present, like the things you mentioned before, and I certainly did not want to tackle those problems.
Any particular reason you chose Java (besides that then anyone could use it).. for performance sake, I love C#

I chose Java, because I am familiar with it and it runs on every machine. Performance is also quite good. And there is no high-end graphics involved, because it just outputs a p2c file.

ChickenMobile wrote:
Who knows, the complete randomness of it might create some interesting concepts!

I doubt it would be good just to randomize and play though.

It is not only random, but it also tries to maximize a function measuring how complicated solving the map is. What it is really good at is the following: You give it map snippets and it combines them into very complicated puzzles. And I think that it is better at this particular job than a human mapper. But it does cannot invent new snippets. Only if the snippets get really small, this would not matter any more.

I will work on a singleplayer map version which does not output a p2c, but a description file how to build the puzzle. A skilled mapper can then implement it. It is harder to do the singleplayer version, because it would most likely either involve cubes or sophisticated flinging and neither is implemented yet.

Avatar
FelixGriffin
2,680 Posts
Posted Apr 29, 2013
Replied 15 minutes later

ciken wrote:
FelixGriffin wrote:

That sounds awesome!

About the fear of this flooding the workshop: here's an idea...what if it generated slightly mangled P2Cs, so you couldn't just start generating them and publishing them? I wonder if it would compile without the exit door, or the primary observation room, for example.

I don't quite see the point there. If it generates broken maps, then you cannot play them.

Not fully broken, but with something preventing instant publishing. For example, a map will compile and run but not publish if the global_pti_ents are gone, or if something conflicts with them.

Avatar
ciken
22 Posts
Posted Apr 29, 2013
Replied 8 minutes later

FelixGriffin wrote:
ciken wrote:

FelixGriffin wrote:

That sounds awesome!

About the fear of this flooding the workshop: here's an idea...what if it generated slightly mangled P2Cs, so you couldn't just start generating them and publishing them? I wonder if it would compile without the exit door, or the primary observation room, for example.

I don't quite see the point there. If it generates broken maps, then you cannot play them.

Not fully broken, but with something preventing instant publishing. For example, a map will compile and run but not publish if the global_pti_ents are gone, or if something conflicts with them.

I did not know that. This should be quite easy then.

Avatar
FelixGriffin
2,680 Posts
Posted Apr 30, 2013
Replied 15 hours later
Unfortunately I don't know of a way to break those in the P2C file, unless someone had a mod installed that could add an extra undeletable unplaceable item to conflict with it. I'll see if I can find a way.
Avatar
ciken
22 Posts
Posted Jun 29, 2013
Replied 1 month later

Recently I continued working on this and I created a single player map. The logic is computer generated and I did the mapping by hand. Since I am not a very good mapper, the map is kind of ugly and could have flaws (I hope not), but this is mostly a proof of concept. Nevertheless, I hope you enjoy it. I would say it is quite hard:

http://steamcommunity.com/sharedfiles/f ... =156399981

Advertisement
Registered users don't see ads! Register now!