Introduction
Hello, everyone. It's been about two months since previous devlog. Despite my warnings, this one is deemed to be the biggest of this year, mostly because of completely new map generation system.
Let's get into all the things that were worked on during that time.
Map Generators
Yes. Previous random map generator was scrapped(again) in favor of a completely new superior one. Don't worry, this one won't ever be replaced by anything else and you'll understand soon why.
But first let me provide a brief history of SourceWorld's Map Generators for those unaware:

MapGen 1 - The first public playable version of map generator used in ModDB demo version of SourceWorld.
There was no clear way to make real playable BSP files for me back then, so I followed approach of placing player in a map with huge black box and generate a level out of props. I had to convert brush structures like floors and walls into models which is a time-consuming hassle.
It worked by dividing a map into horizontal grid, each square/tile being 128x128 units. First it made a basic top-down map in a matrix, then built it from props. You can guess this was an attempt to use a classic 2D roguelike mapping.
This system was extremely limited in terms of map visuals, because verticality wasn't implemented at all besides elevators that just changed floors. Most rooms looked the same. Another huge con is that it wasn't really modular at all. It was good for making simple square-shape mazes, but not for anything else.


MapGen 2 - Generator everyone saw in Steam Demo of SourceWorld.
Few years ago I've decided that handmade content needs to be prioritised and created a VMF parser. The way how MapGen 2 worked is by having developer put together a VMF(Map Source) file with bunch of separated rooms that have random parameters, strictly set bounding boxes and "connectors". Then VMF parser would read all of this data and combine these rooms (or tiles as they're called) into a layout, then spawn enemies, loot, etc.
This system worked fairly well on its own, but it still was just about placing props in a black box, merely imitating an actual map. I think it's primary downside was the way how horrendous the process of making new tilesets was. Demo version had only one tileset which made people bored very fast, and since that time I've only managed to finish just a single new tileset.
The main approach these generators used, which is "Imitating" a level with props and dynamic lights - is the main source of problems and limitations related to map generation.
First of all - since rooms consist of props, these props take a slot in networked entity limit(which is 2048). Some tiny rooms might take only 2-3 extra entities, others take much more.
MapGen2's levels in Steam Demo take so many edicts that if you check the entity limit you'll see it's gonna be filled by about 50%, which is horrible for simple tileset consisting of tight corridors and some props.
Another issue - lighting. Most lights were dynamic light entities. Engine allows up to 32 active lights on the map, a single room can only be lit by 4 different lights at same time(This is why you never saw a tile with more than 2-3 light sources). Most importantly - these lights never cast shadows and bleed through walls, which makes lighting look very degraded compared to what you'd get by properly compiling same map in hammer.
These are just few limitations MapGen used to have, which prevented me from implementing more complex environment generation, like adding skybox brushes or displacements.
However. Everything changed when I lost my patience and decided to add a runtime map compiler into the game...
MapGen 3
www.youtube.com/embed/BCXMNmWWwsE
Realtime VMF compilation is the key feature of new map generator and the main reason why it's never gonna be replaced by something else. All of this hassle and limitations I mentioned above are now gone. It's a heavenly blessing, the power I couldn't dream of for years. Been handicapping myself with rough limitations for years until one day something snapped within me and I added runtime map compilation in an hour... It honestly felt like inventing a Time Machine or something.


Ahem.. So VScripts generate a VMF file ready for compilation, then it runs map compilers in background and it takes few seconds to fully compile a whole layout.


However, this whole process consists of multiple stages as there's a completely new approach for building level layouts.
First, VScript makes a so-called mission graph that places connected areas of various types, adds puzzles(currently in a simple key-lock form). Then, during blockout stage, it tries to assemble the layout out of axis-aligned 3D boxes, each room consisting out of 1-4 boxes arbitrarily connected between each other. This ensures that rooms have rich shape variety and not just plain boxes. It also builds corridors and vents.

Then, VMF generator takes this data and makes a VMF file with all brush and entity data. Placing lights, entity prefabs, etc.
Currently the only hand-made prefabs used here are light sources(which is why lighting now looks similar to the rest of the game) and doorways, as well as skylight/3dskybox. Everything else is placed procedurally.
www.youtube.com/embed/lp44AhOAfQg
This opens MANY possibilities for map generation, finally making it a viable part of the game. I was too scared to touch MapGen2 for about half of a year, because it had a bunch of bugs and was a struggle to work with. I'm really happy I've decided on scrapping it in favor of something superior.
Demonstrations above show levels with small features that didn't exist in previous generators, while keeping their basics. New features include generatable skybox brushes shown in skylights, proper vent generation, various prefabs used for lighting and doorways, FINALLY puzzles which currently are just find-button-to-open-gates. It's incredibly basic, I know, but this is just the beginning.
Not to mention that these generated maps no longer tank perfomance, like previous generators did. VIS optimization somewhat works and there's no need to run background scripts every tick for checking visibility and player position, toggling parts of the map on and off.
I really wished I also implemented things like ladders, displacements, water and more variety of corridors/textures before showing off, but all of these are gonna take time, and there's already so much to show in this devlog.
For now, enjoy the demonstrations and stay tuned for future updates.
Mission Artpass
Phew, that was a lot of text. Now let's move to the rest of our devlog.
Not much to discuss here, but I've also worked on our first mission map "Reclamation". Not much to comment here, so I'll just show few screenshots.
Stuff below was NOT generated! It's a common map like in any other mod.

Armory Closet

Modelled and textured by GreggHayes!
Placing all items on tables or floor is too boring so we're working on getting fancy containers that can hold valuable stuff for the player.
Some containers like lockers will be visually openable and contain placed loot items inside. We might also add generatable containers with inventory UI, which would work like player's loot chest.
Slipping Through

A new little movement mechanic. Some levels have tight spaces that players normally wouldn't be able to pass through. "Slipthrough" or walking across tight space was added for extra immersion.
This feature was actually requested by one of our team members :3. It's awesome and adds up to the vibes of our game.
Updated Feral Zombies

Previously they behaved like classic zombies, but with absurdly fast walking and attack animations. Now they received proper running animations.
Besides, they gained ability to attack their target on the move, I wanted to make them into a tough version of L4D's common infected, they received different sounds too.
Encountering just one of these isn't really dangerous, but a group of 3 can easily trap player into corner and rip them to shreds very quickly. You have to sprint in order to outrun them.
Glock-19

Finally another pistol! Glock-19 is a slightly stronger replacement for starter pistol designed for second half of the game. Other pistols have their emphasis on damage at cost of small clip, so we needed another one which turned out into this. Glock was added under the impression of classic survival-horror games.
AK-101

Man, if only I got paid for every time someone requested an AK to be added in SourceWorld. Ever since Steam Demo this one one of the most frequent requests by our community.
We couldn't add AK-47, because it uses 7.62 ammo and adding a whole new caliber to the game for a single gun is pointless. So we settled on 101, because it uses 5.56 NATO just like bunch of other weapons.
Despite the uncommon model used, this rifle is as much of an AK as you'd expect it to be - strong damage and recoil, slightly lower firerate compared to other weapons, worse accuracy. Based on my own tests, it's incredibly satisfying to use in combat and I'm sure people would love it.
New M590 Animations

I forgot to mention this part in previous article! I've redone all animations for M590 shotgun and changed its sounds. I saw people often preferred SPAS-12 to M590 despite the latter actually being stronger and thought the fault was in its animations and sound choice. So here we are.
Exit Portal Signals
This change will concern both MapGen dungeons and mission maps.
Previously, in order to return to the lab, player just had to find an exit portal placed somewhere in the level and stand inside of it for a bit.
Which was too boring and didn't make much sense so we came up with a whole mechanic for opening exit portals, utilising player's phone.


In order to open portal(which is available after doing all objectives) player needs to find 3 signal points by using their phone. Those signals are marked by little green particles, but your phone shows you approximate direction and distance to nearest one. Upon reaching one of them, you send its coordinates to the lab. By reaching all 3 signals and sending their coordinates, thus completing triangulation, you will open an exit portal in the center.
I might do little changes to this mechanic based on player feedback in the future, but its core gamedesign is making player actually earn their way back instead of randomly finding it.
Quests Menu

Finally a proper interface for quests that track player's progress. Since there's gonna be a lot of new objectives and things to do in the game, we needed a UI for tracking them all.
UI Changes

As you could've noticed, Skills(along with aforementioned Quests) menu is now openable in TAB interface. You no longer need to press a separate button to get upgrades, everything is now in a single menu.
Besides, there are few visual changes to Skill menu.
Oh, and we also added back the XP bar, it's in the inventory screen now.
Adaptive Difficulty
Several years ago I definitely mentioned this. SourceWorld needed a dynamic difficulty system instead of fixed difficulty or difficulty selection.
No matter how we approach the difficulty problem, it's impossible to really balance a single one. Different players expect different things from Normal or Hard difficulties in Half-Life mods.
So, to change that, we added a little system for tracking player's performance across their playthrough. Difficulty level rises when doing many kills without taking damage and gets lowered if player dies or takes a lot of damage in their run. Dynamic difficulty affects enemy health multiplier and how much damage player receives.
To describe it shortly - game starts on something close to vanilla HL2's Normal difficulty, but it can rise up to Hard level if you play good enough or lower itself if you're dying. The goal isn't to punish or coddle, but to keep the experience engaging whether you're struggling or steamrolling.
Conclusion
That's the bulk of what we've been working on. I wish MapGen 3 happened earlier, but the fact it's here is a blessing for the project's future. I was ashamed of generated levels in Steam Demo, but now I can feel proud of this feature again. We will keep working on extra features, content and expanding generator's capabilities, as well as plot. As always, thanks for following along.
Stay tuned!

