wildlife

wildlife

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
res
Posts: 15
Joined: 19 Aug 2017, 21:27

wildlife

Post by res »

Update!Update!

An spin off of this gadget is in the form of wild units!

The idea is that these units can not be selectable, are depended of some food for survival but do shoot at the enemy.
Actually the right form i havent found. But i am curious about having wild peewee that are not controllable anyhow:

video:

https://streamable.com/pvd5f

I wanted to make trees grow but instead i let ant procreate and ducks eat them after gulls can do good on the ducks.
The idea is behind this that by eating the enemies food source they also loose there ability to grow (bio)units there.


Update!

I tried to finish this monster gadget a bit and i hope it makes it easier to use.

https://github.com/xta-springrts/xta-sp ... ldlife.lua

evidence that it works:

https://streamable.com/eeosy

https://streamable.com/fdqmd

https://streamable.com/t7bm3

https://streamable.com/dza3z

This is the info given in the gadget file:

The map gets populated with species (roles) that grow, procreate, forage, predate and die (of age and by eaten)
All species can be present (max 6 per area) or a selection. All species can be used as mobile or as immobile
units theoretically. Only the roles food1 and food2 are set default immobile and growing with time. The roles
prey1 and prey2 roles do foraging on maximal two food names (unitnames) and likewise the pred1 and pred2 roles
do predation on maximal 2. This means that when two areas with defined species carry for different roles the
same names it can be possible that preys in one area predate the predators in another area. (in this case the
predators would be set as food in area 1 and preys would be able to reach area 2) By default wildlife is
selectable which makes it possible to capture them if the unitDef table of the wildlife allows this. From
this example it shows that untDefs are important when setting up wildlife. To not overcomplicate the matter to
much there are default settings for instance for land maps "spawn only trees" or "spawn trees and foragers"
but for manny others too. These setups can be found in the gaia_wildlife_config file.

When wildlife exstinct (by either ageing, foraging or predation) after a couple of life cycles a few new individuals
will be respawned on the original set location. The behavior of wildlife is charactarised by a random patrol in the
given area. Foraging can only be succesfull if food exist in within the given forage radius. (likewise for predation)
When predators and preys do succesful predation and foraging respectively then there is a change of procreation and
else in case of the former a lifespan penalty is given. Food will procreate in a given radius and is limited to a
number of units by this radius which are also set by default. The forageSucces, procreteSucces and predationSucces
changes contribute to the overall forage, procreate and predate behavior. These parameters are set default so no
need to specify them. There are more of these parameters of which the possibilities of this gadget reach near infinity.
This is a downsite since messing to adjust one behavior with one parameter might have great concequences for
other behaviors. There are some behaviors between the above evolution as hunting, socialising etc... . These
behaviors can be easy made from the functions given in the gadget. (see there for an example)(use candy function)

greetz,
res
Last edited by res on 18 Sep 2017, 23:25, edited 2 times in total.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: wildlife

Post by FLOZi »

Sweet!

Growing forests is an ancient Spring meme :shock:
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: wildlife

Post by jamerlan »

Can you make a video? For lazy/busy people :-)
res
Posts: 15
Joined: 19 Aug 2017, 21:27

Re: wildlife

Post by res »

I am not much of a hero at filming and i noticed that the config file is far from logical and practical for the moment.

my computer is no bad ass and the game runs on 10 times the game speed.

As a result of the above insane large video for the lazy and busy!

http://www.filedropper.com/spring2017-08-2122-46-11-55

http://www.filedropper.com/spring2017-08-2122-48-52-59

One movie shows tree loving ants taking a growing forrest down (they eat only the small trees the oldest die)

Another shows how also tree loving duck do some foraging but an ant or duck got caught by a gull.

greetz res

sorry for the big file formats. (needs windows media player to watch without black screen)
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: wildlife

Post by jamerlan »

Thanks! Next time, just upload them to the youtube =)
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: wildlife

Post by PicassoCT »

Very cool, i have a very primitiv version of this as part of the game mechanics in journeywar.

Basically there are neutral critters eating grass, reproducing, and getting hunted upon by both sides. Also the grass can be set on fire and become a wildfire.

Do your critters have a social life? Do they nurse theire young?
res
Posts: 15
Joined: 19 Aug 2017, 21:27

Re: wildlife

Post by res »

It would be nice if it was gameplay wise implemented like in your game journeywar. To get gameplay involvement, maybe?:
- Let predators be able to be captured and transformed to cyborg bots which are cheap but effective.
- The growing trees could be gameplay interesting when you can reclaime them.
- On this theme i could let metal appear in ground where predators die (which happens more with great eco system)
- Let predators (dinasaurs) also attack bots so make sure your ecology doesnt become explosive
- Wildlife doing terraforming when walking the same path multiple times creating new roads.
- Make units that can give extra behavior to neutral units (make them domesticated and help with transportation)
- etc...
But i am still thinking of something more trivial and less invoking :D, any ideas are welcome here!

At the moment i am trying to come up with a easy and hard setup of the gadget. The easier would only be set on or off or have a minimal of parameters possible to set, which is very unlikely going to give good results for all maps :S sadly. Someone else also pointed me on the fact that i ignored the obvious: Grass. I am not sure if i can add grass gadget wise so i don't lose controle with maps without grass. But i want to dive in to this a bit i guess for improving the gadget a bit.

In my first version the conbots did guard there parents which was cool but i could not use a smaller model of conbots.(babies) So ideal i would do something similar and use different models (sizes) but this i found so far a bit too much involved. (unnecessary???) While the wildlife have no social life i am planning to make a more natural behavior programmed instead of the random patrol. The trees seems to only have social behavior in the sense that they create offspring only when local population threes is low.

I am also intending to make predators do mating with nearest predator which results in a predator with a shared radius of predation. And i was thinking of an evolution aspect by making offspring have stochastically properties of both Parents. (this is just for fun) Maybe egg laying (agressive protecting ducks) might also be a nice setup to introduce local social life on a map, or foxes that can run to tunnels for coverage. Anyway all used models look very unrealistic on maps since i have been using MEGA pinguin and SUPER ducks.

maybe we could share some ideas about the matter soon.
User avatar
azaremoth
Cursed Developer
Posts: 549
Joined: 17 Feb 2005, 22:05

Re: wildlife

Post by azaremoth »

That sounds very interesting for the Cursed also. At least as a light version. Currently I have 4 critters include. 3 of them (Spacebugs) do leave corpses that can ne Harvester for metal or undead Units. The last unit ist a small pig that has no use yet. But it could serve as food for the bugs. For the bugs there are 3 sizes available: larva, medium sized bug and full sized bug. These could be used for developing, growing individuals.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: wildlife

Post by PicassoCT »

How does one deny those additional ressources to the other player?
User avatar
azaremoth
Cursed Developer
Posts: 549
Joined: 17 Feb 2005, 22:05

Re: wildlife

Post by azaremoth »

The critters are spawned randomly over the map and can be harvested (for metal or xps) by everyone. Map control = resource control. However, the bugs do fight back and are a pain for unguarded mexes.
res
Posts: 15
Joined: 19 Aug 2017, 21:27

Re: wildlife

Post by res »

dynamics.png
dynamics.png (16.23 KiB) Viewed 14917 times
Thanks for the posts i wanted to comment a little earlier but wanted first a more stable version.

What is still on my wish list (globally):
- more natural foraging predation
- offspring having different predation, forage radius and predation/forage radius be depended on forage/predation history.
- add option to restrict trees to certain areas (now they grow over borders given, which is actually nice naturally)
- add somehow a script that make baby wildlife look little without adding new models of at least make it simple???
- still need to fix food2 (which is intended to be mobile) but is not now (use for now with trees, and stuff)

Some of what can be done right now:
- trees can be reclaimed, captured and therefore be upgraded game wise after after capturing.
- There are some standard setups that spam growing forests on maps. (easy to use :D)
- Also default setup for food1 and prey1 are available as easyTreeSmallMapReclaim, easyTreeSmallMapGroupings, etc

Information:
- predators can predate in different area if radius of predation allows (unitnames should match his prey names of own area)
- as do foraging cross borders as well (notice that overlaying area's of wildlife give therefore surprising behaviors.)
- when an species extinct in a certain area it will be respawned after some given time.

Some improvements and pitfalls:
- (imp) happenings (foraging, predation, killed, ... ) are being delayed randomly to look more natural
- (pit) wildlife that is not tree seems to be cpu expensive (why that is??)(models poly maybe??)

Video:
http://www.filedropper.com/growingforrest_1
Shows a forest growing and some ducks
http://www.filedropper.com/foraging
Some ducks do foraging and trees grow
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: wildlife

Post by Forboding Angel »

dude... youtube.
res
Posts: 15
Joined: 19 Aug 2017, 21:27

Re: wildlife

Post by res »

I added some videos that show some behaviors, behaviors with a bit of lua are easy to adjust!
User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: wildlife

Post by code_man »

This sounds very impressive, im looking forward to see it in action.
Ares
Balanced Annihilation Developer
Posts: 555
Joined: 19 Mar 2011, 13:43

Re: wildlife

Post by Ares »

we need this in ba
res
Posts: 15
Joined: 19 Aug 2017, 21:27

Re: wildlife

Post by res »

update with wild units! see video on top
User avatar
ThinkSome
Posts: 387
Joined: 14 Jun 2015, 13:36

Re: wildlife

Post by ThinkSome »

Was there another thread about this recently? I seem to remember reading about this or a similar gadget a few months ago in the active topics.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: wildlife

Post by Silentwings »

Perhaps you are thinking of https://springfiles.com/spring/spring-m ... as-horse-1, which has some less sophisticated and more intrusive wildlife.
User avatar
ThinkSome
Posts: 387
Joined: 14 Jun 2015, 13:36

Re: wildlife

Post by ThinkSome »

No, that was definetely not it. I remember reading about it on this forum.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: wildlife

Post by PicassoCT »

Je has wildlife, horses eating grass, wildfire eating grass, seastars eating horses. Etc.
Post Reply

Return to “Lua Scripts”