Monday, November 24, 2014

Writing a computer game

Alpha Centauri (SMAC) is one of my favorites. Been playing it since it came out, in 1999. Brilliant game. Complex in a lot of ways. Not perfect, there are some small flaws, but they're small. PC Gamer gave it their highest-ever score ranking (98, not matched by Skyrim, HL2, etc).

Been out of print for years. GOG carries it for Win/Mac, which is great. But eventually even that won't be good enough.

So I'm writing a clone of sorts.

A better-looking clone. Probably a simpler clone--there are a lot of things in SMAC that I have never had to use or understand. Granted, I have never played online against others, and maybe those things are more important in that case.

The level of detail that went into the tech/research-tree, and all the other little details about what can/can't be done when/where by what, just marvelous.

Customizable in so many ways. Largely irrelevant was my experience. I don't know how many times I've played through. This is a really long game (like playing Monopoly all the way through to the solo end), it can take 100-200 hours each time, so my play-through count isn't huge, probably a dozen or so.

I'm going to snarf most of the details, leave out some things that seem like unnecessary complexity.

Already I have a better-looking opening screen/menu sequence, and I've begun creating the classes in Java for it. As Java, it has to be OO, which I suspect the original was not...I have a terrain generator of sorts, but I'm not happy with it yet. Still thinking about how-to details for various aspects.

As Java, it will run on just about any platform that runs a complete Java JSE+Swing, incl Linux, but probably NOT any JME.

I'll try to do some 3D GUI stuff. That's a retirement project, to create such a thing.

I hate Java

I've been programming in Java for over 15 years.

I'm very good at it.

And I still hate it. (Writing below refers to Java 6; newer Java may have solved part of this issue)

Cases in point:

1) Iteration. The inconsistencies about how you do this are endlessly aggravating. There should be ONE SINGLE WAY to iterate. And that means ONE SINGLE WAY to create something to iterate over, when it's not something that already has an obvious iteration sequence.

Sometimes you have a List-behaving group. Sometimes you don't. Either way, I should NOT have to be remembering "ah, for *this* particular thing I have to loop over a Vector, for this one it's an array, this time I get an enumeration, this one is an iterator, etc"

Code examples:

File[] files = new File("some-folder/").listFiles();

Enumeration keys = new Hashtable().keys();

Collection values = new Hashtable().values();
Iterator iter = values.iterator();

Vector xx = new Vector();
for (String yy:xx) { whatever(yy); } //this works fine

for (String fname:new File("some-folder").listFiles()) { something(fname); } // nope, can't do this

2) Lengths of various things.

new File("some-folder/").length

new Vector().size();

Enumeration keys = new Hashtable().keys(); //what? there IS NO WAY to get the length? GGGGAAAAHHHH!!!!


3) Apply a function/method to the elements of a sequence. No such animal.

I'd like to be able to do something like this:

 for (String fname:Apply(FindMethodNamed("xyz"), new File("some-folder").listFiles(), Vector) { something(fname); }

-----------------------------------

I used to program in Lisp, starting 30 years ago. Lisp is beautiful. So clean in comparison. I was twice as good.

need the length of something that could be a list/sequence? (size X

need to do that "Apply" thing above?

(map #'(lambda(obj) (filename-name obj)) (list-files "some-folder/"))

Well, really, you would probably not even do that anyway. There wouldn't be a reason, if you were just going to iterate over the list of files.

(dolist (file (list-files "some-folder/")) (do-something (filename-name file)))

Hmm. Was that that function called list-directory? Been long enough that I misremember.

Rumor is that Java 8 finally has something like this. 8. Rumor was that Java 7 was going to have it. But most of it is a foreign concept for Java. Functions? Functions not tied to a class? Anonymous functions? "Lambda" functions? I haven't been to look, as I have a restriction at work to using Java 6 still (not that I wouldn't like to move forward, but I don't control the circumstances; it was supposed to have changed by now, but personnel turnover in IT have not helped).


Java is a language hacked together by a committee that never met to discuss things like consistency. Damn amateurs.


Granted, when I started with Lisp, it was almost 30 years old, and these issues were long gone, and the formal standard of Common Lisp had just hit the streets. And that was designed by a committee. A committee that "met" many times over some years, and had themselves many years, or decades, of background in various dialects of Lisp. And even then version one isn't quite perfect...for one thing, the Object System isn't included (not because the reference implementation didn't exist, it did, I knew of it, but I hadn't touched it yet). Version two had that, and it was/is better than Java's. Did the Java creators learn from it? Not hardly. Java is C++ minus the really stupid things about C++ from the 80s (another amateur hack that didn't learn from others).

And here I am, I am now full-time a Java programmer. And after this many years, parts of it are still just as stupid as 20 years ago, and will not ever be getting better. And I won't be getting any better at it either.

Fortunately retirement is not that far off...and I still have a huge amount of personal programming to do after that.

Friday, November 14, 2014

The "Friend Zone" :)

This is an amusing read:

Top 10 reasons why...

My reaction (by the reason numbers):

1) Of course it's real. It's been around a long time, and now it formally has a name. (I think it used to be called "LJBF", but "FZ is better".)

OK, what IS the friend zone? It's when a woman you have some romantic interest in tells you "I've always thought of you as [just] a friend" -- which means that she DOES NOT and CANNOT see you as a romantic interest. When they say that to you, it is time to walk away. Take the ego hit and go. Permanently.Getting pushed into the "FZ" is a one-way trip.

2) You have only just so much time to spend on "the pursuit". You cannot afford to spend any on a woman who has "FZ'd" you. Not any. Move on. Be courteous if you bump into her, but you will never be seen as a romantic partner. (Alright, maybe it's not a statistical impossibility, but the probability is vanishingly small, don't waste time on it.)

3) Actually, it's a very subtle attack: what it really means is "please go away and don't be a stalker". She did not give you "the truth", because part of the truth involves words she doesn't want to say.

4) True enough, but since they can't say the words it really means, it's another self-deception on their part. You acted like one of her female friends, so that's how you got classified. Don't allow it.

5) What is a "nice guy" ? One who isn't going to hit her? Remember that they want some measure of excitement. Don't hit her, ever, but don't let her think you're a doormat. Either act like she's a romantic target or do not interact with her at all.

6) Have never done this. Well, not that I am aware of...I remember, well, let's go ahead and say "dumping" two girlfriends, but they were actual girlfriends I'd had sex with, not women who'd been interested but I ignored. That sort of thing could not happen to me. Why? I am not a guy who attracts women. At all. So there is no possible occurrence where I would FZ one, because there wouldn't be a circumstance where there would be one who had a romantic interest in me and she made the initial approach. So of course you can describe the hypothetical of "well what if one did?" but since that can't happen to me, I would be 100% incapable of recognizing it, and would be certain that there was some other meaning to the initial contact and would react accordingly. (My superpower was and still is being invisible to women :) )

7) Women don't complain about it because they are running a master class in self-deception, and that includes careful code-phrases like "It just didn't work out", which is much gentler on one's self than "he thought I was boring/unattractive".

8) As I am not any woman's "type" this doesn't even mean anything to me. It is true as written. (fwiw, I'd go with Zooey, (unless she was blond at the time, that just does not work for Zooey) but since nothing of the kind could happen, it still doesn't mean anything)

9) Correct as written. Move on. Immediately. Do not give her a second glance. It ain't happening.

10) Mostly right. You got rejected, in a way that allows her to pretend to herself that she didn't "reject" you. She still doesn't want to see you ever again, since what it means is that she doesn't think you are exciting or attractive.

------

The Friend Zone is a female thing. Women put you in it so as not to think about you as a romantic partner, and to avoid saying "I don't think you're attractive".

(Repeating from a recent prior blog wherein Ben Affleck was mentioned:)

Scenario: you're female, single, 27. You live by yourself (or with female roommates), in an apartment. There's a knock at the door. You answer, a guy is there, you've not met before. He says "come have dinner with me". What are the first words out of your mouth?

1) Get out of here you creep! (followed by slamming the door and locking it)
2) I've always thought of you as a friend.
3) Give me five minutes to change clothes. How dressed up should I look?

The answer to this is 100% based on how good-looking he is. If it's one of those dorks from Dumb and Dumber, you say #1. If it's Harold from the Accounting dept, you say #2. If it's (your pick) Ben Affleck or Benedict Cumberbatch, you say #3, after you pick your jaw up off the floor.


Variation: flip the sexes. You're male, single, 27. You live alone, of course. At the apartment, a knock comes on the door. You answer, it's a female, she says "come have dinner with me". What do you say?

1) Buzz off slut!
2) I'm unfortunately busy this evening.
3) Let me get my jacket.
4) Am I on Candid Camera?

The answer to this is 100% based on how good-looking she is. If she looks like Mama June, you either say #1 or just close the door and think wtf (followed by holding that beer bottle up to the light and wondering if there are some hallucinogenics in it and why you didn't hallucinate Lynda Carter)? If she looks like Amy from BBT you likely say #2 (unless it looks like she has good-sized tits, or it's Mayim and she looks like this). If she looks like Deepika, you say #3, regardless of whatever the hell else other circumstances exist (even if you're getting married tomorrow), you don't even need to change clothes, because no one is even going to see you other than to wonder who's that guy with Deepika?

No guy is going to say "I've always thought of you as just a friend".

(If you're me, there are only two phrases: "I'm sorry" and you close the door, or "I'm sorry, you've confused me with someone else" (and that is even if it's Deepika) because of course there's absolutely no way a female is going to come knock on my door).


So, another anecdote. (Anecdotes are not data.) Long ago, there was an exchange with an ex-gf:

(I forget the precise timing, it was after the break-up, but perhaps not long after)

Her: can we still be friends? Oh, wait, I forgot, you don't have female "friends".

Me: Your sarcasm is wasted. [I'll be polite, but I won't go any farther than that, if our paths cross again]

I don't know what she meant by "friends", as there weren't any circumstances that would cause us to be within a mile of each other again after that, and we wouldn't be talking on the phone (and this was long before email).

The amount of time I have to spend interacting with women must be focused on the romantic angle, I do not have time to be "friends". What does that even mean?



Another anecdote  (we'll see if I can even remember this completely, I think it was 1988):

Female cousin (age ~26) says to me: I'm in this singles group at church, it's a big group, and I never get asked out. (which I is guess basically the raison d'etre for a church singles group)

Me:Why don't YOU ask one of THEM? Can't hurt...

Weeks or months later...

Cousin: well, I tried that. I got told he didn't want to damage his friendship with {her ex-boyfriend} [so I hadn't known about that at all] [as though an ex-boyfriend would care even slightly].

Me: [probably something like:] Huh. wow. Well...

What was I going to tell her? The reality of that was: He didn't find you attractive enough. [True enough; at the time she was a bit overweight] Simple as that. I guarantee you that if she had looked like (let's pick a well-known actress at that specific time) Kathleen Turner in Body Heat (~same age as cousin in that movie) or Romancing the Stone, the guy she asked would have been more than willing to ignore anything else for her. (Of course this ignores the fact that if she looked like KT in Body Heat she'd have had to fight guys off with a stick just to get out to her car)

So that was a lie he told her to dodge giving the real answer: I don't find you attractive. (And of course I didn't say it either, wimping out to an extent, I couldn't see a good reason to do so.) Also note that he didn't say "I've always thought of you as a friend".

The other important lesson in that episode is that she learns just how hard it is for most of us to ask them out, the insecurity, the second-guessing in advance, the agonizing over whether today is the right day. I sure don't want to have to think about that again.

Thursday, October 09, 2014

How hard is it to find a date when you're female?

I'd have said "not at all"  but maybe I'm wrong...it always seemed like *I* was the one with difficulty...does it take an Advanced Degree (tm) to figure this out?

[sorry about the links having been wrong, I didn't realize Blogger was prepending the http part]

British glamour model Lucy Harrold apparently has trouble. Enough so that despite being on a UK "dating show" called "Take Me Out", and having adequate finances anyway, she created her own singles website to help solve this.

Seriously?

OK, I don't actually like the shape of her face, but certainly from the neck down is more than ok (although her tits are fake, eyebrows too)...I wouldn't have been interested...and of course she wouldn't be interested in me. But if she'd asked me (ok, the odds there are actually negative), I'd have sure had ONE date with her.

Is it that difficult for them?

So what is she looking for?


what are ANY of them looking for?

Brad Pitt, apparently. or Ben Affleck, it seems.

Excitement.

I did another blog on this a ways back...


Apparently Jennifer Lawrence has trouble finding a date, too. 

Seriously? OK, she's ridiculous famous, very attractive without it being ridiculous. She has a lot of money, fancy house...but no dates? Granted, under those circumstances you can't just casually meet people who aren't either sycophants or wanting something themselves, but it shouldn't be impossible. Of course who you DO meet is going to be other people who are in the same line of work and are likely to be more than a bit self-centered. So we're back to the question of "what does she want?"


Which was Freud's old question, too.


---


OK, anecdotes are not data, but we all have some anecdotes. Here's one:

http://www.huffingtonpost.com/xojane-/online-dating_b_5909274.html

She leads with the photo. I'm sure her friends say she's marvelous...but she leads with the photo, and you can tell what's going on. She's overweight. Precisely the thing your friends won't tell you. Of course she kinda knows, you really do always know when you're overweight, altho maybe you can't admit it to yourself. I know; I'm overweight right now, although down 10 from a year ago (I have a dog now; a dog for whom a "short walk" is minimum half a mile, 4X/day). "many ramen noodle dinners" she says, but obviously that hasn't helped, she's been putting too much bacon in them.  "What was turning them away? Was it my looks -- which was based on the best photos of me?" No, hon, it's the weight. And if it was those same photos, eew; I'd include a pic of me with my sailboat (Hobie 16) years 
ago (and mention that it was an old pic), at least that's something a bit more active.

Well. She has gotten to experience what most of us guys go through over and over: "the rejection thing". She certainly seems surprised. "after two months I had been rejected by countless numbers of men" -- aaawwww. Two whole months. I stopped after 10 years.

OK, so we're shallow. Sorry. Lose some weight. Several comments say this, followed by "her weight is fine" except that it's not. I guarantee that a 25-lb weight-loss would turn things around pretty quick for her. OK, maybe 40. (also: go read this, and look at the pics--WAY better than the two she showed for her article/"profiles"; which had that "desperate" sound to me, altho apparently she has clinical depression--that guarantees trouble here)

And as some of the comments suggest, she needs a better self-marketing pitch. It's not like going to Comicon, to a presentation on your fave comic, and know that everyone in the room has a common interest, so you can pick a guy whose looks you like, know he's nerdy and shy and talk...

another great comment: "not all girls want a ben affleck type."

Of course they do. What would they do if Ben Affleck showed up at their door and said "come have dinner with me" ? They sure wouldn't slam it in his face...it'd be more like "Give me 5 mins I need to change clothes first...how fancy?"

Actually, she needs a different approach. My best experience at her age was with a church singles group a cousin suggested I attend. That group had ~200 people attending, all roughly 22-32, and as I recall there was some couple there saying they were engaged at least once a month, maybe even once a week.

---

I'm sure you've heard the words about them having a hard time, because the easy way tended to attract the "wrong kind of guys". I argue that that really means they aren't attacking the problem pro-actively. 

Anecdote: One of my best friends met his wife at a bar. Yes, really. 1989. Been married since '90. That *can* be done, but you shouldn't expect it.

Being a nerd doesn't preclude success here, but it does argue for an alternate approach. You need to get involved in a group (or more than one) that has MOTOS and a specific focus you are interested in, and then actively participate.

The better looking you are the less difficult this is overall, so you have to be really honest with yourself about this, and deal with the fact that there's a correlation. 

for comparison: I'm about 15-20 pounds overweight. I'm tall, but no more than average looks. I'm "difficult", so few-to-none people like me. I'm now approaching 60, and retirement (see blogs on that topic). None of that is fatal, but it's not helpful. I forget who said this in a movie/tv-show, it was a early-teen male: "my superpower is being invisible to women" -- applies to me -- they can only see me for collision-avoidance purposes--and that's always been the case.

A few more little anecdotes (which still aren't data): 

Guy I knew at college ("K"). Civil Engineering. "K" was overweight when I knew him (280, I asked once).  That basically killed his having a date, despite his being one of the most likable people I've ever known. I think he had one date the entire 4 years, and that was because I suggested her to him. Something like 12 years out of college he meets a woman at the golf-pro shop where he plays golf. She does too. He's still the same shape, but with a lot less hair. She's about the same shape, too. They were married ~15 years; he died young, from cancer; one child.

Woman I knew very slightly at work 30 years ago: I only had a conversation with her a couple of times (let's say her name was "G"). Not attractive. A bit overweight. Pleasant enough, intelligent enough, knew how to dress...but the looks were a severe handicap. No dates. Eventually she gave up; I recall a little bit of conversation with another woman ("M", foreign born, distinctly more attractive, I sat next to her for 6 months) at work about it, because "M" told me that "G" had said she was done trying/hoping. (I hope "G" did ok with her life; "M" got married in 1989--almost coulda been to me.)

Woman I've known a while: bought herself a Jaguar convertible car in 2010. All of a sudden she was getting new attention from random men, because of the car.

Woman at work two years ago: stunningly attractive. Attractive enough to have to fight guys off with a club just to get to her car. I only talked to her 2-3 times ever; I know nothing of her social life, but she could have a dinner date with a new guy every single day for years if she wished.

Man. It's a wonder most of us ever get together.

Friday, August 29, 2014

Retirement

Late in 2013 my job situation was getting kinda weird. There was contracting funny-biz at work, on-again, off-again, on-again, off-again...yeesh.

By TG it looked ok again, contract re-awarded...but my tasking wasn't in it, apparently, and that started to go weird in Jan, on/off/on/off--bam! Not going to have a job on Feb 1. What to do?

And then for the first time ever, "Retirement" was now on the list of options. Not *quite* ready to do that (well, I  AM, but it ain't quite time, need to wait about 3 years).

Changed employers very abruptly, stayed in exactly the same job slot, that's good for about 2 years it looks like, so that's now the retirement planning horizon. There are a couple of circumstances whereby it might happen sooner, but I think they're unlikely.

Personally, I can hardly wait...man I'm tired of the rat race around here. Job is more interesting than it was six months ago, but I am getting hammered by this ridiculous database we are using (I've found two seg-fault-fatal crashes in in the last two months, and the indexing isn't anything like SotA speed [a few weeks later: now we have damaged data because deletes are problematic]), and that is getting tiresome (although my next task there will be to try to do a complete replacement for the indexes, Berkeley DB Java is ~4X faster, and I think that will do the job; the C version is probably twice that speed, but I don't know about a Java interface, and I dislike horsing around with JNI).

Got plenty to do when I do retire--enough to keep me busy until I die. Rereading my books is a minimum 10-year project. Working the model railroad runs forever. Computer games never end, programming never ends. Multitude of projects on The Ranch to do, several of which are engineering experiments.

That's all probably good for 30 years, at which point I'm probably getting a bit feeble, and probably ought to just go ahead and die anyway.

It can't start too soon!

Sunday, August 24, 2014

One last time playing Dungeon Siege

One of my favoritest games. I've been through it end to end probably six times, as all four specialties. Figured I'd do one last time, try something I've wondered about since the beginning.

At about the final merchant, there's a spell called "Bomb". You have to have Combat Level 60 to use it, and You can't reach level 60 until about that point, or maybe later (ok, that makes sense), but that's really only if you have one character do ALL the work, using ONLY Combat magic.

Otherwise, you pretty much can't reach level 60 at ANYTHING.

"Bomb" is "Explosive Powder" on steroids, about 3-4X the power. I'm very fond of Explosive Powder, but since it maxes out at 70 pts, it's mostly only useful for getting the attention of an opponent from a distance to separate it from a crowd, or do some special sniping. You'd want Bomb to do the same (which it appears to), but available sooner, like maybe level 45 or so--60 is close to useless, because it's almost the end of the game before you can use it.

Mostly what you want to do is have really good summons to help you. That's the most effective way to go, because their health is be 2-3X you team.

If you do melee players, you most want to have freeze weapons. That, combined with summons is great--your team is maybe 16 players, half have freeze weapons, which means opponents basically can't hit back while you just pound them.

Also interesting: why I didn't notice this before I do not know: when you have to fight Gresh, there are those bunch of stone columns that appear out of the ground. I thought you were locked into that little space with him, but apparently that's not true, you can run back between them where you came from, or off to the right where there are lots more opponents (not a good idea). First time through I could not complete this, had to run the cheat code for invincibility. But when you can retreat safely, it become reasonably easy...I had no idea, I thought it was a locked arena.

Thursday, March 20, 2014

Local weather. I hate snow.

When I was a kid I lived in cold places several times...one of them was Colorado. Right after that I lived in Hawai'i.

I like Hawai'i. I like that kind of weather.

Now I live in Virginia. Mostly this is ok.

So this year we got four feet of snow in my area.

FOUR FEET OF SNOW.

That is why I went to Texas out of college, as opposed to Syracuse.

I hate snow.

Wednesday, March 19, 2014

Divinity 2 game

I replayed most of Divine Divinity first, but gave up when I kinda got lost about what things needed doing next...

Well, D2 has somewhat the same issue...game is visually good, but it's got a large-ish flaw about managing your quests and the locations you have to go to to complete them. I repeatedly had to refer to online sources as to where things were. I liked the "flying fortresses" best of all, they reminded me of Oblivion gates.

Too often the combat devolves into a click-fest, however, and that is not something my hands are capable of on a large basis.

Getting to be the dragon was interesting, esp once I realized I had power-ups I could take, and that "fireball" was actually a homing missile.

I haven't finished, and probably won't. It's clear my attack finger is not up to the next battle I have to fight...

ash, well, I have plenty to do with DLC in Skyrim, and none of that is a major click-fest.

Wednesday, January 15, 2014

Dec/Jan gametime

A while ago, GOG (www.gog.com) offered Sid Meier's Alpha Centauri as a download. This was a favorite a while ago, so for $5 (or was it less?) that was an easy decision.

I'd forgotten how challenging SMAC could be...intellectually the hardest game I've played, because of the sheer range of variability it can have. It's a mostly 2D game.

There's a randomly generated world map; there's a pre-created standard one (actually, probably several). Maps can have several sizes, S/M/L/XL. They can have a variable amount of ocean surface. Land surface is random. There are seven skill/difficulty levels. There's an R&D tech tree, advances are mostly random. Your starting location on the map is random. Ground resources are random. Mobile units that you can create have near-infinite variability of designs that you choose if you wish.

There are seven playable factions; you play one of them, and they're fairly different, different strengths and weaknesses.

If you go with a large map and lots of ocean, the factions are (probably) on islands separated by a fair amount of water. This allows unfettered development with little or no conflict. Then success is based on how fast you expand how far.

Wow. Not easy at all. I had to relearn all the detail. I've only ever played as two factions, green (default) and white. And I've only played two skill levels (default and +1).

I need to try some of the other factions and harder skill levels, now that I've been through it again.

-----

A month ago I received a URL for something on Youtube...it was the opening sequence from Skyrim. You know the one, you're about to get your head chopped off, when all of a sudden, THE DRAGON appears overhead, and you escape in the confusion.

That's the normal situation.

This link was to a machinima of how someone made a game mod to change it. This designer happens to like trains, steam engines in particular, so he's made several mods involving them. There's a spell that rains trains from the sky--do that in town and pretty soon you're Public Enemy #1.

But this startup movie. He's replaced the dragons throughout the entire game with trains. So when you should be hearing the dragon roar, you actually get a train whistle.

But they are not just *any* trains. Oh no. These are special ones. Special KID trains.

Thomas the Tank Engine.

Yes, that first dragon is Thomas.

OMG that was just about the funniest thing I'd ever seen. Angry Thomas swoops down, breathes fire, perches on buildings and glares. Brilliant!