Archive for August 2011
The fixed function rendering path for BloodXL is nearly complete.
Proper cylindrical skies have been implemented. The system works by using the stencil buffer to mark surfaces that should show sky and then rendering the sky after all the opaque surfaces have been rendered using the stencil buffer as a mask. This allows proper occlusion effects but still allow for arbitrary sky mapping.
Translucent and masked walls have been implemented, which fills in a lot of fences and translucent windows.
Finally “camera aligned” sprites have been implemented. Levels now have decorations, enemies, ammo piles and so on.
I’ve also implemented the fixed function version of depth cueing. I have a plan to better emulate the effect of the color maps when running in hardware, but it turns out it’s a little too expensive for fixed function (i.e. 3 textures on every surface). Given the point of fixed function, I decided it’d be better to use the built in fog hardware and save the improved color map support for cards that support shaders.
The vast majority of people will have GPU’s that support at least basic shaders (SM 1.1+), so the lighting and depth cueing will look better for most people. But first I’m going to get the fixed function render path, which I’ve been showing so far, complete before worrying about putting shader support back in.
These screenshots are a before depth cueing and after depth cueing. Notice that translucent windows, proper sky and camera aligned sprites can also be seen.
And another screenshot with sprites and depth cueing:
All the basic rendering elements are in place, so the next step is to go through and fix bugs – such as occasional alignment issues with floors and walls. Once the rendering is robust I’ll get the other projects rendering everything again – which should go much quicker since most of the engine work is done.
Finally once all the projects are properly rendering using the fixed function path, I’ll add the shader path back in – with improved lighting and color map support – and then move on to getting the gameplay ready for the release.
The next update should feature levels from Outlaws, so stay tuned!
Since the last post I fixed some issues with vertical adjoins, turned all the “teleport” water (Duke Nukem 3D style water) into vertical adjoins with translucent surfaces (optional, can be displayed as opaque) and added support for the surface palettes. This will turn the grass and some of the leaves gray in the first level, make the water textures look blue, allow for yellowish lighting around light sources and so forth.
Wall oriented and floor oriented sprites are now working. There are still some tweaking to make the light levels look correct and occasional sorting issue – but the oriented sprites are pretty much complete. Next up are camera oriented sprites, sprites with multiple sides (like enemies) and transparent/translucent adjoin textures (for things like the windows). And of course skies (which is pretty obvious looking at the last shot I’m sure).
After that I’ll get to tweaking overall lighting/palettes and enabling depth cueing. I have a method that should allow the lighting to match the original pretty well even with OpenGL rendering. (There will be a software renderer later to allow for a more exact match if desired).
Once the rendering for BloodXL is complete I’ll get Outlaws working as well – now that the necessary feature additions are in-place and working. Then I’ll get all the projects rendering correctly in the XL Engine post-merger code base, which involves some refactoring for DaggerXL and change over to the improved sector rendering system for DarkXL.
The merger should be complete in a couple of weeks, with DarkXL and DaggerXL back up to where they were before plus some additional features and enhancements and BloodXL and OutlawsXL minimally playable (i.e. – levels function but only one enemy type and weapon type). At that point the XL Engine will be available for Windows, OS X and Linux.
After a trip and short delay, the XL Engine merger progress has resumed. I’ve been working on the sector rendering and collision part of the pipeline. The collision is pretty much complete – it’s pretty much the DarkXL collision code with some slight refactoring and the addition of slope support. As for rendering, I’ve been working on getting the Blood data fully converted and adding engine features needed to support additional Blood and Outlaws features.
In addition the sector rendering algorithm has undergone another revision in order to make rendering faster and more robust. The new algorithm requires no wall sorting or portal clipping, still requires no pre-processing but still maintains the ability to handle dynamic sectors, overlapping sectors and portal-like effects (such as the Perplexion level in Dark Forces). I’ll discuss the algorithm in detail in a future post. I’ve added support for slopes, for rendering and collision as well as “vertical adjoins” (i.e. sector over sector or room over room). To avoid moving sectors around after load I added the ability to apply an offset when traversing sectors through adjoins or vertical sections. Basically sectors connected through adjoins (i.e. portals or sector edges) do not need to be adjacent in space in order to appear adjacent in game.
Below I’ll show some screenshots of Blood levels in action. Some notes: sky is currently not handled correctly, texture scale and horizontal offsets are correct but vertical offsets are not always correct, there are some visual issues that I’m still working out and finally sprites are not currently rendered (but will be soon). Currently per-surface palettes are not supported but will be before the release.
There aren’t any cool screenshots in the post but there’s a lot of information about the merger progress and release, post merger plans and some surprises.
I’m still working on refactoring the world system. So far the object and logic system are finished. The XL Engine takes the Object/Logic system from DarkXL and extends it. Now objects (i.e. entities/actors) are purely component based rather then using a mix of inheritance and components like DarkXL engine. Objects can have one or more Logic components – which can be implemented in either script or code. These control the function/AI of the objects and almost all of them will be implemented in scripts (except for the player and networked objects). If you have multiple logics on a single object, then they are simply run in order. This allows for simpler, reusable, behaviors to be chained together. Similarly there’s a game data component which is used by the scripts or game code, render component to handle various types of renderable objects (voxels, sprites, models, etc.) and so on. This will allow user mods to add new enemies, powerups, items, weapons, etc. or modify existing logics all through script code – allowing powerful modding capabilities without worrying about the OS or compiling code.
In addition the object pool system from DarkXL has been made to work with the new object system and extended to efficiently support growing as much as needed – limiting the number of run-time allocations necessary without putting a hard limit on the number of objects that can be in the world/level.
I’m still working on refactoring the sector code, the goal of which is to have all the Blood, Outlaws and of course Dark Forces levels rendering correctly as well as being functional (i.e. doors, switches, triggers, etc. working). I’ve already implemented the WorldCell and Cell Loader interfaces (basically these load the map, dungeon, exterior, etc. data and then converts it to a proper WorldCell). This basically means that the game code can call a single function to load a map/cell/etc. and add it to the world. The engine takes care of the rest. I will be gone for a week on a trip but when I get back I should be able to start showing screenshots in the actual game worlds.
Finally there will be some limited gameplay for Blood and Outlaws in the release. In addition to the levels functioning, there will be at least one enemy and one weapon implemented. With more to come post-release.
Originally I was going to completely hold off on multiplayer until the single player was much further along. However I realized that this isn’t really a good idea. So my main focus will continue to be single player, however I will be adding networking support and simple multiplayer to the merger build. The reason for this is simple, if I don’t architect this system will multiplayer in mind then I’ll wind up redoing stuff later (again). In order to make sure I’m doing it properly it needs to be tested, which means I make simple multiplayer available.
So here’s the plan: coop and deathmatch – no extended rulesets, just basic support until single player is further along. The primary focus will be on DarkXL since it is the most complete, with support for Blood and Outlaws as well since they are best setup for it. DarkXL doesn’t have all the necessary sprites but I’ll reuse the existing enemy sprites in “creative” ways for testing.
Post-Merger Plan Changes
I’ve already talked about this on the forums, but I’ll put it up here for those who missed it.
There will be some changes to the post-merger plans, mostly related to DaggerXL.
For DarkXL, the goal will still be to finish the Beta – making DarkXL a full and complete replacement for DosBox.
For DaggerXL the original goal was to continue working on the missing features promised for 0.20. However at this point I think the dungeon gameplay is probably good enough for now as-is, even though it still needs some more work. I’m going to move to the NPC and shop systems and then guilds, quests and reputation. The idea is that once we get to quests and dungeon gameplay becomes important again then I can spend time on the dungeons and enemies again but even with the current implementation, once you add NPCs, quests, guilds, shops and so forth the game will become much more “real” and playable. This will be helped tremendously by the UI scripting system and UI tool being developed during the merger process.
BloodXL and OutlawsXL will be all about implementing enemies, weapons and other gameplay elements.