Posts

Showing posts from 2010

Hardware Exceptions & Such

Those of you that have looked at Enigma's code have probably noticed that I have been generating exceptions that can be caught from hardware and other low level exceptions. However I have recently decided that when such an exception occurs there isn't much I can do about it besides crash. The justification for this is access violations for example normally represent some sort of memory corruption. It is extremely difficult to recover from something like that at runtime. With that in mind I created a hardware exception class which is what I now throw in case of such exceptions. I went through all of my try catch blocks and made the majority of them re-throw exceptions of that type.

So now there are cases where enigma will crash completely however when I'm running it through VS I can now get a stack track which gives me clues to actually resolving the issue instead of just managing it. This wasn't possible before I was using VS because I couldn't get the debugging to …

Post Holiday Update

The port to Visual studio went pretty well. I have yet to go through and setup the release build though so debug is all I have. Which at this point is fine because everything is broken pretty good so I won't be posting an actually update anytime soon. As an example the in game browser isn't getting events for some reason and I'm in the process of overhauling the terrain/map code (still). And for some reason the client crashes when I close a window containing a browser or just shutdown.

But that is how the cookie crumbles bugs are just part of the process when your building something that has irreducible complexity because you have to create stub code to fill in until that section is implemented IMHO.

Visual Studio

Thus far in enigma I have been using code::blocks as my IDE and while it is the best cross-platform IDE I have used it still doesn't work as well as Visual Studio. So I have gone over to the dark side and started porting the project files to Visual Studio. Several other programs like code::blocks will import Visual Studio files so at that point there is very little reason for me to worry about using a cross-platform tool.

I'm already starting to see warnings that may actually be bugs in my code so this could end up improving the code base over all. Now those of you worried about Linux & Mac support. Don't worry code::blocks doesn't work so great on Mac so I'm planning on using xcode which I believe can import visual studio projects. code::blocks will likely still be used on Linux unless I find something better that imports visual studio files.

In addition I'm also switching over to ".dll" files for EnigmaCommon, EnigmaVideo, EnigmaVideo, and EnigmaB…

Seamless Enigma

So, I decided tonight while finishing a college paper that Enigma should be seamless as in the main part of the world should be able to be traversed without a traditional map change. So with that in mind as a goal I have started working on a new terrain system that loads up new terrain in front of you and unloads old terrain behind you. It will also move you and the terrain back to the center so irrlicht doesn't have to deal with super high choords and I don't have to do tricky stuff with the Skybox.

Speaking of which I plan to replace the skybox with a skydome I figure I'm doing this stuff in code anyway and the main reason I was using a box was because the old irredit didn't have a dome option.

Anyway I started working on it but my first test didn't go so well because I get an access error from someone in the code. Makes me miss dotnet a little where every exception has lots of information regarding called methods and the exception type. Not in standard c++ though,…

New Job

I neglected to post but I have found employment at a local computer shop. In addition I have started another quarter in college. I'm mainly posting about my job though as that is the main thing that will be effecting my project progress. Although not dead the project will likely see a lengthy dry spell until my schedule gets settled. On the up side I'm working on their website so my programming skills shouldn't get dull in the process.

I primarily do service calls though. It's good honest work though they provide a ton of technical services related to networking/cabling and PC repair. So between service calls and website related tasks I'm getting to use both my hardware/networking background and my programming background. I think it's neat.

I'm pretty glad to be working on the website though it's currently pretty sad. Its more like a picture of a website. That picture looks kinda neat but just won't do for a company website. Oh well new stuff on the w…

EnigmaWeb

I added forms authentication to the EnigmaWeb website tonight. I finished my procurement plan for school, did one quest on DDO and decided to be somewhat productive. Yes schoolwork doesn't count. ;-)

So at any rate I'm quickly realizing that the EnigmaWeb project although completely necessary is almost like another project itself. Players expect more and more from these types of sites like being able to check pvp or guild ranks. Some games even allow the players to check other players gear and stats from the web interface. I'm not too sure I like that last idea though because anyone who does well will just get copied. But anyway point just being that it has a whole work load of it's own and I'm debating with myself if I'm going to add that type of stuff for version one. I need at least basic account management stuff which is totally cool but I need to decide where that cut off is soon. I will probably end up just adding stuff to EnimgaWeb as I need it for testin…

Adventures in Hashing

So first the good news. I have the authentication working with a test user I added via the web interface that I have created. I'm pretty happy about that but the bad news is that I'm gonna have to break it again because my custom hash algorithm isn't up to snuff. As it stands now someone could in theory figure out what the original password was just is obviously not gonna fly. As much as I rant about people not paying any attention to security I can't let something so glaring slide. Not that Enigma is secure or anything considering all the pieces that are missing for validation and such but you know what I mean I don't want to engineer these issues in.

So anyway here is what lead me to what we have now. First I was trying SHA1 using openssl I have been using that since I first added the login code even though the server just excepted any user with any password. My first problem happened when I couldn't find a way to create a SHA1 hash with the dotnet wrapper for…

Berkelium

Relatively recently a reader contacted me and told me about Berkelium which is a off screen render similar to the OffScreenGecko library that I'm using now in Enigma. I bookmarked it but I hadn't gotten around to playing around with it. However tonight I decided to try a test implementation. I used the binaries and headers for windows available on the Berkelium site. I got an initial implementation created but I wasn't able to get it to link correctly. A few but not all classes and static functions resulted in unresolvable symbol errors. So I rolled back to the old renderer but left all the code in place. I will revisit that at some future date as it isn't really needed for this release anyway I just wanted to give it a go and see if I could get something to work.

For the purpose of testing the browser after the roll back I commented out the code that was calling into the new authentication logic which is the way I committed it to SVN. It was just as well because I'…

unsuccessful programmer is unsuccessful

Quick update, I'm still working on the authentication. I have most of the ground work in place however I'm currently have a character encoding issue. Apparently somewhere the hashed password in the database is getting mutated into something different. Basically it doesn't match the hash fresh from the user so the authentication fails. It doesn't throw exceptions all over anymore so that is pretty neat. But that's what happens when you work so long on a piece of code before to get far enough to actually be able to test something. *Lol irreducible complexity* At any rate the generic data access components are tested now and they are working great. I think the nature of the issue is that the editor I'm using for SQLite is using a different character encoding than I'm using from code. Thus a hash password I enter via the editor doesn't work at all. So in the end I may end up adding the ability to register users just so I can test logging in.

Another thing t…

One function to rule them all

I finish the initial implementation of the function that will process database command objects for SQLite databases.It is large somewhat complex and untested so I thought I would share.

DatabaseResultSet Execute(DatabaseCommand& databaseCommand)
{
DatabaseResultSet databaseResultSet;

const char* tail=NULL;
sqlite3_stmt* statement=NULL;
size_t row=0;

rc = sqlite3_prepare_v2(
mDatabase, /* Database handle */
databaseCommand.GetQuery().c_str(), /* SQL statement, UTF-8 encoded */
databaseCommand.GetQuery().length(),/* Maximum length of zSql in bytes. */
&statement, /* OUT: Statement handle */
&tail /* OUT: Pointer to unused portion of zSql */
);
if(rc!=SQLITE_OK)
{
return databaseResultSet; //no need to call finalize because prepare faile…

If it builds ship it.

First of all I'll explain the reason for the title. I'm in the process of committing changes to the trunk that I have no reason to believe work. In all fairness it is data access code that isn't being called yet so it shouldn't break anything. However because I have put a pretty good amount of work into it I don't want it to be lost if my computer bites the dust.

Second bit of news I have made a change to the way I plan to handle the data access layer. From now on the data access will have two classes for each database. The wrapper class and the actual data access class. Having a wrapper class that deals with a single connection allows you to safely deal with the connection and execute commands without making the actual data access class super messy. Now the PostgreSQL data access is already super messy and I may or may not do some cleanup in the near future. I do plan to do the cleanup though I just don't know if I want to do it right now. At any rate the new c…

Data Access Layer

First of all apparently the value of a data access layer is in question. In my opinion if your using a database you should use a data access layer. Because for one things will change and having a single point to make those changes is truly priceless. Well priceless to the programmer. Anyway if your database scheme changes or even worse if you have to port to another database you will wish you had a data access layer if you don't already.

So enough of that little rant on to business well sorta. I have been working on the database related functionality. I started this release thinking it wouldn't be a big deal but I'm quite aware that this should have probably been broken up into at least a couple releases if not more. But anyway I still don't have enough database code to make item testing work.

In the course of working on the database code I realized a severe problem with implementing the PostgreSQL database functionality. That being that users will not be able to test th…

The eye of the storm

So, as of late I have had little to no progress on Enigma. There are several factors that caused this to happen. One is that I realized this release was going to be allot of work because of the lack of database code. Another is that I had tons of papers due for my different college classes. And the final major reason is because I have been playing DDO. :-)

I intend to make some major code updates this week because I have it off from school. I had this last week off as well but I didn't get around to updating any code. I did however have a 3 hour discussion with one of the artists about combat system ideas. Although a bit lofty I think some of our ideas are worth shooting for.

Having an extensive & robust combat system should make it easier for people creating derivative works to achieve what they need to fit into their game play design. One danger with this though is the fact that not every player will want to stop and think about things. I think having options may scare some pl…

AMD 890FX Chipset

Image
I don't know how many of you are aware of this but I'm a big AMD fan. I have been for years. But at anyrate there is a soon to be released AMD chipset called 890FX. It has some pretty nice features from what I understand. Gigabyte is supposed to release a new motherboard using this chipset. As it happens I'm also a long time Gigabyte fan. This new motherboard sports 2 16x PCIE slots, 2 8x PCIE slots, and 2 4x PCIE slots. All of those are actually 16x in terms of physical size but those are the speeds they run at from what I have been able to gather. This motherboard sports sata 6 and usb 3.0 presumably without hindering the 16x PCIE slots like allot of other motherboards. Information is still pretty limited at this point and some of it maybe subject to change but I'm still pretty excited about it. If I have money when it comes out I'm probably going to get it. This motherboard uses AM3 socket which is the most recent AMD socket for desktop processors. There are rum…

OpenGL 4.0

Alright, so I'm a little behind the curve. I just found out about OpenGL 4.0. I'm really hoping that new versions of irrlicht come out with support for it as well as DirectX 11. The Enigma engine is supposed to be a next generation type engine based on open source technology but the core isn't up to date right now. This hasn't been an issue because I don't have any decent test graphics nor do I have a nice level for testers to run around on. Right now I'm still using the same level I have been using for many versions. All of my graphics people have basically bailed on me so I'm back to solo mode I guess. It would have been nice to get some results first but I guess it can't be helped.

On a somewhat related note I have Social Psychology, Statistics, and Project Documentation & Communication. The core class (doc & com) isn't too bad but the social psychology and statistics classes are a bit rough. Not that statistics is rocket science or anythi…

0.8.0 misses the mark.

After releasing 0.8.0 I became aware of a rather nasty bug in the code. There is actually a memory leak of all things. It is pretty quick as well if I didn't have 4 GB of usable ram in my system I would probably have noticed it sooner. I fixed it in the trunk but 0.8.0 is still effected by this bug. There is another smaller memory leak as well that I have yet to locate but I'm sure it is something similar. The memory leak in this case was simply creating a message and not sending it. Because it was never sent it was never cleaned up which obviously caused a memory leak. The problem was I was creating a message and based on some conditions either sending it or ignoring it. I changed the code to call the new clear method when the condition was not met. That solved the memory leak.

I'm thinking about having the message container class clean up if a message isn't sent before it is destructed. This may help prevent further memory leaks like this one in the future. As much a…

0.8.0 Released

Version 0.8.0 of the Enigma project is finally available. The key features of this release are NPCs and Video playback. Currently the video playback only works under windows but the driver architecture allows drivers to be implemented for various APIs/platforms. NPCs work on both Windows & Linux. Presumably they would work on Mac as well but I wasn't able to get a working build environment setup. There are no major bonus features but I large amount of work has gone into bug fixing and overall code correctness.

I was going to make a binary release and I have the files locally but I was unable to upload the files to source forge. Every time I tried it would just sit there at the wait screen for hours even after the actual transfer was complete. So this will be a source version again. For those of you downloading these source versions you will noticed I changed the organization of the svn tree. All Enigma files are under "Enigma" and the development trunk is under "…

cppcheck

I found a wonderful new (to me) tool to help with development efforts. It is called cppcheck and it does a pretty good job of spotting uninitialized variables, possible memory leaks, and things being passed by value when they can be passed by reference. I also noticed it spots functions that can be const but are not marked as such. I'm sure it can do more than this but these are some of the mistakes It caught in my code. I don't feel too bad though because the only memory leaks if found were actually reference counted objects that were part of the Irrlicht engine. So that means it's detection isn't perfect but in all fairness an actual programmer looking at the code without knowledge of the API wouldn't know that. But anyway they were GUI elements that get cleaned up when I clear the GUI. I did however forget to set the pointers equal to null which of course could cause problems if those pointers are accessed and checked for null. So the short version of the story …

0.8.0 on the way

Sorry I haven't posted in a while. I have been real busy with school, taxes, and life in general. This quarter at school is almost over and I have all of my taxes taken care of except my city taxes. Even though I have been busy lately I have managed to make some progress on Enigma. I only have one known bug right now assuming the right-click death doesn't return. I have also gotten Enigma client and server to work on Linux minus the video playback and in game browser. The video simply isn't implemented for any other platform because the windows version uses DirectShow. I plan to use gstreamer for Linux but I haven't implemented it yet. I'm not planning on doing that for this release though because that will be allot of work to learn the API and get a working implementation. However Audio, Video, and physics all have a device based architecture so it is easy to create new "devices" if you know the API. What I really need is some platform maintainers or jus…

Npc working

I got npcs working in enigma about an hour ago. I thought I should post an update for all of you keeping tabs on the project. I cheated and used the message to locate the answer from the answer map but it works pretty well right now. I'm also keeping all npc information in memory. This may become a problem in the future because of the memory requirements however I'll cross that bridge when I come to it.

That is normally a bad policy but like many other things in this project until I get some hard data about how this all works under load I can't optimize correctly.

It's getting late I'll blog more when I'm closer to the next release. Peace out.

Npc progress

I finally got Npcs in the game last night. Or at least the server reports them to the client correctly and the client displays them in the correct location. Right now the location is pretty bad I just set it to 0,0,0 so it's off the edge of the map and below it a bit. You still can't talk to Npcs or anything yet so this seems like a baby step but it was a pain. One thing I should mention is that the Npcs id field is zero which is a problem. Server side I made the code use a string Id for Npcs so content creators could give them meaningful Ids. That won't work for the client/server protocol though because the string id could be large and I should really only need 4 bytes. Well unless we need more than four billion Npcs. But anyway I'll have to account for that somehow. Maybe a static int that increments when a new Npc is created. Like a reference count but I wouldn't decrement it when one is deleted. I mean really I only need the id for telling the client which Npc …

right-click death!

I'm making pretty good progress overall but there is one bug that pops up now and again. When I right-click to rotate the camera the client freezes. Sometimes it does it and sometimes it does not. I thought I had it fixed a few revisions ago but it started doing it again for reasons yet unknown. I actually tried commenting out the code that handles the context menu thinking that might be causing it. But it still froze. Further more I threw some cout calls in there and it was for sure getting past that code before freezing. It's like it executes all of my code and then freezes. It's the strangest thing. Also I checked that whole section of code and I saw no recursive calls and no loops that should be unable to meet their condition. So I don't know how it could possibly be an infinite loop but that is what it looks like.

I'm thinking about starting to work on the Linux build again. The reason is mostly so I can see if it happens on another platform. Kind of a silly re…

job hunt, school work, and enigma oh my!

I have been pretty busy with school work lately I haven't been posting as much as I would like. This of course means that some details are lost to time. However here is basically what I have been up to on the Enigma project. I realized they my horrible performance was from some sort of bug related the the irrlicht collision detection. I commented out my code that added the collision response scene node to the scene and my fps went from 20 to 500. That was a bit of a relief to me because I was concerned that my engines performance was going to be so bad that it would be unplayable with any relatively complex scene.

So after that I started looking into other options for physics in the game I tried to whip up a ode based system with mixed results. I then was going to give bullet a try however it appears bullet will not compile with the 2003 toolkit. Which some of you may know I need to maintain compatibility with some of the stuff I'm using like the gecko SDK wrapper. Apparently i…

0.7.0 mixed results

I fixed a few issues that were discovered after the 0.7.0 release. It is still a good release but not a stable as I thought it was going to be. I have been working on homework allot so I haven't gotten around to working on it more however I may work on it a bit more tonight. Tomorrow I have class so that is a no go. Unless I get like no homework :-). A guy can dream.

0.7.0 Released

Finally, 0.7.0 has been released. It took me a while to get this one polished up enough to call a release. However this release is sporting some nice goodies. The big one is the in game browser using the gecko rendering engine. And the other is server side scripting. There isn't a whole lot to that yet but it is a good start. I have also switched the whole project to the 7.1 c runtime and the 2003 platform SDK. The reason for this is mostly compatibility.

As usual I have included some nice extras namely the ability to select character, monster, and npc scene nodes. That will tie nicely into the next release. It also gives everyone a chance to play with the targeting system before I'm to far into coding against it. Also you can right click on a target to access the entity context menu that allows most of the common options you would expect. One caution on that though it isn't working just yet. For one thing characters don't exist so that information isn't available t…

0.7.0 close at hand.

I have some good news for anyone keeping tabs on this project. The 0.7.0 release is close to ready with a few changes. One is that I won't be providing binaries for all three supported platforms. The reason for this is mostly that I'm having issues issues with build environments. As a matter of fact I have spent more time lately messing with the build environment on Windows than actually programming. For that matter I still have one outstanding regression that appears to have nothing to do with any of my code. So in short if I'm ever going to get this thing working I need to focus a bit more. In theory if I use all cross platform code I can work out the build issues at the end. By the end I mean 1.0.0. It may seem unfair to delay Mac & Linux releases and it probably is but I just plain don't have the time. Maybe I'll get some Mac & Linux build maintainers.

Anyway there is only one known blocker preventing me from releasing version 0.7.0 and that is the above…

me vs c

I've been working a bit on Enigma over the holidays. I have however discovered a pretty nasty regression. The problem is that I have no idea what is causing it because whatever exception is getting thrown it isn't based on std::exception. So I have no information at all about what is causing the crash. Anyway the issues is basically that if you try to use any command the application dies instantly. What command you use doesn't matter. I'm pretty sure this was all working before I reinstalled my computer. So I'm wondering if it has to do with my build environment.

I also found out the enigma server has a dependency on the 7.1 Microsoft c runtime. For what reason I don't know. I found that out because I was clearing out unused libraries and I got an exception complaining about the that library being missing. So I threw it back in the folder and sure enough it was happy as a lark. That bothers me because I"m pretty sure everything is linking against 9.0. Sigh,…