Creating a farming RPG in Unity - Part 3: Farmland Interaction

Creating a Farming RPG (like Harvest Moon) in Unity — Part 3: Farmland Interaction

This article is a part of the series:
Creating a Farming RPG (like Harvest Moon) in Unity

Correction: In the video, we made a reference to the PlayerController component in the PlayerInteraction class. However, we later found that we didn’t make use of it at least in this part, so you can choose to skip that bit in the video for now, as it is redundant. They are highlighted in red in the finalised codes below.

Ever wanted to create a game like Harvest Moon in Unity? This is Part 3 of our guide, where we go through how to set up farmland elements that our player character will interact with. You can also find Part 2 of our guide here, where we went through how to set up our player camera.

Continue reading
Pretty Computer Chips
Image by Jonas Svidras at https://stocksnap.io/photo/intel-8008-LBYK1XTHFC.

Passing a variable by value vs. reference

In programming, a concept that usually creates a lot of confusion among those new to it is the concept of passing a variable by value, versus passing a variable by reference. The 2 examples below illustrate the difference between these two ways variables can be passed in Java:

Continue reading
Why doesn't text-align center always work?

Why doesn’t text-align: center work? A primer on block and inline elements in HTML and CSS

If you’re just starting your foray into web development, you’ll probably find that HTML and CSS have a variety of quirks that can make working with them somewhat frustrating for beginners. One of these quirks involves the text-align CSS attribute, as the attribute only applies its effects to certain kinds of HTML elements.

Continue reading
How do we create a histogram in Microsoft Word?

Creating a histogram with a frequency polygon in Microsoft Word

Microsoft Word has a bevy of powerful chart-making tools, capable of creating almost any kind of graph or chart that one can imagine. The way to create some of these charts are not immediately obvious, however, and one of these kinds of charts is the histogram (with an accompanying frequency polygon).

Continue reading
Creating a bar and line graph in Microsoft Word

Creating a bar-line chart in Microsoft Word

Are you tearing your hair out trying to figure out how to create a bar-line chart (i.e. a combination of a bar chart and a line chart) in Microsoft Word? Look no further, we’ve got step-by-step instructions for you in this post, as well as an accompanying video guide.

Continue reading
A formula for rounding number

A formula for rounding numbers

Most programming languages come with native functions that help us round our numbers, either upwards (i.e. ceiling operation), downwards (i.e. floor operation), or to the nearest whole (i.e. round operation). While this is convenient, we sometimes need a bit more than that — what if — for example — we want to round our numbers to the nearest 0.5, or the nearest 3rd?

Continue reading
Adding virtual hosts on Bitnami Apache

Adding virtual hosts on Bitnami Apache

Over the weekend, I’ve spent a substantial chunk of time figuring out how to add a virtual host onto a client’s subdomain. In laymen’s terms, this means that:

  1. My client has a website hosted on a domain (which we shall call example.com, for confidentiality reasons)
  2. We want to build a web application on app.example.com, which will be entirely separate from example.com.
  3. To save on cost, we want to host app.example.com on the same server that example.com is using (i.e. create a virtual host on the web server).

This means that we have to configure our web server so that it will serve a different webroot depending on the domain it is being accessed from.

Continue reading
Shallow vs. deep copying in Python

Shallow vs. deep copying in Python

If you’ve worked with Lists in Python before, you’ll quickly realise that they work differently from primitives like integers and strings. Consider the following:

a = "hello"
b = a
a = "world"
print(a) # Outputs world
print(b) # Outputs hello

Notice that changing the value of a does not change the value of b. This is called passing by value. In Python, Lists do not behave this way:

a = [2, 3, 4, 5]
b = a
a.append(6)
print(a) # Outputs [2, 3, 4, 5, 6]
print(b) # Outputs [2, 3, 4, 5, 6]

In the above example, notice that changing the value of List a also changes the value of List b. This is because both a and b are referring to the same List, and this is called passing by reference.

Continue reading
Security for your Ubuntu Droplet

Setting up basic security for your Ubuntu Droplet

Have you recently spun up a new Ubuntu Droplet on DigitalOcean? The other day, when I checked my authentication logs in /var/log/auth.log, I came across several login attempts with random usernames.

Malicious login attempts in Ubuntu
Login attempts by malicious users.

We often take security for granted, but it becomes something of great concern once you start to manage servers of your own. If you were to leave your Droplet as it is, it is only a matter of time before hackers guess your login credentials and gain access to your system. Hence, here are some basic security measures you should set up to prevent others from breaking in:

Continue reading
Swords and Shields
Awesome starters artwork by Ry Spirit: https://instagram.com/ryspiritart/

Calculating EVs needed to raise a stat in Pokémon

As a result of working on upgrades for this Pokémon Effort Value Calculator, math has been a pretty big part of my life for the past few months, as I’ve been rearranging the games’ formulas for stat and damage calculation to make my own that fit my needs.

One such formula was the EVs needed one, which gives you the amount of EVs you need to invest to raise a stat by n points. Everyone knows that at Level 100, you get 1 stat point for every 4 EV points you invest; but what happens when you’re not at Level 100, or when you factor in stat modifiers like Nature, or item and ability boosts?

Don’t know what effort values are? Start with this article from Bulbapedia. Don’t play the mainline Pokémon games? Then you should start with these.

Continue reading