Skip to content

Android setup for BossRoom #429

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

Merged
merged 42 commits into from
Jan 24, 2022
Merged

Conversation

jilfranco-unity
Copy link
Contributor

@jilfranco-unity jilfranco-unity commented Dec 16, 2021

Description (*)

This PR is the result of what has turned into a somewhat deep dive over a couple of weeks for getting BossRoom to run on Android. In the end, I've settled on adding things that the user would need to build for Android, while trying to keep overall project size and complexity down. This includes:

  • Setting up the scene geometry for baking (unity generated lightmaps, setting things to contribute to baked global illumination, setting up a light probe prefab that the user can turn on, setting up a baked lighting profile, adding turned off baked mode lights to the torch prefab that the player can use if they want to bake torch lights)
  • Setting up quality settings in the project and adding a button to the settings menu that can cycle through them
  • Setting up URP assets for all of the quality modes, especially for android
  • Also changing the scale of the geometry in the main menu, char select, and post game scenes to be 1 instead of 50-something, which both fixes this bug and makes the environment better for baking
  • Also also did a little bit of a reorganization on the different BossRoom geo prefabs, just some clean up to make it easier to select things in scene

By employing the things listed here, the user can get pretty decently performant builds on android. By messing with these settings, I was able to get 29 FPS on the Samsung J2 Core.

The overall idea is that these changes will give the user a good launching point to start with, covering some of the little nitty gritty things, then they can make more modifications if they'd like

Related Pull Requests

This PR was put on hold as I did a deeper dive into Android performance. This bug has been fixed in this PR due to the other changes I ended up making for performance. Probably not the best practice, but here we are :v

Issue Number(s) (*)

Jira ticket MTT-1068
Jira ticket MTT-1500

…was casued the intensity of the lights being set too high, the compounding render texture error was caused by the ssao being set to sample from depth and normals, setting it to just depth makes the error go away. Also modified low quality settings and added cheaper URP pipeline assets to be used with said low quality settings
…ser can use with their baked lighting, added lights to torches that are turned off, but good to be baked, reorganized the android urp assets, sanity checked and cleaned up quality settings, moved the quality button script to a better place (rather than assets folder), other tiny clean up things
… as setting up baked lights to be used by user for the char select background prefab
@jilfranco-unity jilfranco-unity marked this pull request as ready for review December 16, 2021 17:16
@jilfranco-unity jilfranco-unity changed the title Bossroom setup for android Android setup for BossRoom Dec 16, 2021
@SamuelBellomo SamuelBellomo changed the base branch from develop to main December 16, 2021 18:43
@SamuelBellomo SamuelBellomo changed the base branch from main to develop December 16, 2021 18:43
SamuelBellomo and others added 2 commits December 16, 2021 13:47
…aterial :v (thought it was a test shader i'd been working on and wanted to discard) so i've put it back and now the levels aren't completely pink
{
public class QualityButton : MonoBehaviour
{
public TMP_Text qualityBtnText;
Copy link
Contributor

@LPLafontaineB LPLafontaineB Dec 17, 2021

Choose a reason for hiding this comment

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

Should be renamed to QualityBtnText
Edit: nevermind

Copy link
Collaborator

@fernando-cortez fernando-cortez Dec 17, 2021

Choose a reason for hiding this comment

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

Are you sure you're on the correct code style settings? Public variables are recommended as lowercase for me.

*Edited out code suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, I got confused with properties.
However, could it be made private since it is not used outside this class?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Absolutely, good catch. Should be made private.

Copy link
Collaborator

@fernando-cortez fernando-cortez left a comment

Choose a reason for hiding this comment

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

Looks good to me, besides some of the small comments I've made.

I also tested on my Pixel 3 and it's running a heck of a lot better than before, even on the High quality setting.

Also changing the scale of the geometry in the main menu, char select, and post game scenes to be 1

Amazing.

{
public class QualityButton : MonoBehaviour
{
public TMP_Text qualityBtnText;
Copy link
Collaborator

@fernando-cortez fernando-cortez Dec 17, 2021

Choose a reason for hiding this comment

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

Are you sure you're on the correct code style settings? Public variables are recommended as lowercase for me.

*Edited out code suggestion.

@fernando-cortez
Copy link
Collaborator

Another thing which jumped in my mind when reviewing this, which could be added to a follow-up PR or here if it's easy to implement, is that the camera in the main menu, post game scene (and char select too I believe?), can be consolidated into some sort of UICamera prefab.

It'll be nice to have those camera settings consistent across scenes that don't vary too much in what they render.

@LPLafontaineB
Copy link
Contributor

The texture seems to be missing for broken pots and pillars

No texture for destroyed pots
No texture for destroyed pillars

@jilfranco-unity
Copy link
Contributor Author

Another thing which jumped in my mind when reviewing this, which could be added to a follow-up PR or here if it's easy to implement, is that the camera in the main menu, post game scene (and char select too I believe?), can be consolidated into some sort of UICamera prefab.

It'll be nice to have those camera settings consistent across scenes that don't vary too much in what they render.

Definitely, I can do that in a separate PR right after this one

ART_NOTES.md Outdated
Comment on lines 48 to 50


* You can hover over each setting and a tooltip will descirbe what it does <br /><br />
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* You can hover over each setting and a tooltip will descirbe what it does <br /><br />
* You can hover over each setting and a tooltip will describe what it does <br /><br />

ART_NOTES.md Outdated
@@ -0,0 +1,112 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have a TLDR for say "Steps for Sam who wants to demo Boss Room" and "Steps for Sam when he wants to edit the scene"?

Copy link
Contributor

Choose a reason for hiding this comment

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

In other words, users like me could be pretty inexperienced with lighting and baking (and wouldn't want to start learning about this in a Netcode project...). So having concise instructions at the tope to get you where you want to go could be best.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahaha can do!

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you and @s-omeilia-unity review this together?
I tried to create an iOS build for my low end iPhone device, but I was confused as to what I needed to do to make sure it was running smoothly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Will read through this today!

ART_NOTES.md Outdated
@@ -0,0 +1,112 @@

# **Art Notes**

Copy link
Contributor

Choose a reason for hiding this comment

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

this doc should be linked to by the readme. People don't know we have other docs beside the readme

Copy link
Contributor

Choose a reason for hiding this comment

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

Speaking of docs, this md should reside in the Documentation folder

@SamuelBellomo
Copy link
Contributor

Probably not the best practice, but here we are :v

which bad practices?

resolved with smart merge tool

# Conflicts:
#	Assets/BossRoom/Scenes/BossRoom.unity
Copy link
Contributor

@LPLafontaineB LPLafontaineB left a comment

Choose a reason for hiding this comment

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

There are some of Fernando's comments left to address, but apart from that, LGTM

@s-omeilia-unity s-omeilia-unity self-requested a review January 18, 2022 15:51
jilfranco-unity and others added 3 commits January 19, 2022 15:28
Changed baking menu to an abstract class, edited one of the console logs for baking menu to be more readable, deleted an unused include, changed quality text var to not be private
LPLafontaineB
LPLafontaineB previously approved these changes Jan 19, 2022
@@ -0,0 +1,112 @@

# **Art Notes**
Copy link
Contributor

Choose a reason for hiding this comment

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

There's two ART_NOTES files...
I'm guessing this one is the right one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh weird, I'll delete the duplicate!

![LightExplorer](Images/BossRoomMenu.png)

* **To bake all lights:**
* Go to menu Boss Room > Lighting Setup > All Baked
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there steps missing to require us to load all required scenes? Cause it's the kind of thing I'm sure I'll forget :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've moved a section detailing that from the bottom to the TLDR! :)

Deleted the extra art notes from root, changed some typed variables to vars, made the baking menu class public, edited the art notes to take baking for boss room section from bottom to the tldr
# Conflicts:
#	Assets/BossRoom/Scenes/BossRoom.unity
@jilfranco-unity jilfranco-unity force-pushed the bug/jil/bossroom-setup-for-android branch from 69057c5 to 7583cda Compare January 21, 2022 15:26
@jilfranco-unity
Copy link
Contributor Author

Force pushed a new commit to overwrite a messed up one. Today I learned more about how git works :)

@jilfranco-unity jilfranco-unity merged commit 5c8c6de into develop Jan 24, 2022
@jilfranco-unity jilfranco-unity deleted the bug/jil/bossroom-setup-for-android branch January 24, 2022 14:17
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.

5 participants