12.29.05

KaladeaMUD - Comming along (part 1)

Posted in Programming, General, MUD related, ALPHA, KaladeaMUD at 11:30 pm by Nick

Time: 16 hours
Total Time: 103 hours
—————————————–
Done a lot of work on Kaladea over the past few days. I’ll try to recap since the last thing I reported on was colors (and that was an accomplishment done seemingly ages ago).

The first real night I buckled down to work I did quite a bit. I managed to enhance the command structure and make a lot of tweaks, as well as test commands with a non-human (that is, my random num gen and some previously written messages).

All went well until I realized one mistake, a rather large one if I had implemented a great many commands. The problem was with the design. I used the player structrure instead of the (at the time, non-existant) character structure. This would be a problem down the road when the NPC’s wouldn’t be able to use any in-game commands (such as attack, flee, get, drop, etc.).

I sat wondering to myself why I had done it this way and then, after some sleep and time to think, I remembered. I initially wanted to derive my player class from the character class (as each player is a character with more information). However, this created a potential problem, and the program initially (with this design) looks more like a C program. I later derived the players from the socket class as each player also has a socket. This also makes it safe for me to cast between the two if I so please (mainly from socket to player).

At the time I only had two commands (say and quit), so the change wasn’t too hard. If I hadn’t caught this it could have taken several hours to fix correctly. Now I have a character class which is the basis for most things in the game, which points to a player class if one exists (which in turns points back).

A few other simple enhacements followed, like fleshing out a bit of the character class (still isnt much) and adding Trust Levels to commands. For the unknowing (which is most of you I’m sure), there are different levels of commands in online games. For example, you dont want players to be able to warp from room to room, but immortals (admins, implementors, enforcers, etc) will need to. Also, you dont want your “guests” to have the ability to full out play the game without making an account. Likewise you dont want all of your immortals (ones you hire) to have access to vital commands that mess with the game (such as reboot, slay, or copyover). Trust Levels (TLs) is a simple concept which just checks a players TL in relation to that of the command. If it falls short (that is, too low) then they can’t use it.

I later spent some time revamping my *nix Makefile. I got annoyed with having so many files in the same folder that I seperated all of them into folders for easier finding. Unfortunately this screws up the makefile, which thinks they are all in the same file until you tell it otherwise. So after a bit of revamping I got it to work correctly and added some nice features to it (all of my object files are now in a seperate directory, which is nice).

Several hours have been spent tinkering, playing with formats and testing things. You can now specify your name when you login which gives names to the chatters. My friend and I spent some time chatting over it using colors and what not and the base (at the time) seemed quite stable. I also left it running on Cygwin overnight (to see if it would crash) but alas, it was here when I returned today.

I also added the now infamous glog() function to the code base. My attempts thus far to port Xlib for Kaladea have failed. Granted I havent spent much time, but I realized I don’t really want an elaborate logging scheme. I need something that is easy and works.

I have written a bit of code to deal with the hashing I will need to do, but it remains untested (haven’t even attempted a compile yet). It has been designed as an abstract data type (ADT), but from my experience with templates deaing with my binary tree code I’m not sure how well it will work.

Currently I’m working on adding one of the three core elements to the game: rooms. One thing about a mud is you need to move around. It is part of the game. Which is great, but it means a lot of work. Luckily I don’t need to design prototype structures for this (unlike objects and mobs), as rooms stay the same and are governed by resets.

One other thing I should be working on is file loading. I need a good system. I can think of a very space inefficient way to do things which is easy, but it is not really flexible. I could make the loading somewhat like that of my last CS I assignment, where everything is done line by line, and how the next line is interpreted is dictated by the previous line (meaning the previous line tells how to hanle the next line). This means that each line contains one bit of information. This isnt a problem, but I’m used to the very flexible loading of DIKU derived bases where everything is read one word at a time and interpreted that way (usually putting a key and a piece of data per line). I’m sure I’ll figure it out.

Ok, I think thats all for now. Time to go continue smashing my head in… I mean programming.

12.28.05

So close, and yet, so far

Posted in General, School, College at 6:08 pm by Nick

McCormick finally got all of his final’s graded. This is what I recieved in my e-mail from him:

86.1 on the final exam
92.3 for the course.

You earned an A-, just missed the A by 1.7%

Damn! ::sigh:: Oh well. Using the gpa calculator thing on the UNI web site my GPA should be someting like 3.71 this semester, yet another drop. ::longer sigh:: I need to get to work on this.

A few other brief comments on two movies:

Batman Begins was an amazing movie. One of the best I have seen in many years. Good acting, great action, and a relatively plausible reason as to why Bruce Wayne knows how to fight and move the way he does.

Into the Blue was really stupid. Very stupid. Acting wasn’t too bad, but the movie was just stupid. However, it does have Jessica Alba in it (in swimwear mind you), so its worth seeing at least once (for men anyway).

12.26.05

The Day After Christmas

Posted in General at 1:40 pm by Nick

Well, it certainly has been a good few days. Gotta love break and the events this time of year. I shall talk of a few relatively random things here:

1. Chili + Dogs = Good XMas Eve
2. Mmmm, pie. Speaking of pie… I should go eat some more.
3. Woot for presents and having christmas with two people who didnt have a family to spend time with.
4. Hurrah for an amazing time and stories at the grandparents house with all of the family.
5. Boo for long car trips (6ish hours in two days… thanks for driving Dan!)
6. Woot x2 for kicking back and taking it easy.

Alright, now a little bit more depth on random things:

I finally watched Star Wars Episode III. I must say it has some of the worst acting I have -EVER- seen, but the effects and battles were amazing. It makes me mad that Mace Windu kicks the bucket after he smokes Palpatine. And then Yoda couldn’t take him down! Ack! Oh, and why the hell didn’t Obi push Vader into the lava!?! You don’t leave evil villans like that, they always come back!

Also rewatched The Island. There are several humerous parts, and a lot of action, but overall its just too bull-shitty to believe. I mean, you can’t fall 69 stories on a hunk of metal and live! Though they did humor that up by having the guy on the ground say, “Oh man! Jesus must love you!” and when he see’s Scarlett Johansen (sp?), “I know Jesus loves you!”. And yes, I’ve ranted about this movie before. With the information presented ($5 million per clone and destroying $200 million in “product”) they are to destroy only 40 clones, though they talk of destroying four generations! Someone screwed up the math.

Call of Duty 2 is pretty good. I’m not a big fan of the control’s because I’m used to my Bond game, but I manage. I would have played more had it not died on me (wtf?). Its only the second game thats ever given me an error like that.

Um, thats all I got right now. Going to go gets some pie and play a game while I wait for Dan to bring food. Oh, I need to call Fareway. I must go do that. Anyways, thats my update.

12.21.05

Last Day Of School Before Winter Break

Posted in General at 11:30 pm by Nick

School was pretty good today. I spent many hours yesterday working on math to prepare for the quiz and fix up an assignment (which I completely redid and later found in my notebook). Took forever, and I’ve been tired most of the day, but still went well.

First was Entrepreneurship where we were playing the board game Risky Business. Tis quite fun. Schaefer and I are pretty much dominating.

Second was AAT. Math test. Not much to say… but better than notes I think. Turned in my assignment for a grade boost (that is, returned in). I feel confident on my score with that quiz, so it should be alright. I need to raise that grade.

Last was Creative Writing where we played Jeopardy as our screenplay final. My team did quite well. The other team only beat us because they got the only daily double (those bastards). We ended with 1400 points, while the two groups below us were negative!

Went home and chilled for a bit. Twas nice to kick back. Later Dan and I hopped in the car and drove back to the school to give Mandy her christmas present(s). Yes, it is a huge bear (about as big or bigger than her). It fits well in a chair and could wear a seatbelt in a car. Anyways, it seemed to make her day, and I got the shirt to her (finally), so all was well.

Finally, I finished up the day with some D&D. This is the first time I’ve played in months and was quite fun (though Mandy was a no show). It was supposed to be RP based, but it was a little weak. Overall I think it went about as well as it could have without playing at a table or online. Twas quite fun, and a lot of good jokes.

So, after that, Wendy’s. Yup. Mmmmm. Yay.

The furnace is definitely broken, so its a nice 55 degrees in our house right now. I guess I’d better go sleep. Yup, sleep in the cold.

Today was an incredible day, albeit my lack of sleep.

12.19.05

KaladeaMUD - Color

Posted in Programming, General, ALPHA, KaladeaMUD at 9:11 pm by Nick

Time: 2 hours
Total Time: 87 hours
————————————
Messed with the color codes quite a bit today. In order to get them working correctly I needed a very important string function (strrep), which replaces a string with a different string within a string. This is important because the codes people type are like “&r” and “&Z”. My code must translate these to ANSI color codes.

I used a C function ported from another mud until I realized I could do it much easier using some C++ niftyness. I, of course, use my function, though I’ll leave the other there for now. I also made a strdel function which deletes all instances of a substring within a string. This cannont be done by using strrep because you cannot past a null string to replace with.

After I got these two I just threw them in a function and checked whenever a string was written to a sockets out buffer. Now I have ANSI color support. Granted there is more I should add, such as bold, strikethrough, underline, background colors and flashing text. Maybe later. I personally dont use any of those for mud purposes.

I will try putting the server up sometime later as an example. Color? One more thing off the list. Well, more is involved, but it works for now. Now to work on the command structure some more…. ::boggles over hashing::

12.15.05

KaladeaMUD - The Beginning, Take Two

Posted in Programming, ALPHA, KaladeaMUD at 1:26 am by Nick

Time: 5 hours
Total Time: 85 hours
————————————
–This actually was like, a week ago. But it must be documented!–

After some serious analysis and reading up on class inheritance I decided to scrap most of what I had on this project thus far. Some things, such as the get_command_from_buffer() function were transferable, and the old design would have worked, but it was more of a C-type implementation. This is C++, and I need to start coding like it is.

With this has come a few nifty things. First off, I solved my player class dilemma. They had to point to a socket class and a character class. Fix? The player class is a socket, or rather, it inherits all of the socket data. This has a few bennefits. First, I dont have another pointer I need to keep track of. Second, every socket -will- have a player class associated with it and vice versa, enabling safe casting if need be. Lastly, I can put in a pointer to my character class, which before was what the player was derived from.

Sprites/enemies will be of the character type, and will inherit all character class data. This is a bit in the future as I still have to flesh out the new command structure.

The command structure is now based on two classes. One stores the command and its information, like traditional command structures. However, rather than passing the command I parse it and pass a class containing the relating information.

This enables a few things. First, I can make it as complicated or as simple as I want. Second, this takes some of the messy string handling out of the picture in the actual commands. More notably this enables me to build up the language more, as I can overload operators relating to commands. The first (and only currently) one to be overloaded was the extraction operator (>>), which I use to grab commands from the class’s “cmd” string.

Thus, this (supposing argument held your command data):
string arg1;

argument = one_argument( argument, arg1 );

Becomes this:
string arg1;

cmd >> arg1;

I’ve spent some time getting it to compile on Dev-C++ (or rather, on Windows itself). Whiel it doesnt quite work when you start it up this way, I can work more on that in the future if I feel like it. Its not terribly vital at thsi point.

I also spent at least an hour tracking down why one word commands (such as “look”) crashed the game as opposed to two argument+ commands (such as “look up” or “say hello there”). I finally figured out it was due to using spaces as delimeters in my get_word() function, so I had to add a space to the end of the strings.

Cosmetically nothing has changed. What was once done in three lines is now done in fiffty. This is not counter productive however, as I now have my command structure set up. Soon I will be adding commands like crazy, and life will get better. But for now it just mirror’s your input rather than seriously interpreting it.


In relatively unrelated news, I started a NationState. It is based on the human empire named Condia which exists on one of my D&D worlds. Tis interesting.

Incredible Snow Day

Posted in General at 12:42 am by Nick

Today was quite good. Not too much happening though.

I did accomplish several things:
1) played tales of symphonia for 4 hours (i’m close to the end)
2) played some games with dan
3) ate food from Tony’s that took a way long time to get here (it came from Waterloo…wtf?)
4) wrote in my blog twice (possibly a third time after this)
5) watched the movie Saw
6) watched some history channel
7) there is no seven
8) got a total of nine hours of sleep. Woot.

Thats about it.

12.14.05

No School

Posted in General at 8:06 am by Nick

No school! Yay snow. Thats about all I have to say.

12.13.05

College Final #2 - Discrete Structures

Posted in General, School, College at 5:03 pm by Nick

Final #2 today. Twas a long haul. Took me an hour and thirty minutes to finish even though well over half the answers were already in my notebook!

I wont get the results back for a while (unless McCormick is some kind of grading speed demon), but I think I did well. I calculated my grade without the final and it was a C+, and there is no way I bombed that final (at least I hope so). According to the math I need an 87% on the final to pull an overall 93%, which was my goal. I think I achieved it. We shall see.

I now have 3 classes a day until January 6th I believe. Yay. Of course I should probably go see whats happening in the ALPHA room once in a while (since I’m in ALPHA…), but quite honestly I’d rather go home. I’m thinking I will actually start going to the library to get reading/homework done. I don’t concentrate as well when I’m at home. Too many distractions.

In any event, snow comming tonight (or so I keep hearing). Would be kind of silly to get tomorrow off when I only have three classes, but hey, I’ll take it. A two hour delay would also be spiffy.

As a final comment that is totally unrelated to everything, I’ve decided I like Death Cab for Cutie’s music. Strange name, but I enjoy the sound.

12.12.05

College Final #1 - Computer Science I

Posted in General, School, College at 4:00 pm by Nick

Yup, so this “two hour” final definitely lasted thirty minutes, with talking and amusing commentary. Everyone who was there stuck around to see their grade despite being able to leave (at about the twenty minute mark). I can honestly say I will miss this class. We are going to be missing a few interesting people in CS II.

Despite this, I got a 95% on the final. I was annoyed with the only question I missed, as it was the only one I really debated. “All C operators can be overloaded.” Its true that most can. My thoughts went to the point/dot operator ( . ). It can’t be. But I still but down true. Silly me.

Yeah, so, I definitely got a 98.05% as my final grade in CS I. Tis a fair way to start college I think.

Thats all for now.

« Previous entries ·