My Chicken Farm - Release Devlog


Hello and welcome to my Devlog.

It has been two minutes since I hit Publish on my second game, My Chicken Farm, and I wanted to write a bit more about the game itself and what I learned.

Play My Chicken Farm on Itch.io

About my coding experience:

I started using Renpy last December after Christmas, so basically one month ago. I dabbled a bit with creating Visual Novels and was amazed how quickly I could yield results with the engine. To be honest, I haven't really coded before. I can code HTML, CSS and a bit of JavaScript for Websites, but Python was always a bit foreign to me. I am aware of if-statements, loops and lists and that's basically it.

Ren'Py uses its own coding logic, along with Python blocks. I added some if-statements and it worked. But it wasn't enough for me..

What followed, was the Devlog rabbithole. :)

The Jam

I stumbled over Itch.io and Jams and then I saw the "My First Game Jam: Winter 2022" with a few days left and decided to enter! What fun it could be! The theme nature felt like a good fit to me - I dabbled the days before with some kind of harvest/farm/crop mini-game in Ren'Py and thought it could be done! I am working a full-time job and don't have time on week-ends to spare, so a jam with a few more days left sounded nice.

The Game

So, I grabbed what I was able to do:

  • if-statements and so many elifs
  • lists/arrays
  • boolean (True/False) statements
  • variables, so man variables..

For this game, I needed:

  • day/night cycle on a timer
  • images (crops) growing a bit every day
  • chicken and crop art
  • screens/buttons for shop and other functions

Timer

I read a bit about Screens in Ren'Py and didn't understand a single thing.. I found a timer which is also working with the screen function. I added the code for that, removed all parts I didn't understand.. and in the end found an even more simple solution:

screen timer():
    timer 5.0 action Call("do_something") repeat True

Yay. Easy! Based on that, I created even more screens, one for every button and one for allowing the player to click on the area to shoo the chicken around.

repeat True will cause the timer to be repeated. Hopefully.

Moving the Chicken via Mouse Click

Moving the chicken is pretty simple, too, after I tweaked the code (I have used a tutorial before the jam for right and left navigation. Doing it for x and y felt simple enough) and reduced it to some lines I could actually understand:

The code grabs the mouse position and assigns the chicken that new position, following a simple linear transition of the image to that new position. The game pauses for a moment, so the player cannot click around widly.

Well, it still happens and it looks a bit weird if the position is right next to old one, but for bigger distances it looks quite nice!

So now I had a moving chicken. Perfect!

Growing plants and switching Images and Tint

The plants all got a specific location, which in game is labeled as Areas.

If you sow seeds on a particular area, the area is marked as True and receives a growing point.

Ren'Py offers a ConditionSwitch for images, which I used for that! So, with raising growing points (one per day), the image will change, according to the number given by the variable. Here is the example for my first field:

    image plant1 = ConditionSwitch(
        "grow_one == 0", "images/plantx.png",
        "grow_one == 1", "images/plant0.png",
        "grow_one == 2", "images/seeds1.png",
        "grow_one == 3", "images/seeds2.png",
        "grow_one == 4", "images/seeds3.png",
        "grow_one == 5", "images/seeds4.png",
        "grow_one == 6", DynamicImage('images/corn-[plant_1]1.png'),
        "True", DynamicImage('images/corn-[plant_1]2.png'))

After implementing a night/day cycle, I thought about how to add a night and dawn background. I didn't want to go back to Photoshop for this, so I searched online for a solution.  Using transparent images didn't work sadly, but I found the Renpy Tint function!

Basically it tints your image, depending on the RGB values given. A dawn would look a bit foggy, greyish, but I couldn't get it quite right, so I settled with sunset and night instead. It's only applied to the background, though. I wanted to save myself the headache of applying it to every image - my chickens would only look quite "right" on day time, which wasn't what I intended. I mean, at this point, I created my chickens and crops in Photoshop and different colors already, enough time spent on art!

Here is the code snippet for night version of the background:

im.MatrixColor("images/bg/bg farm1.png", im.matrix.tint(0.45, 0.45, 0.75)*im.matrix.brightness(-0.07))

Less images in the image folder, less work for me in Photoshop. Horroay!

Picking up items

Now, the chicken could move and the plants grow, but how about picking up stuff?

....

Well, yeah, it's not perfect, I guess. Since everything is counted with Pixels, I tried counting too and doing some math. Now the position of the mouse and hence, the new chicken position is compared with the position of the egg and corn. These always spawn on the same spot. Before I tried spawing the egg behind the first chicken and it was quite a mess, so I settled with this workaround. It works, kinda, but sometimes I guess I overestimated some numbers or used a wrong or/and or whatever statement in an if-clause, so the eggs still gets picked up even if the chicken isn't sitting on top of it..

Feed & Hatching

The feed and hatching mechanic is ok. I used a lot of if-statements and variables, hence a lot of copy-paste and changing numbers and names. Each corn has a different variable counter. If you feed the corn, the corn color is carried over to the egg color with an unhealthy amount of if-statements, which in turn is carried over to the chicken color. Tada, new chicken in x color!

Sounds

I added some sound effects (chicken chatter chuckikuro!) for chickens and picking up stuff, some free music I thought would be calming and not too annoying long-term and added a Credits and About page in Ren'Py. I copy-pasted existing menus.. Fingers crossed, it seems to be working!

Sadly music files are HUGE. I had to convert most of them to MP3 and filtered some out, but I still wanted to keep a variety in game, hence the unusual file size of around 45 MB. It should be ok for Browser use - however you can download the file to your Ren'Py engine, too.

Visible Bugs

Also, first time the sprites are appearing as a pixel mess. I assume it's due Ren'Py loading them in the first time after you started the game. It's not a bug, it's a feature! I guess.

Verdict

Now I had added everything I needed. The remaining time was necessary for more copy-pasting (I capped it at 8 crops areas and 9 chicken colors for my sanity - I assume the average player won't need more than two areas to begin with). I'd love to add more chicken colors and variety, but I guess that's going to be a new project!

I linted the script and fixed all the listed errors and added a tutorial to make the gameplay loop more clear. After designing it and playing it over and over it was very clear to me, but not very clear for playtesters. I hope the tutorials helps a bit.

Play time

The average playtime can be around 5-10 minutes. A few seconds, if you just intend to hatch one chicken. If you want all colors or all available plots, you need to add a few more minutes for the game loop.

I intended the game to run in the background - sow some crops and do other stuff, then come back, harvest your crops and pick up the egg, sell for profit and do it again - until you save up enough coins to get the colored seeds, which then you can grow, harvest and feed to your chickens. Which in return will lay a colorful egg! Which might hatch into an even prettier chicken.. 

A lengthy process maybe, but could you lay colored eggs without putting special color into your body? 

Yeah, I thought so!

Victory

You will receive a message after hatching your 11th chicken. It's the cap I set. With these chicken, you hopefully unlocked all available colors. If not, feel free to start fresh and save up a bit for your perfect colored chicken army!

The Jam

Created for My First Game Jam: Winter 2022

It's my first "finished" game and my first time joining a Jam. The theme was "Nature" and I think raising chickens on a farm can relate to that a lot!

Play My Chicken Farm on Itch.io

I'd love to hear your thoughts about the game.

Thank you for your time!

Sora

Files

MyChickenFarm.zip Play in browser
Jan 26, 2022

Leave a comment

Log in with itch.io to leave a comment.