Post new topic    
Page 1, 2  »
Super Slime
Send private message
64digits competition journal 
 PostWed May 09, 2012 9:45 pm
Send private message Reply with quote
I thought I'd make a thread to post updates about my 64digits competition project, so here it is! If you are also working on an entry (Spoonweaver? anyone else?), then feel free to use this thread to your own nefarious ends as well.

Before the contest started, I mentioned that I was thinking of making something along the lines of Actraiser. Well, I dropped that idea; instead, I'm working on something along the lines of the Mysterious Dungeon games (think roguelikes, but a bit more casual). Today's update: map generation!



Shown here are two maps generated using two different algorithms. On the left is my box stacking algorithm. Basically, it puts a bunch of squares on the map, then figures out how to place the doors so that the entire map is connected. One of the big problems for maze generation is connectedness: you need to ensure that there's always a way to get from point A to point B. This algorithm takes the easy way out by putting a door on every wall that might need one (shown in blue because the brown wasn't showing up well).

Even though the rooms are all square, because they overlap, the end result can be an interesting shape. This algorithm generates a map with an artifical, dungeony feel.

On the right is a tried-and-true cave algorithm. It starts with a random pattern of floors and walls, then uses cellular automata (think Conway's Game of Life, but with different rules) to turn the staticky mess into the smooth, natural map you see here. Of course, this is a great algorithm for generating caves, but it also does well with forests and other natural terrain. (Use your imagination here.)

The third algorithm I want to add is the rooms-connected-by-halls type that you see in a lot of roguelikes. There are variations on this theme, but the one I'm going with is going to be the one used all the way back in Rogue. The general idea is that you divide the map into cells, connect all the cells with corridors, then put rooms in some of the cells. The end result is familiar to anyone who's played pretty much any game in the genre.

Next time, I'd like to talk a bit about the flow of the game, which will tend more towards a traditional RPG than most roguelikes. Meanwhile, if you're interested in this project, you can help:
  • If you want to help me make the game, I am taking applications. I am flying solo right now
  • If you can't spare the time to help but have suggestions, then please contribute!
  • And if you just want to see me finish the project, make sure to bug me for updates in this thread. This is more helpful to me than you'd think!

Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Liquid Metal King Slime
Send private message
 
 PostWed May 09, 2012 9:53 pm
Send private message Reply with quote
This is cool! I would be interested to see your map generation code if you are willing to post it.

Are you doing this with the OHRRPGCE or programming it some other way? (your screenshot doesn't give me sufficient clues to know)
Super Slime
Send private message
 
 PostWed May 09, 2012 11:16 pm
Send private message Reply with quote
It's done in Hamsterspeak. These are the top-level scripts:

Code:
script, generate cave level, w, h, begin
   # Cavernous level: wide open level made by cellular automata
   variable(i, j, k, success)
   # Initialize variables
   if (w << 30) then (w := 30)
   if (h <<30>> map width) then (w := map width)
   if (h >> map height) then (h := map height)
   width := w
   height := h
   
   # init random map
   $0 = "Initializing map"
   debug(debug:cave)
   for(j, 0, h) do (
      for(i, 0, w) do (
         if (random(0, 100) <<cave>> cave:generate repetitions)) then (
               write map block(i, j, tile:wall)
            ) else (
               write map block(i, j, tile:floor)
            )
         )
      )
      # then apply it to the pass blocks
      for(j, 0, h) do (
         for(i, 0, w) do (
            if (read map block(i, j) == tile:wall) then (
               write pass block(i, j, 15)
            ) else (
               write pass block(i, j, 0)
            )
         )
      )
   )
   
   # check for connectedness
   $0 = "Checking connectedness"
   debug(debug:cave)
   for(j, 0, h) do (
      for(i, 0, w) do (
         if (read pass block(i, j)) then (continue)
         k := find connected blocks(i, j)
         # If this area is large enough, hooray! Otherwise, fill it in.
         if (k << w * h / 3) then (fill connected blocks(i, j)) else (success += 1)
      )
   )
   $0 = "Successful regions: "
   append number(0, success)
   debug(debug:cave)
   return(success == 1)
end

script, generate box level, w, h, begin
   # Box level: stack a bunch of boxes on top of each other
   variable(i, x, y, size, rooms)
   # Initialize variables
   if (w << 30) then (w := 30)
   if (h <<30>> map width) then (w := map width)
   if (h >> map height) then (h := map height)
   width := w
   height := h
   size := w * h
   rooms := size / ((low room size + high room size) / 2) ^ 2
   rooms -= random(0, rooms / 4)
   if (rooms <<2>> high rooms) then (rooms := high rooms)
   total rooms := rooms
   num rooms := 0
   upstairs x := -1
   upstairs y := -1
   downstairs x := -1
   downstairs y := -1
   for (i, @rooms x, @rooms y + 19) do (write global(i, 0))
   
   # Wipe the map
   for (y, 0, h -- 1) do (
      for (x, 0, w -- 1) do (
         write map block(x, y, 0)
         write pass block(x, y, 0)
      )
   )
   
   # Generate initial room
   i := 0
   w := random(low room size, high room size)
   h := random(low room size, high room size)
   x := random(0, map width -- w)
   y := random(0, map height -- h)
   while (generate box room(x, y, x + w -- 1, y + h -- 1) == false) do (
      i += 1
      if (i >> error threshold) then (exit returning(0))
      w := random(low room size, high room size)
      h := random(low room size, high room size)
      x := random(0, map width -- w)
      y := random(0, map height -- h)
   )
   num rooms += 1
   
   while (num rooms <<total>> error threshold) then (exit returning(0))
      ) else (
         num rooms += 1
      )
   )
   return(1)
end


If you want any more details, I can provide them.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Liquid Metal King Slime
Send private message
 
 PostThu May 10, 2012 1:52 am
Send private message Reply with quote
with the box stacking one what happens if there's a double or triple wall right down the center?
Super Slime
Send private message
 
 PostThu May 10, 2012 2:12 am
Send private message Reply with quote
I'd have to double-check, but I'm pretty sure it won't place a wall next to a door. It also won't place a room into a location that's already mostly full. Triple walls are possible but really unlikely, and they won't affect pathing anyway. At least, that's what I remember while typing on my phone.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Metal King Slime
Send private message
 
 PostThu May 10, 2012 2:22 am
Send private message Reply with quote
Quite impressive. And far, far more elegantly done than the code I was working on, hehe. Will the code eventually feature things like traps and dungeon features like in other roguelikes?
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
Liquid Metal King Slime
Send private message
 
 PostThu May 10, 2012 2:25 am
Send private message Reply with quote
Well anyways, I started a project with Jack. He's currently working on some basic graphics. Once I've got those I'm going to set to work on the game.

Basically, I'm going to try to make an RPG with heavy emphasis on out of battle gameplay. I'm thinking something like castle on the night land but with battles.
Super Slime
Send private message
 
 PostThu May 10, 2012 3:30 am
Send private message Reply with quote
BMR wrote:
Will the code eventually feature things like traps and dungeon features like in other roguelikes?

That's the plan.

Actually, there are quite a few things I'd like to do eventually, but I have to scale it to my timeline. Better work on placing the stairs first, right?
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Super Slime
Send private message
 
 PostTue May 15, 2012 1:35 am
Send private message Reply with quote
Thanks for deciding to read more about my game-in-progress! I've been taking a break from map gen lately to work on items. Today, though, I'd like to talk about the dungeon-level game flow.

If you've played a roguelike before, you know that the enemies don't move until you do. That's true here as well. Enemies that have noticed you will pursue you doggedly, but they have to wait for you to do something first. However, when the enemy reaches you, that's when things diverge from the roguelike norm: you'll enter into a traditional RPG battle.



Rather than create a full walkabout set for each individual enemy in the game -- a huge amount of work for a three-month project -- I opted for an Adventure of Link-inspired approach. You can't tell exactly who you'll be fighting, but you can get a general idea based on the monster glyph, and it's also easy to discern a monster's movement capabilities at a glance. From left to right:
  • The normal monster. Takes one step for each of yours, etc.
  • The flying monster. This one can chase you over pits, lava, water, and so on.
  • The aquatic monster. This monster only appears in the water and is hard to spot from land. Just when you thought it was safe to go back to the beach...
  • The fast monster. It takes two steps to your one, making it hard to escape.
  • The boss monster. It moves like the normal monster, but this glyph indicates an especially tough fight. If you can run, might wanna do that.


As in a roguelike, it's vitally important to get the jump on your enemies. If you make contact with them, then you get the first move. However, if they bump into you, then they get the first move. In other words, your classic roguelike tactics carry over into the RPG battles.

Naturally, you can run from any encounter. The enemy will still be standing next to you, but maybe you have a clever plan to escape. Should you find yourself cornered, you can take comfort in knowing that any damage you dealt in a previous encounter will stick around.

And that's how you get into battles. Anyone want to vote on our next topic? I could talk about skill progression, introduce you to our brave hero, discuss the item catalogue, or do something else entirely.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Liquid Metal King Slime
Send private message
 
 PostTue May 15, 2012 4:27 am
Send private message Reply with quote
Mogri wrote:




I love these, I love these, I love these!

If you had a different glyph for every distinct monster, all drawn in this style, would you use them?
Super Slime
Send private message
 
 PostTue May 15, 2012 4:45 am
Send private message Reply with quote
Yes, absolutely. I don't have a complete bestiary yet, though.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Liquid Metal King Slime
Send private message
 
 PostTue May 15, 2012 1:07 pm
Send private message Reply with quote
If I was going to draw more for you, how would you want them? are they in the first two slots of each walkabout? the two down slots of each walkabout? Are they packed 4 to a walkabout?

Are you using the default master palette, or some other?
Slime Knight
Send private message
 
 PostTue May 15, 2012 1:13 pm
Send private message Reply with quote
The glyphs really are super-nice, Mogri. Not so much simple as ICONIC. I love them, too, and am looking forward to your project even more now!
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! Grab it today!
Metal King Slime
Send private message
 
 PostTue May 15, 2012 1:48 pm
Send private message Reply with quote
I checked this thread earlier today, but didn't get around to replying. For some strange reason, I distinctly remember those walkabouts to be animated... I guess that just shows the strength of the design that my brain is playing tricks with me that way, hehe.
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
Super Slime
Send private message
 
 PostTue May 15, 2012 4:28 pm
Send private message Reply with quote
Thanks for the response, guys! It means a lot to me.

James Paige wrote:
If I was going to draw more for you, how would you want them? are they in the first two slots of each walkabout? the two down slots of each walkabout? Are they packed 4 to a walkabout?

Are you using the default master palette, or some other?


I have only the two frames for each, spread across an entire walkabout set (ABABABAB). I am indeed using the default palette.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Display posts from previous:
Page 1, 2  »