Posts

Showing posts from June, 2009

0.3.0 Released

Finally, the release that some have been waiting for a little bit. In truth I have probably been more excited about this release from a technical stand point because of all the advances required to accomplish the promised functionality.

The binaries aren't packaged fancy they are just in a 7zip archive but that should work. As mentioned in my previous post I didn't produce a Mac binary like I intended to because of issues with the tools. I may create a binary later from the 0.3.0 branch if the tools show signs of improved stability.

As always I created a branch for 0.3.0 however the branch doesn't include the license files that were added to the binary packages. These were and afterthought.

You can of course pull them from the development version at any time. Those are unlikely to change.

I meant to have this release out earlier but I decided to go see transformers with some friends instead. Oh well whats a couple extra hours of waiting.

Alright signing out now.

Mac attack

So, anyone checking the svn has noticed I have been making tweaks all over to allow the client & server to build on Mac & Linux.

Linux was pretty easy at least on Gentoo. I just had to emerge all of the dependencies and boom the headers were all where I needed them. Gentoo is my favorite.

I had to make a few small tweaks here and there but for the most part it was portable.

Mac on the other hand has been like pulling teeth the whole way.

I got a good chunk of the dependencies via fink. If memory serves I had to build all the rest from source which I hate doing manually. So already at that point I had more work invested in mac then I did for Windows & Linux build environments put together.

Then came the issues with the Mac version of codeblocks. It kept crashing on me so again modifying the project files was like pulling teeth. I actually used a text editor a few times because I was having so many crashes.

I finally got it to compile sometime around 4:00 AM this morning. However…

Few quick fixes.

I fixed a server bug that broke whisper again. It was basically just that I wasn't giving the character the user's name. Which is a hack anyway but required until the database stuff gets added.

Also I made whisper case insensitive so now it is better than ever. I like bonuses.

Alright I'm done for tonight I should be able to get another update out sometime Monday. No idea how long 0.3.0 will take though.

0.3.0 is near

I finally got the voice chat working as of this writing the code in SVN will now perform the promised 3d voice chat.

So what is left for 0.3.0 you ask. Well for starters I need to do all of my cross compiling and make sure this thing still builds on Linux. Also I need to make it build on Mac now that I have one to work with.

I'm sorry to say though that I'm not going to support BSD & Open Solaris. It isn't that I don't want to but I tinkered around with them in a VM and had troubles getting everything I needed installed. Some of the stuff I would probably end up building from source myself.

And also I know how to compile stuff from source (obviously) I don't want to have to go through building dependencies. Of course if someone is willing to go through all of that work be my guest.

I'm planning on building on Gentoo Linux for my Linux binary. I haven't decided if I will make an ebuild or not though. Depends entirely on how much work that would be. I wouldn&…

Random crash Frustration.

I have been working on getting the voice chat to work and I thought I was close before because I got garbage to come out of the speakers.

Well come to find out the data was getting big time corrupt. I have since fixed those issues however now I'm crashing when I use the voice chat feature. This is frustration because I get no error messages it just gives up the ghost. That is of course after one or two audio checksums have been taken. So it seems like it almost works twice and bites the dust.

This makes no sense to me right now. I guess I need to step back from it and take a break. I did take a bit of brake before posting this. I added some slash commands including but not limited to "camp" My buddy Avery informed me that is his favorite mmorpg command so I thought I should add it.

Slash commands are obiously not all that important at this point but it was a distraction I was hoping for an epiphany or something. Oh well I guess I need to just call it a night and dig in tomo…

Voice chat on the way.

I'm getting pretty close to getting the voice chat feature to work. That is a good thing as that is the functionality promised for 0.3.0.

Right now I'm getting sound when I should the problem is the sound is garbage. So I'm thinking that the message is corrupt somehow. The frequency, length, and such are fixed for voice streaming so I don't think it is a bad setting there.

I suppose I could be capturing from the wrong device or something. That could get interesting.

Anyway I'm probably gonna hit the sack and work on it tomorrow. I'm getting tired.

One more thing though I added buffer recycling functionality to sound sources. That will keep streaming from eating up all the xram for those that have it.

Also as usual I have added my standard set of bug fixes that I have already forgotten. I sure am glad I have source control lol.

Also I split the sound sources amongst voice chat & misc sounds. The sound sources don't seem to like being switched back and forth be…

Understand then fix.

So in programming there is kind of a rule something to the effect don't fix it if you don't understand the problem.

The idea being if you don't clearly understand the problem you may only make it worse. Breaking this rule can of course end up not fixing the problem, making the problem worse, or create new problems.

Well the bad news is tonight I broke that rule sorta. I was working on 0.3.0 like a good little programmer and noticed a huge regression. You couldn't see other players on the server. As a matter of fact the server was sending id 0 for all players.

This has worked fine since 0.1.0 so I was of course doing diffs like mad trying to figure out what I had changed that broke it. And naturally I didn't find it. If this was easy I wouldn't learn as much right lol.

So I did my normal thing and threw some cout calls in a few places. I know they have these things called debuggers but hey it's how I role. Plus I don't think the debugger in code blocks works…

0.2.0 Released

That's right 0.2.0 is now available.

This is another source release but I plan to make a binary release for 0.3.0. That is the plan anyway.

Now for the nuts & bolts. In 0.2.0 you can now use local chat to talk to all the users on the same map as you. Currently this means everyone. You can also broadcast to the whole server. Which for the time being is basically the same thing as local chat but I won't have to change the code later when that happens. The whisper feature I promised is also there. It even sends the user a message when the user they tried to whisper isn't online or does not exist.

There are a few other tweaks here and there that have gone into this release but I don't think there are any milestones that got slipped in there.

As is my custom I have made a branch for this release. I hope this release at least makes a good chat program for someone lol.

That's all for tonight time for sleep.

Fink on Mac OS X

After thought here. For those of you who don't know there is a piece of software called fink that installs all of your favorite open source Linux apps on Mac OS X. Or at least a good amount of them.

Of course there is more to the application than just downloading them. You can actually build them from source if you have apple's dev tools installed. Also it is downloading modified versions of some of the packages that work on Mac OS X. I'm not sure about all the changes they had to make to make all of this work but good job folks.

It kind of reminds me have gentoo's portage but for Mac OS X. So of course I instantly like it allot lol.

But anyway I may have some dependencies from fink in my project. I haven't found binary packages for some of my dependencies so I'm thinking I will need to compile them using fink and apple's version of GCC. I think it is basically regular GCC4 though so I should be good to go.

I'll also have to deal with bundles and all that f…

0.3.0 roll out plans

I have allot of work to do before I can release 0.3.0. After all I'm only on version 0.1.0 right now. So I'm working toward 0.2.0. Also I plan to put allot more spit and Polish into 0.3.0 because I plan to make binary releases to platforms other than windows. Part of the reason for this is that 0.3.0 will be able to be used as a chat system of sorts. That isn't the ultimate goal but it becomes useful at that point.

Also it will probably be a while before I do this again so I want to give people something to play with while I'm hard at work on newer versions. Or studying for college if I'm in college by that point. I may not even finish 0.3.0 before I start college although I would really like to.

I'm thinking about actually implementing the user logic on the server and database so people can actually use it in a live environment. I haven't made up my mind on that yet though because that would take longer.

Also my mapper is supposed to be back in town soon so t…

Delays

As much as I would like to announce ground breaking progress. I haven't been very productive. At least not in regards to the project.

I have been doing allot of PC repair type stuff. As a result I have also updated my cd case of tools & Operating systems. It now includes a couple flavors of BSD. BSD has always interested me since I heard about it a long time ago but I had never gotten it to install and work.

That changed recently as I got a PCBSD install to work and it was quite nice. Unfortunately I couldn't get it to use multiple hard disks so I ended up replacing it with open suse.

Next time I need to install an operating system on a single disk system though PCBSD is a definate possibility.

As for the project the last progress I almost got basic chat working the other night. I still need some work in the message classes though I think because they don't seem to be working quite right. There are probably some other bugs that I just haven't uncovered yet.

Also I got m…

0.1.0 Released

That's right 0.1.0 is now available. The main features of this release are the ability to fake login select a fake character and move around. Also you can see other players connected to the same server.

This may not sound like allot but it takes quite allot of effort.

This is a source only release so if your waiting on a binary release I may wait until 0.3.0. Because at that point it will at least make a good 3d chat program. As of now it isn't possible to communicate really.

The release is available in source control. I made a branch so this version can be downloaded at any time. I'm going to continue on toward 0.2.0 in the main branch.

Getting close to 0.1.0

I haven't gotten a whole lot done the last couple days I have been busy with some work unrelated to the project.

However I added a small hack to the server that gives characters a fake id. That will allow them to be identified by other clients. Unless I have forgotten something the server is ready for 0.1.0 with the exception of the character creation screen which I plan to drop from the release. Forcing users to create characters that are not stored at all seems like a bother.

So now the big thing left is creating models for other players that don't have them when the state change packet is received and delete them when said packet has the is leaving property set to true.

I feel this release is close. Maybe some time this weekend if all goes well.

Holy memory leak batman

I found a memory leak. Which is funny given my statement before about there being no known memory leaks.

Well anyway down to the nuts and bolts. The issue was that even though the API docs for enet say once you pass an enet packet to the api to send you don't need to worry about it. As a matter of fact it says you should not use destroy packet on it. However it would appear that it doesn't actually clean up the data in the packet.

This is unfortunate however now that I know this I can work around it. Right now I'm flushing after the send call and then calling a delete on the pointer in the message union. The flushing ensures it has actually sent it and should be done with it more or less. However at this point I'm kind of guessing it makes a copy of your data. Otherwise it makes no sense that it wouldn't be cleaned up except if it was keeping it in case of a packet loss. In which case it should clean it up after the other other system responds.


But anyway so that memo…

Sound Source management.

Alright, so guess what I got distracted by a sound source management.

See, I found out that you can only have a limited number of sound sources. It is limited because each one represents a hardware sound source unless of course your using a software device. But in any case they are a limited resource.

Now from what I was reading you could have anywhere from like 14 to hundreds. Fun times. Well anyway the general consensus among posts I saw on the topic was that the best way to handle it is to allocate all of your source up front. Basically create sources until you get an openal error and that is your max. It sounds like a big hack and it is but I see no way to query the api for the max number of supported sources.

Also if you allocate on demand there is always that chance you won't be able to get a source.
Another thing most of the people agreed on was that you have to create some sort of priority system to handle giving the sources out.

Well, my solution was to use a priority queue a…

VirtualBox

Ok, for those of you who don't know Virtual Box is an open source virtual machine. Similar to VMware. One notable difference is that they have a free open source version that has 3d acceleration for OpenGL. What that means is for example you could actually play a game in a virtual machine as long as it uses OpenGL and not DirectX.

The down side is of course that most games these days seem to use DirectX.

However the game I'm working on can use DirectX or OpenGL via the irrlicht engine. And I'm currently using OpenGL. So what this means for the project is that when the time comes I can install various different operating systems inside different virtual machines and create builds for a wide selection of operating systems and actually test them.

If I tried to test them without hardware acceleration it would be painfully slow even running bare metal. So inside a virtual machine would be even worse.

The short version of the story is I can make releases for different operating syst…

Linkers hate me

I have been making pretty rapid progress as of late. And because I have been unable to install linux on my main computer I have been developing on windows.

It has been working just fine but today I decided to check to see if my project still builds on Linux. I mean one of my project goals is to have this thing build on as many platforms as possible and Linux happens to be my operating system of choice.

So, um guess what it didn't build at all both the client and server failed.

The first problem was that I included enet in the project instead of using a library. This was mostly because making the library on windows was a pain in the butt. However that requires a couple windows only libraries to be linked. And of course on the Linux side the linker would fail because it couldn't find either of those libraries.

So to solve that problem I build the library on the windows side and removed the enet sources from the project. I also modified the linker options. That solved that problem. …

Memory leak.

While showering the other night(aka other morning) I realized that I had a few memory leaks in the message code.

Before when process message was called it created a new message container of the correct type but it was never cleaned up. Now after it calls the next version of process message I call dispose on it.

There were a few other fix ups of the same kind I think. I'll have to look at my commit history I don't remember anymore.

Anyway as of now as far as I know there are no memory leaks. If anyone spots some in my code shoot me an email or something. Fixing such things will only get harder as the code base grows.

Fake Authentication.

I actually completed one of the goals needed for 0.1.0 gasp.

I Got fake authentication added to the client and server. There are of course a few gotchas.

1. The login screen doesn't force the user to wait for response.
2. The Server always allows it doesn't even look at password.
3. The Client's hash function does nothing right now so passwords are sent in clear text.
4. I'm only setting an is logged in flag. Later I will need the user id so I can poll the database for valid characters.

But that said implementing this was relatively pain free. That encourages me. I'm hoping that all of the remaining 0.1.0 features will be mostly pain free. I don't see that happening but hey a guy can dream.

The New Deal.

I'm changing the road map somewhat.

Chat will no longer be part of 0.1.0 as it will be in the next release.

I may still have that release and 0.1.0 out before I go back to school but really we are talking about two milestones which should really be in different releases. Plus I don't want to wait that long to make a release.

So the new road map is a follows.

0.1.0
Movement(Player can move around and see other players.)
Authentication(Player can login although credentials will not be validated.)
Character Creation(Actually make character creation work.)
0.2.0
Chat(Players can chat using world chat, broadcast, and whisper.)
0.3.0
Voice Chat(Players can talk to other players on the same map.)
0.4.0
Map Change(Players can actually move between maps.)
0.5.0
Party(Players can form parties and use party chat.)
0.6.0
Guilds(Players can form guilds and use guild chat.)
0.7.0
NPC(Players can see and talk to NPC.)
0.8.0
Quest(Players can pickup and complete quests from…

Client Config

While working out some details in my head regarding the movement logic needed for 0.1.0 I realized that having the server hard coded wasn't going to fly once I was in that phase.

So, my first thought was ok I'll just read it in from a plain text file. I mean all I need is a host name I don't need anything fancy.

Of course I realized that wasn't an elegant solution to the problem and before you know it I was coding a configuration class.

I used the irrlicht built in xml parser so it wasn't that hard to make a nice xml based configuration system. I created the logic for loading server information and for now I'm using the first one it finds as the default.

Now that worked so well in fact I decided to make the resolution and other display settings configurable. I remember someone else doing something like that on the forum but I think that was in .net and was tied to a GUI. I'm trying to make this in such a way that I can use it in a wxwidgets based Configuration …

Voice Chat

So, guess what I got distracted with. That's right voice chat. I was doing some reading on the OpenAL API and noticed it had support for both streaming and audio capture.

So of course first thing I think of is voice chat for the game. So in my excitement I pounded out a nice chunk of code related to voice chat.

The idea of it being that you would hear people within ear shot and OpenAL would take care of the direction modification & volume relative to distance.

The game's networking code is already designed to be relatively low latency so I should be able to pull this off. However there are a couple tricks.

One is Managing all of those OpenAL resources. I'm pretty sure there are a limit to the number of sources etc you can have. I'm not sure if those are just active ones aka ones playing or if it is a hard limit in the API. So I don't know if just creating them in the scene nodes will work like I want it too.

Second is making my messages efficient. I believe voip o…

PostgreSQL

Here I go again getting detracted.

I deciced to go with PostgreSQL for my database. This desision is in part because the license is commercial friendly but also because the database is very feature rich and capable of handling large amounts of data.

The general idea being that the game server acts as a state machine of sorts and it saves it's data back to the database on a regular interval. And of course when the player logs out thier data would be saved then as well.

I've only added some basic stubs for the data access class. I'm planning on just throwing all the database stuff in there. Normaly I would break it out into a class for each type of thing but in the past when I did that I ended up just creating instances of other data access classes in others to handle complex data structures containing other complex data structures.

The issue is just that there is no clean division because by nature all of the data is linked in one way or another. Now that said I would probably …