Archive for September 2012
When testing out some things, with terrain, I realized that the edges of the map were not handled gracefully – it crashed in fact. So in the process of fixing the crash, the terrain now extends beyond the map edges – pretty much forever (or close enough). Granted its not too interesting, since there won’t be any locations, roads, rivers and so forth – at least not now. But who knows, maybe I’ll add some surprises out there later.
Anyway here is a shot showing me running around outside the map.
Where I am on the map. Notice I’ve gone off the top side by quite a distance.
And what it looks like in game. While the large scale height map data is basically just “stretched”, the terrain generation still makes it look fairly interesting.
It seems that some people like to get their information in different ways. Some people follow this blog but not the forums, for example. So I’ve decided to make smaller updates here on the blog for those that don’t follow the forums.
There will still be larger blog posts, but I will start making interim posts – like this one.
To start the trend, I’ll post a picture of NPCs starting to work. They don’t talk yet but do use proper facing frames, animate and stand still in their idle animation if the player is close enough. Next up is to fine tune their pathing and spawning and then to get the conversation dialog working properly – including being able to get directions, rumors and other information that you expect to get from Daggerfall NPCs.
And in case you missed the last big post, here is the latest video – see the last post for more information.
I’ve been working on refactoring the terrain and “location” code for the XL Engine. There were several deficiencies with the original DaggerXL system that I was seeking to rectify, which I’ll talk about below. Everything I show in this post was rendered with the software renderer, running in 8 bit mode. As I’ve talked about before, GPU support has also been expanded – Shader Model 2.0 support will no longer be required. The new requirement for GPU rendering is OpenGL fixed function support.
The sky in Daggerfall is basically a flat plane that is scrolled as the camera is rotated, very much like the backgrounds in psuedo-3D games such as the original Mario Kart. The result is that the scrolling of the background doesn’t match the rotation in the foreground. In vanilla Daggerfall this looked strange but when running at smoother framerates an higher resolutions it looks rather disturbing. The XL Engine now uses a “tapered cylinder” to map the 2D sky textures onto 3D geometry in the scene. The result is proper scrolling and perspective while maintaining the appearance of “infinite” distance.
One visual problem in DaggerXL were the “rounded cliffs” that showed up in the terrain, especially around locations. The terrain generation has been improved, changes in elevation in the base heightmap are visualized in a much nicer way now. In addition medium detail data has been added/generated, resulting in more variety. Terrain textures are handled properly now as well, without the seams and hardlines that were in DaggerXL. There are still the occasional seams, when a combination of terrain types isn’t support by the art, but these are rare and were present in vanilla Daggerfall as well. Finally coastlines look much better now then in the last release of DaggerXL.
In DaggerXL transitions between cells caused hiccups that were very noticeable, as new terrain tiles were generated and locations loaded. Due to the terrain refactoring, these pauses are very rarely long enough to be noticeable now. Only parts of the terrain that need updating are regenerated, the area that stays the same is simply “moved” into the correct place for the new view. This means that only a fraction of the visible terrain needs to be touched, instead of all of it like before.
Object positioning is handled using two sets of coordinates – “local world space” and “global.” The global coordinates point to the “cell” the where the objects exist in the world. The “local world space” coordinates are the objects fine grain position within that cell. To position objects relative to the camera, they are converted into “relative” coordinates – basically centered around the cell that the player or camera currently occupies. In the previous release, objects were responsible for updating these relative coordinates in their game logic code. This was obviously a very bad idea, something easy to miss or fail to update. Now these relative coordinates are no longer explicitly stored, only the local world space and global coordinates are actually stored and handled by the objects. The conversion to relative coordinates is done, as needed, at a low level. All code goes through this path, freeing the game logic from having to worry about it at all. This fixes a variety of issues, including the “phantom collisions” and other collision related issues.
Foliage updates and rendering speed has also improved, resulting in much improved exterior rendering performance even on low end hardware or using software rendering. The flats are also scaled properly, fixing scaling issues that the previous release had with several flats.
This post only scratches the surface, a lot of work has been completed since the last update. Below I show a movie of some of this stuff in action.
For the movie the in-game UI has been disabled (just like all the screenshots) and enemies are not loaded. However the release will have all the UI elements, monsters and so forth that the previous release had. Also animated sprites have not been fully reincorporated yet, but they will be in the final release too.
There are more features that I didn’t talk about above that will also be in the release as well. This release will be more complete in terms of gameplay as well as visuals. Features include: waves in the ocean (as shown in the video), NPCs that walk around the locations, improved UI – fixing a variety of issues such as click-through, mouse offset, etc. and implementing missing features such as unequipping items, getting item info, scroll bars and more. So this release is not just about the refactoring and engine merger but improving and fixing existing features, improving performance, improving hardware support – with fixed function support and the software renderer, paving the way for cross platform support, adding networking support (though no actual multiplayer in this release), implementing new features for both gameplay and visuals, merging all projects under one engine and more.