Script Public Properties Configuration

Forum posted on

Project: Armament

We need to discuss how we will find and label public properties for our game.  Like this one highlighted in red.  This goes for any item that needs to be attached to a script like UI element or other scripts.

Script Public Property
Currently we use the website to locate the item and then follow the that path that is listed on the view screen for the asset to where the asset belongs.

// List View http://www.thoucurator.com/asset/listasset?projectid=8&isgameable=1

Web Asset Isgameable Items

// View of Asset http://www.thoucurator.com/asset/viewasset?assetid=1530

Asset View

Now this will work for our team but I want to put it out there if anyone has a better idea of how to tie content asset to scripts.

// Unity Folder Strucutre (IsGameable = Asset Content Provided By Website) (Scripts = TFS Source Code By Programmers)

Unity Folder Structure

Anyone have any thoughts?

Thanks,
James Fleming 
Facebook
Discord
Script Public Properties Configuration

        I think that the current system is fairly readable.  I rarely have issues finding an asset on the website and so long as the project file directory reflects the website, from a designers point of view i dont think there will be any issues.  

        The system is easy to follow and pretty tight, but will scripts be handled the same way as 3d models and other assets on the site?  



538.05 SSgt Anthony Michelizzi Programmer
4/3/2018 9:27:46 AM

I'm not sure I follow what you're trying to ask.

I don't think that any special labelling for serialized fields are needed in Unity. No matter what the programmer uses for it asset wise, we will ultimately have final control over what we decide to put there.


GameProgrammer  - Anthony Michelizzi

@Anthony I'm talking about the gap between programmer and designer.  When a script is created and needs game objects or raw assets how to help the designer find that item.

"Section Highlight" in this sample is the game object that is needed.  The only hit is that Unity says its a texture.  So where is this texture?  The site offers a good solution for finding things but this is limited to knowing what you are looking for.

In this sample the image is a 2x2 pixel.  In other sample I've been playing with like finding game script object for the HUD the only hint is that it needs a script of some class.

So my question is... Is their a better way to make it so a design knows what the programmer want for the public public properties or is the way we are doing it as good as it gets?

Thanks,
James Fleming 
Facebook
Discord

538.05 SSgt Anthony Michelizzi Programmer
4/3/2018 9:48:58 AM

Everyone has been making sample scenes that demonstrate what they want. We should be referring to those examples when needed.

If we have examples, and unity tells you what the item is, then I don't see this as an issue. 


GameProgrammer  - Anthony Michelizzi

i think though the question is after we have 1000+ assets is there anything we can do to improve the system now to prepare ourselves for that?

Which i think the system is pretty tight and well designed for that already


@Jonathan Do you think the way we have thing set right now it is manageable if we have a lot of asset and scripts to choice from?

@Anthony Do you think the way we have thing set right now it is manageable if we have a lot of asset and scripts to choice from?

Having a sample scene for each script is doable. But is the time to do that and maintain it in the project worth it.  To me it would seem tedious and sooner or later be left alone just for the fact that it is not needed.

Thanks,
James Fleming 
Facebook
Discord

@james i feel like eventually the file structure will be changed a little here and there as the project grows.  I know the point is to minimize that the best we can but its inevitable and i think instead of perfecting a file directory having a good plan in place fix whatever needs fixed when is the best idea.  So if we have more and more assets and we change some things in the directory to accommodate them, how much effort would that be?

 

Im trying to think of a stable solution but my experience on what a project should be handled and looks like further on in development, with so many people on board that is.   I think however the best plan would be to have everyone understand and agree working together to make it work the best they can.  Even if the system is flawed I usually take on the stance that done is good.  Just get it out of the way and we will make the necessary changes later.

Though i understand how problems at the stage could be more problematic in the future.  



@Team The only other solution I have thought of is to have the programmer type in comments on the public properties.

e.g.

// Texture for on screen box looking thing
public Texture Select Highlight;

This can be seen in the inspector if needed by the Designer.

Thanks,
James Fleming 
Facebook
Discord

Im not sure what happened and why this got dropped.  After working with the project more I really encourage that actually.  One example id like to bring up is @robert peric put such detail as to where the script would be placed and what assets would be used.  This would be really helpful to increase productivity down the pipeline by cutting down on time?  

@Jono Do you think if we a comment section at the top of the *.cs file that would be enough.  So you can click the script and read it in the inspector?  This was a solution I think I mention earlier to bridge the gap between programmer and designer?

Also I would like us to put the word "Script" at the start of all scripts that are to be attached in unity as well.  This will come with refactoring by Anthony and I.

Of course I would like to hear other idea if some has any.  We could also maybe keep a logo of what scripts we have?

Thanks,
James Fleming 
Facebook
Discord

@james honestly it depends on what you and anthony deem necessary.  I can tell you with SelectionRectangle.script that robert did I didnt have to look at the code at all to understand exactly what i needed to do in order to make it work.  If you review that script he explained what each block of code did and what to do with it.  

Im not saying we should explain what the math functions are doing but explaining that this block checks to see if the mouse is on the edge of the screen would do wonders.

The reason i recommend this is because if for whatever reason i run into an error I then have to go and figure out what went wrong weather it was a problem on my end or if there is an issue in the code.  And while Its good that I have the understanding to be able to do that, not all designers are going to posses the knowledge to isolate issues with the code versus a misunderstanding.  

While I do like that i can go in and check things out, I think for the most part game designers should not have the responsibility to become fluent in C# just to know what to do.  I think if we take the structure @robert put in his script and adopt it as a standard it would prevent allot of back and forth that could happen.

 

However speaking with @anthony he mention how this might be unnecessary so i just wanted to suggest it and hear from the rest of the team as well :D



@Jono I think one comment at the top explaining the script rather then a programmer commenting each method would be a better idea.  You are right most of our designer will probably not know how to code.  So my thought still stand that we only comment at the top of every component script what/why/how the script is to be used.

Let me also add that all public properties should be commented too.

@Anthony What part of this conversation where you saying would not be necessary?

Thanks,
James Fleming 
Facebook
Discord

23.08 Pfc Felipe Wagner Programmer
5/3/2018 10:04:29 PM
I think the use of Tooltips would be very good here.
https://docs.unity3d.com/ScriptReference/TooltipAttribute.html

So there is no need to open the script to read the comment saying what should be linked there and/or what that variable controls/does.

Also, unless the variable needs to be public, its better practice to use SerializeField

https://docs.unity3d.com/ScriptReference/SerializeField.html

Heres a great GDC talk about this subject i think will help everyone get a better understanding.  https://www.youtube.com/watch?v=6b-o_-Xb50E

There we go thank you @Felipe that is an excellent idea.  Let me look into that and see if we can make that a standard.

Thanks,
James Fleming 
Facebook
Discord