A game about growing plants (beta 6 released!)

Show off your games, demos and other (playable) creations.
Post Reply

Beta 5: What should be worked on now?

Polish the 'Perfect Plant' mode
7
58%
Add an options menu
4
33%
Improve graphics and sound
1
8%
Something else (please explain)
0
No votes
 
Total votes: 12

User avatar
pygy
Citizen
Posts: 98
Joined: Mon Jan 25, 2010 4:06 pm

Re: A game about growing plants

Post by pygy »

What about emulating how a real tree works?

The process is also recursive, but a bit more complex.

Roughly (I'm not a botanist, some of the details could be off):
  • The apical sprout gets out of the ground, and produces a straight stem pointing to the light and/or away from the ground.
  • On a regular pace, nodes are created on the stem. From the nodes emerge leafs (either on both sidees, or alternating.
  • The segments between the nodes continue to grow, but a a slower pace than the emerging one. They also get gradually larger.
  • At some point, new sprouts emerge from the nodes, and the leaves fall.
  • goto 1 for each new sprout
The ballance between how much a stem is dragged to the light or away from the ground should produce naturally beautiful forms.

You could also tweak the weight and elasticity of the branches, and the probability for a new stem to emerge from a leaf.

Branches should cast shadows on one another. A stem / sprout whose leafs get too little light would die.

Genes could be the number of nodes before the new sprouts come out, the node length, the stem weight and the elasticity of the nodes...
Hermaphroditism is not a crime. -- LSB Superstar

All code published with this account is licensed under the Romantic WTF public license unless otherwise stated.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: A game about growing plants

Post by Taehl »

Jasoco, use 7zip to open the file, not whatever (apparently) sub-standard program you're currently using. The code dealing with branches is plant.lua lines 63-139 and gamefunctions.lua 59-85 (you may also need to look at helper.lua for a few tiny functions like varandom() and table.endReverse()).

pygy... Short answer, no. Especially on that part about the light and shadows. I have it the way it is now for a huge number of reasons, including:
- Performance
- Easy-to-comprehend (to the player) genetics instead of easy-to-program genetics. (that is, they're fun, not arcane)
- Performance
- Centering the plant mechanics around the intended gameplay mechanics (crossbreeding plants)
- Performance! Casting light and shadows? Good god, man, listen to yourself!
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: A game about growing plants

Post by Jasoco »

OS X with all three versions. And don't blame my ZIP program. It's the same ZIP function I have used since forever and never have any problems. I'd blame whatever program you used to ZIP it. 7Zip works fine though. I do have that program, but I never would have thought to use it to open a LOVE project.

Anyway, I figured out how to do branches myself through trial and error and remembering some of the methods I saw in the sample code that was somewhere on this forum. I don't remember if it was this thread, or a thread this one was branched off of... pun intended.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: A game about growing plants

Post by Taehl »

I used 7zip to compress it.

Anyway, back on topic: Flower genes and generation are implemented:
Image

Not all plants have flowers, of course. You need a fairly high flowerAmount gene before any flowers will be present. Flowers have separate hue and lightness from the stems and leaves, as well as a gene to control their size.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: A game about growing plants

Post by Robin »

And the clouds?
Help us help you: attach a .love.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: A game about growing plants

Post by Taehl »

The clouds in that picture are messed up because that's a collage, not a screenshot.

Or do you mean, how do they work? They're pretty simple. Each puff is a transparent .png with its own (slow) velocity (there's only a little bit of variance here, you can just barely see it, but it's nice). When they move off the left side of the screen, they're put on a new random location off of the right side of the screen. Nothing fancy.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
StoneCrow
Party member
Posts: 199
Joined: Sat Apr 17, 2010 9:31 am
Location: Wales the land of leeks and leaks
Contact:

Re: A game about growing plants

Post by StoneCrow »

are we going to get an update soon ?
:3
Dull but sincere filler.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: A game about growing plants

Post by Robin »

Taehl wrote:The clouds in that picture are messed up because that's a collage, not a screenshot.

Or do you mean, how do they work? They're pretty simple. Each puff is a transparent .png with its own (slow) velocity (there's only a little bit of variance here, you can just barely see it, but it's nice). When they move off the left side of the screen, they're put on a new random location off of the right side of the screen. Nothing fancy.
So, pretty much the same as my 'clouds' library? (One of the first things I made with LÖVE. :P)
Help us help you: attach a .love.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: A game about growing plants

Post by Taehl »

I guess so?

I suppose I'll give you guys a new version to play with once I finish adding fruit (and doing another round of tweaks). At that point, plants will have all of the genes we currently have planned.

EDIT) Okay, new version. This one has clouds, flowers, fruit, and a finished genome. It also has countless little bugfixes and tweaks (for example, skeletal plants are affected less by the wind than dense, leafy plants). It should also theoretically run faster, especially when multiple plants are growing at the same time. Download it here. Please tell me what you think of the new plant graphics!

Image

First person to show me a plant with red fruit and white flowers gets a cookie (play the game to make it instead of just hacking my code, please).
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: A game about growing plants (beta 2 released)

Post by Robin »

:nyu:
cookie.png
cookie.png (475.66 KiB) Viewed 2685 times
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 171 guests