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

Improve Game Setup Menu #79

Closed
Cheeseness opened this issue Apr 24, 2017 · 10 comments
Closed

Improve Game Setup Menu #79

Cheeseness opened this issue Apr 24, 2017 · 10 comments

Comments

@Cheeseness
Copy link
Contributor

The current temporary game setup menu could do with some improvement (replace with ugui?).

Matchmaking buttons can be dropped from the online config - we've decided to drop that functionality for now.

During today's contributor catchup, it was suggested that asset/table/etc. selection should probably use left/right buttons to seek through available options as a scalable alternative to showing every available item in a list.

game_setup_ui_concept

@fragmental
Copy link
Contributor

fragmental commented Apr 24, 2017

That's a really useful image, thanks. (I assume that's an image, and not a screen cap of some ugui elements?)

@fragmental
Copy link
Contributor

fragmental commented Apr 24, 2017

https://forums.doublefine.com/topic/17182-concept-art/?do=findComment&comment=403659 link to image @KGuNN45

If we do something like this I might able to fake the ui button borders, but it might better to have a ui image for the border.

@Cheeseness
Copy link
Contributor Author

Cheeseness commented Apr 24, 2017

I assume that's an image, and not a screen cap of some ugui elements?

Yeah, it's something I slapped together quickly in Inkscape a few days back

@fragmental
Copy link
Contributor

So, how do we want to choose between network play vs local play and local one player vs local 2 player in the menu?

@jctwizard
Copy link
Contributor

jctwizard commented Apr 26, 2017

I have started exposing the functionality of the LoadAssets script so it can be tied to the UGUI. Currently several methods exist:

int GetCount(string type) // returns the number of a certain type available types are: "table", "variant" or "paddle"

string GetName(string type, int index) // takes the index of a certain type and returns its name

void LoadScene(int variantIndex, int tableIndex) // takes the index of a variant and table and loads a table

bool HasFinishedLoading() // returns true when the table has finished loading

@Cheeseness Cheeseness added this to the AF milestone Apr 26, 2017
@Cheeseness Cheeseness added the UI label Apr 26, 2017
@jctwizard
Copy link
Contributor

When dealing with networking the following methods are relevant inside NetworkSetup which will need added to ScriptHolder:

void BeginHosting(int port) // takes the port and begins hosting using it

bool ConnectToServer(string IP, int remotePort) // takes an IP address as a string and a port and returns whether it successfully connected

bool LoadTableOnClient() // attempts to load the table the server has chosen on the client, continue to call this until it returns true otherwise the client's table will not load!

@jctwizard
Copy link
Contributor

I have also added a few more vital functions to the LoadAssets script which will need called from parts of the menu:

void SetSinglePlayer(bool singlePlayer) // Determines whether or not the second paddle is an AI, takes a bool true or false

void BeginPlaying() // Must be called TO BEGIN THE GAME! Loads the paddles in and sets them up to be players or AI

@jctwizard
Copy link
Contributor

This should now set up everything. LoadAssets contains an array of player prefabs which will need updated from the inspector with all of the variations. These will need to have their names hardcoded in to the dictionary called paddleNames in LoadAssets too!

@fragmental
Copy link
Contributor

It appears that HasFinishedLoading() never returns true.

I get these two errors
There is no scene with name "Table_Clean" in UnityEngine.Debug:LogError(Object) AssetBundles.AssetBundleLoadLevelSimulationOperation:.ctor(String, String, Boolean) (at Assets/AssetBundleManager/AssetBundleLoadOperation.cs:43) AssetBundles.AssetBundleManager:LoadLevelAsync(String, String, Boolean) (at Assets/AssetBundleManager/AssetBundleManager.cs:490) <InitializeLevelAsync>c__Iterator2:MoveNext() (at Assets/scripts/LoadAssets.cs:183) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) <BeginExample>c__Iterator0:MoveNext() (at Assets/scripts/LoadAssets.cs:159) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

NullReferenceException: Object reference not set to an instance of an object LoadAssets+<InitializeLevelAsync>c__Iterator2.MoveNext () (at Assets/scripts/LoadAssets.cs:190) UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

@Cheeseness
Copy link
Contributor Author

OK, this stuff was merged with #110. It still needs some work/refinement (#113 and some cosmetic changes to match the styling of the main menu?). Going to close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants