Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: Invitation to contribute to random map generator




Hello,

  I'm working on a random map generator for crossfire right now,
and I'm at the stage where I'm working on forming reasonable basic
wall layouts.

  I've written a maze generator already:
####################
#...#.#.#.#.#.#..#.#
#.......#...#....#.#
#...###.##..####.#.#
#####.#..##......#.#
#.....#...#..###...#
#...###.###.##.##..#
##..#...#...#...##.#
#..##.#.#.#.###..#.#
##.#..#.###...#.##.#
#..#.##.....#...#..#
#..#.#.....##..##.##
#.##.#.....#...#...#
#....#.....#...#.###
####.##....#...#...#
#..#..##.###...#.###
##.##..#.#...###.#.#
#.....##.##..#...#.#
#..#..#...#..#.#...#
####################

And I'm working on a layout generator which makes things like:

/*  generates onion (layered) maps */
char **map_gen_onion(int xsize, int ysize, int option, int layers);

like this:
regular			      random
centered, linear onion        bottom/right centered, nonlinear

#########################     #########################
#                       #     #                       #
# ########  ##########  #     #   #####################
# #                  #  #     #   #                   #
# # ######  ######## #  #     #   #                   #
# # #              # #  #     #   #   ######## ########
# # # ####  ###### # #  #     #   #   #               #
# # # #          # # #  #     #   #   #               #
# # # ############ # #  #     #   #   #  ########### ##
# # #              # #  #     #   #   #  #            #
# # ################ #  #     #   #   #  #    #########
# #                  #  #     #       #  #    #       #
# ####################  #     #   #   #  #            #
#                       #     #   #   #  #    #       #
#########################     #########################

options:
0	Pick a random options below
1	linear doors (default is nonlinear)
2	bottom "centered" -- produces bottom centered onion
4	right "centered", can be combined with bottom centering
8	outer wall off:  i.e., no outer wall.
16	irregularly/randomly spaced layers (default: regular)

Someone else is working on maps which look like:
######################
#       #   #        #
#       #   #        #
#                    #
#       #   #        #
#########   ##########
#       #   #        #
#                    #
#       #   #        #
#       #   #        #
#########   ##########
#       #   #        #
#                    #
#       #   #        #
######################


I invite everyone to contribute their own random layout generation function,
if they're not along these lines.

Specs:

allocates and returns a char ** array given xsize and ysize and whatever
options you feel are appropriate, like so:

char **layout_generator(int xsie, int ysize, int option1, int option2);

Passing 0 in for option1 or option2 should make it pick at random from
the options available.

The returned array should have a '#' for a wall block, and a char value
of 0 for an empty cell.

Restrictions:  every point should be accessible from every other point.
You may also use the char value of '*' to indicate a door, if you like.

Please keep me informed about your plans so that I may coordinate.

PeterM
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to ]