42 Techdoid
Author: nasKo,
published 2 years ago,
Hey all, here’s a general update from TIS Towers on various things. We do hope this finds y’all well.
First off a quick heads-up on the forthcoming 41.66 patch. It’s now content locked, and is now receiving required fixes reported by our internal testers. We will look to put it out into a new unstable beta branch as soon as we can.
The full current changelist [url=https://pastebin.com/e3KXcmzd]can be found here for those interested[/url].
Next up, a few details on our Build 42 work.
As previously mentioned the core MP team will be sticking with Build 41 patches to improve life out on the servers for the immediate future, but work on the next big build has nevertheless now begun/continued in earnest.
Already announced for Build 42 was a major expansion of late game crafting and a major focus on game balance – details on which can be found [url=https://projectzomboid.com/blog/news/2022/01/2022-and-beyond/]here[/url].
There are a few other irons in the fire for this build too though. As ever, no ETAs on any of this.
We are very much still in the early versions of this build, and indeed much of the late game crafting update is currently in the ‘pen and paper’ planning stage. More on this in future blogs.
[h2]Engine Tech Improvements[/h2]
We have recently taken some time to get rid of a bunch of our longest standing issues with the game’s engine.
Whilst this is definitely not a b41-style level of disruption, we’re digging deep inside our renderer and looking for ways to get rid of the quite severe problems that have been baked into our engine for a long time in terms of both capabilities and performance.
[h2]Performance[/h2]
Of course, the biggest issue our engine struggles with daily is the extreme CPU and GPU heavy requirements of having a map composed of so many unique tiles, shaders and other stuff without the ability to use a z-buffer to let us render in an optimized way like most 3D games.
Ironically the fact that its ‘a simpler looking 2D game’ is what works against using a lot of the power of the GPU to render the map fast. This results in large FPS drops, particularly when zooming out due to the mind meltingly inefficient draw method that the ISO perspective forces on us.
We’ve had a few rather bold ideas on how to solve this, using the caching of chunks that have already been rendered, which we hope will vastly increase the FPS in B42.
It’s early days, but looks promising. This tech requires heavier use of the GPU memory, however, so it may be that this optimization will only be able to benefit cards with a few gigs of free VRAM. We’ll have to see which generations of GPUs will be best able to leverage it when its dev time is a little further down the line.
Speaking of not being able to use a z-buffer to render things in an optimized way: in actual fact, we’ve also been working towards being able to use a z-buffer to render things in an optimized way.
[img]https://clan.cloudflare.steamstatic.com/images//4460946/0091565e2b584c8f325a72503001116639712353.png[/img]
This essentially frees us from having to slot the draws of zombies, vehicles or players in between the appropriate tile draws in ‘back to front’ order.
We’ll be able to simply draw all the characters and vehicles on-screen at the end, their pixels then discarded if they are deeper into the scene than an existing building object’s pixel.
This should massively optimize the rendering speed of zombies, and allow us to sort them by materials. It will free us to use cached chunks indefinitely, until the lighting or cutaways demand a change, rather than rendering all the tiles individually.
We have had some surprising FPS results in 4k on max zoom,[u] [/u][b][u]however[/u][/b][u] [/u]we also expect this will likely fall a lot in practice – once the work is complete and everything is drawing. Please excuse any visual glitches at the moment!
[previewyoutube=G6t5h0_Sfqc;full][/previewyoutube]
Due to all this, in B42 it currently feels safe to assume that zooming out will have significantly lower performance penalty – and that higher resolutions will become more feasible for at least mid-range GPUs, and possibly lower end GPUs too.
[h2]Variable Chunk Heights[/h2]
In the game, since our very earliest builds, we’ve been limited to 8 storey buildings. This was primarily because the height was global, and increasing this would incur a penalty to performance across the entire map even if that extra space was not used.
The other issue was simply performance when drawing those extra floors. If we’re struggling to render the amount of tiles we already have, adding extra tall buildings would be a big mistake.
Thirdly, there’s something to be said about less being more in terms of gameplay. However, this hard limit of 8 has long been a thorn in our mappers’ sides, as well as for our mod community.
Seeing as it looks like we’ll be able to solve the performance issues discussed above, we’ve now added a variable chunk height system which will allow each chunk of the map to define its own max height.
This means that in Build 42 it’s looking like a particular area could have floors up to 32 in height, should the mapper desire it.
[h2]Four way stairs[/h2]
Currently, due to certain tech limitations, we only have stairs that rise in north or west directions.
This is annoying, and we’d like to get rid of this limitation for numerous reasons. We’ve done some mock-ups of how stairs would look in the other two directions, and think we’ve found a way to make it work.
They look a little odd, however functionally being able to have stairs in any of the four directions would give mappers and ourselves much more freedom in building design.
[h2]Map Coordinates[/h2]
Another limitation that has been very longstanding is the fact that negative map coords (expanding out the map in the negative X and Y directions) is not possible in PZ – due primarily to some TIS naivety early on in development.
For the maths-minded out there: casting a player’s x, y, z location to an int to work out what tile they are standing on will return the wrong value if any of those coordinates are a negative value.
There were thousands of places where this occurred in the codebase, and they all needed changing from a static cast to a math.floor, so that they will work in negative dimensions.
Making negative map coordinates possible means that we, or modders, will feasibly be able to build northwards and westwards, and opens up a huge extra area of potential map area to expand to.
It likewise also puts other cool stuff (back) on the game dev table that we’ll discuss at a later date.
[h2]Light Propagation[/h2]
We have also been updating our lighting system.
In the current B41 we have an ambient light level that’s inherent to every tile within the map – though slightly reduced indoors. Light sources are only capable of lighting the room that they are in.
Locking yourself in a cupboard with the door shut currently results in the same light level as you’d get in the living room with open curtains.
For B42 we are rejigging how lighting is calculated, to make a much more interesting and realistic light propagation system.
Now being in a room with no windows, even in broad daylight, will leave you in the darkness. The evening sunset glow will encroach through the window and bathe your room in a red tint, creeping back toward the window and dimming as the sun goes down.
Interiors of buildings will lighten and darken with the daylight based on how much exposure to the bounced light they will feasibly receive. Opening a door to a lit room will bathe the outside corridor in light, and so on.
This is all still development in progress, and it maybe requires tweaking of light intensities, colours and fall-off ranges.
Please also excuse any glitches you see, this is all still very much in the oven!
[previewyoutube=9_0TiPQ-JQA;full][/previewyoutube]
[h2]OTHER BIZNESS[/h2]
[list]
[*]The map team continue their awesomeness, with lots of map polish currently going into the current Knox Event map – including electricity pylons and cool new locations like this.[/*]
[img]https://clan.cloudflare.steamstatic.com/images//4460946/96ac786b01d5484d11a3d17f86836484bd009b53.png[/img]
[*]The Noiseworks gang continue with their improvements of the PZ soundscape, with their current mission being to provide background sounds that provide different ambiance for times when the electricity and water are on, for when they are off, and an audible change to signal the exact moment when the turn-off happens in-game.[/*]
[*]Currently awaiting integration are also 14 new music CDs, 14 movie VHS tapes, 20 new TV show tapes and 44 home recorded tapes too. You will be delighted to hear that these include several new sequels in the much-lauded Dog Goblin horror franchise. Our thanks to Brat Pen for these.[/*]
[*]The curator of the online PZ map project, Blindcoder, wants to let you know that he’s on the case with updates – and apologises for delays caused by Covid and irl fun/games. His blog [url=https://www.benjamin-schieder.de/blog/2022/01/30/project-zomboid-map.html]here[/url]. Our thanks to him for all his amazing work also.[/*]
[/list]
[i]This week’s flamingo fun[url=https://steamcommunity.com/sharedfiles/filedetails/?id=2738756391]from Cute Cappuccino[/url]. A changelist of all our pre-release patches since the 41 beta began [url=https://pzwiki.net/wiki/Build_41]can be found here[/url]. The Block of Italicised Text would like to direct your attention to the [url=http://pzwiki.net/wiki/Main_Page]PZ Wiki[/url] should you feel like editing or amending something, and the [url=https://projectzomboid.com/lists/?p=subscribe&id=1]PZ Mailing List [/url]that can send you update notifications once builds get released. We also live on Twitter [url=https://twitter.com/theindiestone]right here[/url]!
[url=https://discord.gg/theindiestone]Our Discord [/url]is open for chat and hijinks too! And you can always find our bi-weekly blogs over [url=https://projectzomboid.com/blog/news]here[/url].[/i]