Jump to content

Erosion - Nature takes over


turbotutone

Recommended Posts

fcfd57848d21ed5155c6b979183e8d42.png

 

 

The idea

 

To slowly have the map detoriate over time, nature grows wild and the urban areas slowly decay.

 

What will the mod do?

 

Currently the planning is for Erosion to add the following effects to the game:

 

  • Plantlife:
    • Nature will slowly start to take over, popping up on natural tiles.
    • Currently plants have 6 stages (low grass to tree), only the most fertile spots will reach the maximum.
    • Random special objects with a very low chance of spawning (imagine a dead campfire and the likes).
  • Streets:
    • Big cracks in the road that gradually become more intense.
    • Patches of cracked road where grass and stuff grows through.
    • More litter and garbage appearing over time.
    • Random special objects with a very low chance of spawning (a pile of zombie corpses for example).
  • Houses (exterior):
    • Cracks that can appear on over time.
    • Vines that slowly takover a part of a wall.
    • Windows have a chance to be broken over time (idea by RobertJohnson)
    • Doors have a tiny chance to pop open at some point.
    • Random stuff like smudges and what not.

 

 

Textures by Thutzor

 

Thutzor will be doing the extensive list of additional artwork for the mod. Thank you Thutzor! :)

 

build 27 version:

pz build 27 click here

Post 25 march 2014 steam update:

pz build 26B click here

Pre 25 march 2014 steam update:

pz build 26A click here

 

Download Erosion Alpha 0.1

Please read this first:

 

DO NOT USE ON A WORLD/SAVE THAT IS DEAR TO YOU!

create a new world to play on (Y)

 

This version is NOT recommended for actual serious play yet. At own risk.

 

Things that are wrong:

  • The seed isnt saved, this will be fixed soon when ZombRand gets a seeding function. (this means for now everytime you load the map newly discovered chunks dont connect properly)
  • Sprites, current ones will gradually be replaced by better ones, and new types will be added.
  • Spawning, is very basic, will be fine tuned later on.
  • Season colors, some are decent others are not so good, for example grass contrast is bad in some months.
  • Performance, since a few builds performance has dropped, will be investigated.
  • Some stuff isnt implemented yet.
  • May crash without any output in console, a rarity i havent been able to pinpoint.

The reasons for releasing the alpha as is:

  • People finally being able to take a walk in the floral chaos.
  • Getting bug/performance feedback from community.
  • A critical look on the code produced so far.
  • Introducing the modability to community, if it got you interested and you make something be it sprites or code let me know as well, if its good and in line with the rest of erosion it could be added.
  • Same goes for things as the season colors mentioned, if you find a better color scheme for example.

 

Changing settings

Currently this can only be done by means of changing values in the theme file, no UI stuff yet.

Check out:

media/lua/Erosion/themes/ThemeErosion.lua

Some interesting options are:

ErosionLevel     = 100,ProcessSpeed    = 10,DemoMode    = false,DevMode        = false,            SetMonth    = 3,    

I recommend setting ErosionLevel to 0 and DemoMode to true, then start a new world to see a timelapse of the growth and seasons ingame.

(this will likely lag a bit :D)

 

Download link.

CoordinateViewer is bundled in the download for debugging purposes.

 

Thanks to:

RobertJohnson and Lemmy for helping me out with questions/problems.

RoboMat for letting me bundle his Coordinateviewer.

Myth for info on kentucky plantlife.

Everyone showing support/suggesting things.

 

 

Modding Erosion

General

The objects part of Erosion is designed to be modified or even completly replaced. Its still a bit of a work in progress so some stuff may change. Therefore i will give a brief overview/doc, once things get more solid ill write a more extensive one.

 

The objects system

The PZ world is first divided in "regions" which are the top level categories to consider. Currently there are 3 regions (only outdoors)

  • Nature (any natural tile)
  • Street (any street tile)
  • Wall (any "outdoor" wall)

Indoors could be added later on as well.

Check out "Erosion/objects/ErosionRegions.lua" to see how regions are managed.

 

To these regions category class files can be added as found in "Erosion/objects/categories/".

In the category files spawn and update behaviour is defined for one more erosionobjects that belong to that category.

 

ErosionObjects:

Erosion/objects/ErosionGameObject.luaErosion/objects/ErosionGameOverlay.lua

These classes have functionallity to place, manipulate or remove IsoObjects (or childsprites incase of overlay)

based on a given "ErosionSpriteTable".

 

 A "ErosionSpriteTable" is basically what the name suggests, a table with sprites for a certain object, all stages and variations.

It also hase some functionallity for getting a IsoSprite or adding them. See the corresponding lua file.

 

Theres also a "ErosionSpriteObj", this one is being used by the spritemanager, "ErosionSprites", to store/control colors, animations etc.

 

Spawning/Updating

Perhaps its worth mentioning that whenever erosion encounters a tile it can do 2 things, call the validatespawn function chain if its a new tile, or the update function chain if its a know tile and its due for updating.

This chain starts in Erosion.lua->ErodingQue(), gets called in ErosionRegions, and optionally a category is called.

When validating spawn for new objects, the categories are called in order by a z value defined when adding them to the regionmanager (see theme file).

So in the nature region, the system will first see if it can spawn a tree (top category), if not it will try a bush, again fail try spawning grass. Untill something spawns or the category list has no more items.

When updating it already knows which category has succesfully spawned there and calls it directly.

 

Themes

In a theme file you can load and construct all these mentioned components. You can copy and modify the default theme, or create one from scratch, if you want you can also write your own category classes to create a completly unique theme for a overhaul mod par example.

 

The default theme can be found in:

Erosion/themes/ThemeErosion.lua

In the top of the theme file a table with erosion options is defined, you can copy/modify those to your custom theme.

(any options not defined will revert to default)

You could also add custom variables to the list (as the cfg table is also passed to category class files this maybe usefull)

 

The init block:

ThemeErosion.Init = function( _spriteMgr, _regionMgr, _cfg )     ...end

This block is called when the game starts a world if this theme file is selected as theme.

The parameters supplied are:

_spriteMgr     = Instance of ErosionSprites._regionMgr     = Region manager (ErosionRegions)._cfg        = the config table as defined in current theme file.

If you sniff around in the default theme file youll find examples how to override game sprites or load a set of images for a tree for example.

 

Some things that may be helpfull:

 

SeasonColors

_spriteMgr.AddSeasonColor( "BaseGrassLow", { 3, 98,115, 35,255}, { 6, 75,100, 39,255} );

the numbers in the tables define:
{ MONTH, R, G, B, ALPHA }
month count = 1 to 12

 

Image Filenaming
To use autoload functions like this:

_spriteMgr.AutoLoadSet( "bushes/A/bushA", 3, 1, false, { snow = { "snow" } } );

your files need to follow a certain naming scheme, which is:


name_<stage>_<variation>.png

tree_1_1.png

to add a "animation" to the tree, for example snow use:


name_<stage>_<variation>_<snow>_0.png

tree_1_1_snow_0.png

 

Animations
When passing animation information to functions like this:

local anims = { early = { 2, 11 }, mid = { 3, 10 }, invis = { 1, 12 } };_spriteMgr.AutoLoadSet( "bushes/bushBleaves", 1, 1, false, anims );

The keys in the "anims" table are the animation names as defined in the filename of the sprite, ex: tree_1_1_early_0.png

the numbers in the value table are the months/periods to play the anim.
strings can also be accepted, currently "snow" is the only accepted string for a period.

 

Hope this rather poor documentation helps a little bit atleast :P, if anything is unclear leave a post in the thread and ill try to clarify.

 

Videos

Seasons test

 

Early test

 

Screenshots

cbfcee1d4fb1300cac02bcd7677cd437.png

1fa925721442b05c8053c638ea7ff908.png

 

Screenshots Archive

Outdated screenshots from the very first functional version:

screenshot 1:

3c4026ca48974d63a4ba500f2d922ee2.png

ce04accac576463bb5e4f909080f3ef9.png

screenshot 2:

0ac33da310a1b6746059245464e2ab20.png

2d47173e4796b73555528d952506ae97.png

screenshot 3:

b30c9cceaa9b2674d696bc65386cf0ed.png

188402b63999b40464a00960c1457a63.png

screenshot 4:

43ac02a9f0bec167012d8bf3b0505aa4.png

5428430a7d3cb9fd1902f5efcec3eede.png

screenshot 5:

6e7d0940a8d094ade2cef14330c8c85f.png

1a4575554dafe0131aefb8809f3d85a8.png

screenshot 6:

78300b774a02d0d06ac3c7bf8815c53d.png

30c6dc22ee5648f5df85026eba9f8e23.png

Link to comment
Share on other sites

Would love to see this in the vanilla game as well , great that you have something like this in mind devs. But the erosion should mostly consist of gras and bushes and rather of trees ( which would take a few years ... well if you survive a few years than this would be amazing too) .... I want this in the vanilla so much ! The screeshots look amazing 

Link to comment
Share on other sites

Would love to see this in the vanilla game as well , great that you have something like this in mind devs. But the erosion should mostly consist of gras and bushes and rather of trees ( which would take a few years ... well if you survive a few years than this would be amazing too) .... I want this in the vanilla so much ! The screeshots look amazing 

I completely share your opinion.

 

Great idea turbotutone, I love what you did here!

Link to comment
Share on other sites

wow very nice! looks very good mate.

can you give a little more information on how long this process takes / is supposed to take? This is a good addition to the game IMO, but this would take some time in real life

 

Almost forgot to reply on this, to answer your question its all variable :P

 

Currently the system determines the GlobalErosion level by ElapsedDays / modifier, the maximum level for GlobalErosion = 100.

So if you play 356 days and the modifier = 3.65 then your at 100 erosion.

I suppose for sandbox setting the user could be allowed to set both the modifier and the GlobalErosion itself, so if you want to you can play in a world that is already eroding/fully eroded.

Link to comment
Share on other sites

A little update on the progress that also answers this question:

Great job, maybe add random clumps of trees?

 

Ive restructered the code completly to make it lua oop, its now a singleton class, a instance can be gotten by "local instance = Erosion()" for example.

 

As for Fj45 question, heres a development screenshot:

ce1ac64d2678d35e92f2588794638bef.png

 

NOTE: this is not how the end product will look like :P it merely a display of values.

The base values (their perlins) in nature are visualized by the height of trees/grass here (shows only 6 different intervals or so, but in reality the values have a much higher diversity), the higher the base value the more chance on developping bigger objects like trees over time. So clumps of trees should evolve naturally. Ofcourse there will be chance involved for each tile so low value tiles might have big objects too but their chance of development is just much smaller.

 

Now the roads, the crack on tile that the player is standing on signifies a roadcrack, im just using sprites from the game, but the idea is for it to be a connected crack. These will gradually become more intense as time goes by.

The darkened tiles on the road is where other smaller cracks appear where grass grows through slightly, als needs custom tiles.

 

So the todo list for the next days is to build the new spawning method based on the current system.

Link to comment
Share on other sites

This mod looks absolutely fantastic! :eek:

 

The concept alone would make the world so much more "alive" (well...you know what I mean :mrgreen: ) that it blows my mind outright, but I especially love how you plan to use pseudo-random procedural texturing to give it all a more natural look.

 

By curiosity, could I ask how large an interval of values you plan to use for the different stages of erosion?

 

Anyways, I hope you find someone to help you with the sprites, as your mod truely deserves it.

 

Can't wait for a release/preview!

Link to comment
Share on other sites

Thanks guys,

 

Been a few days since last status update, so i figure i let you in on whats happening. First of all im still working on it every moment of free time ive got :P

Sadly this has not produced any new pictures yet as ive been tinkering with the stuff that runs behind the scenes. Mostly the chunk reading/updating system.

 

The thing is, the mod affects the chunks loaded around the player, normally the mod would run pretty much at a idle mode, only doing some minor checks (if you walk about in a area that is already up to date)

But if you move to a area undiscovered before and the erosion is at 100, then it has to initialize and update every tile. Doing this at once for every new region would create lag spikes and what not, unplayable. So im spreading the updating, currently lowest setting is 330 tiles a second, which is perfectly doable also for lower machines i think. But 330 tiles is only 3 chunks a second, and there lies the problem of the previous system. I added newly discovered areas to a pop and push stack for updates and thus had no control on when to process what chunk. This led to unwanted behaviour.

 

So ive rehauled mentioned system, it now no longer has a que, but rather has a search algoritm that is centered on the players chunk, it also takes a directional parameter so it will always attempt to check for chunks in the direction you are moving first, making sure that whats on screen is always updated.

Im still fixing some bugs, then ill add back functions ive temporarily disabled (like the ones that actually fill the tiles etc).

A test release is taking a bit longer then i initially anticipated, but its better to have these things sorted properly imo.

 

 

Someone find this man a spriter!

I could definatly use some help with the sprites, either someone whos willing to make them, or so show me a way to add custom sprites for tiles (havent figured a way yet)

 

but.. PLEASE tell me there will be some ingame items to cut the grass short again...

Its not in there, but perhaps someone will make working hedgecutters or something? :P

 

 By curiosity, could I ask how large an interval of values you plan to use for the different stages of erosion?

The erosion itself right now is 0 to 100, increasing with 1 over time. The stages of plants for example right now would be 4 at max, from low grass to tree, but the latter is still in a conceptual txt file, have not tested it yet.

 

 

 Another thing you should have a look at doing is putting in some Puddles and Land Erosion, I'll show you what I mean later on.

Sure suggestions are always welcome, what do you mean with Land Erosion exactly?

 

Regards,

Turbo

 

 

 

Link to comment
Share on other sites

 Another thing you should have a look at doing is putting in some Puddles and Land Erosion, I'll show you what I mean later on.

Sure suggestions are always welcome, what do you mean with Land Erosion exactly?

 

Regards,

Turbo

 

 

 

Rockslide%20One.jpg

 

I can only find an example from AOE as it's the only other isometric game I've played like PZ. It's just an art trick to make you think it's a cliff edge but you've not gone up a level.

Link to comment
Share on other sites

Another thing you should have a look at doing is putting in some Puddles and Land Erosion, I'll show you what I mean later on.

Sure suggestions are always welcome, what do you mean with Land Erosion exactly?

 

Regards,

Turbo

 

 

 

Rockslide%20One.jpg

 

I can only find an example from AOE as it's the only other isometric game I've played like PZ. It's just an art trick to make you think it's a cliff edge but you've not gone up a level.

Isn't something like that coming after they renovate the engine to support hills and such?

Link to comment
Share on other sites

 

 

Another thing you should have a look at doing is putting in some Puddles and Land Erosion, I'll show you what I mean later on.

Sure suggestions are always welcome, what do you mean with Land Erosion exactly?

 

Regards,

Turbo

 

 

 

Rockslide%20One.jpg

 

I can only find an example from AOE as it's the only other isometric game I've played like PZ. It's just an art trick to make you think it's a cliff edge but you've not gone up a level.

Isn't something like that coming after they renovate the engine to support hills and such?

 

 

I don't know I've only just joined this community.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...