|
Welcome to my page. My name is Alec Dun, I finally got myself one of those
cool digital cameras so now I can put some neat pictures on my web page.So who am I?I suppose you define someone by their attitudes and what they like and do. Attitudes are subtle, so I'll focus on the things I like and do. You can read some of my attitudes from how I describe the things I like and do. |
|
| My e-mail address is alec@dun.org if you want to comment on my page. |
|
|
I've had the opportunity to try several different jobs. I've run several of my own businesses, I've worked as a project manager, and I've worked as a software developer. I've been reasonably good at all of them, but software development has been the only job I've really enjoyed so far, so I've recently switched back to doing that. It's not surprising that what I enjoy the most is also something that I enjoy doing in my spare time anyways.
Figured I'd add some information about my philosophy. They are merely my opinions, and I'm often wrong, so I'll probably revise many of these after I learn and experience more.
Interactions. In general, when interacting with other people, treat people the same way you would like to be treated.
Respect. All people are worthy of respect. Everyone occasionally does stupid things, that does not diminish one's respectability. Sometimes people interact in a way that can angers or hurts each other. Tell them how you feel and then forgive them. Do not bear a grudge. Respect them.
Honesty. Do not lie about things that are important. Never lie to or keep secrets from your spouse.
Trust. In business relationships, be pragmatic, trust that people are not malicious, but also that a business man should always try to get the best deal for himself. In friendships, trust is situational (not absolute), and must be earned; you can trust that a friend will usually have your best interest in mind, except when it conflicts with your friends best interest. Maintaining trust is crucial in marriage, but don't be naive and think your spouse isn't human. In marriage, it is your obligation to ensure that you and your spouse don't put yourself in any positions where your interests and your spouses interests would conflict and therefore test the trust.
Marriage. Marriage is a life-time commitment made by two people to spend life as best friends and partners. Take it seriously. People's will not change much after making the vows. Make sure before you get married that you are going to put the work into it to make it last forever. Your spouse must be your best friend. You must consider your spouse to be your equal. You must respect your spouse. You must be sexually attracted to your spouse. You must be able to communicate and work out problems in a logical way with your spouse. Do not marry to fill some greedy but temporary desire. Not getting married is OK. If marriage is not for you, don't get married.
Polygamy. Sounds exciting, but how could you possibly have two best friends?
Opposite sex friends. Your only opposite sex friend should be your parents, siblings, and most importantly your spouse. If you're not in a relationship then opposite sex friends are fine.
Sexual orientation. I am heterosexual. I think I was born this way. This does not make me any better or worse than people of other sexual orientations. People of all sexual orientations deserve respect.
Life. The purpose of life is to (not necessarily in order of importance) (a) enjoy yourself, (b) have many children, (c) socialize with peers, (d) overcome difficult problems, (e) eat, (f) sleep, (g) have sex, (h) explore, (i) compete, (j) nurture.
Achievement. I measure a person's achievement by how much a person has achieved that is of value to others. Children are one of the biggest achievements anyone can make. Value is most easily (but not always) measured by how much people are willing to pay you for what you achieved.
Religion. Logically, there could be a god, there is no proof either way. Emotionally I believe there is one, and often I pray to Jesus Christ. Logically, if there is a god, then it would follow that his only motivation for creating the universe could be to create an experiment/simulation to learn valuable philosophical lessons by watching people, creatures, and the environment interact with one another. Religion in general has played a very important role in bringing a consistent philosophy to an otherwise chaotic world. It saddens me to think about how many people in history have killed/died because of their religious beliefs. God provided religion to help people live together, not kill each other, I don't know how things got so warped from God's original intent. Also, I do not understand why some religions attempt to make people feel guilty about behaving the way God designed us.
Government & Socialism. Government should be as small as possible. They should provide a safe environment in which all citizens can achieve great things, devoid of war and malicious acts. The government should not redistribute wealth from overachievers to underachievers; this penalizes the overachiever and rewards the underachiever, which is the wrong direction if you want society to achieve great things.
Laws & Justice. Laws are created with the best intentions, but unfortunately enforced blindly without regard for the intent of the law. This sometimes creates great injustice in society. Sometimes honest people are punished. Sometimes dishonest people don't get punished. Having said that, the legal system is far better than no system at all, and I can't think of any way to improve the system.
I have a wife, a daughter, and a son. They are all a little older now, and some day I have to get around to updating these pictures:
So I am writing a computer programs in my spare time (when there is any).
It is a kind of graphical MUD that I've been working on for about 5 6
7 years now. I think I'm going to call it "AI Wars".
Here's a picture:
I keep having to update the game because it gets totally out-of-date as the industry progresses. Right now the server runs on Windows NT, and the client runs either (a) on a Win95/NT machine, or (b) on a java-enabled web browser.
Client I originally wrote my client as a plain Win32 application. Then when java became the hype of 1996, I thought what the heck, why not learn about Java and make a multi-platform client for my game all at once. So I sat down and re-wrote my client in Java. It was a fun project, but it was annoying how under-powered Java was. I couldn't do half the cool stuff in the Java version that I could do in the Win32 version. So now that I've learned Java, I have a real idea about if it is better/worse than Win32, and it is as follows: if Java can't rival Win32, then Java has a limited hype-span.
This year, I re-wrote my Win32 client in ActiveX. This was relatively simple except for the @#$% IObjectSafety interface which there didn't seem to be an easy way to add to my MFC based activeX control. Eventually, I rewrote the container object for the activeX control in ATL and I used MFC for everything else. The ActiveX control works very well now, and it's pretty to look at, and overall the ActiveX control can provide a much richer user experience due to the richness of Win32. I still can't make my tooltips work within my ActiveX control, but that is a project for another day.
One problem I hit using my ActiveX control was where to put stuff on the user's hard disk when I need to download a file locally. I eventually concluded the best spot was the Internet Explorer cache since it could be automatically expired if the user wasn't playing the game for a while. Unfortunately, there are some drawbacks. If I change something and it's in the user's cache, I have to know to force download it. Also, it takes time to download this stuff. I eventually added a progress bar so that folks on slow links can see that it is downloading stuff. I'm not sure what I'll do about changes. I suppose eventually I can return a list of things that changed since the user last logged on as part of the logon protocol, then I could walk the user's IE cache deleting stuff that I know has changed.
Editor I orginally decided to use VB3 to build my editor because of the ease of writing UI in VB3 (the editor requires a lot of UI). VB's main strenght other than ease of writing UI is that it has very nice database support (I keep the list of objects and regions in an access database), except for a couple of things. First, it was too slow to effectively show a map, and second of all, it didn't handle structures with pointers to other structures. At first I limited my program to the constraints put on me by the lack of pointers, and I then wrote an VBX to draw my map. Later Microsoft decided to change the technology, and I had to rewrite my VBX as an OCX. That was quite a lot of work. More recently, they decided to switch from OCX to ActiveX, which wasn't really any code change. Recently, the constraints got too great and I had to fix the poitner limitaiton, so I added an object to my ActiveX control to provide (and maintain) a manipulateable tree of objects. Pain-in-the-butt, but now I can do much cooler stuff in the editor, like change the icon of an individual object when I've placed it on the ground.
Setup I used installshield for my setup program. I am very impressed with install shield, it is powerful and has a short learning curve. It even does the correct reference counting on DLLs that it installs, which is a standard everone is suppsoed to follow on Win32 but many install programs don't. It allows you to do all the obvious stuff you'd expect (copy files, make registry settings, show dialogs, ask user questions), and for stuff that is not handled by Install shield, you can write a DLL and call a hardcoded entry point from install shield. There are a couple of things I was surprised to not find in Install shield, and those were registering a DLL (I had to put that in a custom DLL), and there is no debugger for the install script. I don't know that lack of a debugger is all that bad for an install program though.
Server The server is my baby. This is where I've spent most of my time. Unfortunately nobody can really appreciate what a (not to sound too arrogant, but I have spent the bulk of my time on this part) good design job I have done on the server. It was not without having several modules being rewritten a couple of times though.
Most notably, my communication module (manages connections with the client) has been rewritten 3 times. The first time it was an RPC based communication manager. The second time, I used wsock32, but I created two threads for each connection. The third time, I create two + number of CPU threads (one for incoming connections, and the rest for managing each connection. I originally wanted to use select to determine when to send/receive data, but that is problematic because you can't select and wait on an event (I use the event to signal new data that arrives that should be sent to a client). Eventually I used IOCompletion callbacks to receive incoming data, and to send any outgoing data. After an outbound packet is sent, the IOCompletion routine checks if there is any more data pending to be sent, and sends that if there is. If there is no more data waiting, it just returns.
The core game engine uses an event model. Each request (chat, move, examine, etc.) is received by the server and put into a master event queue in the order it was received. As the event is put in the queue, an event (synchronization object) is signalled which wakes up the processing thread (if it wasn't doing anything). There are CPUs + 1 processing threads so events can be processed in parallel as long as there are no dependencies between the two events. Contention between the CPUs is handled by locking regions (see next paragraph). After a thread is done with an event, it tries to get the next event and if there are no further events it waits on the event. Events are not just created by clients, they can be generated by other objects, and by timers. Event processing is usually a matter of (a) determining if the event is valid based on the world rules, (b) telling the user the event happened, and (c) telling the other users that the event happened.
The world is divided into rectangular regions. Each region in the demo game (if you try it) is 10 by 10 squares, and there are 16 regions in the demo. Object locking is done based on the region you are in, and the region lock is used to lock all the objects within that region. This means that to move within a region, you lock the region, move the player (or other object), and then unlock the region. This strategy allows multiple CPUs to move players around assuming that they are not all in one region ;-), which I figured was a pretty safe bet. Objects that a user picks up are children of another object and therefore ultimately owned by a region. I also have a lock that is used for objects that are not in a region. So when a user moves from square (a) to square (b), it can be conceptually kind of tricky to figure out what to do. Firstly you have to tell all the users that can see the user move that the user moved. You could just broadcast everyone's moves but that doesn't scale at all and generates unnecessary network traffic which would be really crappy over a 28.8k modem. Instead, I calculate a logical area that the user used to be in and the new area the user will be in, and do the logical union of those two areas, and only send the update to the users that are in the resulting area. I also take the dest area, subtract the source area, and send the user a list of new objects that have become visible. All this is complicated by the fact that areas can cross multiple regions. Like graphics kernels, I use rectangles to represent the areas that the user can see. Chat is done in a similar way, but it is not nearly as complex as move.
I keep one big reuseable array for objects in the world. Each object gets a handle which is simply comprised of an index into the array and a version number. The version number is used to distinguish between an object which may have been destroyed/deleted and a new object which has filled it's place in the array. The fact that handles contain an index into the array helps makes looking up objects from handles very quick.
I keep a static array for regions since you can't add/remove regions on the fly. Each region owns the objects in that region (a double array of pointer to object). Regions also keep track of generators which will fire periodically and repopulate items in a region when the number of items falls below a certain threshold (as configured in the editor).
I use a thread as a timer for regeneration of items in the world. The thread wakes every 1s and I use a delta-queue to figure out if there is something to do; if not, I go back to sleep again, if there is, then I submit a timer event to the master event queue. A request for timer events can be registered for by any object or any region.
I have one abstract class that handles all objects (players, trees, money, weapons, etc.). The code for a player object is part of the core server, but the code for everything else lives in a DLL that is loaded when the server starts up. At startup, the server creates a list of all objects that could be instantiated on the server and a pointer to the DLL that would need to be used to instantiate each object. When any event happens, an object has a chance to react to that event, or in many cases, veto (for example pick an object up) that event.
All in all, this is a very mean server. Totally overkill given that at most I'll probably only have one person playing at a time, but I've done performance test simulations of 400 users and my dual PP180 was barely hitting 10% on each CPU. I discovered that Win95 only allows you to create 95 sockets during this test... ;-) convenient number huh? Another reason to buy NT if you're doing serious development work.
Protocol I orignially started this project with an RPC based protocol. I switched to conneciton oriented tcp/ip sockets because RPC has no notification mechanism (well you can ask the server for the next event and just block on the server, but it's kind of tough to delete the user object while they made an RPC into the server...).
Next I used a binary tcp/ip based protocol. Used this for a while until I started learning about internet protocols (which are usually text based). I wanted to learn more about the difficulty in writing parsers for internet protocols, so I re-did my protocol "IETF" style (ie. pure text). It's less efficient, but it does have the benefit that when I add a parameter, I can often get away without having to recompile the client or server. If you want to check out the protocol, here it is. At some time, maybe I will submit it to the IETF, but I've got plenty of real IETF work to do, so I probably won't do it until later.
Ok, how do I play it?
There are three ways to play the game. (1) An ActiveX control, (2) A Java Applet, (3) A Win32 application. To play the game, click on the link below.
If you're interested in checking out the server software or the editor, here are links to those:
AI Wars server (1.5Mb) (Requires
Windows NT 4.0 + SP2 and IIS)
AI Wars editor (3.1Mb) (Requires Windows
'95 or Windows NT 4.0)
So computer gaming is a serious hobby of mine. I started out descirbing what I thought of each game, but that wasn't too effective since I didn't keep it up-to-date. I'm going to try just giving a brief rating of each game as I play it. My criterion is that an excellent game should hold my interest for a long time.
I couldn't stop playing this for a month at least. I also played
this at least once/week for 4 months.
I couldn't stop playing this for a week at least. I occasionally
still play this.
I played this over a weekend and then stopped.
I played this a couple of hours and got bored.
I wished my local software store had a return policy.
| Game | Company | Rating | Comments |
|---|---|---|---|
| Starcraft - Broodwars | Blizzard | The new units are still very balanced. | |
| Half-life | Valve | Realistic to the point of being scary. Network play is kick-ass. | |
| Populus - the beginning | Bullfrog | Very fun single player. In network play, the priest is just too powerful. | |
| Railroad Tycoon II | PopTop | Fun remake of the classic game. Network play is broken. | |
| Deadlock II | Sierra | Pretty boring. Network play is broken. | |
| Hereitc II | Activision | Very entertaining, especially with network play with your firends. | |
| Dune 2000 | Westwood | The UI is looking pretty old after playing red alert. Internet play is very slow. | |
| Buccaneer | Downright boring, bad UI. | ||
| Imperialism | Activision | Very difficult if you pick any setting other than beginner. | |
| NetStorm | An online game, but unfair to beginner players since veterans can build more units than beginners. | ||
| Starcraft | Blizzard | Excellent all around. | |
| Star wars rebellion | Lucasarts | Pretty cool game, too bad it's not multiplayer. | |
| Stars! | Very complex; very long, big learning curve. | ||
| Tone rebellion | Different, and fun. Medium learning curve. | ||
| Blade runner | Westwood | Very entertaining. Replayability is not as good as I thought. | |
| Tomb raiders II | Need too much hand-eye coordination. | ||
| Quake II | Id | Violent, but cool scenery and puzzles. | |
| Jedi Knight | Lucas | Too much hand&eye coordination for me. There are some nice puzzles and some very cool scenery. | |
| XCom Apocolypse | New real-time mode is cool. | ||
| Fallout | Something different. Very well done. | ||
| Pax Imperia II | Good game. | ||
| Masters of Orion II | Good game, could use better multiplayer support. | ||
| Outpost II | Sierra | Cool game. I like the sticky-foam tank. | |
| Diablo | Blizzard | Awesome. Better replayability would be cool. | |
| War Inc. | IMagic | Unique mix of realtime and economics. | |
| Ages of Empires | Microsoft | Cool game. The priests are a little unbalanced at times. | |
| Red Alert | Westwood | Excellent game. | |
| Warcraft II | Blizzard | Excellent game. | |
| Heroes of Might&Magic | Good. Multiplayer could be better. | ||
| Crusader No Remorse | Origin | Violent, but good playability and puzzles are interesting. | |
| Capitalism | IMagic | Fun. Interesting economics simulator. Educational. | |
| Civilization II | Fun. Cool new units. | ||
| Wing Commander IV | Origin | Good video cut scenes. Some fighting scenes are pretty hard. | |
| Star Control 3 | Pretty fun. Path to finish game should be clearer. | ||
Watching movies is another serious hobby I have. I've finally started my ratings section. Let's see if I can keep it up-to-date.
| Movie | Rating | Comments |
|---|---|---|
| Star trek - Insurrection | Thoroughly enjoying. Good story. Lots more humorous moments. Good action scenes. Riker comes off very reckless during a battle scene. Troy's character continues to become more likeable. They finally made Data's incomprehension of humans humorous. | |
| Dark City | Kind of strange. Aliens search for the line between cerebral process and human nature. It's unclear how knowing the difference will help the aliens though. | |
| Gatica | Thought provoking. The technology depicted in the movie is not very far away. Also makes you wonder about the impact of cloning. | |
| Blade | Very violent, but an original story, and the action scenes are pretty cool. | |
| Avengers | Considering the cast, disappointing. The film was focused on style rather than story. They could have done so much more with a good plot. | |
| Armageddon | Although technically unrealistic at times, it was action packed and thoroughly entertaining. Tear jerker. | |
| Tomorrow Never Dies | Great action scenes. The female kung-fu agent seems out of character for a bond movie. The bad guys somehow just don't come off quite as despicable as those in GoldenEye. The plot also doesn't seem all that believable. | |
| GoldenEye | My favorite bond movie of all time. Non-stop action. Bond doesn't wrinkle his clothes. The bad guys are totally evil to the core. |
I like driving fast cars. I only wish that fast cars weren't so expensive.
Ok, now there are various car clubs that let you drive regular street cars fast on a race-track with the focus on learning how to drive better. I like these days a lot. Here's a list of all of such days in the pacific northwest that I know about:
At every opportunity I am given, I test drive cars. Thought I'd rate them, although it's hard for me to keep track of what a car was like when comparing purposes, so my ratings are a little fuzzy. One trend I have noticed is that cars have definitely getting better over the years (or maybe it's just that nobody would let me try the cool ones when I was younger). The cars are ordered in the order I tried them.
I am one with the road; when I press the gas pedal down all the
way, it frightens me.
I can feel the road, I can go fast, but there is no fear.
Very nice sporty car.
Ok sporty car, or very nice car but
slow.
Either very slow and boat-like, or it fishtails when I use the
brakes.
| Car | Rating | Hp | Comments |
|---|---|---|---|
| 2000 Mercedes E55 | 360 | Smoothness, speed and luxury all in one. | |
| 1991 Ferrari Testarosa | 360 | Takes a while to warm up, no power steering, nice handling, good accel. | |
| 2000 BMW M5 | 400 | Good accel, fly-by-wire throttle is a little abrupt, brakes are touchy. Nice steering. Leans in corners. | |
| 2000 Mercedes S500 | 305 | Very comfortable, leans a lot in corners. | |
| 1998 Mercedes ML320 | 210 | Nice car, very comfortable, perf is ok. | |
| 1997 Honda Prelude VTEC | 200 | Very nice engine, good handling, good brakes. | |
| 1997 Dodge Viper GTS | 450 | Very fast, good brakes, good handling, a lot of body vibration. | |
| 1997 BMW M3A | 240 | Fast, very good brakes, very good handling, the auto trans is amazing. | |
| 1996 Porsche 911 turbo | 400 | Exceptional in every way. The best handling car I've every driven. | |
| 1995 BMW M3 | 240 | Fast, very good brakes, very good handling. | |
| 1994 BMW 325i | 189 | Quick, good brakes, good handling. | |
| 1993 RX7 Twin Turbo - R1 | 255 | Very fast, very good brakes, very good handling. | |
| 1993 Supra Twin Turbo | 320 | Very fast, good brakes, very good handling. | |
| 1993 Mitsubishi 3000GT - VR4 | 300 | Fast, good brakes, very good handling. | |
| 1993 Camaro Z28 | 275 | Very fast, very bad brakes, hard to keep it in it's lane. | |
| 1991 Lexus LS400 | 250 | Fast, good brakes, fair handling. | |
| 1991 Subaru Legacy Wagon LS | 135 | Slow, good brakes, good handling. | |
| 1989 Corolla DX | ? | Moderate speed, ok brakes, ok handling. | |
| 1988 RX7 Single Turbo | 195 | Fast, very good brakes, good handling. | |
| 1988 Camry Wagon LE | 120 | Slow, ok brakes, good handling. | |
| 1986 RX7 | ? | Quick, good brakes, good handling. | |
| 1985 Ford Escort | ? | Slow, ok brakes, ok handling. | |
| 1983 Volvo DL | ? | Slow, good brakes, good handling. | |
| 1970 Ford Maverick | ? | Moderate speed, very bad brakes, very bad handling. |
You need Internet Explorer to see her site. If you and are interested in web authoring techniques, or you're interested in teaching or looking up your Chinese horoscope, check out her site.
Go to the start page for dun.org.
![]()