News:

Welcome to World of Banished!

Main Menu

Help a newbie!

Started by jesta030, January 22, 2017, 12:03:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RedKetchup

for sure it wont spawn on a tile tagged as "water" or "deepwater"
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

jesta030

Well i got wheat to spawn in water as deep as -3, but trying to harvest it failed. Further testing showed that wheat can be harvested up to -0.7. that's a promising start because it means a model that reaches from -0.5 to +0.5 might be a solution... I'll have to make a model tonight and try it out...

RedKetchup

ok let us kknow cause nobody reallydid anything there
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

jesta030

#123
So I tried two different approaches to model and implement the reeds and both have treir... downsides. :(



This is just partly transparent faces overlapping. each plant has 2 or 3 faces = 4 to 10 vertices. the problem is the plants diasppear when scrolling too far back.



this is each plant modeled separately. each plant has 24 faces = 49 vertices. looks awesome, cripples performance.

suggestions?

[Edit] Was able to reduce Vertices and improve performance. there's also too much reed spawning so i guess i'll be fine as it is right now.

Bartender

Quote from: Tom Sawyer on July 02, 2017, 01:04:45 AM
Welcome back! I'm also playing a game for myself these days but always come back to my modding project. ;)

The natural resource has to be added to the start condition itself (Hard.rsc for example), not to the default in StartConditions.rsc. At least I do it this way. But natural growing reeds is not really possible as far as I know and the reason why CC reeds is as it is. We cannot let it grow in water because people cannot gather it there and we cannot make it reseeding because it would spread on ground level 0 which means away from waters over the whole map. Maybe Bartender/Despo found a solution. I did not test their new version yet.

We didn't, our reeds don't reseed either. Personally I don't think there is a solution, as Luke simply did not code the game to take the minHeight and maxHeight values into account for reseeding. What we did, after trying a lot of things, is to make a reed farm in the forester fashion, which is built on the water. It has a small influence area, so it only grows new reeds on the two banks, though still only at z1.0.

Quote from: jesta030 on July 02, 2017, 06:25:38 AM
Well i got wheat to spawn in water as deep as -3, but trying to harvest it failed. Further testing showed that wheat can be harvested up to -0.7. that's a promising start because it means a model that reaches from -0.5 to +0.5 might be a solution... I'll have to make a model tonight and try it out...

From my tests I concluded that -0.75 is kind of the limit, so with -0.5 you're definitely safe. Be careful with the range as well though; if the villagers harvest a resource from a tile below 1.0 that tile turns into water afterwards. This means that any resources that are still lower than that tile might become inaccessible. I've set our reeds between -0.15 and -0.7, and this (almost) never gives this problem while still looking good.

RedKetchup

Quote from: jesta030 on July 05, 2017, 05:00:16 AM
this is each plant modeled separately. each plant has 24 faces = 49 vertices. looks awesome, cripples performance.

but you have what 10-20 plants per mesh ? (per tile ?)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

jesta030

#126
Quote from: Bartender on July 05, 2017, 07:16:11 AM
Personally I don't think there is a solution, as Luke simply did not code the game to take the minHeight and maxHeight values into account for reseeding.
...
Be careful with the range as well though; if the villagers harvest a resource from a tile below 1.0 that tile turns into water afterwards. This means that any resources that are still lower than that tile might become inaccessible.

well shit. everything is exactly as you said. reeds will spread across the whole map at elevations between 0.0 and 1.0. they wont even reseed close to water. this sucks ass...

maybe it's possible to make a reed farmer that needs to be built on the edge of the water and has an invisible plane at 0.0 so the banis can walk on it and plant/harvest above the water? and have the naturally spawned weed be permanent and non-obstructing? any thoughts?

[Edit] I'll stick with Reeds that spawn next to the river and live forever plus a reed farmer that simply produces reed when being worked. seems to work just fine.

jesta030

So I read here about floors and have been digging around in the resource files... is it impossible to create a crop field that can be dragged over water that has an invisible floor and grows reeds?

RedKetchup

Quote from: jesta030 on July 06, 2017, 12:03:00 PM
So I read here about floors and have been digging around in the resource files... is it impossible to create a crop field that can be dragged over water that has an invisible floor and grows reeds?

i think you can add Water | DeepWater to the Normal | Obstacle;

CreateDragDescription createdrag
{
bool _ignoreZones = false;

PathBits _placeBits = Normal | Obstacle;

int _maxWidth = 15;
int _maxHeight = 15;
int _minWidth = 4;
int _minHeight = 4;

ComponentDescription _allowAndRemove = "Template/Clear.rsc";
}



not sure if you can add
      "floor",

to the // layout of the entity
ComponentDescription resource

and set the FloorDescription floor
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

jesta030

thats what i tried. i made an .fbx that has a plane of 1x1 size at z=-0.7 with no material attached to it.
did the modifications to template/cropfield.rsc and it builds fine, but crashes when dragging to create a field on water...

inside cropfield.rsc:
FloorDescription floor
{
PickingMesh _mesh = "Models\ReedFarmFloor.rsc";
}


reedfarmfloor.rsc:
PickingMesh resource
{
String _meshName = "Models\ReedFarmFloor.fbx";
String _subObject = "floor";
}


the .fbx:


RedKetchup

#130
so we cant put Water/DeepWater ? thats sad


Water | DeepWater works !! i dont get crash !

but they dont go plant there though, they plant on what is available
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

jesta030

yeah, the field is still under water and the banis wont go there... i tried that before and thought i could get a fix by using that "floor" thingy... but thats when i get a crash.

RedKetchup

Quote from: jesta030 on July 06, 2017, 02:51:35 PM
yeah, the field is still under water and the banis wont go there... i tried that before and thought i could get a fix by using that "floor" thingy... but thats when i get a crash.

yeah dooesnt accept the floor function

and wont get harvested neither :(
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

jesta030

#133
Alright, I found something that seems workable!

I now have two different Resources: permanent reeds and spawned reeds.

The permanent reeds are put next to water on map creation (-1.7 < z < -0.001), are walkable but cant be harvested.
The spawned reeds are spawned by the permanent reeds just like trees spawn onions/mushrooms/roots/etc. They look the same but can be harvested and yield a rawmaterial.

This allows a profession "reed collector/farmer" as well as manual harvest, has no problem with pathing or tiles becoming water and thus unusable, the reeds dont reseed and spread across the whole map.
The downside is the permanent reeds will stick through buildings built on top of them (fishermans dock).

[Edit]
I'd love to give you guys the .pkm that I built, but it crashes when creating a game. it only works using the run.bat in the mod's directory. No idea why. :(

[Edit 2]
New Idea: make the permanent reeds invisible and let them spawn the harvestable reeds like trees spawn mushrooms/onions/herbs/etc!

[Edit 3]
So i went ahead and tried it. Aaaand it works.



The green cones in the pic are markers where the invisible reeds were put by the map generator. (-0.3 < z < -0.001) obviously they will later be made invisible.

As you can see they are spawning reeds next to them and on top of neighbouring markers. the reeds can be harvested like trees and the markers dont obstruct pathing/building etc.

downside: reeds wont spawn in water which would look even more realistic. :(

[Edit 4]
Added Marshes: invisible markers that spawn in groups away from the water (z = 0) and spawn reeds and some mushrooms/Roots/Herbs/Onions.


RedKetchup

> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .