Regardless of the sluggish begin, this week ended up fairly productive. I began designing and implementing a brand new audio background which has no direct impact on the gameplay, however which undoubtedly provides temper.
Beneath is an audio clip from the ship choice, participant introduction, countdown and battle. I’ve discovered it helpful to typically solely hearken to the sport with none visible distractions. Viewers atmosphere wants extra variation and a few parts are clearly out of steadiness, however I’d name this an excellent begin. Audio already reacts to the sport occasions: gamers and destroyed ships are cheered, boring gameplay will get booed, mishaps trigger laughter and so forth.
A lot of the ambiences and results are taken (and normally additional modified) from two asset packs: Final Sound FX Bundle and Common Sound FX. As selection is the important thing for a vivid audio background and most sounds should have a number of variations to randomly select from, these two match to my wants.
Some sounds I recorded myself. Bulletins are impressed by the practice station scene of “Les Vacances de Monsieur Hulot”, and, after all, you’ll be able to’t have a correct area recreation with out organ music. I haven’t actually been taking part in for ages, so it was enjoyable to improvise.
Beside this audio factor, I’ve made a number of miscellaneous fixes, enhancements and balancing in addition to taken a while to experiment with Unity’s baked lighting and multi-scene workflow. Each are fairly unknown stuff to me, however they need to be one of the best ways to make enviornment stands fancier. So heaps extra about that later.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
Allright, time for half two of my lighting adventures. As my so-called workflow consists primarily of trials and errors, explaining it’s fairly laborious. However I’ll attempt to give a shallow clarification.
As I implied in a earlier submit, I discovered stadiums to be an excellent candidate for baked lighting since they’re just about the one static components within the recreation. Stadiums are available in three sizes, and every one in all them should have two variations: one with lights on (used throughout ship choice and outcomes screens) and one solely lit by the solar (used in the course of the battle). Beneath are some photos of the present fashions, lights on and off.
Earlier than the precise lighting, I used to be compelled to do some severe refactoring. My lights and light-weight settings have been far and wide, and a few directional lights have been already on baked mode; I don’t know how they have been even working. So for starters, I corrected the sunshine sorts, removed some out of date gentle sources and renamed all objects appropriately so as to make the most of Unity’s gentle explorer.
The stadium fashions took some refining additionally. I attempt to stick to the WW1-style, and 1910s stadiums have been tough locations. However nonetheless, to satisfy even probably the most rudimentary security requirements, I used to be compelled so as to add handrails in addition to inexperienced lights to point out the exit. And naturally I had so as to add the lights themselves to the ceiling and contained in the bins.
So far as I do know (and proper me if I’m improper), Unity can solely bake one set of sunshine maps per scene. This compelled me to desert the sooner stadium prefabs and begin utilizing a multi-scene workflow. It’s an excellent time for working towards: if there have been others working with the mission, the multi-scene strategy can be virtually necessary. I created six new scenes: gentle and darkish variations for every three arenas. These can now be loaded additively when the background enviornment is required in different scenes.
Adjusting shadow map resolutions was fairly time consuming at begin, however I managed to determine an easy workflow. I begin by ramping up the lightmap decision in lighting settings till probably the most seen and necessary geometry is correct sufficient. Then I cut back the “scale in lightmap” -values (discovered within the MeshRenderer element) of the opposite fashions as little as doable inside the required accuracy. With filtering on, the resolutions might be saved surprisingly low, which reduces the baking time. Beneath is the picture of the sunshine maps I’m at the moment utilizing.
One other tough job was to arrange the sunshine probes for the dynamic objects (there might be spectators in some unspecified time in the future, in any case). Unity’s personal instruments are fairly unhealthy particularly for putting the probes in round kinds. I ended up making a helper editor script and putting probes procedurally. Finish end result works surprisingly properly. Picture beneath exhibits the probe positions.
And right here’s how they lit the placeholder spectators in gentle and darkish arenas.
I’m already fairly happy with the small enviornment, which was the primary one I did; I nonetheless have to do the identical issues for medium and huge stadiums. Fortunately, most components of the bigger stadiums are simply scaled (or pulled/pushed in Blender) variations of the small one, in order that they share the identical textures and UV-mappings. Which means all arenas use the identical supplies, and there shouldn’t be a lot work left after the small stadium is perfected.
The true problem is to animate the group. Common skinned animation is method too sluggish for 1000’s of meshes, so all types of GPU trickery might be wanted. Extra about it later.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
The stadium is sort of prepared for the viewers, however sadly massive crowds have a unfavorable impact on efficiency. That is primarily because of two causes: having a skeleton hierarchy for every spectator ends in an enormous variety of dynamic recreation objects, and Unity’s batching doesn’t help skinned meshes. These trigger an enormous CPU load to cope with.
Answer is to animate meshes on GPU (in shaders), and use the batchable MeshRenderer as a substitute of its skinned variation. Unity doesn’t have a built-in device for this, so I made one myself. I wrote a tough editor script that reads vertex positions of skinned mesh on every body and shops them right into a texture. A customized shader then repositions vertices in run-time by studying the positions from that texture.
As I used a shader graph and my baker utility class could be very specialised for my wants, it’s laborious to share any helpful code simply but. However should you’re , I discovered this article and this repository helpful.
As a place to begin, operate AnimationClip.SampleAnimation units the mesh into a correct pose at a given time, and SkinnedMeshRenderer.BakeMesh can be utilized to extract the mesh knowledge at that second. Within the shader, the vertex index is saved within the built-in variable vertexID. An fascinating discovering is that should you retailer every keyframe on a separate texture row, bilinear filtering will mechanically deal with the animation mixing (see the article linked above).
Resizing the feel to power-of-two (not essentially required in desktop growth) was a surprisingly advanced job that required an exterior render texture (or I’ve simply missed some too apparent utility operate). Right here’s what I’m doing for texture scaling (notice the feel format that’s wanted for storing unfavorable values with first rate precision):
public static void ResizeTexture(Texture2D pTexture, int pWidth, int pHeight) { var rt = RenderTexture.GetTemporary(pWidth, pHeight, 0, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Default); RenderTexture.energetic = rt; Graphics.Blit(pTexture, rt); pTexture.Reinitialize(pWidth, pHeight, TextureFormat.RGBAHalf, false); pTexture.filterMode = FilterMode.Bilinear; pTexture.ReadPixels(new Rect(0f, 0f, pWidth, pHeight), 0, 0); pTexture.Apply(); RenderTexture.ReleaseTemporary(rt); }
In the long run, animation baking wasn’t practically as advanced as I feared, however resulted in some hilarious glitches. Through the first makes an attempt, fashions distorted closely and made the viewers seem like a horde of lovecraftian monsters; sadly I did not file a video of it. After all there’s nonetheless heaps to do. As a substitute of repeating similar gestures, every spectator wants particular person variation, so mixing of various animations at completely different speeds per particular person is required; it will in all probability introduce some batching points. I additionally have to bake normals and tangents and resolve smaller points with digital camera frustum culling (in all probability associated to AABB calculation). However at the very least I now have a strong base to construct on, already capable of run 1000’s of animated spectators and not using a noticeable FPS drop.
I may make a prolonged weblog submit concerning the topic. Maybe I’ll in some unspecified time in the future. Writing concerning the course of appears to be slower than the precise implementation, so hopefully somebody finds these useful.
In addition to the GPU magic I’ve additionally improved the background of the shipyard, experimented with GUI design and ACES tone mapping (I’ve to spice up up all these baked lights…) and so forth. I’ll come again to these within the upcoming posts.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
I had a bit flu, so final week wasn’t excellent for something that requires pondering.
So, I did a couple of boring jobs that simply needed to be performed: created bigger enviornment fashions by scaling the smallest one, and utterly re-organized the binaries, prefabs and supplies in my mission hierarchy; hopefully it will likely be simpler to truly discover one thing sooner or later. It was additionally an excellent time to refactor cameras and idiot round with post-processing.
I’ve all the time thought that the looks of the sport wants deeper contrasts, and the emissive lights needs to be introduced up extra with out interfering with the outdated, industrial look. I made a decision to modify the impartial tone mapping to ACES, because it ought to give higher distinction and extra room for changes. It tends to make the general picture darker, so I brightened up the lights and re-baked static shadows. I additionally added a secondary directional gentle to the battle scene so as to convey out the meteors and different areas shadowed by the solar (correct ambient lighting would possibly do the identical trick, however I wasn’t capable of make it look nearly as good). ACES boosts saturation, so I introduced it down a bit in a shade grading. It’s laborious to see objectively if the adjustments are for the higher or worse; I’ve to prepare a recreation testing workshop to see if the brightness is OK and colours might be clearly seen.
The one drawback I got here throughout was that Unity’s submit processing all the time units alpha values to at least one. This prevents transparency, which in flip causes issues when rendering ships to GUI widgets by utilizing render textures. A customized shader might be wanted.
It will naturally lead me into the subsequent job: enhancing UI graphics. Admittedly, I solely have a imprecise thought of what I’m after, however let’s see the place it goes.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
The sport (and particularly the screenshots) appear too darkish. So though it’s laborious to get the brightness proper objectively, I modified the ambient shade to gentle grey and elevated gentle intensities. I intentionally set the scene to be overly lit, as it’s simpler to cut back the brightness in submit processing than enhance it.
As lighting impacts how the completely different materials layers work, I needed to modify them a bit. I spent an excellent whereas re-organizing supplies so as to simply export textures from Substance and check them in Unity. And after a couple of curse phrases, I managed to bake brighter variations of all arenas.
I additionally improved and changed most of the particle results. New explosions and smoke are already wanting fairly neat. As I’ve by no means favored Unity’s particle system editor, I’ll in all probability be utilizing solely VFX graphs sooner or later.
Sadly my formidable GUI experiments weren’t as profitable. I’ve to take one other strategy and see the place it goes.
However subsequent I must repair some issues with the sport controller dealing with so as to prepare testing workshops. Extra about these within the subsequent submit. Check periods normally reveal a ton of gameplay-related bugs, so I can then put graphics apart for some time.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
Controller points are rather more advanced than I anticipated, I appear to seek out two new issues for each fastened one. Frustratingly, plainly every time I replace Unity’s enter system to a more recent model, one thing will get damaged. Right here’s a fast abstract of issues I’ve handled in the course of the previous two weeks.
Composite keyboard controls (WASD) stopped working once I up to date Unity and its enter system after the earlier launch (to Unity 2021.3.4f1 and enter system 1.3.0, if I interpret the model historical past accurately). In case somebody experiences the identical, I needed to set the management to “cross by means of” so as to make it work.
Equally, the controller’s shoulder (or bumper, whichever you favor) buttons didn’t work anymore in battles. In GUI they do work. Move by means of -trick didn’t work right here, so lastly I simply downgraded the enter system to 1.1.0, which fastened the difficulty.
Gamepad scrolling within the shipyard didn’t work after the most recent ATP launch both. Even downgrading the enter system doesn’t repair this, which has left me clueless. Plainly my digital mouse implementation (the code I posted nearly a yr in the past) causes conflicts between the precise system mouse and occasions I ship. This aborts dragging prematurely. I really received the dragging work by making a digital mouse machine as a substitute of calling system mouse straight, however now I’m unable to make use of gamepad and mouse concurrently, which makes this answer ineffective for me (Unity’s reference implementation has the identical limitation). Enabling/disabling the digital mouse relying on the final used machine would possibly work. I’ll attempt that in some unspecified time in the future.
As this wasn’t sufficient, there have been issues with the {hardware} as properly. Crosshair jumped unusually when managed by the gamepad’s joystick, and I spent a number of hours adjusting lifeless zones, filtering noise and so forth. with out impact. After some time, I began getting suspicious and tried one other controller. The whole lot labored tremendous. https://gamepad-tester.com/ proves that the difficulty actually is within the controller:
I don’t really feel like combating with controls proper now, so I’ll in all probability simply implement the widespread controller navigation to the menus (which was on my TODO listing anyway), and use digital mouse solely within the shipyard (if I get it to work). Mouse is virtually necessary within the shipyard, so I gained’t be prioritizing this very excessive.
Nevertheless it’s not all work with out enjoyable. Our first spectator invited his brothers to cheer me up (or mock me, determine your self). Extra concerning the crowd sooner or later posts.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
An increasing number of spectators are coming in. And though there’s nonetheless room for optimizations, I haven’t seen a outstanding efficiency drop even with full stands. It’s laborious to explain the technical course of with out being boring, however I’ll attempt. I can also share the baking utility and shader in some unspecified time in the future, if I discover time to wash it up and exchange the ugly hard-coded components.
I began by modeling a particularly low-poly spectator in Blender, then creating a number of completely different swimsuit textures for it in Substance; colours precisely match the boys’s vogue in the course of the 1910s. Ladies’s clothes from that period is far tougher to mannequin, so sadly ladies are solely allowed in trousers and pretend mustaches for now.
Subsequent I imported the mannequin into Mixamo, rigged it, and exported all kinds of animation clips that spectators would possibly do.
In Unity I wrote a utility script that bakes clips into one sequence, and writes vertex positions and normals into textures. Additional variance is achieved by altering clip order. These textures are then given to the particular shader that performs the mesh deforming in GPU.
Spectators could not look notably good-looking by themselves, however their energy is in numbers. Animation sequences and clothes textures might be joined freely so as to get an exponential variety of mixtures. It will be tedious to do that by hand, so I wrote one other script that creates materials for every cloth-animation-combination with various tint and animation velocity. Script additionally helps completely different fashions, permitting ladies, youngsters, monsters or no matter I would mannequin sooner or later. However that’s not my primary precedence proper now. Right here’s the present state of affairs:
In addition to this, I hosted check periods over the last week. These would be the topic of the subsequent submit. So one thing concerning the gameplay itself, for a change.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
A delayed abstract of our testing session on 28.10. There have been surprisingly few points, and AI-opponents have been rather more stable-minded and fewer suicidal than earlier than. I collected among the cooperative battles in a video.
After all, there’s all the time room for enchancment.
Missile flame particles had distracting gaps, which might be consistently seen in movies. I managed to repair this by feeding the missile’s world coordinates to each “Spawn Over Distance” and “Initialize Particle Strip” elements within the VFX graph. Undecided if this can be a correct method, although.
Mine explosions brought on an enormous shock wave that threw ships across the enviornment and doubtless broke the collision detection (time 2:48 in video above). This was in all probability due to a typo: the explosion drive was ten instances too sturdy. However some type of gravitation weapon is perhaps a pleasant function…
Stalemate buoy look brought on a complicated leap in digital camera focusing. Now the viewport needs to be tweened correctly.
We additionally fought a grand, eight-ship event with two people and two AI pilots. Right here’s an uncut video of the event to show the sport circulate and completely different ship designs. You may skip the ship choice components from bookmarks.
A number of the laptop opponent’s stupidities have been bothering me for a very long time. Though AI performs relatively properly in micro-level (goals fairly precisely and even has some creativity with particular modules), it utterly lacks strategic pondering by taking silly dangers and losing ammunition in innocent conditions. The true problem is, that AI needs to be much less aggressive and suicidal, however not too cautious. In any other case battles have a tendency to finish up in a state of affairs the place AI refuses to do something.
I made some enhancements to make issues higher:
AI is now higher at calculating its close-combat energy relative to opponents, and making the most of it. It is aware of to maintain the gap to stronger ships and rush in the direction of weaker ones.
Bonus objects aren’t prioritized as excessive as earlier than. AI is much less keen to succeed in them when the win is already available.
AI has had a bent to shoot bonus objects with cannons for no cause. I assumed I had fastened this a number of instances, nevertheless it all the time saved coming again. The ultimate (hopefully) repair required an even bigger refactoring to the AI structure.
My AI code is split into three components that may be executed concurrently: motion, cannons and particular features. The division is evident and works properly, however higher cooperation between the elements is required. As an example, the bonus object subject was as a result of the AI first aimed cannons, however then tried to draw the bonus with a tractor beam. The latter habits re-positioned the crosshair, which made cannons shoot within the improper place. Fortunately, capturing solely takes one body, so it was sufficient to inform secondary modules to carry on till the cannons are performed. As soon as once more, I contemplate this fastened. Count on to listen to extra about comparable points sooner or later.
I discovered it laborious to visualise this topic, so right here’s an unrelated image of a drunken spectator about to fall down the steps:
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
Due to the recurring issues with the digital mouse, I up to date a lot of the menus to be browsed with a controller; I omitted shipyard, because it virtually requires a mouse anyway. uGUI’s computerized navigation covers a lot of the conditions, however tends to fail in some locations. Fortuitously the menus are easy, and express navigation can be utilized to repair these conditions. Nonetheless, disappearing picks and unstable navigation might be anticipated within the close to future, however as every thing should work with a mouse, none of these issues needs to be crucial.
I might be updating the person interface’s graphics as soon as I additional refine the appears to be like. As uGUI’s default shade/sprite transitions will not suffice for my wants, I’ll be utilizing callbacks (UnityEngine.EventSystems.IXxxHandler) to alter the visible states of the widgets. Sooner or later I’ll in all probability attempt Unity’s animation system for the transitions simply to be taught extra about it.
Right here’s an animation of the present gamepad utilization. Participant choice display screen is kind of cumbersome, however as I am missing a imaginative and prescient of the way it ought to work, I in all probability don’t have time to re-implement it to the subsequent model.
And oh, the issue with dysfunctional shoulder-buttons I complained a number of weeks in the past was solved by calling
in the course of the startup (this was talked about in enter system’s launch notes). So should you occur to struggle with non-responding buttons, this workaround would possibly work.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
I’ve nearly run out of trivial enhancements, and all unfinished options appear relatively massive. I take this as an indication to start out wrapping the model 0.5.2 up, and proceed different duties within the subsequent launch. I ought to in all probability be taught to make releases extra usually. It’s simply that my strategies are fairly experimental and ineffective, so definition-of-done might be relatively unclear. I additionally spend an excessive amount of time on small bugs, which causes me to overlook most of the extra necessary ones. Extra frequent check periods will surely assist with this.
However let me summarize the present state of affairs:
GUI and controller navigation works relatively properly, though 0.5.2 will in all probability have some minor points nonetheless.
I’ve refactored GUI widget objects/code, and cleaned up their look a bit. Graphics might be finalized later; now I ought to be capable of consider them as a substitute of continually tweaking the performance.
Multiplayer choice display screen is usable but cumbersome. I’ll redesign the format for 0.5.3.
AI has already improved rather a lot since 0.5.1, however personalised opponents aren’t prepared. Every one could have a portrait that, with my graphical expertise, takes more often than not.
I’ve a imprecise thought of enhance the tutorial. It could even make it to 0.5.2.
The sport at the moment takes 1.5 gigabytes of disk area (0.5GB compressed). It isn’t all that a lot these days, however nearly half of it consists of sunshine and shadow maps that, actually, don’t even make issues look that a lot better. I’ll rebake these; very low decision ought to suffice for darker scenes.
Away from dwelling, with out entry to my dev machine, I gained’t be jamming the thread with GIFs this time.
Have a cheerful no matter you’re celebrating! And if nothing, be blissful anyhow.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
Whereas affected by a nasty flu, I had time to additional experiment with baked lighting. Gentle and shadow textures are deceptively massive, and my goal was to cut back the construct measurement from the present 1.5GB.
First I switched the lighting mode to “Baked Oblique” since I actually did not make any use of baked shadows. This alone dropped area necessities by a few hundred megabytes. Inspired by this, I utterly eliminated gentle maps from all darkish arenas (small, medium and huge; used in the course of the battle), and elevated ambient luminance as a substitute. As you’ll be able to see, the distinction is virtually nonexistent. The construct measurement, however, went beneath 1GB.
Now there’s just one scene (lit enviornment behind the GUI) with baked textures. This hastens the lighting course of considerably, as I don’t should cope with the opposite three anymore. Listed here are some photos of the lit enviornment.
I despatched the present dev model to a number of check gamers for fast suggestions. Some bugs have been discovered and glued, however in any other case the sport appears relatively steady. GPU load has been elevated considerably, however plainly 2GB NVIDIA GeForce MX150 could be very able to working the sport, so nothing severe there.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here
I cleaned up my laborious drive and bumped right into a set of outdated ATP clips from early 2019 to late 2021. It took a while to get them so as, however I managed to edit a careless little historical past video with some extraneous organ music.
It was enjoyable to look again and see how the graphics have advanced. I began as an entire newbie, lengthy counting on placeholder cubes and spheres solely. And although I’m nonetheless removed from a professional, I’ve discovered rather a lot. I’ve additionally managed to remain trustworthy to the sport’s core thought; aside from a couple of renamed and deserted module sorts, the ships from 2019 are totally appropriate with the upcoming model.
In the end these clips will make good content material for the floating media dice “Mauno”. I simply should watch out with video format compatibility between platforms.
Logged
Avaruustaistelupeli (ATP) – an area fight recreation – Free obtain from itch.io or IndieDB – Dev diary right here