User:SkeletonCrew

From The Battle for Wesnoth Wiki
Revision as of 20:41, 26 October 2006 by SkeletonCrew (talk | contribs) (terrain strings)

WIP

Terrain system

The goal is to convert the old single letter terrain system to a new multi letter system. The internal changes to the engine are almost done.

These are the proposals and explanations for the new system, once these are final and implanted these texts will move into the wiki.

Version: pre-proposal Last updated: --SkeletonCrew 21:59, 26 October 2006 (CEST)

History:

terrain

Every terrain type gets a new field named string this will be the new string to use to refer to the terrain. The old char field will stay for the existing terrains, this is needed to convert older maps to be used with the new engine.

This string will exist of 2 to 4 characters, the allowed characters are all letters (the engine is case sensitive), all numbers and the symbols / | \. Note leading numbers are not allowed in the string, they might give confusion with starting locations. Other characters are reserved for special uses in the engine.

The limit of 4 characters is not the upper limit of the engine, but the upper level for easy parsing. The internal format uses 4 bytes and every character is 1 byte. This way it's very easy to convert the characters to the internal format. If more letters are required it will require some modifications to the engine.

I'm considering to allow 1 character terrains as well since I've some trouble to find a second letter everywhere.

Every terrain will also get a new field named theme this is explained in the editor section.

scenario map

The map will use the new strings instead of the old letters. For every tile a string will be used instead of one letter, these strings are separated with a comma. Between the string and the comma one or more spaces are allowed.

Discussion: Should we also allow tabs at the places where we allow spaces? We can allow it but depreciate it.

The WML for map will use the same format. The letter for map WML will use a single terrain string without comma's.

Terraingraphics

The need two modifications the map format and the type format.

map

This format will change a bit more than the other items. The old format is described here TerrainGraphicsWML. According to mog the letters in the map are never used, only the anchors are used. The new format will only accept anchors. The special characters . and * will stay the same.

This map file will no longer be space separated but comma separatedand. Odd lines will start with a leading comma instead of 2 spaces. Spaces are allowed for padding (tabs depending on the discussion above.)

For example this

map="
  1
1   1
  2
1   1
  1"

will become

map="
,1
1,1
,2
1,1
,1"

or

map="
, 1
1 , 1
, 2
1 , 1
, 1"

Discussion: Or do people like the 4 spaces separated items?

type

The type will be a list of terrains, comma separated. Spaces are allowed but then the items need to be between brackets. (A WML rule.)

I'm not sure what to do with the ! whether or not it requires a comma behind it, but I'm inclined to add this requirement.

Mog had an idea which will also be implanted, the * can be used in a terrain string, V* would match all terrain strings starting with the letter 'V'. Vh* would match all terrain strings starting with 'Vh' eg Vh, Vha, Vhaa but not VH or vH.

editor

The editor also will need an overhaul due to the changes, since the terrain consists of a maximum of 4 characters I propose it writes the terrain as a string of 6 characters; the terrains string followed by a comma and padded with spaces. eg the following terrain string

Vh,Vha,Vhaa,Vha,Vh 

will be written as

123456123456123456123456123456 (numbers won't be written.)
Vh,   Vha,  Vhaa, Vha,  Vh 

Discussion: Should the editor be able to write the old format terrain or not.

custom terrains

Zookeeper told me there's no option to add custom terrains at the moment. I want to add a button to add a custom terrain, once clicked it will prompt for the terrain string and insert the tile to the list of available tiles and allow to use this tile. The tile will be 'painted' with the terrain string. When loading a map with unknown strings these will be added to the list of terrains. The only problem will be the location of the terrains but I'll worry about that later.

Discussion: Would this solve the unkown tile problem?

themes

In my opinion the list with terrains to browse is pretty long and this will only grow in the future. I want to add an extra grid of buttons with theme's the buttons will have an icon for their theme. When a button is clicked the list of terrains is filtered per theme. eg when the theme villages is selected only village tiles are shown. Every terrain gets one or more themes for example a snow forest can be in the theme forest and the theme snow, so with either theme this tile is shown. There will be 2 special theme's favorites and map. Favorites are your favorite tiles saved in preferences and can contain unknown terrains. Map are all tiles already used on this map, including the unknown.

Discussion: Is this handy?

terrain files

Eleazar would like to move the terrains in subfolders, this seems to be possible with the current system. The required modifications can be found in the following changelog http://svn.gna.org/viewcvs/wesnoth?rev=14069&view=rev

I've no idea what the best possible directory layout will be. I'll ask Eleazar to do this change when I'm ready for it. At the moment I've some patches in my queue which will conflict with these changes.

terrain strings

Last but not least a proposal for the new terrain strings.

Discussion: At the moment /|\ are used for bridges with the mog's idea of using a * in the type for terrain graphics it can be used for all directional items. Would it be handy to also use this for roads? For now I'm going to ignore the roads and bridges depending on the outcome. If it's handy for roads /bw bridge wood could be handy else /w might be enough.

I want to reserve the letters X and x for user made content eg Vx are user villages. X is a user made letter.

I'm proposing a systems of 1 capital letter followed by one or more lowercase letters. I think that adds to the readability.

Discussion: Do we want to reserve letters for Spacenoth and or any other user made campain which uses letters at the moment. Since UTBS is mainline I want to include these in the mainline system. (If agreed I'll look at the letters required.)

aliases

The aliases will also be a comma separated list, where the same discussion about the + and - can be started as in the types.

terrain list


Letter String Theme Description
A Vhsh village, snow, hill human (snow) hill village
a Vh village, grassland human hill village
B Vd or Vda village, desert desert village (adobe)
b Vhm village, mountain human mountain village
C C castle castle
c Ws water, common shallow water, "coast"
D Vu village, underground underground village (cave, village), "dungeon village"
d Ps plains, desert sand, (old desert)
E road, desert desert road
e Ves village, snow elven (snow) village
F Fs forest, snow forest (snow)
f F? forrest, common forest
G Pgs plain savanna (grass)
g Pg plain, common grass
H Hs hill, snow hills (snow)
h H? hill, common hills
I Pd plain, desert desert
i Pi plain ice (tundra)
J Hd hill, desert desert hills
j Ms mountain, snow -nothing- (will be snowy mountains)
K K? misc keep (castle)
k Wf water river ford (grass, shallow water)
L Vtf village, forest tropical forest village (savanna, village)
l Yl using Y for strange items misc lava (canyon)
M Md mountain, desert desert mountains
m M? mountain, common mountain
N Cr castle ruined castle
n Ce castle, common encampment (castle)
O Co castle -nothing- ( will probably be an Orc Castle one day )
o Cd castle dwarven castle (castle)
P Do desert desert oasis
p Vd village dwarven village
Q Crw castle, water sunken ruin
q Crs castle, water ruin (swamp)
R plain, common road (grass)
r plain dirt (grass)
S Pt plain tundra
s Wd water, common deep water
T Ft forest forest (tropical)
t V? village, common village
U Vt village desert desert village (tent)
u Pu cave, plain cave
V Vs village, snow snow village (tundra, village)
v Vh village, common human village (village)
W Yu cave, impassable cavewall
w S? water swamp
X Yc misc canyon (replaced by chasm in trunk)
x reserved for UMCs
Y Vws village, water swamp village (swamp, village)
y reserved for UMCs
Z Vwm Village, water mermen village (shallow water)
z reserved for UMCs
/ bridge (grass, shallow water)
| bridge (grass, shallow water)
\ bridge (grass, shallow water)
~ fog, can this be used in game?
void/shroud (it uses the "space" character), can this be used in game?
[ Pur plain, cave rockbound cave
] Fu forrest, cave mushroom grove
' Pui plain, cave illuminated cave
? Yet forrest, misc great Elven tree
& Mi mountain impassable moutains