This term is almost done!
What got done
- Worked on the CS presentation which went pretty well. (9 hours)
- Added the foundation of a pause menu with in game options while you are playing and I added it to the map editor. You no longer have to quit the game to switch scenes! (3 hours)
- Since there's been talk of getting a "grey box" build out to more people, I started making the game less error prone when we aren't walking someone through it. I reworked the way the bases are assigned to avoid situations where a player doesn't get a base or there is an incorrect number of players for a map. I added validation to the map editor and the lobby to force an equal number of players per team to leave out the guess work of assigning bases to player. So far this has been working out pretty well, but we will probably add functionality for uneven teams in the future. (12 hours)
- I continued working with the MeshBaker asset this week where I made some awesome breakthroughs. A few weeks ago I added functionality to combine the mesh and materials of the map into 1 mesh and 1 material at runtume. This takes about 2 seconds on average and can easily be concealed in the loading screen. What I set out to do this weekend was find a solution to combining the meshes of entities (bases, towers, units and superunits) as they spawn. I tried using MeshBaker to bake the models into prefabs, but I was met with an endless stream of errors. It turns out that MeshBaker breaks very easily. Even assigning values in the inspector in a different order can cause errors. I had previously been using the runtime API, so I figured I would give that a shot. After a few hours of fighting with it I was able to to get some pretty good results. I set up script where you could just drag all of the models into the scene, press the "Bake" button, and then you would automatically get the new texture atlas and material. Then at runtime, as entities are spawned, I could just add them to a big combined mesh for next to no performance hit (it takes about one thousandth of a second). At that point I had every mesh in the game as 1 draw call. Unity has a hard limit on texture size of 4096x4096. Once we have textures for all of the models we will probably surpass that max size once all of the textures are combined. I reworked my script to now support 4 different textures atlases. One for all bases, towers, units and super units. So now we have a setup where we will have 4 draw calls for all entities.
So what does all of this mean? For starters, artists will no longer have to spend time creating texture atlases. This could save hundreds of hours of work. It is now just a few clicks to automatically generate texture atlases. We no longer have a huge performance hit when a ton of units and towers are on screen. This will be especially useful for larger multiplayer games. I've still got some work to do on this but this is coming along nicely. (15 hours)
What's next
- After I combine the materials into 1 big material, I still have to manually go update all of the 15+ prefabs. This is very time consuming and needs to be automated.
- (In the coming weeks) Refine behaviors for AI.
- (In the coming weeks) Continue testing 8 player support.


No comments:
Post a Comment