Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (575)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  procedural content generation  (Read 3662 times)
0 Members and 1 Guest are viewing this topic.
Offline mmcp

Junior Newbie





« Posted 2008-07-08 16:07:04 »

Does anyone know what specific knowledge I should have to create a 2d tile-based level generator, like the Diablo series? I want to use it in a networked game, so the server will generate the map using some input, such that the input can be sent to the clients and generate the same map.

Please let me know of some algorithms I can study that can open my mind in this area, and lead to the development of my own solution. Thanks in advance!
Offline Wildern

Junior Duke





« Reply #1 - Posted 2008-07-08 18:13:56 »

This might be a good algorithm to incorporate.
You could have a fixed distribution of tiles for the level and pull them in completely randomly.
You could also adjust the randomness a bit based on what tiles are adjacent to the new tile, even to the point of specifically prevent certain tiles from being next to one another.
If you want to have all walkable tiles of the level reachable, you will need to do some form of path finding (A*, etc.) to ensure that you can actually get to a newly placed walkable tile.
Offline SwampChicken
« Reply #2 - Posted 2008-07-09 00:56:59 »

If the server has already made the entire map, why wouldn't you simply push a small section of map to the corresponding user(s).

Sending a 'seed' to the client so that it can generate its own map is dangerous because your actually relying on *trust* with the client.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #3 - Posted 2008-07-09 03:24:47 »

Does anyone know what specific knowledge I should have to create a 2d tile-based level generator, like the Diablo series? I want to use it in a networked game, so the server will generate the map using some input, such that the input can be sent to the clients and generate the same map.

Please let me know of some algorithms I can study that can open my mind in this area, and lead to the development of my own solution. Thanks in advance!

You can use the Drunkard's Walk algorithm. I used it in a open source maze generator: http://www.otcsw.com/maze.php and I improved on the algorithm and used it in this game: http://www.otcsw.com/sinuosity.php

If you want the improved algorithm, I can send it to you. Basically by iteratively adding rooms it loses a bit of randomness, so I changed it to add rooms at random locations instead.

See my work:
OTC Software
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #4 - Posted 2008-07-09 08:17:53 »

If the server has already made the entire map, why wouldn't you simply push a small section of map to the corresponding user(s).

Sending a 'seed' to the client so that it can generate its own map is dangerous because your actually relying on *trust* with the client.

Well, actually, it's no more dangerous than sending the entire map (or having it included with the client download).
If you want to limit the visible area to the player, send a unique seed for every n*n tiles.

Just make sure that the server double checks that the player really could pass that wall, and that the player really could reach that item. (But you have to check this regardless of if you send the seed or the actual map)

As for the original post:

I've been interested procedural content for a while now, and my best advice is probably to just draw a map on paper, looking roughly how you'd want the generated maps to look, but think about HOW you draw it. If you start by adding a huge room, then adding corridors from that and smaller rooms at the end, then that might be a good way for the algorithm to work.

There are some articles in the roguelike news archives, of varying quality.

Play Minecraft!
Offline mmcp

Junior Newbie





« Reply #5 - Posted 2008-07-12 23:25:10 »

Thanks for the replies everyone. I will post all of my developing ideas here.

Sending a 'seed' to the client so that it can generate its own map is dangerous because your actually relying on *trust* with the client.

Not too worried about this, since the server screens all the in-coming messages, and logs the potentially illegitimate requests(either a bug or malicious stuff). The only thing visible to the client is the collision information, to do client-side guessing stuff. Smiley


Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (35 views)
2014-10-17 03:59:02

Norakomi (25 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (26 views)
2014-10-15 16:18:58

TehJavaDev (50 views)
2014-10-14 00:39:48

TehJavaDev (50 views)
2014-10-14 00:35:47

TehJavaDev (40 views)
2014-10-14 00:32:37

BurntPizza (63 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (75 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!