0.9.8.0 released

Anything else to do with MoM IME
Post Reply
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

0.9.8.0 released

Post by Implode »

Firstly, no Blake, I have not been hit by a bus :P I have rather been hit by my real life and my job making me insanely busy though. I have been trying to work on the AI and tweaking and playtesting it a great deal over the last month or so and, while it is not perfect (the AI does not for example understand how to load units into boats), it is at least to a respectable point where I felt it good enough to do a build and let others play around with it.

This has been a very long and painful road... very long post coming, so up to you if you read all this but wanted to explain what's been going on. Programming AIs in games is by far the most complicated part by far. Most AIs in games utterly suck, MoM being no exception as I'm sure everyone here is well aware (Ascendancy being another really awesome 4X game but completely ruined by the terrible AI). I'd started work on the overland AI several years ago, came up with a plan for how I thought it might work well, after a long effort had something workable and... it was so terrible. The AI wizards hardly did anything at all. I'd put so much effort into it and it was just terrible, and I had no clue how to fix it.

That made me leave the project alone for a while to get a breather and try to understand why. Also, I had a bigger problem. There was another game I worked on even before MoM, which I can't discuss in any great detail because its based on what's still a very active intellectual property, but given when I had worked on it, it was all in Delphi still and worked on peer-to-peer connections from back in the days where we actually had to take our PCs over to a friends house to play games together. Things then moved on, and all games started shifting to a hub-and-spokes model with servers on the internet hosting games, to avoid problems where players started to be behind routers and thus not have public IPs. I tried to convert it to a client/server model, and completely failed to grasp just what a huge paradigm shift this was, made a complete mess of it and ruined the project. And worse, this was before I'd learned about using source control systems at work so I only had sporadic backups with half the code being one version and half the code being another version and no complete backups of it before I wrecked it. But the one thing was, the AI in that game was brilliant. With no cheats (extra resources) whatsoever, it would quite often beat me. So when I'd based the MoM IME AI on it, and that turned out to be terrible, I couldn't understand what I'd done wrong.

But it also bothered me that I'd let me other favourite project sit wrecked for such a long time. I had to get it working again before the spotty backups of things I did have of it fell to dust. I had to understand why the AI in it worked so brilliantly but so terribly in MoM IME. So I started porting the entire thing into Java and client/server. Its not quite as big and complicated as MoM, but still that was no small task and taken me a few years. And in doing so, I got the answers I was looking for - I came to the conclusion that there was actually nothing particularly "good" about the AI in my other game and nothing particularly "bad" about the AI in MoM IME - the differences were fundamentally in the design of the game itself:
  • In MoM, you start off knowing nothing about the map, where enemy wizards are, or anything at all. You have to scout around to figure out where to go. In my other game, the terrain of the map is known to all players at the start, as well as the location of all objectives you need to try to capture. The AI immediately knows exactly where it should be going, so that's a lot simpler.
  • In MoM you tend to just work on the best unit you can possibly get, be that Great/Sky Drakes, pimped up longbowmen, amandantium hammerhands, or whatever you like, and just churn out tons of them. In my other game, that doesn't work at all. There are no "better" or "worse" units - every unit is good at one thing or another, and if you just buy one type of unit, you will do terribly. You need both scouting units, close combat units, ranged units, and so on - you need a mixture. The AI in that game literally picks which units to buy at random and that's one of things that makes it difficult to play against, as you never have any idea what units you're going to be facing.
  • In my other game, each unit is fundamentally of a particular type. A close combat unit is always a close combat unit. A long range attacker is always a long range attacker. So I wrote scripts for every unit in the game that the AI follows to work out what to do with that kind of unit. There are some piecemeal upgrades you can get to units, but they're minor and don't fundamentally change the nature of the unit, so the scripts don't change, and the AI knows how to play every time of unit. In MoM, one of the things we love about it is there's just so much freedom to come up with crazy things to try. A warship would have a script telling it to scout oceans for enemy boats and transport friendly units... until you cast flight on it. Even just a regular unit of swordsmen, if you stick it in a stack with the hero with wind walking, suddenly you need to play it completely differently. You just can't write AI scripts in MoM for each type of unit - it has to be able to classify units itself and assign the right AI script to each unit depending on the unit's capability at the time.
Realising all this, I still didn't really have a way forward, but started in the last few months to warm up to the idea of having another go at it. So did, and started picking through and debugging through the AI in a lot of detail, fixed several issues, kind of got it scouting around the map and building the right things, but it was still visibly really struggling. That's when I realised something else - it isn't wrong that its struggling - just none of the AI wizards get 11 book starts and picking 1 super useful rare spell at the start like Basilisk, Incarnation, Shadow Demons, or whatever else you like. Those 11 book strategies give the human player such a major head start. Actually one of my favourite setups to try in the original MoM is 3 life books, 3 chaos books, 3 nature books, 1 sorcery book + Node Mastery. If you can get off the ground, once you start taking a few nodes, your magic power goes through the roof (and to collect lots of spells, you have to attack wizards' capitals only... find a spell in the ruins, let them cast spell of return, take their new capital, and so on and so on.. you can eventually get almost all 40 spells in 3-4 realms of magic). But its hellishly difficult to begin with as you start with no decent spells and no decent units - and that's exactly what the AI is faced with so no wonder it is struggling so much. To counter this, I made a new difficulty setting of "recommended" where you get 10 spell picks instead of 11, so there's no more 11 book super starts to give human players a major boost, and it makes it much more challenging.

The other difficult decision I had was whether to let the AI "cheat", by getting bonuses to city growth, production and so on. I really didn't want to, because that's something people criticize about the original MoM AI. But the fact is without this, the AI was struggling so badly and boringly easy to beat. The AI is pretty good at deciding where to scout, which lairs it can attack, how big of a stack it needs to attack an enemy city (yours!), how much defence it needs to leave in its own cities - where it struggles is trying to decide the relative importance of all of these - do I sacrifice some defence to make a bigger unit stack to attack with? In the original MoM you see the AI players with hordes of units running around the map, and there's no way that's ever going to happen unless the AI gets some free advantages. So, I tried putting in exactly the same bonuses as in the original MoM (they're documented in the strategy guide) and now... the AI actually has hordes of units running around just like the original. I've been sat just trying to get my city production started, and he's already showing up with stacks of 6-8 units kicking my ass, and that's exactly what I wanted to see :D

A final note about Raiders. In the original MoM, raiders had their own custom rules about city sizes, units in garrison and so on. The raiders cities don't even "build" units - there's a formula about how often, how many, what experience level units the raiders cities just "spit out" without actually building them, and come and attack you. Much like rampaging monsters that just appear out of nodes and ruins. In MoM IME, the raiders are subject to the same economy as wizards - they're really just a wizard player who cannot cast spells. They have to actually build units, pay upkeep on units - to generate units with higher experience, they actually have to build a Fighters' Guild / War College, it doesn't just happen because of some formula. This makes them act a bit differently - in the last game I tested out, I saw it built Javelineers in a Lizardman city, and moved them to a Gnoll (I think) city, so when I attacked it there was a mixed race of defenders, so that was really cool to see. I have not yet actually seen Raiders build a settler and go make a new city, but that should happen too.

That raises some questions about how Raiders should work:
  • Should they get the same economy boosts that AI wizards do - currently I've said yes, because again I want to see hordes of raider units running all over the map making things difficult for me, and that's not going to happen if they build at normal rates. (A side effect of this is, much like in the original MoM when you capture a wizard city you often loot a big stack of gold coins - the raider cities in MoM IME now do this too because they are raking in insane amounts of coins).
  • Should the raiders player have to scout the map? In the original MoM I'm fairly certain they don't - you never see raider units just wandering around scouting - when there are raider units, they already know exactly where your city is and make a beeline for it. In MoM IME, I think it works better if raiders have to scout around the map to find you first just like AI wizards do.
Now I'll enjoy being able to take a break from working on the AI endlessly and work on a few different things for a while, like roads and properly handling when wizards get banished, and casting Spell of Return.

Also, sorry I am not on being more active on the forum. I just find it too distracting and time I'm on here is time I am not working on writing code and then I never get anywhere with it.
User avatar
Blake00
Posts: 34
Joined: Sun Nov 01, 2015 3:59 am
Location: Australia
Contact:

Re: 0.9.8.0 released

Post by Blake00 »

OH MY GOD!!! He's back!!! He wasn't hit by a bus!!! and we have AI!!! this is amazing!!!!

I'll have to spread the word in the MoM forums and social media groups so you can get some of the feedback you're after! :)

I can't wait to try this.. super excited!!

Oh and it might help if you put a link to the new release mate hahaha!!

People can get it from the MoM-IME Sourceforge page here:
https://sourceforge.net/projects/momime/files/

Oh and do you want people to post bugs and feedback here on this forum or lodge tickets over on the sourceforge page?

.
Last edited by Blake00 on Mon Jun 01, 2020 6:13 am, edited 1 time in total.
Image
Blake's Sanctum - Master of Magic Legacy:
fan page containing pictures, vids, info, similar games & fan projects!
Cor'e =)
Posts: 13
Joined: Mon Sep 26, 2016 5:48 pm

Re: 0.9.8.0 released

Post by Cor'e =) »

Cheers! I just saw all the updates! =)

Another Delphi (recently ported to Lazarus/FreePascal) game i recommend is C-Evo at www.c-evo.org =)
User avatar
Blake00
Posts: 34
Joined: Sun Nov 01, 2015 3:59 am
Location: Australia
Contact:

Re: 0.9.8.0 released

Post by Blake00 »

Cor'e =) wrote: Sun May 31, 2020 5:58 pm Cheers! I just saw all the updates! =)

Another Delphi (recently ported to Lazarus/FreePascal) game i recommend is C-Evo at www.c-evo.org =)
What?? I thought c-evo was dead???

I really need to do a tour video of that on youtube to get it some more attention.

.
Image
Blake's Sanctum - Master of Magic Legacy:
fan page containing pictures, vids, info, similar games & fan projects!
eggsome
Posts: 2
Joined: Mon Jan 18, 2016 5:59 am

Re: 0.9.8.0 released

Post by eggsome »

Cor'e =) wrote: Sun May 31, 2020 5:58 pm Cheers! I just saw all the updates! =)

Another Delphi (recently ported to Lazarus/FreePascal) game i recommend is C-Evo at www.c-evo.org =)
Is it fair to call April 2013 "recent"?
Cor'e =)
Posts: 13
Joined: Mon Sep 26, 2016 5:48 pm

Re: 0.9.8.0 released

Post by Cor'e =) »

What's in 2013?
User avatar
Blake00
Posts: 34
Joined: Sun Nov 01, 2015 3:59 am
Location: Australia
Contact:

Re: 0.9.8.0 released

Post by Blake00 »

eggsome wrote: Fri Jun 19, 2020 12:30 am
Cor'e =) wrote: Sun May 31, 2020 5:58 pm Cheers! I just saw all the updates! =)

Another Delphi (recently ported to Lazarus/FreePascal) game i recommend is C-Evo at www.c-evo.org =)
Is it fair to call April 2013 "recent"?
You fell for the same thing I fell for. The original last release of c-evo was many years ago however this delphi port version Core speaks of is much newer, you just gotta go hunting through their forums to find it lol.

lol meanwhile he we are at the exciting moment of a new MoM-IME after all these years and we're all friggin talking about c-evo haha.

Oh and FYI guys Implode just released a new 0.9.8.1 version on sourceforge which supports the AI building roads! :)

.
Image
Blake's Sanctum - Master of Magic Legacy:
fan page containing pictures, vids, info, similar games & fan projects!
jtholmi
Posts: 3
Joined: Thu Jul 23, 2020 10:55 am

Re: 0.9.8.0 released

Post by jtholmi »

First of all, great work Implode! I found it rather difficult to get Java 11 Runtime Environment (JRE 11) installed to my PC until I accidently found very good website offering OpenJDK installers (either JRE or JDK)! Go to https://adoptopenjdk.net and the JRE or JDK installers for Java 11 (or newer) to the most common platforms! JRE only installers are found here. Upon its installation, I think it is needed to tick checkbox for "Set JAVA_HOME variable" (and probably "JavaSoft (Oracle) registry keys" as well). (I did so just in case and Command Prompt's "java -version" test works now.)
User avatar
Blake00
Posts: 34
Joined: Sun Nov 01, 2015 3:59 am
Location: Australia
Contact:

Re: 0.9.8.0 released

Post by Blake00 »

jtholmi wrote: Thu Jul 23, 2020 11:18 am First of all, great work Implode! I found it rather difficult to get Java 11 Runtime Environment (JRE 11) installed to my PC until I accidently found very good website offering OpenJDK installers (either JRE or JDK)! Go to https://adoptopenjdk.net and the JRE or JDK installers for Java 11 (or newer) to the most common platforms! JRE only installers are found here. Upon its installation, I think it is needed to tick checkbox for "Set JAVA_HOME variable" (and probably "JavaSoft (Oracle) registry keys" as well). (I did so just in case and Command Prompt's "java -version" test works now.)
Nice work Jtholmi! :)

I just finished putting together an install guide over in the MoM-IME sourceforge forums so I'll add your easier way into the thread too!
Image
Blake's Sanctum - Master of Magic Legacy:
fan page containing pictures, vids, info, similar games & fan projects!
jtholmi
Posts: 3
Joined: Thu Jul 23, 2020 10:55 am

Re: 0.9.8.0 released

Post by jtholmi »

Glad I could help! Looking forward to upcoming versions of this work :)
Post Reply