The best kittens, technology, and video games blog in the world.

Saturday, February 16, 2013

Crusader Kings 2 review

Rude? by Tjflex2 from flickr (CC-NC-ND)

So after playing Europa Universalis 3 Divine Wind a lot (my review - part 1, part 2) I decided to give Crusader Kings 2 a chance. So far my impressions are not as positive as they were with EU3.

CK2 is not a strategy game

First - CK2 is not a strategy game. It's an RPG with some fairly minor strategy element. It is actually far more of an RPG than most of the so called "RPG" games which are usually just shooters with some rudimentary XP and levelling system.

RPG parts of CK2 are pretty interesting. Managing relationships between characters, building dynasties, plotting to kill anybody you don't like, handling various events (in ways depending on your character's traits) is unusually deep and complicated. Some events like the chain with framed cook's wife leave quite an impression.

Strategy elements on the other hand - not so much. Battles in spite of fancy interface are pretty much "bigger army wins", and leave much less room for tactical manoeuvring which in EU3 made it possible to defeat much stronger foes and was so satisfying.

Wars and CBs are even worse. You can only push claims to a single county in a war, no matter how many claims you have, getting claims is mostly completely random, wars can stop at random if a ruler on either side dies, you can't protect your allies in any way (EU3 had warnings, guarantees, sphere of influence and alliance CB - all made it possible to join a war to defend your allies), and I've even had one of my allies surrender completely when our war score was over +40%.

One minor aspect that I really enjoyed was how I could actually control my vassal's armies. That was badly missing in EU3, since vassals (and allies) always acted as uncoordinated retards. Hopefully EU4 keeps that, at least as an option.

Succession mechanics are horrible

Pretty much every time your ruler dies your realm breaks down completely, and you have to spend a lot of time fighting both your disloyal vassals and (in case of gavelkind succession) any siblings you had.

Speaking of which - gavelkind succession is really horribly implemented. Let's say I'm a king of Poland, have duchies of Lesser Poland and Masovia (with most of the counties), and have 3 sons. I'd like my oldest son to inherit all of that - and fortunately wars against pagans are coming so there will be plenty of new counties and duchies to give away.

What I should be able to do is create duchies of Lithuania and Prussia in newly conquered territories - give them to my two younger sons, and have my oldest son inherit Lesser Poland and Masovia. But the game won't let me do it! Instead I have three equally awful options.
  • I can keep everything until I die, then I get massive penalties for both demesne limit and duchy count limit. It seems in older versions of CK2 demesne limit was set somewhere reasonable, in 1.09 it's just ridiculously low.
  • I can give my younger sons new duchies, but that won't remove them from inheritance of lands I'm not giving away, so my oldest son won't be getting anything.
  • I can give my oldest son some of the lands I want to keep - let's say Masovia and Prussia, while keeping Lesser Poland and Lithuania. Then hopefully he'll inherit Lesser Poland, my younger sons will share Lithuania, and then once he's a king he can give away Prussia to one of his brothers. This has a minor issue that the younger brothers will fight since duke of Prussia will have lands in Lithuania - and a much bigger issue that once he gets any lands he starts behaving like a idiot and ruining his and his children's stats.
To make it worse I can't even give any lands exceeding ridiculously low demesne limit to my underage family members and hold them temporarily as a regent until they come of age while keeping them at my court so I can educate them and arrange their marriages the way I like.

Now I'm sure there's a lot of gamey ways to deal with all that - making younger sons bishops, assassinating them and so on, and it seems like people are routinely using them, and I'm fine with going gamey in a strategy game (my favourite game of all time is Magic: the Gathering and nothing is as gamey as Magic), but that's horribly immersion-breaking in an RPG game!

There are some minor issues that conflict with my sense of immersion like not being able to revoke all titles of a rebellious vassal and just banish him (well, without a massive penalty), to freely arrange marriages between vassals in my realm, or to plot against anyone I want, but they are easier to live with that succession failure (and demesne size).

Nothing is explained anywhere

CK2 is a very complicated game, probably even more so than EU3, and tutorials for both are nearly nonexistent.

The huge difference is that EU3 has a really good wiki explaining things, but nothing like that exists for CK2. Wikis like this one are not ever 1/10 of EU3 wiki's size, and explain pretty much nothing. Explanations people give on forums are contradictory (some of the things might have been changed in patches)

Pretty much the only way to learn the game is to watch a lot of Let's Plays on Youtube, or to just play blindly until you get what's happening (except everybody on Youtube seems to play with about two times higher demesne limit somehow, seriously WTF?).

Hopefully at least that will improve with time.

Reactive gameplay

A strategy game needs to include a mix of actively planning and doing things, and reacting to events happening to you (randomly or due to AI actions).

Most strategy games are very far on active end of the spectrum - if you want you can just sit there and relax and nothing bad will happen. And when you want things to happen, you'll be the one setting everything in motion.

CK2 goes all the way into the other direction. There's very little you can do to further your goals, most of the times things will be happening to you, and mostly at random not due to AI's plans. The challenge seems to be mostly in surviving all the events game throws at you.

This isn't necessarily a bad thing, but I feel they went a bit too far and there should be somewhat more room for actively planning strategy. But then maybe there are such ways, the game simply never explains anything so I missed them all.

Interface

This is one area I have nothing but praise for. The interface is a big improvement over EU3, and hopefully EU4's interface will be as good as CK2. There are a few things I missed like CBs page in ledger (claims page is not quite the same thing), but overall I've been very happy about it.

Quality of graphics also improved a lot since EU3, and sound effects are much more enjoyable. Or perhaps too much exposure to EU3's sound effects made me enjoy them a lot less. I don't remember having any complaints about them in the first few campaigns.

Summary

CK2 looks like it has a lot of interesting ideas, but too many things about it feel just wrong, and some of the best things like the updated interface will hopefully be present in EU4 as well.

In the meantime I'm more inclined to look into EU3 mods like Death&Taxes rather than going deeper into CK2.

As far as I can tell, there doesn't seem to be many mods for CK2 fixing issues that annoy me the most, but hopefully someday someone will made the mods and document things on some wiki so I'll be able to give it another try.

PS - Ruler Designer DLC


I've taken a look at ruler designer DLC, and it seems it only allows making new rulers, not editing existing ones - and you lose all dynastic connections, marriage alliances and so on. It also seems that you'll get some really awful rulers - stats of starting 24 year old king of Poland (who's pretty good, but not amazing) would make him 118 years old in ruler designer, and that without even counting loss of marriage alliance, and inheritance from your brother duke of Masovia.

I know you can go all gamey and take excommunicated (lift on day 1 for a bit of gold), wounded/depressed/stressed (plus whatever else randomly heals on its own within a few years) and various other traits and trait combination that are probably not as bad as they are marked (lustful + homosexual) to bring your age down, but option to edit existing rulers would be nice.

One potentially great feature of the ruler designer is starting as heretic, so you get CBs against pretty much everyone, but I don't know how well that would work in practice.

Thursday, January 31, 2013

Europa Universalis 3 Divine Wind second impressions

NYC - Brooklyn - Prospect Park Zoo: Discovery Trail - Red Panda by wallyg from flickr (CC-NC-ND)

Over a month ago I wrote first impressions review of EU3 Divine Wind. Since then I've played it a lot more, and did a tiny bit of modding, so here's an update.

Modding is easy!

First, modding is ridiculously easy. Pretty much everything is a just a bunch of text files.

To get started you just need to make a simple mod skeleton, copy over defines.txt and any other files you want to tweak, and just edit some data.

New values you're trying don't necessarily have to result in a "better" game, it being different from one campaign to the next can be very interesting.

Some things like giving everybody a lot more diplomats, or making basic buildings not get destroyed when province changes ownership are fairly easy to do. Unfortunately "fixing" infamy or providing faster mission cancelation option for particularly stupid missions seems like a lot of work, if it's even fully possible.

The game is full of bugs

So far I had two different save game corruption bugs - and since save games are plain text files (something very rarely seen in any game ever) I managed to fix them both manually. The first was achievement exponential growth making save games double in size each time, the second was some kind of string escaping problem that added a lot of crap in the middle of save file - and interestingly moving back to last good save the problem would still reappear in a month or two.

In addition to these serious bugs there are countless things in the game that don't work like expected, or in a sane way - for instance just a few game-years ago when my vassal was sieging a province held by rebels and I sent some spies to bribe defenders away, my spies were detected and of course that screw my relationships with my vassals.

There's even more things which might or might not be bugs, but in any case work in completely undocumented ways - I still have no idea why my relationships with other countries go down (usually) for no apparent reason at random times. It's amazing since the game openly provides such huge piles of data and algorithms, and still manages to surprise every single time.

Even when things work as designed, it's really hard to know what's the design unless you alt-tab to a browser with EU3 wiki. The tutorials and in-game explanations are so bad as if they were nonexistent, but after a few games you figure things out on your own.

There is no balance

Some games make a serious attempt at balancing things - I doubt they even bothered with EU3. There are so many broken things you can do, like become Holy Roman Emperor, establish Baltic or Black Sea tolls, seize Rome/Jerusalem/Mecca, establish land route to Africa or India and so on.

These things tend to be game-breakingly good, but then if the prize wasn't great what would be the point putting major effort into such goals?

Exploits

There are quite a few fun mild exploits I recommend trying.

Start multiple wars at once. Sadly the casus belli system makes it unprofitable to get anything out of countries that joined existing wars, but there's an easy workaround - save 5 diplomats, then stars 5 wars on the same day with each member of the alliance! A massive 5-way Crusade against Ottomans/Saruhan/Candar/Kardamon/Ramazan can net you 10+ provinces and up to 5 annexations at 1 infamy each.

War goals against leader sometimes work against alliance members. If you declare war against a country and it loses war leader status, you have no casus belli against anybody except that country. But if other countries join as minor parties your war goals often still apply! So declaring a Holy War against Muslim country, you still get 1 infamy/province even for taking provinces from their Christian allies. It's quite useful against Bosnia and Serbia early game. It's not as good as multiple war technique, since you'll rarely be able to afford taking more than 4-5 provinces in peace talks per war and you won't be able to annex anyone.

Bait ships in port with 1-ship blockade. AI is somewhat competent at land warfare when it has compact country like France or Burgundy, since it's pretty much impossible to screw that up. Naval warfare on the other hand - it's just amazingly bad at. If you want to sink some ships that happen to be in port, just move your entire fleet one province away and leave one ship blockading their port. AI will invariably sail out of the port to attack that ship, then your fleet returns to sink them.

Baiting fleets before blockades are invented. Similar technique works even before blockades - if your land army is crossing a narrow strait, AI can't resist trying to stop it, even if that crossing is fairly irrelevant to its goals. Of course your superior fleet is just one province away, waiting for them.

Naval patrols. That's not as exploitative, but useful when you have massive naval superiority, but don't want to micromanage. Just set your whole navy to go in circles (set route with some shift-clicks, select start patrol) - for example around eastern Mediterranean when you're fighting assorted Muslim minors. AI will see that your ships sailed away and will leave port even when it has no reason to, then it won't get back in time when your patrol reappears.

Land route to Africa or India. This is a surprising game mechanic, but can be extremely powerful. Provinces are counted as "overseas" when they're on another continent (somehow "continent" boundaries are not quite geographic), or when there is unbroken land route of actual control (not ownership) from your capital to the province. This makes is extremely powerful for European power to control land route to Africa or India, since then they count for far more money and manpower. You lose some special abilities of "overseas" provinces like colonialism casus belli, ability to culture shift with one colonist etc., but since what matters is actual control not ownership you could temporarily make these provinces "overseas" again by letting rebels take one of key provinces on your land route.

Breaking alliances. Do you want to attack your ally's ally? First, attack a third country and get your ally into your war on your side. Then attack your target. Since they're in existing war on your side, they can't take the victim's side in the new war, so their alliance will break. It's pretty damn useful if you get alliance with the Holy Roman Emperor, get them into a silly war on your side, then you're free to attack anybody in the empire at flimsiest CB and they won't intervene.

In other words - it's an awesome game to play, and an awesome game to mod!

Wednesday, January 30, 2013

Medieval 2 Total War Concentrated Vanilla 0.61

Jumping after each other on mom! by Tambako the Jaguar from flickr (CC-ND)

Since 0.60 release I fixed a lot of minor bugs, and added a bunch of minor enhancements to the mod builder (big thanks to everyone who tested and reported the bugs, especially Guimbix).

There aren't any huge features, but enough minor fixes accumulated that I feel it's good time for an official release.

One feature that got added is File > Generate Map TGA command you can run after building the mod to see how campaign map looks without launching the game, and trying a different random seed if you don't like this one.  The map file is saved to output/political_map.tga

And one more thing - if you're using old versions of retail Medieval 2, make sure it's updated to 1.3 or the mod won't work. (you're also saving yourself a ton of bugs this way)

Fixed bugs and minor improvement

  • start.bat pauses with "Press any key to continue" after running the script, so you can read error message if it fails, usually due to JRuby not being installed properly.
  • Campaign map heigh map level 0 changed to 1, fixing many campaign map glitches
  • Belgrade's resources (timber vs wood and missing comma) fixed
  • Floods disabled completely due to being buggy in vanilla
  • Simplified building tree option works now
  • Clustering% fixed to mean that (it accidentally meant random%, reverse of what it was supposed to)
  • Mod builder now extracts map information from TGAs at run time, instead of using preprocessed data. (so it's easier to port it to alternative maps, even if it's not yet there)
  • When allocating the last few settlements, clustering is often impossible. Before the update algorithm tried to look at neighbours-of-neighbours, then just picked a random settlements. Now it goes quite deep searching for not too distant settlement.
  • There's a switch for "allocating rebels last" if you need even more clustering than you get by default. This often causes rebels to be pushed to borders of the map, so only use this if really necessary.
  • Various help texts and error messages improved.

Credits and links

Concentrated Vanilla 0.61 includes some files from Medieval 2 Total War game by Creative Assembly, and the following minimods:
  • Sinuhet's Battle Mechanics
  • Lusted's Better BAI/CAI
  • Agart's Cities/Castles Strat
Download link.

If you're interested in how this mod evolved, posts about previous versions (with links inside):

Tuesday, January 22, 2013

Gatecrash Sealed Simulator

Rude? by Tjflex2 from flickr (CC-NC-ND)

Continuing the grand tradition I made Sealed Simulator for Gatecrash, which you can use to practice before the weekend Prerelease.

Here's Gatecrash Sealed Simulator.

Or if you want to play with older sets:
The simulator works in a way identical to RTR simulator. Strangely we had 4 single-set Limited formats in a row - I don't think that ever happened before, or is all that likely to happen anytime soon.

The one for Dragon's Maze will need to change since it will be a three-set format. And then presumably two more single-set formats.

Any feedback welcome.

Good luck on the Prerelease and may the best Crocodile Frog win!

Saturday, December 15, 2012

Europa Universalis 3 Divine Wind review


Getting your head above the parapet... by law_keven from flickr (CC-SA)

Over the last couple of weeks I've been playing Europa Universalis 3. A lot.

You could vaguely compare it to Total War games, but without battles, and with a lot more complex and deeper campaign mode. There's an obvious idea of mixing Total War style battles with EU3 style campaign, but EU3 is extremely complex and would probably be inaccessible to most casual players, and it would be far too easy, since any half-competent human player can crush AI in Total War battles even with significantly smaller armies.

So here's my list of issues with EU3, since do I ever do things in my reviews other than complain?

Infamy and Stability

These two numbers are the main way game controls pacing of the campaign and prevents one country from just conquering the world right away.

You gain 4 infamy for each annexed territory and 4 extra for annexing whole country, and with really good reason you can get it to as low as 1 infamy per territory (like in a holy war). You also gain 4 infamy for forcing defeated enemy to become your vassal, and then 1 infamy per territory for annexing them later (but you also lose 1 stability, and all your other vassals strongly dislike you, so it's not that easy either). Your infamy can get pretty high before everybody gangs up to beat you, so it's not an immediate problem, but it takes forever to go down.

Stability has smaller scale of -3 to +3, and if you start a war without casus belli (-2), or against someone you have dynastic ties to (-1), or break truce (-5), or annex your vassal or country you're in personal union with (-1), or change domestic policy (anything from -1 to all the way down), it will make your stability hurt. Stability matters right away since it drastically increases revolt risk and lowers your income. It is relatively fast for small countries to recover, but extremely slow and expensive for big empires.

These two numbers mostly work well, but they often lead to extremely frustrating situations.

Annexing provinces which are core provinces of your country currently under someone else's control can cost 0 infamy, but only under some narrow circumstances - otherwise it's full 4 infamy penalty per province. I feel that's one thing which really needs fixing - even if you get only a partial discount without the right casus belli.

If you're attacked, then as defender you get to annex attacker's provinces at only 3 infamy each, but it doesn't always work, and for many defensive wars it's still full 4.

And generally any discounts you have only apply to your primary target - never to its allies, even if identical conditions apply to them as well (like reconquesting your core provinces, or holy war).

The game could really tweak these mechanics to reduce number of frustrating moments.

Or it could provide more ways to reduce your infamy. One thing I feel should really burn some is forcing others to release countries. That should be at least 1 infamy per released nation, or maybe even as much as 1 per released province + 1 extra for each released nation - and perhaps even a bit for forcing nations to free their vassals, but that might be getting too far.

Or there could be some decisions that you could use to convert prestige to infamy reduction at some steep rates. There are too many ways you can gain prestige (which maxes out at 100 anyway) - and there's little you can use it for other than expanding your sphere of influence, for some minor diplomatic bonuses. If annual infamy reduction used your total diplomacy (ruler skill + size of your sphere of influence), not just your ruler skill, that would be a really great prestige sink.

Agents

You get some number of agents - diplomats, merchants, missionaries, colonists, spies, and magistrates. I don't have many issues with most of them - except diplomats are always in extremely short supply if you try to do anything interesting.

Seriously, diplomats should either be completely unlimited, or at least massively more plentiful. The way it is now, it's hard to do anything interesting when not at war, so you just sit there waiting for a diplomat to come while chasing rebels around the map.

It wouldn't lead to much abuse, since all diplomatic actions have some kind of associated cost - converting your diplomat to a general or admiral costs ton of money and army/naval tradition, while any diplomatic mission has limit of one a month per target country, and you get relations penalty if your proposal is refused.

So mostly not having enough diplomats is just annoying.

Peace talks

After any war there are peace talks, where some of war's gains can become legitimate and permanent, while others revert to pre-war situation.

This of course, leads to some extremely annoying moments. First - only country which took a province can annex it - if any of your allies did so, you're screwed. Oh, you can force them to release that province, but you take the infamy hit, while they get the province.

And you cannot annex the country, unless you personally took every single one of their provinces. If you took 3 of 4 but your ally took the last one - screw you - no annexing for you for the next 5 years.

There have been far too many times when I wished my allies would just make a separate peace treaty and exit the war - either annexing that damn province they took, or releasing it so I can retake it myself, but they never felt like it.

Random missions and events

There are two things driving the game forward. First, there are your own goals, like uniting some particular country, defeating some nearby enemy, becoming the Holy Roman Emperor, or whatever you want.

Second - there are randomly generated missions and events. And very often these are the only thing moving the game forward. If you don't like a mission, you can cancel it for -5 prestige hit, but then you won't be able to cancel again for 5 more years.

I really wish it was possible to cancel mission more often, even while paying full prestige penalty. A lot of missions are either pretty much undoable - for example while playing as Burgundy with five coastal provinces, and fleet already over support limit, I was asked to "make larger fleet than England" - there's pretty much no way in hell to do so. Or to completely screw my standing in the empire by either attacking one of electors (who even happened to be my ally with royal ties and currently voting for me), or annexing some vassal on whom I don't have proper cores.

Or missions could be possible but they would take ridiculously long time. I had to convert Tangiers to Catholicism as Portugal, or convert all of Spain as Castille. This is all doable, but missionaries have low chance of success per year (like 5%/year), and there's no way to speed them up. So do you cancel the mission right away, or wait on average 20 years, or possibly a lot longer - Tangiers never converted in my entire over 100 years campaign.

The most annoying of all are missions requiring you to go to war with someone you just entered a truce, or even worse - you're already at war. Since your current war has wrong casus belli for the mission, you can either do what mission demands (annex something or vassalize them etc.) for a huge infamy hit - or finish current war, wait 5 years, and only then start a new one properly. Even assuming nothing will get you into another war with them in the meantime.

Quick fixes

Fortunately there are ways around this. First, there's lovely console where you can fix most of these issues.

For infinite diplomats, just use diplomat command - something I've been doing all the time anyway. You can also do that to other agent types, but I very rarely felt the need, other than when I was trying to figure out the mechanics.

You can also change infamy and stability this way - by commands like stability +3, infamy -8, etc. This gets quite solidly into cheating territory, but then if your choice is between infamy -20 and quitting the campaign out of frustration, go for it.

For stupid missions the easiest way is to edit save game file and delete the mission. Save file is a neatly formatted YAML-like text file - imagine that in this century - and it's super-easy to edit with any text editor.

Of course then you'll very often just get other stupid missions, so maybe the right fix is just add larger collection of sensible missions to the game, or tweak them so they are more appropriate.

I haven't been able to find even a very cheaty way of kicking an ally of territory the occupy, but that's probably just a matter of save game editing too.

Slow fixes

The game looks amazingly moddable - everything is just a bunch of text files with very little bullshit, so many of the issues I have I could probably solve by just writing a minimod - the same way I did with Medieval 2 Total War, Empire Total War (I never really released that one) etc.

Or maybe such minimod already exists somewhere. The game even has options for tweaking some settings - like making merchants cost 0 money, making colonists 4x faster etc. (both probably good ideas), but unfortunately not the ones I want.

If I ever get to do anything like that, I'll let you know.

Thursday, November 29, 2012

Make your own Medieval 2 mod, with blackjack, and random campaigns!

I'm as biased about it as it ever gets, but I'm pretty sure this is one of the most awesome things that happened to Total War modding ever.

Here's what in the release:

  • Concentrated Vanilla minimod - essentially vanilla with a ton of minor fixes and enchantments for more dynamic gameplay.
  • A program you can use to easily make your own minimod, customizing your gaming experience in many ways.
  • Random campaign system, allowing every single campaign you play to be completely different.

Pics or didn't happen

For some nice campaign maps, go here, here, and especially here.

Here are some screenshots of just some of the things you can customize:




Installation

This is first public release of the mod builder, so it wasn't extensively tested. You might have problems with any of these steps - in such case just contact me.

  • Install JRuby. Download link.
  • Install 7zip. Download link. (in case you don't have 7zip or another unpacker for .7z archives)
  • Download mod builder and unpack itDownload link.
  • Start mod builder by double-clicking start.bat. You should see GUI like one in screenshots above.
  • Customize in any way you want. If you want random scenarios, be sure to tick "Enable random scenarios" checkbox.
  • There are two presets you can choose with File > Open. "Default" preset is Concentrated Vanilla minimod. "Minimal" preset is almost vanilla Medieval 2 Grand Campaign. You can then customize them any way you want from either of these starting points, including enabling random scenarios for both.
  • Build your mod. It's as simple as using File > Build command. If there are any errors, you'll see them in a separate window. (if so, screenshot and send to me if you need help)
  • Install your mod. If your game installation was detected correctly, File > Install command will install the mod.
  • Run your mod [Retail version]. If you use retail (or cracked) version, use File > Run command, or double click concentrated_vanilla.bat file in your game directory.
  • Run your mod [Steam version]. If you use Steam version with builtin launcher, start Kingdoms (not Medieval 2) from your Steam Library, then select Concentrated Vanilla from launcher's menu. This is least tested way. If in doubt, try to get retail version.

Troubleshooting

In case of trouble, screenshot whatever errors you see and send it straight to me.

If installer doesn't work, try running it as administrator.

If builder can't find your (retail) game installation, copy and paste all files from output directory to your game directory, then run concentrated_vanilla.bat from your game directory.

Support for Steam launcher is extremely experimental, and I just finished it moments ago, so if it crashes, just provide me the best information you can and I'll try to figure it out. For some reason starting launcher as "Medieval 2" rather than "Kingdoms" invariably results in a crash on my computer. (even though the mod actually uses Medieval 2 not Kingdoms engine).

Saving your work

You can save your settings with "File > Save", but format of that file is not guaranteed to be compatible across upgrades. For now it probably won't be.

Random seeds should result in the same map as long as you use the same version of the mod builder, and identical scenario settings. Different machine, or different settings for anything else are not meant to affect it, but no guarantees. In the future in would be nice to make random seeds shareable like in Minecraft.

Using Install command will overwrite previously installed version of Concentrated Vanilla. It won't touch your saved games.

Using Uninstall command will uninstall Concentrated Vanilla, but will not touch your saved games.

Limitations

This is early release so it has many limitations. Just some of them:
  • Only Concentrated Vanilla map is supported (which has 7 extra regions over vanilla map). In the future vanilla map, and possibly other maps will also be selectable. Each map requires a bit of support code for random scenario builder. If you have any map you want supported, send me all the files, and I'll try to include it in a future release.
  • Mod builder is somewhat fragile and hasn't been extensively stress tested. Unusual combinations of options might not work. Error reporting is currently minimal. If you find any errors screenshot errors, email me with as much information as you can.
  • Scenario builder doesn't have any interface for ton of features it can do programatically. Features like leaving pope in Rome while shuffling everybody else around, adjusting city sizes randomly, or adjusting regions' religions to match ruling factions - and many others - would be fairly straightforward except for lack of interface. If there's any particular feature you want to see, just contact me.
  • Only features I needed for Concentrated Vanilla are available in the mod builder GUI. I'm sure ton of other automated changes could be added. If you have any needs, contact me and I'll see what I can do.
  • Medieval 2 engine can only run one mod at a time, but mod builder can add minimods to mod you're building. Currently only 3 such minimods are included. If you want your minimod included, contact me right away. (I especially need better CAI mod).
  • Installer, especially for Steam launcher, is only minimally tested (and only on English 64-bit Windows 7).
  • In principle this kind of customization system can work with Rome, or any existing mod. It would require some porting effort, but if there's significant interest, I don't see why not.
  • A lot of people requested hotseat campaign mod. This would require switching the mod from medieval 2 engine to Kingdoms' retrofit mod as a base. It will probably happen someday, since Kingdoms gives us access to a bunch of extra features.
Good modding, and have fun.

Credits and links

Concentrated Vanilla 0.60 includes some files from Medieval 2 Total War game by Creative Assembly, and the following minimods:
  • Sinuhet's Battle Mechanics
  • Lusted's Better BAI/CAI
  • Agart's Cities/Castles Strat
Download link.

If you're interested in how this mod evolved, posts about previous versions (with links inside):

Easy Windows registry editing with JRuby


DSCF0434 by rabbit57i from flickr (CC-NC-ND)

Like all people who came out of Unix tradition I approached Windows registry as something not to be touched even with a long stick, but it turned out not to be that bad.

The first thing you need to know about Windows registry is that it has multiple roots. All our viewing and editing will apply to particular key only (usually HKEY_LOCAL_MACHINE).

It looks like a pretty stupid decision, but then it comes from people who use C: D: etc. instead of single directory tree.

  require "win32/registry"
  def hklm
    Win32::Registry::HKEY_LOCAL_MACHINE
  end
Reading information from registry, like installation paths of various programs, is very easy:

  hklm.open('SOFTWARE\Wow6432Node\SEGA\Medieval II Total War')["AppPath"] rescue nil
  hklm.open('SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 4700')["InstallLocation"] rescue nil
If you want nil instead of exception just rescue nil the entire thing.

Writing to registry is very easy as well, here's actual example:

    cv = hklm.create('SOFTWARE\Wow6432Node\SEGA\Medieval II Total War\Mods\Unofficial\Concentrated Vanilla')
    cv["Author"]="Tomasz Wegrzanowski"
    cv["ConfigFile"]="concentrated_vanilla.cfg"
    cv["DisplayName"]="Concentrated Vanilla"
    cv["FullName"]="Concentrated Vanilla"
    cv["Language"]="english"
    cv["Path"]="mods/concentrated_vanilla"
    cv["Version"]="0.60"
    cv["GameExe"]="medieval2.exe"
And deleting things to uninstall:

    hklm.delete_key('SOFTWARE\Wow6432Node\SEGA\Medieval II Total War\Mods\Unofficial\Concentrated Vanilla', true)

And that's about it. If you want to explore the registry either start regedit program, or start jirb and play with it from JRuby REPL.

Tuesday, November 27, 2012

JRuby Swing GUIs with cheri gem

PocketMew by Sin Amigos from flickr (CC-BY)


I am not in any way a fan of desktop GUI toolkits - HTML5 and jQuery totally spoiled me, so I resisted for a very long time making GUIs for my Total War tools - and happily enough, other people would sometimes make them for me.

But this time I decided to make a desktop GUI, in JRuby, and that means one of the awful non-HTML toolkits.

So my first idea was of course making a big window with a menu calling some functions, and big embedded HTML form with all stuff in HTML. I was even getting somewhere since Java Swing has HTML widget, but then it turned out it's HTML 3.2 only, no Javascript whatsoever, and serious pain to get data into and out of it.

I also tried SWT, and hoped danlucraft's cookbook would help me get somewhere with it, but I couldn't figure out most of the things I wanted to try, so I kept looking.

Finally I found this lovely cheri gem, which didn't seem to such too hard. I've heard mostly horrible things about Swing API, but it was only as bad as the rumor says, at least for my simple use case.


I'll put all that code for public view eventually, but it's pretty massive, so here are just some tips for working with Swing and cheri.

Basic window creation

Start a class and include Cheri::Swing module. What you probably want to match HTML-ish behaviour is actually not a single layout manager but GridBagLayout (for actual layout) within ScrollPane (so you get scrollbars when content).

That's the code:


class ConcentratedVanillaBuilder
  include Cheri::Swing

  def initialize
    @controls = {}
    @frame = swing.frame('Concentrated Vanilla builder'){ |frm|
      size 800, 800
      default_close_operation :EXIT_ON_CLOSE
      build_menu!
      scroll_pane {
        panel {
          grid_bag_layout
          grid_table {
            background :WHITE
            build_form!
          }
        }
      }
    }
    load_settings! load_settings_file("settings/default.txt")
    @frame.visible = true
  end
end

This initialization is pretty generic (other than trivial matters of default window size and title), other than four italicized lines.

Separate form buildings from settings


That's advice for GUIs that simply configure some settings and then run some script. You want to keep your settings in a nice Hash, and don't mix GUI code with settings defaults.

So what you want are helper methods like these:
  def checkbox(name, description)
    grid_row{
      @controls["checkbox-#{name}"] = swing.check_box description, :a => :w, :gridwidth => 3
    }
  end

And then use methods on @controls[something] to both get and set various fields. That's far easier than ton of on_change callbacks or whatever is their Swing equivalent.

Use text_area not label for labels


Label widgets are pretty dumb, and non-editable text areas can handle things like multiline text and formatting a lot better.

Just add some helper methods and pretend you're coding HTML:

  def div_helpmsg(msg)
    grid_row{
      text_area(:a => :w, :gridwidth => 3){
        editable false
        text msg.gsub(/^\s+/, "")
      }
    }
  end

  def h1(msg)
    font = java.awt.Font.new('Dialog', java.awt.Font::BOLD, 24)
    grid_row{
      text_area(:a => :w, :gridwidth => 3){
        set_font font
        editable false
        text msg
      }
    }
  end
If things get too complicated, you can always go for full HTML widgets.

Result

Half-finished result looks something like this. Not amazing, but it will do the trick.

It will get released sometime soon, and then you'll be able to play random scenarios everybody's waiting for.

By the way if any Java / JRuby experts has better ideas, go ahead. Googling was unusually unhelpful to me here, and IRC and StackOverflow were as useless as they always are.

Sunday, November 25, 2012

Yu-Gi-Oh! - first impressions

dj sugar by Apogee Photography from flickr (CC-NC-ND)

I'm back from Hyper Japan and one of the things I've done there was a demonstration game of Yu-Gi-Oh! I had no idea what the game is about, other than the thing Magic: the Gathering players make fun of.

They gave away free demonstration deck and one booster.  I am going to open them right now as I'm writing this post, and describe my impressions.

Just a reminder - I have no idea what I'm talking about. This is a first impression post. I'm posting this without even checking Wikipedia, so hilarious misunderstandings are very likely to ensue.

Demonstration Deck


It's 20 cards. Surely you must play "real" Yu-Gi-Oh! with more than that right?

There are 12 monster cards, 3 spells, and 5 traps.

They have types in upper right corder and different colored borders. For spells and traps there seems to be 1-to-1 correspondence between frame colors and card types.

For monsters the symbol says dark/earth/light, but frame color seems to be unrelated to it. It seems that one color is for vanilla creatures, other for non-vanilla creatures. I bet there are more types, just like with Pokemon.

There don't seem to be any rarity indicators, no idea yet if it's also true for cards from the booster.

Art is pretty crappy, and there are no artist attributions. It's probably drawn by Chinese prisoners or something like that.

One thing I really like about it is very high numbers it uses. First card has attack 2500, defense 1200. I thought they're all multiplies of 100, but there's another with Attack 450, defense 600.

Magic really suffers a lot from not being able to use fractional numbers for power, toughness, life, mana and so on. The chasm between 2 and 3 is just too vast, and forcing Thragtusk to have toughness 3 while every single first striker in Standard has power 2 at best is part of the problem with current meta. If Thragtusk had toughness 2.5, and at least some of these first strikers had power 2.5 - it would have been a very different story. Or if Snapcaster had only power 1.5. Now fractions look silly, but if Magic started alpha with all numbers x10 (or otherwise wider scale), it would have saved itself a ton of problem.

Here's contents of demonstration deck:

  • Summoned Skull
  • Dark Blade
  • Sabersaurus
  • Gene-Warped Warwolf (yes, that's exactly what it says)
  • Man-Eater Bug
  • Hayabusa Knight
  • The Fiend Megacyber
  • Marauding Captain
  • Exiled Force
  • Des Koala (featuring literally a koala, meanwhile Magic creative is too much serious business to get even one squirrel...)
  • Majestic Mech-Ohka
  • The Calculator (I so fucking hate cards with "the" in name, like The Mimeoplasm, nothing about card names get me more annoyed than "the Something" cards)
  • Fissure
  • Upstart Goblin
  • The Warrior Returning Alive
  • Mask of Weakness
  • Secret Barrel
  • Threatening Roar
  • Rising Energy
  • No Entry!
I really hope it all sounds less ridiculous in Japanese.

Oh, and three more things come to mind:
  • Does Yu-Gi-Oh! have anything like magiccards.info (or even its crappier official equivalent Gatherer - which I'm not going to link to because it sucks too much)?
  • Does it have anything remotely like Comprehensive Rules? I've noticed a few people with real decks play, and it seemed pretty thoughtless as well, but then this wasn't exactly a high level tournament.
  • Templating on Yu-Gi-Oh! cards sucks so hard. I'm a huge fan of legalistic precision of modern Magic templating. What I see here reminds me of alpha's "let's vaguely describe what it does" templating style. But then if Yu-Gi-Oh! is so much simpler than Magic, maybe that's enough.

Booster

Now I'm going to open "Return of the Duelist" 1st edition booster.

It says that it includes 9 cards, and full set is 48 commons, 20 rares, 14 super rares, 10 ultra rares, and 8 secret rares. I already hate the fuckers. Mythic rarity was such a massive mistake for Magic - and the main reason they gave was "every other card game has more than 3 rarities, so we'll introduce mythics to force players to buy more boosters".

Anyway, opening now.

First, art quality is a lot better. Madolche Chouxvalier and Madolche Lesson are adorably chibi, instead of crappy shonen dark bleh.

For some reason Madolche Couxvalier has foil label. The rest of the card is nonfoil. Does it have something to do with rarity?  My prediction that there will be more types than Dark/Light/Earth so far isn't working.

Judging from text of cards, they are parasitic as hell. Just these 9 cards refer to "Madolche", "Xyz", "Spellbook", "Machine-type", "Chronomaly" cards - and how many are just from this particular set? Magic managed to avoid this parasitic design, mostly.

For reference, the cards:
  • Madolche Chouxvalier
  • Amores of Prophecy
  • Damage Mage
  • Chronomaly Mayan Machine
  • Madolche Lesson
  • Lucky Punch
  • Chronomaly Pyramid Eye Tablet
  • Generation Force
  • Spellbook of Power
tl;dr I'll stay with Magic.

PS. Kakigori is delicious.

How to make a good random maps for Medieval 2 Total War

Some news about Medieval 2 random scenario generator I wrote about yesterday.

Today I fixed most of the known bugs in scenario builder (except AI passivity, which would require playing an actual campaign to figure out), and I was looking at JRuby options for a simple GUI so everybody can enjoy scenario builder, and customize their Concentrated Vanilla experience any way they want - including simply turning all options off and playing vanilla with bugfixes and random scenarios if that's your thing.

Sadly making GUIs looks like a lot more work than expected. I got so used to the happy universe of HTML5 and jQuery on frontend with Ruby on Rails on backend that my first contact with Java GUI libraries was like hitting a wall. I'll figure something out eventually - in the worst case I'll just make the script start web browser and present you the mod customization form in browser window.

Anyway, scenario builder.

How to make good random maps


Assigning settlements completely at random means a few fun campaigns, but it confuses AI too much, and doesn't really lead to much strategic gameplay since whoever you just attacked probably can't respond since all their other settlements are in completely different part of the map.

So my next idea was % cluster / % random allocation, but there are many things I don't like about it. Here are some ways how cluster algorithm fails them, while random allocation worked reasonably:

  • 5 settlements have no neighbours and 6 have only one. Cluster allocator assigns most of them to rebels.
  • There are some false neighbours like Dongola / Benghazi, Tripoli / Timbuktu, Arguin / Marrakesh - they are next to each other on a map but you'd need to move through unpassable desert.
  • Since factions were allocated in order, factions late on the list were most likely to get scattered settlements.
  • Very often huge areas are all rebel, while there are no rebels in other places. On 67% cluster map there are no rebels in Spain, France, and Germany, but there's a massive 11-region rebel cluster in Anatolia and Balkans, and second 7-region cluster on South/East Baltic Sea coast. This is not due to algorithm since rebels just got whatever was left. Random chance will lead to some clusters, but rebel clustering is far too strong.

So I tried many things like:

  • Allocating settlements to different factions in random order, one at a time.
  • Allocating settlements to rebels first rather than last (without clustering), or one at a time as if they were normal faction (except without clustering) 
  • Making rebels not take settlements with 0/1 regions if possible, so factions would get them instead.
  • Using XY distance between cities instead of map neighbourhood, or some combination of both.
Eventually after looking at countless maps for far too long, the following algorithm seems to work best:
  • Fully at random, allocate one settlement to each faction, and all rebel settlements.,
  • Then allocate other settlements in random order. Some % will be neighbours of existing settlements, the rest will be random.
  • If there are no neighbours available since all have been allocated to other factions, try neighbours-of-neighbours instead.
  • If neighbours-of-neighbours still doesn't work, just do random allocation. (because of this % in this post are much higher than in previous post - you actually get significant random allocation because no other is possible)
  • Neighbours of a settlement are 5 geographically closest settlements. Then we add arrows back, but only if they are geographically connected. This seems to work best. 
And now the maps. Muslim/Orthodox factions get 3+d6 regions, Catholics get 1+d6 regions, rebels get whatever's left.

Each with 10 different random seeds - for ton of maps.

100% clustering (only random when forced)












80% clustering












70% clustering












Next steps

So much map porn for today. The next step is making some kind of interface so people can run this without going into command line and/or editing code.

Testers very much welcome. If you want to play some random map soon, and don't mind possible technical difficulties, contact me ahead.

Also, if anybody knows how to run a mod on Steam version of Medieval 2 without going through massive pain (the way it works on retail and pirate versions), definitely tell me. I've heard rumors there is a way, but I've never seen anything reasonable.

By the way since maps will be mostly clustered, I'll probably move distance to capital penalty somewhat higher than it was on fully random map.

I've also been asked about hotseat mode. As far as I understand, this would require switching from Medieval 2 engine to Kingdoms engine with retrofit mod as base. I'll probably do that some day, but for the time being the mod will most likely stay a single player only thing.