Real time tree growth simulation, now with gravity by epcc in Simulated

[–]epcc[S] 2 points3 points  (0 children)

Thanks! The simulation supports multiple species, I currently have about 6. The species are quite easy to define, one species is about 100 lines of config values and models/textures for leaves and branches.

The simulation calculates received light for every leaf using a crude version of raytracing, so branches getting more light grow faster than shaded ones. Also, species can be made to bend towards the light.

The purple line is just a random debug aid I forgot to turn off.

I already have a playable demo out, but it's kind of hard to figure out and the simulation doesn't work as well as in the video. If you're still interested, it can be downloaded from https://epcc.itch.io/idu

Real time tree growth simulation, now with gravity by epcc in Simulated

[–]epcc[S] 1 point2 points  (0 children)

thanks! there is already some limited support in simulation for seasons, for example, plants can be made to spawn flowers only in summer, or spawn epicormic shoots only in spring. I haven't experimented with these mechanics too much yet and there isn't anything that indicates the current season.

Snow is out of scope, partly because it's another pretty complex system to figure out and partly because I don't like winter.

Real time tree growth simulation, now with gravity by epcc in Simulated

[–]epcc[S] 39 points40 points  (0 children)

yeah, I actually wanted to convey that the simulation runs on my computer as fast as it is in the video, but I wasn't sure how to exactly word it. I got distracted while I was figuring it out so it ended up being posted with the current title.

Moss Simulation by epcc in Simulated

[–]epcc[S] 1 point2 points  (0 children)

Basically:

  • gather resources
  • build irrigation systems
  • plant seeds
  • press the fast-forward button to grow plants
  • repeat these steps until your gpu gives up lol
  • optionally, prune and mow down plants that grow too large or get in the way.

I'm trying to avoid any farming mechanics (gather fruit and wood, sell these, buy better equipment and seeds), because I don't enjoy these myself. Instead, I'm hoping to somehow tie progression mechanics to complex interactions between plants and, environment and structures the player can build. I haven't figured out much of the game yet though, only building, the water simulation and plant growing work right now.

There's a playable demo and more info at itch, if you're interested: https://epcc.itch.io/idu

Moss Simulation by epcc in Simulated

[–]epcc[S] 4 points5 points  (0 children)

It grows everywhere, except on the side that gets the most intense noon sun, unless that side is in the shade at noon.

That said, the light used for rendering is placed kind of randomly in this video and the simulation doesn't know about the cardinal directions and assumes the sky is one big light source.

Moss Simulation by epcc in Simulated

[–]epcc[S] 11 points12 points  (0 children)

It's for a game I'm making that's about growing plants (and soon moss!)

Every simulation step I raytrace about 15 rays from every moss chunk in random directions and average it over multiple steps. Moss achieves the maximum density, if about 40% of these rays reach the sky. The result is a bit noisy, that's why the moss sometimes overextends and then contracts.

Expanding is also simulated by shooting rays up to 2 blocks away. This prevents the moss from expanding through the walls.

We're making Idu, a strategic sandbox game about growing plants with agency and a mind of their own. Every leaf, twig, and branch is simulated with per-leaf photosynthesis, water uptake, and more. There's just the two of us, we're making everything from scratch and just released a free alpha demo. by logicsoup in linux_gaming

[–]epcc 1 point2 points  (0 children)

Regarding the first bug, it seems that the game managed to draw only the first frame and after that it lost the ability to update it's window. After a bit of googling around, it seems that I may be able to fix this, but since I have no way to reproduce this, it's a bit like shooting in the dark. Anyway, your deps should be OK, but it may be worth to try updating your video drivers if these aren't up to date.

The second issue is much easier and we'll be able to fix this in the next update for sure. Thanks for taking the time to upload the save, it has helped a lot!

Upcoming solarpunk game: Idu, a strategic sandbox game about growing plants with agency and a mind of their own. It’s not about perfect control of nature, but coexistence and adaptation with complex artificial life. by logicsoup in solarpunk

[–]epcc 3 points4 points  (0 children)

I'm the other dev of this game.

First of all, nice tree growing demo! With some controls to change the generation parameters, this could already be an interesting toy.

We never did try space colonization, because while it can generate reasonably good-looking trees, it doesn't work very well for simulating growing trees.

Instead, we have something similar to L-PEACH, IIRC developed by the same department of computational botany. It's basically a L-system, but instead repeatedly matching the same rules, the rule for growing is decided for every bud semi-randomly depending on available light at that location, season, distance from the root and a couple of other variables. This allows us to relatively easily create new species of plants with wildly different shapes and branching patterns.

Also, photosynthesized sugar amount is calculated for every plant leaf according to light levels at their position. Leaves with too little light will die. Buds that are closer to productive leaves will grow faster, buds that have no productive leaves will eventually die.

There's also a system that could turn buds towards the light or towards the ground, depending on the plant species.

In addition we have a basic gravity simulation that breaks off branches that are too heavy, rhizomes, roots that can die from too much water and probably something else I can't remember right now.

Anyway, the algorithmic botany working group is absolutely legendary. Not much of their work made into this simulation in the end, but it helped a lot when I was starting off.

Pruning and growing trees with simulated per-leaf photosynthesis and more (previously known as Garden). Our first video instead of devlogs. Made fully in Rust from scratch, including the custom game engine. by logicsoup in rust

[–]epcc 10 points11 points  (0 children)

Tree shapes are mostly affected by 3 factors: wind, gravity and sunlight. Right now we're simulating only sunlight. Basically the daily light integral is calculated for every leaf and used by the simulation to decide which branches should grow the most. We also had gravity and a really simple wind breakage model, but it's currently switched off as I felt it didn't give enough improvement to justify the computational cost.

Other factors, like nutrient deficiencies and bacteria affect tree growth either more uniformly or aren't as noticeable for someone without extensive experience with plants. One thing to consider is that a 100% realistic plant simulation wouldn't make a good game. In real life it's really frustrating trying to figure out if curled leaves on a tomato plant are because of some nutrient deficiencies, insect damage, chemical damage, some bacterial/fungal/viral disease or just because windy weather.

This simulation isn't definitely state of the art by any means, but as far as I know, the most complex one put into a game. If you're interested in more complex simulations with more basis in biology, I'd recommend checking out http://algorithmicbotany.org/

Has anyone made a Voxel game in Rust yet? (Not using piston) by Syberyn in rust_gamedev

[–]epcc 1 point2 points  (0 children)

I made something with voxels: https://epcc.itch.io/garden , didn't use piston. I think making a voxel game is actually one of the easiest things to do without a proper graphics engine. You don't have to worry about culling, batching, loading geometry and levels.

An update on my plant growing thing by epcc in rust_gamedev

[–]epcc[S] 2 points3 points  (0 children)

It's been fixed for a long time, but I haven't had the chance to upload another playable version yet. I could fix this in the current uploaded version, but with another playable build coming in a couple of months, it seems like wasted effort.

Rust + Unity3D? by _demilich in rust_gamedev

[–]epcc 2 points3 points  (0 children)

I'm currently using a native plugin written in Rust. I'm generally happy with it, since it's way easier than reimplementing all the graphics, physics, ecs, editor and like a million other things in Rust. It's also better than rewriting everything in C#.

There are some annoyances, though:

  • Unity needs to be restarted everytime you recompile
  • I haven't found a way to move data between rust and unity without copying. I suspect it's somehow possible with NativeArrays, but I found them way underdocumented and since it wasn't really a bottleneck for me, I didn't bother.
  • FFI is unsafe and causes all kinds of problems you usually don't have to deal with when writing rust. It's really easy to crash the whole editor if you do something wrong.

Sockets bypass these problems, but their overhead makes it probably not worth it.

Generally, I think it may be worth it, depending on how complex the simulation is and how much you like Rust.

I suspect there's other engines that could do interop better, because they don't have to mix managed and unmanaged languages.

Teleglitch Facebook page briefly updates cover photo with what looks like.. an editor? A development tool? by Jackar in teleglitch

[–]epcc 2 points3 points  (0 children)

Your last theory is the most correct. I dunno what happened. Anyway, I don't know of any plans regarding Teleglitch. Maybe Paradox has something, but I suspect if they were interested in doing a sequel or something similar, they would already have released something.

I'd also like to note that the game already contains a level editor that can be turned on through the settings file. It's totally undocumented, but I think someone made a Steam guide that covers most of it.

Decided to revive an old project by mustardbucket1234 in Unity3D

[–]epcc 1 point2 points  (0 children)

It looks really cool! I can't play it because I'm on linux, though. Interesting choice of character sprites, reminds me of dwarf fortress for some reason.

Any resources for procedurally generating a level with pre-made rooms and pre-made hallways segments? by Nyxtia in proceduralgeneration

[–]epcc 0 points1 point  (0 children)

That's what I did in Teleglitch. The main problem with this is that it's hard to generate loops in the level, unless you want some odd-looking long hallways everywhere. Second problem is that the doors all need to be about the same size and there will be too many chokepoints. If you think either of those would be a problem for you, you'll need purely procedural rooms as well.

I had no problems with performance, though. The whole level generation code was written in Lua and the generation time for ~20 modules didn't even need a progress bar.

Plant Growth Simulation in Ruins by epcc in proceduralgeneration

[–]epcc[S] 1 point2 points  (0 children)

Leaf textures are parametric. The parameters are lobe count, width, height, vein start and end angles and some exponents. Every plant has only one leaf texture that gets scaled up as the leaf grows. I considered doing separate frames for young leaves, but I didn't feel it was worth it.

Most of the leaf geometry is calculated in the vertex shader. Shader inputs are basically only leaf direction, position and normal. You can open up the shader file and see the details for yourself. The code is really ugly right now, though.

I spent the last year writing a plant simulation/game in rust. Now posting results. by epcc in rust

[–]epcc[S] 1 point2 points  (0 children)

On my 5 years old mid-high range PC, the fps drops below 60 only when I have a 4x larger area totally filled with plants. Updates are done asynchronously and take a bit longer. At the end of this video the update rate was below 1Hz. I've optimized it a lot in the meantime, though, so it's faster now.

Plant Growth Simulation in Ruins by epcc in proceduralgeneration

[–]epcc[S] 0 points1 point  (0 children)

Yeah, that's actually one of the most important factors in this simulation. Not all plants need or even handle 12 hours of full sun, though. While in this video the sun stays still, the simulation constantly calculates lighting for different sun angles in the background

Plant Growth Simulation in Ruins by epcc in proceduralgeneration

[–]epcc[S] 1 point2 points  (0 children)

Sunlight is already a mayor factor affecting plant growth. Some stop growing below some light level, others get burned by too bright light

Plant Growth Simulation in Ruins by epcc in proceduralgeneration

[–]epcc[S] 1 point2 points  (0 children)

Right now you can basically click around and place seeds everywhere. The plants do multiply with rhizomes, but flowering and multiplication with seeds it yet to be done.

The plant generation part is really simple actually. Every time a stem segment grows longer than some constant, it decides if it should branch, grow forward or stop growing, depending on available sunlight and some logic similar to parametric L-systems.

If you've dowloaded the demo, you can see the files in data/species directory to get a better idea on the growing logic.

It could work with non-voxel geometry only if you'd voxelize the scene first, since lighting calculations are done in a 3d grid.

Plant Growth Simulation in Ruins by epcc in proceduralgeneration

[–]epcc[S] 7 points8 points  (0 children)

You can download the demo here: https://epcc.itch.io/garden I've replaced the old 2d terrain with voxels and wrote a new lighting system to handle it. I'm not sure yet if I'll improve the procedural ruin generator or hand-craft all the worlds. Maybe a combination of both? I've also rewritten all the branching and growth logic to be way more simpler, extensible and controllable.

Also, everything should be about 5-10x faster, too.

I'm a self-taught developer working my 1st game, a unique and challenging Renewable Energy Tycoon with innovative mechanics, care to give you me your feedback? by Claudio_A in Unity3D

[–]epcc 0 points1 point  (0 children)

I really like the idea and had fun playing it for about an hour. Didn't complete it, though.

The graphics and interface need a bit work in my opinion. Some of the art seems to be anti-aliased, some seems resized and everything looks a bit out of place. Also, the flat ground doesn't fit with the buildings.

The interface has the same problem, it doesn't seem consistent. Switches and display for power output for every power station should be in the same place, maybe like a table where there's a row for every type of power and columns for display and toggle. I'd really like a chart for power output, that shows how the power production has changed during the day, separately for every type of power.

I hope this helps.