Chill Jam 02, Day 1: Water, Character Movement, and a thunderstorm IRL.

 Today, I started work for the Chill Jam 02: Summer Edition. It started at 10:00 PM BST last night and by then, I had begun to think of ideas for the game. 

Initially, I had planned to make the game in Unity’s 2D mode and with URP. By the time I woke up the following day, however, I had decided to use Unity’s 3D mode instead, with URP. I chose this because I enjoyed working on my previous jam project, Jim’s Marble

I first started by creating a river. I did this by using a YouTube video for creating water within Unity. I had not worked with shaders before in Unity so it was a bit difficult to follow, but it was similar to the node system within Blender so I was able to mostly get it working. What I couldn’t get working was the Normals, I couldn’t find a free version of water normals. The usual place I go for free textures, PolyHaven, doesn’t have any, and textures.com didn’t provide the normals for their water textures. 

This is what I came up with. I think it’s a decent first effort.



Shortly afterwards, I got a reply by someone which had a open-source water shader they had made, along with the normals. I haven’t been able to correctly implement it into the game yet, however. 

While I was waiting for lunch to cook, I used a notepad to make an action plan for what I wanted to put in, and to describe the essential and nice-to-have features. 



I had already decided against using my flagship OC within the project, so I decided to create a new character. I wanted to make an animal character that would fit the theme, and it didn’t take long for me to land on a crab. I chose the name “Carrie” for the crab, as it sounded right. 

It had already started to gain a bit of attention when I shared this in-progress screenshot. 


Initially, I wanted it to be a purple crab based on what I saw from a NatGeo article, but I went for a more standard colour instead. I also added circular eyes a little later on in the day. 




I started Brackey’s Third Person Character tutorial. It was a bit more understandable than the shaders graph but I found the angle part difficult to understand near the end of the tutorial. A sign that I need more practice 😅 There was a bit of an issue where the camera was sticking close to the ground. I fixed this by going back into Blender and scaling Carries body parts by 10, and then re-exporting. 


However, while I had a bit of the movement script implemented, a thunderstorm broke out. 


I can’t say that I didn’t expect a storm, I knew that there was a possibility for a storm, but I never expected one today

I immediately unplugged the extension cable that carried power to my electronics (My laptop, my M1 Mac Mini and a 75Hz Dell Monitor from 2007).

 I returned to the project an hour later, but with my stuff unplugged. The main consequence of this was the fact that my laptops GPU (an RTX 3070 mobile) would be limited by it’s powered. Indeed, Unity was showing a maximum of 30FPS and it was about 17FPS in 4K (it was showing around 200FPS while I was plugged in). 

Despite this, I was eventually able to complete the tutorial and get a working version of a player movement script. 




Finally, the last thing to do was implement a date/time system and a points system. The former was much easier to work with. I created a new script called DateTimeManager and threw in some code which increased the value of the gameMinute variable. Once the gameMinute variable reached 60, it would then add to the gameHour. And if the gameHour would hit 24, it would reset to 0 and the gameDate would be incremented by 1. 

private int _gameDate = 1;

[SerializeField] private int gameHour = 6;

private int _gameMinute;

[SerializeField] private int timeMultiplier = 2;

private void Start()
{
_gameDate = PlayerPrefs.GetInt("Date");
}

// Update is called once per frame
void Update()
{
AddToGameTime();
}

private void AddToGameTime()
{
if (_gameMinute <= 59)
{
_gameMinute += timeMultiplier;
}
else if (_gameMinute == 60)
{
_gameMinute = 0;
if (gameHour + 1 == 24)
{
gameHour = 0;
_gameDate += 1;
PlayerPrefs.SetInt("Date", _gameDate);
Debug.Log("Day " + _gameDate);
}
else
{
gameHour += 1;
}
}
}

public int GetGameDate()
{
return _gameDate;
}


This doesn’t have any effect yet, but I plan to have a system where the Skybox is affected by the current hour. The system isn’t bug free, as it does add a bit too much, but it’s fine for now. 

Finally, I worked on the scoring system. This was surprisingly difficult, as I initially couldn’t get the script working to destroy the coin object and provide a player with the coin. I had come up with a player scoring script, and so I decided to handle coin collisions directly on the player. This provided to work, some of the time. Occasionally it didn't work, so it's something that I will need to fix.  

private int _playerPoints = 0;

private void Start()
{
_playerPoints = PlayerPrefs.GetInt("Score");
}

public int GetPlayerPoints()
{
return _playerPoints;
}

public void AddPlayerPoints(int pointsToProvide)
{
_playerPoints += pointsToProvide;
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Coin"))
{
Destroy(other.gameObject);
AddPlayerPoints(1);
Debug.Log("Player Points: " + _playerPoints);
}
}

Tomorrow, I will create the tree models, and shaders for the sand. I will also create crab NPCs, and I will start to build for WebGL and iOS, ready for player testing. 





Comments

Popular Posts