Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add game features, update graphics #12

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bquan0
Copy link
Collaborator

@bquan0 bquan0 commented Jan 11, 2024

Closes #6, #8, #9, #11.

New Features

Main Menu Screen

  • Has background animations of a camera panning through Level 1.
  • Buttons to quit the game and go to the level select screen.

Level Select Screen

  • Has a scroll menu to navigate through the various levels.
  • When a level is hovered over, a thumbnail of that level will be displayed to the right of the scroll menu.

Loading Screen

  • Used when loading a level (since loading the data from a .csv file into an array takes a relatively large amount of time)
  • Has a progress bar (whose function isn't really shown because loading the .csv file takes up most of the time and it happens first)

Pause Screen

  • Displays the instructions and objectives of the current level.
  • The Pause Screen is a scene of its own that can be reused in every level.
  • Each level requires its own Instructions and Objectives scenes.
  • Buttons to quit the game and go to the level select screen

Objectives

For Level 1, there are two objectives:

  • "Reach the End Zone" detection is achieved using an Area node to detect when the Player has entered the End Zone.
  • "See the Radioactive Cylinder" detection is achieved using raycasting and checking if there's no walls between the Player and the Cylinder.
    Completing an objective will cause a notification to be displayed and will mark the objective as completed in the Pause Screen

End Screen

  • Shows the total amount of radiation received by the Player (currently still actually the Geiger Counter) and the objectives
  • Buttons to go back to Level Select, Quit, or Continue (go to next level)

Models

  • Updated the Geiger Counter Model.
  • Added PBR textures and collisions to the TwoRoom model.
  • Expanded the layout of the TwoRoom model to include a hallway, starting zone, and ending zone.

Code Review

General thoughts:

  • Changed Main scene's name to Level1 since the new default scene is the MainMenu scene.
  • Many scripts now have onready var for the paths to certain nodes. This is to increase readability and also performance because we only have to find the node once at the start.
  • Deleted GeigerViewport.gd because I realized that the tutorial I followed for 3D Labels was outdated and Label3D exists starting in Godot 3.5 (the version I'm using)

Global.gd

  • This is a Godot Singleton which acts like a library of functions and variables that can be accessed by any script. Ex: Global.go_to_scene("...")
  • load_scene() loads a scene in the background while displaying the loading screen. Used for loading in scenes with radiation maps that need data from .csv files (since they load slowly)
  • go_to_scene() switches to a scene directly without showing the loading screen. The deferred method is there just to make sure that nothing is running when we try to switch the current scene.

MainMenu.gd

The reason why we don't call get_tree().quit() in the _on_QuitButton_pressed() function and instead send a notification so that the game quits in the _notification() function is because in the future, we might want to do things before we quit, such as saving Player data and whatnot.

ObjNotif.gd

This uses an array as a queue to store all the objectives because it's possible for the player to complete multiple objectives at the same time. Without the queue, only the first objective completed will send a notification, and the other objective notifications won't be shown. This could be updated in the future to use a ScrollContainer so that multiple objectives can be shown at once.

Player.gd

Removed the GC_click_sound variable because it wasn't used in this script, so its existence seemed arbitrary. Don't worry, it's been added to Level1.gd since that's where it was actually being used.

text_theme.tres

This is a Theme that I'm using for the buttons in MainMenu and LevelSelect. Originally, this was so that I could reuse the same theme in different scenes, but then I realized that I could just copy and paste themes across different scenes, so I didn't save any more of my themes as .tres. This could be removed if necessary, it would just take a little bit of effort to remake the theme and not save it.

Thoughts, Questions

Modularity

Previously, there was the idea of being able to plug in .csv files into the game in order to simulate different radiation situations. After texturing the TwoRoom model, I do not think this is a feasible idea without some advanced infrastructure to generate the associated models, textures, and collisions in Godot. This is because the .csv file will get you the radiation map, but it doesn't have any information about the collisions (which must be done in Godot), model, or textures.

Quit, LevelSelect Buttons

Currently, the Quit and Level Select Buttons have similar functionalities wherever they are. Should they be made into their own scenes for more modularity and not having to repeat these functions in other scenes? Currently, they are being used in the MainMenu, PauseScreen, and LvlCompleteScreen scenes, and it's unlikely they will be used in another scene. Also, making them scenes means 2 extra scripts and scenes.

Final Remarks

If anyone has any ideas about what I should add to the game, please add a draft or issue in the GitHub Project.

@bquan0 bquan0 changed the title make the game look prettier Add game features, update graphics Jan 11, 2024
@bquan0 bquan0 marked this pull request as ready for review January 11, 2024 16:48
@bquan0 bquan0 requested a review from gonuke January 11, 2024 16:48
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good, mostly very minor points, and some may not make sense - I'm guessing some things about how Godot works...

Comment on lines +23 to +25
*.png
*.jpg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we discussed this before, but don't we want include these artifacts to ensure the reproducibility of the project?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not included for the same reason as the .csv, .ogg, and .obj files, which is that they can be large and take up too much space in the repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they all large? I think we need to find some solution to this. Can you post some information about file sizes?

Copy link
Collaborator Author

@bquan0 bquan0 Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.csv

  • points.csv is 222KB
  • tank10.csv is 223MB (large)
  • tworoom10msht.csv is 28MB

.obj

  • GeigerCounter.obj is 3MB
  • TwoRoomModel.obj is 43KB

.ogg

  • geigercounter.ogg is 6 KB

.jpg

  • In total, the textures folder is 18.5MB
  • Each .jpg ranges from 0.4MB to 2MB, and there are 4 .jpg used for each PBR texture. There are currently 5 PBR textures in game.

The fonts folder is 451KB.

Another thing to consider is that the .git folder will become very large if there are ever any changes made to these large binary files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... a little larger than we'd like and I don't want to get into git large file stuff...

That said, we would like to have an easy way for someone else to replicate this. We can host these files somewhere and have a step to download and unpack them into the right place.

We may also want to think about how we separate them out. For example, I could imagine building a library of textures (jpg) and sounds (ogg), but the geometry (obj) and rad data (csv) are unique to a particular case.

scripts/Global.gd Outdated Show resolved Hide resolved
scripts/PauseScreen.gd Show resolved Hide resolved
scripts/Level1.gd Outdated Show resolved Hide resolved
scripts/Level1.gd Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Geiger Counter Model
2 participants