Project: New Light City



Intro

Worked as a Game Programmer
2020 - 2021

What I worked on:

  • A fully functional chess game done entirely in C++.
  • Journal system with unlockable entries.
  • Multiple choice dialog system.
  • Noise/sound based stealth detection system.
  • True first person controller coded from scratch in C++.
  • NPC behavior tree for enemies and robots.
  • Animation Blueprint and blending.
  • Traffic system.
  • Technical art implementation and solutions.

This was a project me and a friend started working on late 2020. It was my first working in Unreal Engine and with C++. Our goal was to do a demo and try and find funding to continue the development. The first demo was completed, but we never had the opportunity to pick up the development again. However, I still want to showcase it here since I’m quite proud of several of the features that we implemented, I feel that they showcase my strong C++ and Unreal Engine experience that has only gotten since then.

Gameplay




Breakdowns

Below you can more read more about the systems I wrote for the game and get a glimpse of some of the code.

This section is a work in progress and more will be added soon.

Chess Minigame


This minigame has all the rules of chess, including en passant, castling, promotion and a basic AI opponent. It is fully written in C++.



IsSelfCheckMove

Below is a method that checks if a move will put the king in check, returning true or false. It’s called when the chess game is verifying all possible moves of a piece. If the method returns true the move will be removed from the list of available moves.

Code:
bool AChessBoard::IsSelfCheckMove(AChessPiece* SimChessPiece, AChessTile* OriginTile, AChessTile* SimTargetTile)
{
	bSimCheckMate = false;
	bSimSelfCheck = true;

	AChessPiece* TargetedPiece = nullptr;
	if (SimTargetTile->IsOccupied(CurrentTurn))
	{
		TargetedPiece = SimTargetTile->GetOccupyingPiece(CurrentTurn);
	}
	SimChessPiece->TrySetTile(SimTargetTile, CurrentTurn);
	UpdateTurn();

	if (bWhiteTurn)
	{
		for (AChessPiece *ChessPiece : WhitePieces)
		{
			SetAvailableMovementTiles(ChessPiece->CurrentTile, CurrentTurn);
		}
	}
	else
	{
		for (AChessPiece *ChessPiece : BlackPieces)
		{
			SetAvailableMovementTiles(ChessPiece->CurrentTile, CurrentTurn);
		}
	}

	SimChessPiece->TrySetTile(OriginTile, CurrentTurn - 1);
	ResetTurnTo(CurrentTurn - 1);
	if (TargetedPiece)
	{
		ReactivatePiece(TargetedPiece, SimTargetTile);
	}

	bSimSelfCheck = false;

	if (bSimCheckMate)
	{
		UE_LOG(LogTemp, Warning, TEXT("Move removed as it does put king in Check!"));
		bSimCheckMate = false;
		return true;
	}
	else
	{
		UE_LOG(LogTemp, Warning, TEXT("Move does not put king in Check."));
		bSimCheckMate = false;
		return false;
	}
}