Difference between revisions of "Landgen usage (Worms 2)"

From Worms Knowledge Base

Jump to: navigation, search
m
(Additional info on command parametrs, new command "grafitti" discovered)
Line 6: Line 6:
 
Landgen is used to create:
 
Landgen is used to create:
 
* Thumbnails for Terrain Editor
 
* Thumbnails for Terrain Editor
: ''Command Line:'' '''Landgen.exe /thumbnail ''path\name_of_generated_thumbnail'' ''random_big_number'' ''random_short_number'' ''random_short_number'''''
+
: ''Command Line:'' '''Landgen.exe /thumbnail ''Path\name_of_generated_thumbnail'' ''Land_base_line'' ''Base_line_noise'' ''Noise_randomization'''''
 
: ''Example'' : '''Landgen.exe /thumbnail levels\thumbs.dat 444831613 24 54'''
 
: ''Example'' : '''Landgen.exe /thumbnail levels\thumbs.dat 444831613 24 54'''
 
* Previews - 1:1 terrain data file that is used in manual terrain editing.
 
* Previews - 1:1 terrain data file that is used in manual terrain editing.
: ''Command Line:'' '''Landgen.exe /preview ''path\name_of_generated_preview'' ''random_big_number'' ''random_short_number'' ''random_short_number'''''
+
: ''Command Line:'' '''Landgen.exe /preview ''Path\name_of_generated_preview'' ''Land_base_line'' ''Base_line_noise'' ''Noise_randomization'''''
 
: ''Example'' : '''Landgen.exe /preview levels\preview.dat -1891240261 95 29'''
 
: ''Example'' : '''Landgen.exe /preview levels\preview.dat -1891240261 95 29'''
 
* Land that is used for game and land preview in Terrain Editor
 
* Land that is used for game and land preview in Terrain Editor
: ''Command Line:'' '''Landgen.exe /generate ''path\name_of_generated_land'' ''path_to_level_sprites_dir'' ''path_to_water_sprites_dir'' ''random_big_number'' ''random_medium_number'' ''water_level'' ''random_short_number'' ''random_short_number'''''
+
: ''Command Line:'' '''Landgen.exe /generate ''Path\name_of_generated_land'' ''Path_to_level_sprites_dir'' ''Path_to_water_sprites_dir'' ''Land_base_line'' ''Object_code'' ''Objects_count'' ''Base_line_noise'' ''Noise_randomization'''''
 
: ''Example'' : '''Landgen.exe /generate data\land.dat .\data\level\FARM .\data\water\Blue 1765502980 24323 50 4 40'''
 
: ''Example'' : '''Landgen.exe /generate data\land.dat .\data\level\FARM .\data\water\Blue 1765502980 24323 50 4 40'''
 +
* Land for game and land preview can be generated from edited terrain
 +
: ''Command Line:'' '''Landgen.exe /grafitti ''Path\name_of_generated_land'' ''Path_to_land_data_source'' ''Path_to_level_sprites_dir'' ''Path_to_water_sprites_dir'' ''Land_type'' ''Object_code'' ''Objects_count'''''
 +
: ''Example'' : '''Landgen.exe /grafitti data\land.dat levels\grafitti.dat .\data\level\SNOW .\data\water\Blue 1 18688 50'''
  
; random_big_number : random number up to 11 digits or even more, used for land randomization, can be negative
+
; Land_base_line : random signed 32-bit integer, used for land randomization, first 8 hexadecimal digits of Terrain Code, never equals to 0
; random_short_number : random number 1-2 digits, used for land randomization
+
; Base_line_noise : random number, values 0-100, used for land randomization, 9-10 hex-digits of Terrain Code
; random_medium_number : random number up to 5 digits or more, used for level sprites randomization
+
; Noise_randomization : random number, values 0-100, used for land randomization, 11-12 hex-digits of Terrain Code
 +
For Line Noise and Noise randomization hex values greater than 100 recalculates as [HexVal MOD 100].
 +
: ''Example'' : '''Terrain Code = 2E3C132D6466 -> Land_base_line = [2E3C132D] = 775689005; Base_line_noise = [64] = 100; Noise_randomization = [66] = [102 MOD 100] = 2'''
 +
; Object_code : random number up to 11 digits or more, used for level object's sprites randomization
 
Random numbers are generator seeds, which means same numbers generate same terrain. Still researching how this numbers change affects generated terrain.
 
Random numbers are generator seeds, which means same numbers generate same terrain. Still researching how this numbers change affects generated terrain.
; water_level : height in pixels of initial water level, by default = 50
+
; Objects_count : set how many object appears on terrain, values 0-100, by default = 50
 +
; Land_type : 0 = Open, 1 = Cavern
  
 
----
 
----
  
 
There can be more. Research continues.
 
There can be more. Research continues.

Revision as of 07:15, 21 November 2014

(Up to Game logic)

Landgen (short for Land Generator) is the command line program that generates land files for Worms 2. It's located at "%Worms_2_Install_Dir%\Binaries\Landgen.exe". Landgen is executed by frontend, which sets "Default Dir" for Landgen to "Worms 2 Install Dir". This means the paths passed to Landgen by frontend are relative to "Install Dir", not "Binaries\".

Landgen is used to create:

  • Thumbnails for Terrain Editor
Command Line: Landgen.exe /thumbnail Path\name_of_generated_thumbnail Land_base_line Base_line_noise Noise_randomization
Example : Landgen.exe /thumbnail levels\thumbs.dat 444831613 24 54
  • Previews - 1:1 terrain data file that is used in manual terrain editing.
Command Line: Landgen.exe /preview Path\name_of_generated_preview Land_base_line Base_line_noise Noise_randomization
Example : Landgen.exe /preview levels\preview.dat -1891240261 95 29
  • Land that is used for game and land preview in Terrain Editor
Command Line: Landgen.exe /generate Path\name_of_generated_land Path_to_level_sprites_dir Path_to_water_sprites_dir Land_base_line Object_code Objects_count Base_line_noise Noise_randomization
Example : Landgen.exe /generate data\land.dat .\data\level\FARM .\data\water\Blue 1765502980 24323 50 4 40
  • Land for game and land preview can be generated from edited terrain
Command Line: Landgen.exe /grafitti Path\name_of_generated_land Path_to_land_data_source Path_to_level_sprites_dir Path_to_water_sprites_dir Land_type Object_code Objects_count
Example : Landgen.exe /grafitti data\land.dat levels\grafitti.dat .\data\level\SNOW .\data\water\Blue 1 18688 50
Land_base_line 
random signed 32-bit integer, used for land randomization, first 8 hexadecimal digits of Terrain Code, never equals to 0
Base_line_noise 
random number, values 0-100, used for land randomization, 9-10 hex-digits of Terrain Code
Noise_randomization 
random number, values 0-100, used for land randomization, 11-12 hex-digits of Terrain Code

For Line Noise and Noise randomization hex values greater than 100 recalculates as [HexVal MOD 100].

Example : Terrain Code = 2E3C132D6466 -> Land_base_line = [2E3C132D] = 775689005; Base_line_noise = [64] = 100; Noise_randomization = [66] = [102 MOD 100] = 2
Object_code 
random number up to 11 digits or more, used for level object's sprites randomization

Random numbers are generator seeds, which means same numbers generate same terrain. Still researching how this numbers change affects generated terrain.

Objects_count 
set how many object appears on terrain, values 0-100, by default = 50
Land_type 
0 = Open, 1 = Cavern

There can be more. Research continues.

Personal tools