La Salle Debain

Open Source @ Consolidated Braincells Inc.

Search for:

Show past days of news

About La Salle Debain

This is a weblog I'm keeping about my work on Debian and any other useful Debian related info I come across. It is not meant to compete with other news sources like Debian Weekly News or Debian Planet. Mostly it is just a way for me to classify and remember all the random bits of information that I have floating around me. I thought maybe by using a blog it could be of some use to others too. Btw. "I" refers to Jaldhar H. Vyas, Debian developer for over 8 years. If you want to know more about me, my home page is here.

The name? Debain is a very common misspelling of Debian and la salle de bains means bathroom in French.

If you have a comment to make on something you read here, feel free to write to me at jaldhar@debian.org.

You can get an rss 0.91 feed of the blog here.

Sunday, October 24 2010

So You Think You Can Dance...ON MY GRAVE? (4DRL Challenge Day 1)

Kanzepharaz of the one thousand and eight spires. Kanzepharaz capital of the Empire of K'thorv and since the succesful end to the war that led to the annihilation of the Pleiadic Oligarchy in K'threl, the richest and most splendid city in the Middle World. Kanzepheraz whose real estate prices have soared e'en beyond the calculation of the rainbow abacus of Thobis Himself.

Anathomelis, a princeling of the Imperial Clan needs a location for his new and expanded orgy dome. Yet the only available—and affordable on a seventh rank civil allowance—place left in the city of one thousand and eight spires is the tomb of Pharaz the First and Subsequent, lich-emperor of the Jerelite dynasty and his eldritch retainers. Before the construction-serfs can move in, the tomb must be cleared of its unshriven and non-rent-paying denizens.

As His Principalities' chief swordbearer it has fallen to you to make the tomb of Pharaz safe for gentrification. Treasures and honors await you if you succeed. Aeons of torment in the Planes of Unlife await you if you fail.

WILL YOU RISE TO THE CHALLENGE?

rec.games.roguelike.development is having another challenge, this time to complete a roguelike game in four days. My previous attempt to write one in seven days was a failure but as I can build upon my previous work, I think I can make it this time.

This time I did not waste lots of time thinking of a name. S.Y.T.Y.C.D...OMG? and The Real Housewives of Mordor were the only ones under serious consideration.

With that crucial task out of the way, I spent the morning ripping code out of A.L.F. wherever possible. In the afternoon, I looked into dungeon generation.

My previous experiments with this sort of thing were pretty convoluted but now I think I have a simpler algorithm which still provides a random yet plausible-looking map. It basically goes like this:

  1. Divide the map into a grid of sectors.As the S.Y.T.Y.C.D...OMG? map is 60×80, my sectors are 20×16 giving 3×5 grid.
  2. Mark each space on the map as impassable.
  3. In each sector, pick a random square as its "center" not too near the edge of the sector.
  4. Join each pair of centers first W -> E and then N -> S. with passable spaces. These will be the corridors and doing it this way ensures all sectors will be connected. Last time, my mistake was making rooms first and then corridors which is much more complicated to get right.
  5. For each sector, there is a 2/3 chance it contains a room. If there is, randomly a number of spaces to each side of the center square. These will be the dimensions of the room. Make all the spaces in the resulting rectangle passable.
  6. Randomly take a quarter chunk out of some rooms making them "L" shaped for a bit of variety. (at some point I can add round, polygonal or other shapes.)
  7. Create "walls" by making all the outer boundary spaces of the room impassable again. This also ensures rooms do not touch or overlap.
  8. If a wall meets a corridor, turn it into a "door." Doors don't do anything yet but eventually will be locked, trapped etc.
  9. Finally, place monsters, treasure, and items in the room.

posted at: 21:48:10 | #