Switching To Unity3d

Forum posted on

Project: Thou Curator

I'm opening up this discussion to talk about us switching to Unity3d.  Below is a list of stuff that needs to be done.

  1. Backup Everything
  2. Setup Armament Project in Unity3d
  3. Setting Up TFS
  4. Merge Asset using Automation System
  5. Adjust the Member Collaboration Utility
  6. Testing
    1. TFS & Website Asset
    2. MCU
    3. Unity Project
  7. Website Configuration Changes
  8. Create Agenda's for Programmers
  9. Send Out Email for Programmer to Come Help


Thanks,
James Fleming 
Facebook
Discord
Switching To Unity3d

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 9:44:23 AM
If there is anything specific you need me to tackle, let me know.


GameProgrammer  - Anthony Michelizzi

Can you tell me where the "RAW" asset like fbx etc are stored in Unity to be used with the prefab created in the engine?

Xenko use a folder called "Resource" and then when you used the in the engine they get ported into a folder called "Asset" but the engine does that part of it.

Better yet if you can tell me the normal folder structure of Unity that would speed up my research.

Thanks,
James Fleming 
Facebook
Discord

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 9:56:17 AM

Unity automatically imports them as long as they are in the assets folder. All Textures should be in a folder named Textures on the same level as the imported mesh.

 

IE. You have a folder, "Tank", and you import the tank mesh into unity. In the "Tank" folder you need to have a "Textures" folder that contains the textures for that mesh.




GameProgrammer  - Anthony Michelizzi

@Anthony Ok so does that mean it has to be labeled "Textures" instead of "Texture"?  Our automation system will handle all this just need to know if the title really matters because we have audio etc file too that go in a subfolder called ambient noise etc.

Thanks,
James Fleming 
Facebook
Discord

Here is a sample of the resource folder structure as of right now.

Resources>Game Artist 3D>1482>Model>785.fbx
Resources>Game Artist 3D>1482>Texture>1543.png

Based off what you are saying this will not work it has to be as follows?

Resources>Game Artist 3D>1482>Model>785.fbx
Resources>Game Artist 3D>1482>Model>Texture>1543.png

Thanks,
James Fleming 
Facebook
Discord

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 10:13:28 AM
That is correct. If it's not structured that way, we can still use the mesh and texture together, but we will have to manually set them in the engine.


GameProgrammer  - Anthony Michelizzi

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 10:14:29 AM
Question,  If thats the file structure then what would be the best way to have multiple assets referencing the same texture.  Would that texture have to be in every asset folder?  I doubt thats the only way but now seems like a good time to bring that up i think?

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 10:14:37 AM

Here is also the Unity docs for importing.

https://docs.unity3d.com/Manual/HOWTO-importObject.htm


GameProgrammer  - Anthony Michelizzi

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 10:19:58 AM

@Jonathan

I'm not a 3D modeller, but I believe the textures are created when you export the model from the 3D software for import into the engine. With that being the case there shouldn't be multiple meshes referencing multiple textures.

Regardless, if we are using multiple textures on multiple meshes, I think we have a bigger problem then just pasting repeating textures in different folders. 

GameProgrammer  - Anthony Michelizzi

@Anthony At this point yes we would have to have it in every folder that needs it.  If it comes down to something like that we can make a global one I would think and reference it in the engine as needed for prefabs.

Based off what you're telling me and what I barely remember I have not used Unity is a long time.  I suggest this as our folder structure.  

1482>Model>785.fbx
1482>Model>Textures>1543.png

This way we keep the asset and agenda name for the website and use the prefab title to tell us what it is like M1A2Abram.prefab

Notice the Texture folder has and "s" all subfolder will be marked the same way.

Do you agree?

Thanks,
James Fleming 
Facebook
Discord

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 10:25:16 AM

From reading the documentation, I agree with you @James

And whatever it takes to get the assets working is fine. I'm just having a hard time imagining that a tank texture would wrap a soldier unit correctly, or even the reverse. This comes though from a totally 0 3d modelling knowledge standpoint though.

GameProgrammer  - Anthony Michelizzi

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 10:30:17 AM
Dont worry about @anthony It does work but looking into it more its not an issue thats going to hang anyone up right now so sorry i brought it up.

@Anthony " I'm just having a hard time imagining that a tank texture would wrap a soldier unit correctly"

I don't see this being and Issue with the folder structure as the asset idea will be the parent to the texture etc and presumably be only for that asset.  

1482>Model>785.fbx
1482>Model>Textures>1543.png

1482 - Agenda Id
785 - Tank Asset Id
1543 - Tank Texture Asset Id

All nested as a single item for Unity to consume.  Am I making sense?  This is what I'm planning on making the the automation system to do.

Thanks,
James Fleming 
Facebook
Discord

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 10:43:48 AM

Though im not a programmer james you have the right idea.  Theres no need to worry about that.  

The file structure looks sounds Im trying to replicate it on my own computer to see if we cant get something solid to look at.  Since what it seems like is the issue is just in whether or not the folder is called "Texture"  Vs "Textures"  



538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 10:45:28 AM

From the unity documentation:

 

"You must store Textures in a folder called Textures, placed inside the Assets folder (next to the exported Mesh) within your Unity Project. This enables the Unity Editor to find the Textures and connect them to the generated Materials."




GameProgrammer  - Anthony Michelizzi

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 10:45:33 AM

"Anthony " I'm just having a hard time imagining that a tank texture would wrap a soldier unit correctly"

I don't see this being and Issue with the folder structure as the asset idea will be the parent to the texture etc and presumably be only for that asset.  " -james

Im sorry i didnt clarify james your right the prefab will handle anything we want to do with textures later on so we dont need to worry about that right now.  I just wanted to know if it was going to be an issue but it doesnt seem like it.  


Yes please do @Jonathan and see if Unit pull the asset in automatically if we have the folder structure the way I have it listed.  If not can you mess with it to find out what Unity will take in automatically.  One of the main reason we are doing this is to make our life easier so lets let this engine work for us.

Thanks,
James Fleming 
Facebook
Discord

Let have everyone just try out a few folder structure and see what works if we need the Textures folder inside the model folder or if it should stand alone.  Get some screen shot and make a choice now so I can get it setup.

Thanks,
James Fleming 
Facebook
Discord

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 10:51:26 AM
@james Im not really sure about this idea because to me it is kinda the lazy/room for error way of doing it.  But that conversation could be had later.  But there is a way, we could just drag the blend files and drop them into unity.  I think then the engine would probably do, any if all the work.  From animation to texture to materials.  Im not 100% on everything it can or cant do but i could venture down that path if you think its worth looking into?

@Jonathan No I think for now we should do it the fbx way.  Thank you for that insight we might review it another time.  But our system is setup already so I don't want to rework all of them to make blend files at moment.

Thanks,
James Fleming 
Facebook
Discord

@Team Take a look at this.  https://docs.unity3d.com/Manual/ImportingAssets.html

Thanks,
James Fleming 
Facebook
Discord

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 11:00:02 AM

Updated asset

 

Its possible we can still do that with FBX too.  Before going foward we really have to take a hard look to make sure theres little room for error but if you can see my screenshot i dragged the fbx into unity and the simple defuse materials i made and wrapped on the model ported in just fine.  

 

Again we really have to iron it out and fully understand it but it might be worth looking into



737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 11:06:13 AM

https://answers.unity.com/questions/121825/importing-blender-material.htmlhttps://docs.unity3d.com/Manual/class-FBXImporter.html

@james If you look here the top answer really irons out a workflow for getting Textures into unity from blender cycles.  If we combine that knowledge with the features unity has on its manual   https://docs.unity3d.com/Manual/ImportingAssets.html

i think it might save us allot of time. 

Looking at all this information leads me to think you have the folder structure right as well and we could automatically do it.  Though i think like in xenko someone will have to go and manually drag everything into unity maybe


Ok and this is from the *.blender file?  This leads me to think though we will be using more then one texture for the units however because we will need to set the teams color.  Like red team blue team.

Thanks,
James Fleming 
Facebook
Discord

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 11:40:30 AM
No Fbx

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 11:42:57 AM
Also Not only can we import the materials but we have control over the prefab.  We can change certain details with code alone.  And if we decide to update or overhaul things seems to me like this is the most hassle free way of doing it.  However we have less control doing it like this that the ATLAS method manually if that makes sense.  Doing it like this we are working with data mainly i believe

@Jonathan Ok so if we use that method for doing it let talk about the automation system.  The way it is right now each asset is named the asset id.  Which means you get asset 785.fbx and 1231.jpg etc.  Blender does not know this I'm assuming at this point that Unity can only import the materials named whatever they are in blender correct?

Thanks,
James Fleming 
Facebook
Discord

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 12:14:42 PM
@james The directory you have set right now with the asst id and texture id works for atlas method.  perfectly.  But if we just drag the FBx in with materials and NOT ATLAS method (so everything minus the actual ATLAS step.  However using the drag ind drap fbx into unity method means all the materials and uv maps go into it as well.  Then we could edit the model and textures in unity and not have to bring it back into blender

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 12:15:49 PM
At the same time with the ATLAS method means we could change the textures oh the fly using Photo shop

@Team Ok with that said I'm say we go the "ATLAS" way of doing it with the directory.  I'm start on that so speak now if you have an objection.

Thanks,
James Fleming 
Facebook
Discord

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 12:51:25 PM
No objections here.
GameProgrammer  - Anthony Michelizzi

@Anthony On next question most game engine keep like a caching area where they put all the game engine stuff it compile for the assets. 

Do you know where that is in Unity3d?

Thanks,
James Fleming 
Facebook
Discord

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 1:16:37 PM

I'm not quite sure I follow.

Everything in the assets folder will be compiled upon build.


GameProgrammer  - Anthony Michelizzi

Ok so Unity does not prebuild them and store them then?  Xenko did that so we made a utility to clear it in the MCU application.

Thanks,
James Fleming 
Facebook
Discord

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 1:26:51 PM
The only thing unity does is use/builds .meta files for the assets. They give the editor specific data on all the assets. I can't say 100% that it would matter if they got deleted for the 3D assets, but it does matter for prefabs, scenes, etc.
GameProgrammer  - Anthony Michelizzi

Ok I will leave that part of the MCU out for now unless we find we need ti.

Thanks,
James Fleming 
Facebook
Discord

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 1:44:00 PM

@anthony could you look at this  for me https://answers.unity.com/questions/319802/rotation-when-importing-from-blender.html

Have you ever encountered this before?  When i bring a fbx with the rotation set to 0,0,0 i guess it imports into unity with a -90 rotation on the x axis.  Have you ever encountered this and if so what was your solution? 



538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 2:02:39 PM
I've always just rotated my objects in the editor. Once they are rotated properly for a prefab, then it wont spawn incorrectly in game.
GameProgrammer  - Anthony Michelizzi

Ok so the file structure is as follows

Parent: AgendaId>AssetId>785.fbx

Children: AgendaId>ParentAssetId>AssetType>1543.png

Any objection?

Thanks,
James Fleming 
Facebook
Discord

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 3:03:03 PM
No objections here.
GameProgrammer  - Anthony Michelizzi

737.43 SSgt Jono Lansdale Artist 3D
3/8/2018 3:13:02 PM
sounds great

Ok the Member Collaboration Utility (MCU) is up and working.

http://www.thoucurator.com/project/viewdocumentation?documentationid=13

Thanks,
James Fleming 
Facebook
Discord

Sounds great I've already started setting up some project structure so I can test out some stuff and get some of the things ported over.

538.05 SSgt Anthony Michelizzi Programmer
3/8/2018 7:19:58 PM
So are we not doing anything in VSTS anymore @James?
GameProgrammer  - Anthony Michelizzi

@Anthony Yes that MCU application connect too TFS.

Thanks,
James Fleming 
Facebook
Discord

Ok after getting this loaded and seeing it in Unity3d I think a change needs to be made.  I see in the folder structure that really having it nested by agenda is not really necessary.  Does anyone object?

// Orginal
Parent: AssetId>785.fbx
Children: ParentAssetId>AssetType>1543.png

// New Plan
Parent: AssetId>785.fbx
Children: ParentAssetId>AssetType>1543.png

Unity Asset Screen SHot

Thanks,
James Fleming 
Facebook
Discord

@Team Does anyone have a project in Unity that has some content too it and can screen shot the asset directory.  I would like to see some of the file types and where they sit in the structure like prefabs.

Thanks,
James Fleming 
Facebook
Discord

James unity is pretty free with the file structure as long as the game assets are in the asset folder. It's for cross-platform compatibility, unity exports that folder in various forms for whichever platform. Basically, we can just setup a file structure in the assets folder like you had in the xenko folder organizing everything. Although from my experience its nicer to group related items, prefabs with prefabs, models with models and so on then sub- out those categories with things like units, environ, resources, sandbox, so on and so forth, I'll set up a screenshot as I've been trying to port the folder directory over and it has been a bit difficult because xenko has a separate asset directory for scripts vs hard assets. I was going to just ad a scripts folder in the asset folder and break it down from there. I'm trying to port over what I can and start getting the terrain and units moving with rotation and colliders. I need to work with @Jonathan and show him unity's in engine terrain editing tools, they are quite nifty to quickly sculpt terrain and can then use an optimized terrain collider. I'm not sure how it compares to blender but its something to look into.what i had so far, rough and super easy to modify at this point.  

An active project of mine, not super organized but i follow a general pattern


 You can add as much hierarchy as needed, should try not to exceed OS file path limitations lol

This is an example form a free asset I downloaded. I have the entire folder structure highlighted in the left panel so it appears to all be in one folder on the right but it is not. 
An example from a free asset i downloaded from Unitys' asset store





@Wallace Thank very much you gave me the insight I needed to make the folder structure.

In the mean time will you uninstall the MCU and redownload it from the site you will need the new version that is Unity ready.

Thanks,
James Fleming 
Facebook
Discord

Your welcome @James. I'm not great at setting up the back end and structure so I'm glad that helped. I've set up a basic structure of my own just to get things going, we can port into the final structure when you are ready. So far these are the things I been working on:

  • Terrain - I've used Unity's in-engine terrain editor (its just an interactive way to paint heightmap data directly on a piece of terrain and watch the results in real-time.) It automatically sets up a specialized terrain collider that is optimized for a large collision mesh. I would like to get with @james and @Jonathan to talk about the implications, and whether we can use Unity's terrain engine or make terrains in Blender and use mesh colliders.
  • Camera - I'm writing a general purpose camera script that we can use to move around the game world and look around. (For example, it used a ray-cast down to offset the height based on the terrain as it moves around.) The camera also houses the raycasting to see what the mouse is hovering over. 
  • Units - I'm still setting up the camera and terrain but I'm also working towards movement and pathing of units over the terrain, unit selection, rotation.
I'm aiming to get us closer to where we were with the Xenko project at least as far as the visuals and functionality. Even if it doesn't exactly fit the final structure these things should be easy to port and I'm trying to keep everything modular


538.05 SSgt Anthony Michelizzi Programmer
3/9/2018 12:31:25 PM

As for some rts type components, there is a nice demo from Unity Technologies that covers some basics.

 

https://github.com/UnityTechnologies/ATerribleKingdom


GameProgrammer  - Anthony Michelizzi

737.43 SSgt Jono Lansdale Artist 3D
3/9/2018 12:41:15 PM
Awesome looks like we are hitting a nice stride right now guys!

538.05 SSgt Anthony Michelizzi Programmer
3/9/2018 12:45:15 PM

@Wallace do you have any agenda items for the stuff you are doing?

If not I'll get them created so you can log time to them.

A bit later tonight I'll get a pile of agenda's written up for getting game play and networking going. I think @James, @Jonathan and I need to arrange a meeting or start a discussion about networking before we go to far down that rabbit hole. 


GameProgrammer  - Anthony Michelizzi

@Team I know we're all excited about Unity but let slow down just for today let me finish tweaking the asset folder and stuff.  @Jonathan and I have been working non stop of testing and it should be completed by late tonight.  Then we will open another discussion of where to go from their.

Thanks,
James Fleming 
Facebook
Discord

@Team Ok Delta is setup and ready to start coding using VS2017 & MCU application.  Let me know if you have any questions.

Thanks,
James Fleming 
Facebook
Discord

@Anthony Negative, no agendas. I'm just trying to get a little ahead, I have some time this weekend and would rather spend it in unity then trying to write quaternion math functions for Xenko... why recreate the wheel if we're already going to use unity's wheel =p

I'm basing what I've been doing on the agendas I had before, the state of how things were on the front end. I wanted to get the bases covered, get terrain in and get the collider working this time around. Get a camera control going even if its only for development so we can navigate the game world and look around. And then get a unit moving around and tilting with the ground...  I honestly don't know how much of it will port right over or what will need to be reworked to allow for networking considerations, but I spend way to much time trying to do this in Xenko and it was demoralizing and discouraging. Unity is something I do know and I'm mainly doing this as a personal reminder that I can actually solve these problems without bashing my head against a wall. As I said I'm not super with the background setup and networking (yet) so trying to make what progress I can and hoping it fits. If you would like to make some agendas I won't complain. A little direction never hurts a project. 

538.05 SSgt Anthony Michelizzi Programmer
3/9/2018 7:23:33 PM

@Wallace

I don't think networking is a huge concern MVP wise, and we haven't had a discussion about how we are going to do the client side via unity. The nice thing about it is most solutions in Unity are easy to patch in at a later point.

I did create two agendas to cover unit selection and moving, and the camera. As soon as those come through, I'll get them assigned, or you can request them.

 

 


GameProgrammer  - Anthony Michelizzi

@Team I just want to make sure everyone know you will need to uninstall the MCU application and reinstalling it before you can start on any agenda.  The MCU was last updated this evening.

http://www.thoucurator.com/project/viewdocumentation?documentationid=13

Thanks,
James Fleming 
Facebook
Discord

@James I will reinstall just to make sure but I did that already today and downloaded the unity project. I have some stuff done with the camera, just fine tuning it now, and the terrain, I'm going to make a video of it so I can share it with the team, I was going to sync up and import what I've done and then check it in if that was ok, that way everybody could access it.

@Wallace Sounds good please reinstall MCU as it has tweaks and patches that are needed from @Jonathan and I testing all day yesterday.

Thanks,
James Fleming 
Facebook
Discord

119.03 Cpl Wallace Donegan Programmer
3/10/2018 12:12:26 PM
I have re-download the MCU and will be syncing later today i have some things i need to do this morning then i'm going to go rest of the day on these tasks. 

Just a quick video on the terrain tools in unity. Not a complete look but just me creating a quick terrain to test with. https://youtu.be/8OYI4Z3X9IE

@Wallace That is awesome Unity is able to do terrain.  We will decide what to do about the terrain once we cross that bridge.

Thanks,
James Fleming 
Facebook
Discord