Brad Wardell's Blog


Turn 2,733

Published on Sunday, December 12, 2010 By Brad Wardell In Elemental Dev Journals

image

As part of Elemental: War of Magic’s v1.1 stability testing, we play through thousands of turns in order to see what sorts of stability things we might run into.

The most common things we’ve been addressing include:

(1) Good old fashioned access violations. These have largely been the result of functions that aren’t “thread safe”. Elemental v1.1 is very multithreaded. If you have a multicore machine, you’ll be able to really see this, especially late game.  v1.0 of the game was more like traditional PC games where the the AI, economic engine, garbage collection and graphics all run in the same thread. In order to make the kinds of AI improvements we wanted to make, we needed the AI to run in the background so it could have more time to make more sophisticated strategies.  However, that means the AI and the main game are often “touching” the same bits of data.  So this has been a major focus of work.

(2) Critical Section conflicts. This is where one thread is trying to touch a piece of code that is being reserved by thread B but thread B is prevented from going further because thread A has reserved some part it needs. The result is a “deadlock”.

(3) Memory.  Does memory leak? This was a real issue during the beta and in v1.0 because many of the APIs we were using were relatively new and some of the video drivers were not releasing the textures. Thus, we would have to work around these things. That’s why some people never ran into memory issues and others did.  In v1.1 this has largely been resolved except for the case when the game itself is simply using a LOT of memory (not from leaking but simply because it’s a big map with lots of stuff going on and the map is largely uncovered.  This will be something we’ll optimize further in v1.2 (future update) with level of detail tweaks.

In the game I’m playing, after a couple thousand turns here’s where I’m at:

image

So what’s been happening?

image

Elemental, 842 years after the Cataclysm.

They’ve managed to eliminate each other with only 3 powers left. There’s quite a road network going on.

Makes you wonder what the AI, left to its own devices, will end up with.

image

The city of Anisirk has a population of 2,680 people.

image

This one army has a combat rating that is over 6,000. Armed with Lord Hammers they’re incredibly powerful.

image

On defense, however, you can see that the AI can still get a lot better in designing units.

image

Gilden has become quite impressive.

Elemental in the year 842 AC

image

Altar has dragons.

These are all cities built by the AI.

On the plane

Published on Monday, December 6, 2010 By Brad Wardell In Elemental Dev Journals

Hi guys,  I’m on the plane heading to San Fran for various meetings on various things.  Anyway, we’re pretty happy with how the latest beta of 1.1 is working out. From here on out, we’re focusing on stability. More new features will come in for 1.2.

Sales of Elemental have been..unusual.  For the first day, Elemental was our top launch in company history. Then the infamous PC Gamer UK article came out and sales went to nearly zilch.  Since then, it’s picked up. Dramatically.  It has resulted in us not being able to project its future revenue because traditionally sales maximize in the first 30 days and then go down.  In Elemental’s case, sales (at retail especially) increased in October and further in November.  Word of mouth matters. 

The good is is that means Elemental has been able to stay at retail at full price.  Now, anyone who buys Elemental before the end of this year can still get the first expansion pack for free which is a pretty good deal.

The AI in v1.1 is much better than in v1.0 largely due to the threading of it which has enabled us to put in a lot of new algorithms that we couldn’t have realistically put into 1.0 otherwise you’d be waiting several seconds between turns which isn’t acceptable.

This week, Kael and the team are trying to get the game ready for v1.1.  The demo version probably won’t make it out until January due to marketing considerations (late December is a very bad time to put out a demo because coverage would be sparce).  But we’ll be putting up videos and such so people can see how much has changed.

Last night, the AI beat me for the first time on Normal. Now, if I was really focusing on it I could have totally won. But it’s a good sign that the AI has gotten a lot better and the strategic part of the game.  That said, I’d still rate the AI at being around a 4/10 (GalCiv II’s AI being a 7/10).  I am hoping to really get going on the diplomatic AI over the Christmas “break”.  If there are any diplomatic features you guys would like, feel free to chime in.

When Stardock shuts down for Christmas, I’ll be available quite a bit on irc.stardock.com #elemental to hang out, chat, and hear your ideas.  This is your game.

Next year, we’ll be bringing in an expert to help us begin the transition of our general engine to being a true modding engine.  We’ll be talking about that more in the future.

I also want to emphasize how much we enjoy hanging out with you guys on the forums.  Truth be told, the community of Elemental is really amazing.  Seriously, check out our forums and look at how people are.  It’s a great experience for all involved and we thank you for that. Your continued support and ideas fuel our motivation to keep making the game better and better.

P.S. I love free airplane WiFi.

Almost…there

Published on Thursday, December 2, 2010 By Brad Wardell In Elemental Dev Journals

They’re currently working on staging the new beta build for the upcoming Elemental:War of Magic v1.1.  If you’re not into test builds, definitely stick with the official release build.

For this week, Kael and team focused largely on stability and performance but there were some significant game mechanic changes as well that should make the game play with a much better…hard to describe but a much better pacing.

I finally got to spend quality time with the AI.  That’s the whole point of working on games for me. Having Kael in charge of the project has allowed me to focus on the parts I’m specialized on so I’m hoping you guys notice some significant improvements in this beta build in the way the AI plays the game.  Over the coming months and years it’ll just keep getting better at playing the game.

We have some huge (like things that will make some big news) announcements coming up in the next few weeks regarding Elemental.  I realize that when games are released that’s usually the beginning of the end of their work.  For us, the release was just the beginning.

As a reminder, anyone who purchases Elemental before December 31 can still get the first expansion pack for free.  I talked today with Random House and our music composer about new story elements and music for that. It’s going to be pretty exciting.

I hope you guys are excited about what’s coming. We’re having a blast working on the game and interacting with the community with their ideas and suggestions.  And we hope you like what we’re about to update.  It should be quite a more more stable and faster. Fingers crossed.

Installing Windows Live Essentials

Published on Thursday, December 2, 2010 By Brad Wardell In Personal Computing

Well I’m taking the plunge and installing Windows Live Essentials.  I’ve been a big fan of Windows Live but as has been the tendency with Microsoft these past few years, they let Live die on the vine a little bit and I found myself migrating to Google apps more and more.

What Microsoft needs to do is relearn what made them so successful in the first place: Commitment.  Microsoft was notorious for sticking with things until they got it right.  Now, heh, even I don’t worry about Microsoft “stealing” ideas from us because I’m confident we’ll outlast them. Some exec there will get promoted or transferred or retire and the project will just fade away.

AI Test: December 1 – running blog…

Published on Wednesday, December 1, 2010 By Brad Wardell In Elemental Dev Journals

Developer Journal on new AI capabilities for Elemental: War of Magic v1.1

World Difficulty: Normal

Map: Tiny

All players (10 opponents) have “normal” intelligence instead of Pariden

Goal: Elimination of all AI players as quickly as possible.

imageI just find that funny.

If you guys see anything wrong with the strategy I employ, let me know.

Early Game:

Build town, recruited a couple NPCs, sent sovereign out to gather goodies.

Observation: Need more choices in what to build early on.

First rule in this game: Any sovereign I can kill, I will kill.

Ok, Verga by himself can take out Relias and friends…

Ack, at war with a lot of players now thinking I was going to steamroll.

image I still haven’t figured out why that sort of thing happens.  It shouldn’t.

Building a pioneer. (Winter, 166 AC)

image

image What? No love at first sight?

Built “Toad Ville” near an ancient temple.

Ok, AI sovereign is stuck.   Need to make them intelligently learn to teleport out.  Let’s see how this works..

image

Fixing a deadlock I caused… Grr.

Ok, deadlock fixed.

Grr. It is really really hard to nail down what the battlerank should be.  I thought I had Verga but nope. He killed my whole group.

Going to try doing it via tactical (loading a saved game to try it again to see).

imageShould be easy…right?

 

image

Well crap, Magnar came after me!

image

This isn’t going well.

image

I really hate Verga.

GOT HIM!

I KILLED VERGA!

Magnar’s forces have come for me.

This could go either way.

image

Heh.

imageWith Magnar thrown back, I’m in a much better position.

Magnar is still a threat but my capital (and last city) is no longer in immediate danger.

Building up again.

Need more war music, emailing Mason.

Getting low on candy.

Next…

 

 

I am starting to gain momentum.

image

Pariden shows up.

 

Okay, it’s almost midnight. Time to check in my changes and head home.

..updating…

Highlights of AI work in pictures

Published on Monday, November 29, 2010 By Brad Wardell In Elemental Dev Journals

I’ve spent the better part of last week working on the Elemental AI.  Without going into too much detail, here are some notes of what has been done and what needs to be done still.

image

Starting out playing as Relias for the Altar.

image image

image

image 

One of the things I noticed when I was playing was that after awhile, the monsters become simply fodder for experience and gold. The low level ones just don’t keep up.  So I made it so that intelligent monsters (like bandits) will tend to tame/combine up with other monsters into bigger and bigger groups as the game goes on (basically as they find each other).

This resulted in a problem in the game I’m having..

image

Monsters can and WILL attack and destroy settlements if they think they can do it and if they are lead by an intelligent monster.

image

And so MY participation in the game came to an end.

But the AIs could still play each other…

Year: 170 AC

image image

Turn 184 AC (around 60 turns later)

image image

By the year 222 AC, the world is claimed:

image image

 

So let’s see what they’ve been doing…

image

It’s a lot better than it was but it has a long way to go too. Now, I’m playing with the AI on “normal”. 

Admittedly, I did get killed but if I hadn’t gotten killed, I would have been able to wipe them out.

Magic AI

Published on Sunday, November 28, 2010 By Brad Wardell In Elemental Dev Journals

image

As I’ve mentioned in previous blogs, I don’t like game design. I like to mod other people’s games much more.  That’s what got me into game development in the first place, the love of modding or taking other people’s concepts in a different direction.

It’s probably one of the reasons I enjoy debugging so much (and hence, multithreading is so fun for me to work on).

One of the areas I desperately want to improve the computer players on has to do with spell casting.  Ideally, I’d like it all data driven in XML and then tweaked with Python.  But in the nearer term, I just want to make the computer players play Elemental extremely well. And that means, looking at the kinds of things that the computer players can easily access:

image

There are a lot of interesting APIs available to the AI to look at spells.  But like Cypher in “The Matrix”, I prefer to look at all the data at once and see what strikes me as useful.

I know, as a human that Arcane Weaponry is useful. But what kinds of things can I access in this spell that will indicate that it’s useful to the AI and how it might best be used?

As you’ve probably gathered, there’s a lot of subjectivity involved. An author bias.  As I get better at the game, read the forums, etc. I can incorporate these experiences into biasing the AI in certain directions.