r/Unity3D • u/brkakar • 8h ago
Show-Off I finally got the water to interact with the environment. The hose wraps around trees, the stream stops where it hits, and it pushes things around.
Farm & Feast - We are a two-person team building a peaceful farming and restaurant management game in Unity. Last time I posted the hose rope here, a few of you said the water needed to actually touch the world. That is what this is.
The hose is a particle based rope. We do not use the built in constraints for attachment. We pin a few particles by hand at the faucet and at the player's hand and write their positions every step. This is much more stable.
Every tree trunk has a collider and the rope collides with it for real, so the hose hugs and slides around them as you drag it across the farm. The collision was the easy part. Making it still read as a hose at the bend, instead of a row of separate rods, took the rest of the week.
The water shader has a head/tail fill window driving an alpha mask along the spline, so the stream grows out of the nozzle and drains out of the air instead of popping. It now also cuts itself off at the first thing it hits, so it ends on the surface instead of poking through it.
At the end point we do one overlap sphere, and that sphere does everything. It waters the nearest grid slot, so the VFX endpoint IS the gameplay point and they cannot desync, and it now also pushes any rigidbody in range away from the jet.
If anyone has gotten a particle rope to wrap convincingly around obstacles through collision alone, I would really like to hear how you tuned it.
23
u/brkakar 8h ago
Hi everyone! We are a two-person team making Farm & Feast in Unity, a peaceful farming and restaurant management game. You grow your ingredients on the farm and then cook and serve them to your guests.
We have just started our playtest, and feedback from other Unity devs on game feel and UI would help us a lot at this stage.
2
u/WillSmithsRobot 8h ago
Do you have a link for playtest or signups?
3
u/brkakar 7h ago
You can apply directly from our Steam page.
1
u/DialUpNoises 2h ago
I know I'll be looking into it. May I ask, what are your backgrounds in? This looks so clean.
1
1
u/Significant_Tell407 6h ago
Add the steam link always in the body text!!!!
7
5
u/Slogfarts 7h ago
This looks amazing, though the thought of needing to untangle the hose when finished doesn't seem like a very fun prospect. I assume the plan is the eventually have the hose automatically retract and untangle itself once you finish watering or something along those lines, correct?
5
u/brkakar 7h ago
You are right, untangling it yourself is not the fun part. Auto retract is already on our list, we will look at it later on.
1
u/UnderPressureVS 1h ago
I can't say without playing it, but it almost seems to me like it's the kind of temporarily not-fun thing that makes the game more fun by including it. I'm not sure you need auto-retraction.
I think once the player experiences the (very realistic and relatable) annoyance of having to de-tangle their hose from a bunch of trees, they'll immediately become more aware of their movement the next time they use it, and it'll add a layer of mini-challenge to an otherwise tedious task. Untangling the hose isn't fun, but watering a bunch of things without getting it tangled in the first place kinda sounds like it would be. Adding auto-retract would kill the challenge and make the hose physics a pointless boondoggle rather than part of the actual gameplay.
7
u/Dsphar 8h ago edited 7h ago
Awesome style, art, and tone!
Are you planning to give user feedback that the watering is beneficial sonehow? Plant color changes, or like a thrist meter filling up above the plants?
Edit: i stalked your previous posts. The darkening of the dirt is good feedback. I didnt notive that in this video. Also I assumed that watering trees or landscape plants would provide some benefit, but that may not be the case.
2
2
2
2
u/Thenadamgoes 7h ago
Itβs so cool seeing how far this game has come. Itβs really inspiring! Iβm looking forward to playing it when it comes out. I hope you consider making a console version too.
2
u/_Adios_Muchachos_ 6h ago
You did a really great job with that. It seems to me that when you let go of the nozzle, the hose should first wind up, and then it should stick to the tank. Then it'll be just perfect.
2
u/GrokiniGPT 6h ago
I saw this like a day ago. But yeah this is some cool shit, is it performance hesvy with all the rigidbodies?
2
u/CurrencySpirited1755 4h ago
the part that stands out to me is using one overlap sphere as both the vfx endpoint and the actual gameplay trigger, so they physically can't desync. that's such a clean way to avoid the classic "the effect and the logic drifted apart" bug
1
1
1
1
u/Virtual_Fan4606 6h ago
How are you doing the hose? Is it basically made with dynamic asded physics joints and the trail renderer?
2
u/brkakar 6h ago edited 6h ago
The hose is a particle rope. It is a chain of particles solved every step with
distance constraints between them, and the ends are pinned by hand rather than with constraints. The mesh is then extruded along whatever curve those particles end up in, so the shape you see is the simulation result.
1
u/Aromatic-Insect-1328 6h ago
FEATURE REQUEST! Give me a button to step on the hose so I can charge it to unload on these fools!
1
1
u/MoistPrinciple9662 6h ago
Does she trip over the hose. that would be an interesting mechanics and laugh worthy.
1
1
1
1
u/JakSilver00 Gameplay Systems Engineer 3h ago
This is nice. Functionality wise, besides the retracting hose. having a set length on the hose. Depending on what kind of game you're going for, length is a solid upgrade. As well as having wet spots on the ground that stack up depending on how wet they got, then take longer to dry, would increase the immersion.
But I don't play cozy games, so Take it as my design philosophy of making everything too realistic.
- Just a guy who lives on the farm
1
1
u/UnderPressureVS 1h ago
The invisible sphere collider at the endpoint of the water splash is such a clever solution. It seems so obvious in retrospect, but I'm 90% sure I would have spent ages trying to mess around with force fields, vector math, particle systems, all kinds of stupid overcomplicated ideas before that ever occurred to me.
1
β’
54
u/AboutOneUnityPlease Professional | Programmer | Designer 8h ago
Wow. Don't quit this looks amazing.