E.X.P.L.O.R. in development now! Cool Developer Stuff

Pages: 1 3 5 ...6 ...7 8

Recent Engine Updates - July 5, 2011

Quite a bit more progress has been made on the game engine since the last blog update. I modified the map format a little, because I had seriously modified the way the engine handled materials, the map format now treats materials the same way as the rest of the engine. Previously, the map format specified dark maps and textures in separate tags, they are now in the same tag. This would seemingly cause the problem that duplicate textures would be loaded because a given dark map might be rendered with more than one texture, and vice versa. However, because of the way the game manages resources this is in fact not a problem at all.

I also fixed a problem with the map exporter where it was exporting regions that didn’t actually have anything in them. This corrected some problems I had with the game not actually knowing where a given entity was located (a problem that didn’t show up a lot, but on occasion).

I’ve also implemented cube maps into the game, something that I had tinkered with a bit, but now they are officially supported. Using them vastly improved the appearance of the water pixel shader that has been seen in previous posts. It now has a shiny, reflective appearance. I had played briefly with rendering cube maps in real time by using render targets in order to create a reflection effect, but for now I have abandoned that idea.

In other news I have also been experimenting with real time shadows using shadow volumes. Something that seems quite effective, though these require models to be formed in a specific way, something which I, being that I am not an artist, have not done with most of the models I created for the game. For that reason I will be experimenting with a few other ideas for real time shadows and see how they perform.

I’ve also been working on the windows system for the game’s UI. I’ve added a new global function that can post a message to the overlay window and that message will appear on the screen for a few seconds then fade away. This was especially helpful when saving a game, you see, previously when you pressed the quick save button there was absolutely no indication that the game had been saved (unless you opened the console), now the overlay displays a message that the game has been saved. Of course, other messages can be displayed as well. This did involve modifying the font class a little in order to allow alpha blending. Previously, the font would only use the alpha value of the texture that contained the font. The alpha value was used to distinguish each letter (the actually font texture is all white so that it may be colored by the vertex color) and for anti-aliasing around the edges of each letter. I discovered that it is possible to use both the texture alpha value and the vertex alpha value to achieve the desired effect.


Categories: Development

Tech Demo 2 - June 25, 2011

The second tech demo was actually released a few weeks ago, but I’m now posting it into the blog. Check it out.


Categories: Development

FreeType Implemented - June 25, 2011

One problem I’ve revisited many times within the game engine was implementing fonts for outputting text. Fonts are used to render the console. Fonts pose a difficult problem and there are many ways to implement them. I’ve tried manually created fonts, this has presented quit a few problems. One way to do this is by creating an individual case for each letter. Another way is to create a single font containing all the characters, and some way of calculating where each character is located (this is the method I previously attempted). In either case there must be some sort of algorithm or data file to specify how each letter is to be loaded. I had generally gotten bad results using these methods. The fonts looked terrible and it was difficult to create new fonts.

My solution to this had been to use the ID3DXFont interface. This is a font renderer specific to Direct3D. This worked well enough, and the console looked alright with it. However, I was not satisfied using something so dependent upon Direct3D. In creating this game engine I have been designing it to be easily portable, but the ID3DXFont interface is obviously not portable to anything outside of Direct3D, and it is dependent upon the Windows Font library as well.

The solution to this was to use the FreeType library, an open source library for loading and rendering fonts. I used this in conjunction with the newly implemented ability to draw on Render Targets to create a font engine for the game. The font engine now works by loading a font file, which can be packaged into an LPK file (whereas ID3DXFont mostly used fonts that were registered in Windows), and then the font engine creates a texture containing the characters of that font (currently it creates the standard ANSI characters, but it is designed so that it could easily work with any UNICODE character set). While it is creating this texture it also stores information about where each character is stored, as well as other properties for rendering.

The results have turned out quite well, and in fact the CFont class that I created is a little more robust than the ID3DXFont interface as it allows fonts to be scaled dynamically as they are drawn. I must admit I’m actually surprised out how sharp the fonts look considering the results that I in previous attempts at creating a font engine.

This is also the last specific rendering code that was Direct3D depended an it has now been eliminated. Due to that it would be very easy to port the engine to OpenGL or some other API if necessary. Part of the reason I worked on fonts was to go back to developing the window system in the game, and hopefully create some kind of main menu soon.


Categories: Development

Render Targets - June 23, 2011

For a while now I’ve been experimenting with various techniques using render targets. That is, the usual render target is called the back buffer, you can draw a game simply by drawing to the back buffer directly, but it is also possible to render to a texture that has been created as a render target. This allows for various possibilities such as a mini-map display, mirrors, video playback, and so forth. I have been working on the implementation of render targets within the game. Previously my implementations had been experimental and sporadic, but I now have a much better system implemented that is not dependent upon Direct3D.

The main reason I have been working on these is because I want to develop a window system for the game so that I can create menus and so forth. (Actually, I have already implemented a window system, and the console is part of that system, but it is heavily dependent upon Direct3D, and I want to create a more generic system.)


Categories: Development

Spawning Entities - June 11, 2011

I have finally created the console command spawn this function will spawn any entity from the entity dictionary, at any location desired. This is long due because it it how one could actually design a level with objects in their proper places, that in conjunction with the ability to save. So for example, one would spawn the desired entities at their desired locations. Then save the game, then with a few modifications the save would then be the basis for a level.

Also, because spawn is a console command, a level could be designed through lua scripts. For example, the following lua script generates a triangular stack of barrels (2 is the dictionary entry for a barrel in my demo).

nSize = 10

for i = 1, nSize, 1 do

for j = 1, (nSize-i+1), 1 do

spawn(2, j*0.75 + (i-1)*0.75/2, (i-1)*1.0, 20.0)

end

end




I also worked on a problem that I was experiencing which involved the net message queues filling up too quickly. This especially happened when the client was loading a level and didn’t have time to empty the message queue, so the queue got overfilled and clamped. Now the net message queue has priorities for different types of messages. The most frequently posted message is the entity update message which contains information about an entities position and animation. These messages aren’t that important though, because if an entity does get updated for a frame or two it really doesn’t matter, it will still end up in the correct position eventually and probably with very little lag. However, a message indicating that a new level should be loaded comes much less frequently but it is very important that the client receives that message otherwise the client and server could end up working with two different maps. Now a load message has a higher priority and will always go through, whereas the update message, and other less important messages may not go through.


Categories: Development

1 3 5 ...6 ...7 8

Search

This blog chronicles the development of the Emergence Game engine. The Emergence Game Engine will be a fully functional 3D game engine with support for the latest technologies in video game development. This blog features the remarks of the lead programmer, Blaine Myers, as he comments on the struggles and joys of developing a 3D game engine.

Categories

Recent Posts

  XML Feeds

CMS + user community

Rough Concept Skin by Beem SoftwareMultiple blogs solution