Hengband  2.2.1
データ構造 | マクロ定義 | 型定義 | 関数 | 変数
wild.c ファイル

荒野マップの生成とルール管理 / Wilderness generation [詳解]

#include "angband.h"
#include "util.h"
#include "core.h"
#include "dungeon.h"
#include "floor.h"
#include "wild.h"
#include "world.h"
#include "monster.h"
#include "realm-hex.h"
#include "player-status.h"
#include "player-effects.h"
#include "grid.h"
#include "monster-status.h"
#include "quest.h"
#include "dungeon-file.h"
#include "files.h"
#include "feature.h"
#include "floor-town.h"
#include "realm.h"
#include "view-mainwindow.h"
wild.c の依存先関係図:

データ構造

struct  wilderness_grid
 

マクロ定義

#define MAX_FEAT_IN_TERRAIN   18
 

型定義

typedef struct wilderness_grid wilderness_grid
 
typedef wilderness_typewilderness_type_ptr
 

関数

static void set_floor_and_wall_aux (s16b feat_type[100], feat_prob prob[DUNGEON_FEAT_PROB_NUM])
 地形生成確率を決める要素100の配列を確率テーブルから作成する [詳解]
 
void set_floor_and_wall (DUNGEON_IDX type)
 ダンジョンの地形を指定確率に応じて各マスへランダムに敷き詰める / Fill the arrays of floors and walls in the good proportions [詳解]
 
static void perturb_point_mid (FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, FEAT_IDX x4, POSITION xmid, POSITION ymid, FEAT_IDX rough, FEAT_IDX depth_max)
 プラズマフラクタル的地形生成の再帰中間処理 / Helper for plasma generation. [詳解]
 
static void perturb_point_end (FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, POSITION xmid, POSITION ymid, FEAT_IDX rough, FEAT_IDX depth_max)
 プラズマフラクタル的地形生成の再帰末端処理 / Helper for plasma generation. [詳解]
 
static void plasma_recursive (floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, FEAT_IDX depth_max, FEAT_IDX rough)
 プラズマフラクタル的地形生成の開始処理 / Helper for plasma generation. [詳解]
 
static void generate_wilderness_area (floor_type *floor_ptr, int terrain, u32b seed, bool border, bool corner)
 荒野フロア生成のサブルーチン [詳解]
 
static void generate_area (floor_type *floor_ptr, POSITION y, POSITION x, bool border, bool corner)
 荒野フロア生成のメインルーチン / Load a town or generate a terrain level using "plasma" fractals. [詳解]
 
void wilderness_gen (floor_type *floor_ptr)
 広域マップの生成 / Build the wilderness area outside of the town. [詳解]
 
void wilderness_gen_small (player_type *creature_ptr, floor_type *floor_ptr)
 広域マップの生成(簡易処理版) / Build the wilderness area. [詳解]
 
errr parse_line_wilderness (char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x)
 w_info.txtのデータ解析 / Parse a sub-file of the "extra info" [詳解]
 
void seed_wilderness (void)
 ゲーム開始時に各荒野フロアの乱数シードを指定する / Generate the random seeds for the wilderness [詳解]
 
errr init_wilderness (void)
 ゲーム開始時の荒野初期化メインルーチン / Initialize wilderness array [詳解]
 
static void init_terrain_table (int terrain, s16b feat_global, concptr fmt,...)
 荒野の地勢設定を初期化する / Initialize wilderness array [詳解]
 
void init_wilderness_terrains (void)
 荒野の地勢設定全体を初期化するメインルーチン / Initialize arrays for wilderness terrains [詳解]
 
bool change_wild_mode (player_type *creature_ptr, bool encount)
 荒野から広域マップへの切り替え処理 / Initialize arrays for wilderness terrains [詳解]
 

変数

wilderness_type ** wilderness
 
bool generate_encounter
 
static s16b terrain_table [MAX_WILDERNESS][MAX_FEAT_IN_TERRAIN]
 
static border_type border
 
static s16b conv_terrain2feat [MAX_WILDERNESS]
 
static wilderness_grid w_letter [255]
 

詳解

荒野マップの生成とルール管理 / Wilderness generation

日付
2014/02/13
著者
Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
This software may be copied and distributed for educational, research, and
not for profit purposes provided that this copyright and statement are
included in all such copies.
2013 Deskull rearranged comment for Doxygen.

マクロ定義詳解

◆ MAX_FEAT_IN_TERRAIN

#define MAX_FEAT_IN_TERRAIN   18

型定義詳解

◆ wilderness_grid

◆ wilderness_type_ptr

関数詳解

◆ change_wild_mode()

bool change_wild_mode ( player_type creature_ptr,
bool  encount 
)

荒野から広域マップへの切り替え処理 / Initialize arrays for wilderness terrains

引数
encount襲撃時TRUE
戻り値
切り替えが行われた場合はTRUEを返す。
呼び出し関係図:

◆ generate_area()

static void generate_area ( floor_type floor_ptr,
POSITION  y,
POSITION  x,
bool  border,
bool  corner 
)
static

荒野フロア生成のメインルーチン / Load a town or generate a terrain level using "plasma" fractals.

引数
y広域Y座標
x広域X座標
border広域マップの辺部分としての生成ならばTRUE
corner広域マップの角部分としての生成ならばTRUE
戻り値
なし
x and y are the coordinates of the area in the wilderness.
Border and corner are optimization flags to speed up the
generation of the fractal terrain.
If border is set then only the border of the terrain should
be generated (for initializing the border structure).
If corner is set then only the corners of the area are needed.
呼び出し関係図:
被呼び出し関係図:

◆ generate_wilderness_area()

static void generate_wilderness_area ( floor_type floor_ptr,
int  terrain,
u32b  seed,
bool  border,
bool  corner 
)
static

荒野フロア生成のサブルーチン

引数
terrain荒野地形ID
seed乱数の固定シード
border未使用
corner広域マップの角部分としての生成ならばTRUE
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ init_terrain_table()

static void init_terrain_table ( int  terrain,
s16b  feat_global,
concptr  fmt,
  ... 
)
static

荒野の地勢設定を初期化する / Initialize wilderness array

引数
terrain初期化したい地勢ID
feat_global基本的な地形ID
fmt地勢内の地形数を参照するための独自フォーマット
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ init_wilderness()

errr init_wilderness ( void  )

ゲーム開始時の荒野初期化メインルーチン / Initialize wilderness array

戻り値
エラーコード

◆ init_wilderness_terrains()

void init_wilderness_terrains ( void  )

荒野の地勢設定全体を初期化するメインルーチン / Initialize arrays for wilderness terrains

戻り値
なし
呼び出し関係図:

◆ parse_line_wilderness()

errr parse_line_wilderness ( char *  buf,
int  ymin,
int  xmin,
int  ymax,
int  xmax,
int *  y,
int *  x 
)

w_info.txtのデータ解析 / Parse a sub-file of the "extra info"

引数
buf読み取ったデータ行のバッファ
ymin未使用
xmin広域地形マップを読み込みたいx座標の開始位置
ymax未使用
xmax広域地形マップを読み込みたいx座標の終了位置
y広域マップの高さを返す参照ポインタ
x広域マップの幅を返す参照ポインタ
戻り値
なし
呼び出し関係図:

◆ perturb_point_end()

static void perturb_point_end ( FEAT_IDX  x1,
FEAT_IDX  x2,
FEAT_IDX  x3,
POSITION  xmid,
POSITION  ymid,
FEAT_IDX  rough,
FEAT_IDX  depth_max 
)
static

プラズマフラクタル的地形生成の再帰末端処理 / Helper for plasma generation.

引数
x1中間末端部1の重み
x2中間末端部2の重み
x3中間末端部3の重み
xmid最終末端部座標X
ymid最終末端部座標Y
roughランダム幅
depth_max深みの最大値
戻り値
なし
被呼び出し関係図:

◆ perturb_point_mid()

static void perturb_point_mid ( FEAT_IDX  x1,
FEAT_IDX  x2,
FEAT_IDX  x3,
FEAT_IDX  x4,
POSITION  xmid,
POSITION  ymid,
FEAT_IDX  rough,
FEAT_IDX  depth_max 
)
static

プラズマフラクタル的地形生成の再帰中間処理 / Helper for plasma generation.

引数
x1左上端の深み
x2右上端の深み
x3左下端の深み
x4右下端の深み
xmid中央座標X
ymid中央座標Y
roughランダム幅
depth_max深みの最大値
戻り値
なし
被呼び出し関係図:

◆ plasma_recursive()

static void plasma_recursive ( floor_type floor_ptr,
POSITION  x1,
POSITION  y1,
POSITION  x2,
POSITION  y2,
FEAT_IDX  depth_max,
FEAT_IDX  rough 
)
static

プラズマフラクタル的地形生成の開始処理 / Helper for plasma generation.

引数
x1処理範囲の左上X座標
y1処理範囲の左上Y座標
x2処理範囲の右下X座標
y2処理範囲の右下Y座標
depth_max深みの最大値
roughランダム幅
戻り値
なし
A generic function to generate the plasma fractal.
Note that it uses ``cave_feat'' as temporary storage.
The values in ``cave_feat'' after this function
are NOT actual features; They are raw heights which
need to be converted to features.
呼び出し関係図:
被呼び出し関係図:

◆ seed_wilderness()

void seed_wilderness ( void  )

ゲーム開始時に各荒野フロアの乱数シードを指定する / Generate the random seeds for the wilderness

戻り値
なし

◆ set_floor_and_wall()

void set_floor_and_wall ( DUNGEON_IDX  type)

ダンジョンの地形を指定確率に応じて各マスへランダムに敷き詰める / Fill the arrays of floors and walls in the good proportions

引数
typeダンジョンID
戻り値
なし
呼び出し関係図:

◆ set_floor_and_wall_aux()

static void set_floor_and_wall_aux ( s16b  feat_type[100],
feat_prob  prob[DUNGEON_FEAT_PROB_NUM] 
)
static

地形生成確率を決める要素100の配列を確率テーブルから作成する

引数
feat_type非一様確率を再現するための要素数100の配列
prob元の確率テーブル
戻り値
なし
被呼び出し関係図:

◆ wilderness_gen()

void wilderness_gen ( floor_type floor_ptr)

広域マップの生成 / Build the wilderness area outside of the town.

戻り値
なし
呼び出し関係図:

◆ wilderness_gen_small()

void wilderness_gen_small ( player_type creature_ptr,
floor_type floor_ptr 
)

広域マップの生成(簡易処理版) / Build the wilderness area.

-DG-

戻り値
なし
呼び出し関係図:

変数詳解

◆ border

border_type border
static

◆ conv_terrain2feat

s16b conv_terrain2feat[MAX_WILDERNESS]
static

◆ generate_encounter

bool generate_encounter

◆ terrain_table

s16b terrain_table[MAX_WILDERNESS][MAX_FEAT_IN_TERRAIN]
static

◆ w_letter

wilderness_grid w_letter[255]
static

◆ wilderness

wilderness_type** wilderness