Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Adding new Resources

This is more of a multi-step process.

  1. Create a new data file (again with "game_data" at root), and add the resource element: <resource name="My New Resource" />.
  2. Define the new terrain (this can be in the same data file, or another one): <terrain id="my_new_resource_terrain" image="t_new_resource" cleared_image="t_new_resource" map_image="map_grass" is_walkable="true" is_swimable="false" move_cost="1" resource="My New Resource"/>
    1. The values of "image" and "cleared_image" should correspond to an image file in the mod.
    2. The value of "resource" should be the same as the name of your new resource.
  3. Copy "wg_biomes" into your mod, and add the terrain to whatever biomes you want.
  4. Zip and load the mod as noted in my previous reply.

Side Note: Thanks for asking these questions, it's made me realize how crummy the ModApi is for modifying data instead of creating new data. I'll work up a better system for this but it will probably be a few weeks.

thanks for the side note.

 in biome worldgen <noise_mapping id="oretype" ideal_value="X" /> what is it? 

when one value used, generate first mod biome and not generate other.

The world generator is based on noise maps (here's an overview) that have values between 0 and 1, there are several maps defined in "wg_noisemaps" in BaseMod.zip. (you can add new ones too). "noise_mapping" maps the values of noise maps to a biome, when the world is generating biomes are picked based on their noise mappings. The biome closest to all of it's "ideal_value"s is chosen.

desert, for example has:

<noise_mapping id="height" ideal_value="0.6" />
<noise_mapping id="rain" ideal_value="0.0" />

That means that an area that's fairly high in elevation and low in rainfall will tend to be desert. 

For comparison, grassland has:

<noise_mapping id="height" ideal_value="0.6"/>
<noise_mapping id="rain" ideal_value="0.4"/>

Both of these biomes have the same value for height, but different values for rain. If the "rain" noise map has a value of 0.1 in the area, then "desert" will be a better match, and will be picked. If the "rain" noise map has a value of "0.3" in the area, then "grassland" will be a closer match.

The noise mapping you pasted, uses the "oretype" noise map. That noise map controls what type of ore-type resources appear in the ground. This tends to make some areas rich in limestone, and others rich in copper.

Does that all make sense?

yeah thanks.