![]() |
Single Player Improvement
1 Attachment(s)
I know that Single Player is kind of the red-headed stepchild of the Dominions community, but I still occasionally like to play a SP game. To make the AI more of a challenge I have been using the SemiRand program to create games with more intelligent AI pretenders. I have had some problems getting it to work the way I want, plus I had ideas for other ways to improve the AI that weren't supported, so I wrote a utility to create SP games that are a little more challenging.
I wanted to guide the AI away from making stupid choices, so I took the idea of the pre-made pretenders from SemiRand and added the ability to create custom mods that can improve the chances of the AI making good choices. I haven't really explored the possibilities very deeply except for modding the AI nations to remove sub-optimal units (to get the nation to concentrate on sacred units when using a bless strategy for instance). This utility also removes or limits independent units (through either No-Indy maps, Partial-Indy maps or the Better Independents mod) to keep the AI from fielding hordes of useless chaff. Optionally, you can set up random teams of nations allied against you. This will keep the AI nations from killing each other off while you just sit there. Also, you can limit the magic levels available to 6th, 7th or 8th to help out the AI since it does not use high level magic effectively. When limiting magic you can choose whether or not to use Vanilla or CBM(1.94). If you choose Vanilla, gem gems will get removed. No matter what level or type of magic restriction you use ALL global enchantments will also be removed. The reason for these changes is that the AI can't effectively use gem generators or global enchantments(casting or dispelling). This utility also supports adding mod nations to the mix of allowable nations (though you will have to create at least one pre-made pretender for it if you choose the AI to use it). The goal of this utility is to create more enjoyable SP games, not to provide a multi-player testbed. The games created will be unbalanced and you will see some crazy stuff. Don't use any skills gained in winning these games in MP games. To summarize here are the features of this utility: - Intelligent pretenders/scales for AI opponents. - Ability to generate No Indy maps (or Partial Indy, or use the Better Independents Mod) to reduce the AI tendency to use hordes of useless chaff. - Ability to restrict magic to 6th/7th/8th level since the AI does not effective use high level magic. - If magic is restricted (which I recommend) than ALL Global Enchantments will be removed and all gem generators will be removed. - Can use CBM along with the restricted magic. - Create teams of AIs for you to fight so they won't all kill each other off and will instead work together against you. - Support for mod nations. - Support for small mods tied to specific nations and pretender builds to give the AI some help or steer it toward a specific strategy. NOT supported: - Water nations (the AI has trouble going into and out of the water so water nations seem pointless to a fun SP experience) There are a limited number of premade pretenders for each nation (most stolen from the excellent SemiRandom utility). It would be great if others could contribute effective builds for the AI and mod snippets that may help them. No need to worry about design points, it's OK for the AI to cheat (you could create a dom10, all 10s in magic perfect scales build). The mod snippets are tied to a specific pretender build so they can be used to support a particular strategy. If anyone has any other ideas for improving the AI let me know. One thing I have found helpful is to use the --comptrn switch when testing dom3. This will let you see all of the AIs turns so you can see how the AI "thinks". Here is a screenshot of the application: Attachment 12215 Instructions: First, point to your dom3 executable, then choose whether you want to use an existing map or generate a random map. Look in the settings.txt file for the look-and-feel settings for generated random maps. Next, choose the Era and nation you which to play. the choose the AI nations. You can either select a number of random nations or choose specific nations from a list. You can then choose the difficulty and whether you want there to be teams of allied AI nations. Then choose whether you want there to be no recruitable independents or you want to use the Better Independents mod. (I prefer no independent but if you just can't live without independent commanders use the BI mod). Then you can choose a magic restriction level if you wish. Just press "Generate Game" and a map and a custom mod (if needed) will be created. You can then directly launch dominions and the correct map and mod will automatically be loaded (or you can launch yourself, just note the names of the map and mod file). Then once Dominions is launched just generate a new game, add the players (just leave at random, they will get set correctly), and choose your nation. You are now good to go. Here are links to download this utility for Windows/Linux/Mac. Windows: http://dom3editor.googlecode.com/files/dom3ai_win.zip Linux: http://dom3editor.googlecode.com/fil...i_linux.tar.gz Mac: http://dom3editor.googlecode.com/files/dom3ai_mac.zip The source code for this is open and located at https://github.com/larzm42/Dom-3-AI (if you are interested). |
Re: Single Player Improvement
Interesting idea, thanks for doing that. Aside from test games I only play MP but I suspect the majority of Dom players are SP gamers.
Given my MP focus I'll never get around to doing this (and even if I did I wouldn't have a program to generate things on the fly like you do) so this might be a good place to mention some ideas I had to help the AI. Taking the idea of limiting the AI's ability to make bad decisions a little further it occurred to me that it could be helpful to have AI friendly nation lineups. Taking Niefel as an example, the AI friendly version of the nation might have: Niefel giants have reinvig 2 and 5% regen Some commanders would autocast divine bless, others might autocast grip of winter Units that the AI will not use effectively will be removed or boosted so they are effective (since you don't have to worry about a human player abusing them you have a lot of freedom to make unit changes) So for each game a mod would be compiled using AI friendly nations for all nations except the player's (if it's a coop game then you could specify more than one nation to not use the AI friendly version). Note that the idea wouldn't be to create AI nations that can crush human players but to limit the AI to choices that are effective and thematic in order to create a fun more experience for the player. Ideally there would also be a random element in place during pretender creation combined with some rules. For instance, a nation might have a rule that it can't take more than Sloth 2 and Death 1 and perhaps have a minimum dominion of 6. So it would be prevented from making bad decisions but at the same time there is an element of surprise on each play through. You may know that the AI friendly Niefel has that reinvig 2 and 5% regen on Niefel giants but this time around the AI took some N magic to boost the regen even more and some F magic so those giants might land hits and not just rely on their cold auras. |
Re: Single Player Improvement
Kindof an all-in-one? A one-stop for all the AI improvements? Sounds good.
Id rather have seen SemiRand work for intelligent gods. Plus it had other features for improving solo play. Otherwise you are trading one type of predictable behavior for another. EDIT: they are the semirand gods? good move If the program can generate NI maps then why not generate PI maps? Allow setting a percentage. I prefer 1 to 10 so that most of the provinces are no-recruit but it still allows for some provinces to offer nice surprises. It still forces the AI to use much less indepts. And it makes those recruitable sites prime real estate. How about random scattering of castles with inside and outside defenders? And PD? random labs and temples appropriately guarded? How about an option to sprinkle the map with magic items? How about an option for 100% magic sites? How about surprise units scattered out? Will the maps go up to 1495? will the have new color options? the Sepia option of Elmokki's maps would go over well. EDIT: colors are in the settings file. Never mind. |
Re: Single Player Improvement
one trick i have been using when playing SP is to mod all the AI nations mages research bonus to maximum (30), so the AI wont lag behind in research and will use soome high level spells.
|
Re: Single Player Improvement
Quote:
|
Re: Single Player Improvement
Any possibility to compile a mac version? Or maybe we could try and make a wrapper for it...
Sounds super nice. Frosted on dom3mods also mentioned that it is theoretically possible to make a truly better AI by setting all players human, and creating a program that plays all nations except one for you. In theory, such a program could be implemented in a dom3 server, but making it would require lots of work, AI programming experience and possibly reverse engineering the game in the process, which isn't legal. So it's just an idea, but possible. A sort of robot dom player. |
Re: Single Player Improvement
I love the idea of a robot dom player because it totally lays out the basic problems of trying to improve the AI
|
Re: Single Player Improvement
Well, basically it would require a program that could decipher .trn files properly, and then output a correct 2h file. Or in other words, mimic the game client This is only possible by either reverse enginering the game or in cooperation with illwinter. No idea what they would say, but it would be very nice.
Since they are okay with people ripping the graphics from CEO3 to make mods for dom3 and so on, they might have no problem with someone hacking the game to make a useful addon. |
Re: Single Player Improvement
Seems like a very very good tool.
|
Re: Single Player Improvement
Quote:
This still won't get you beyond 1495 provinces, but after the first few hammer blows you won't be able to count beyond 10 so it will FEEL like a very large number. ;) |
Re: Single Player Improvement
Quote:
|
Re: Single Player Improvement
Personally I think it would be easier with a macro program which is designed to do that very thing. They are usually used by advanced players in online games. Particularly online worlds to do the "grinding" (doing the same task repeatedly to gain levels). Macro recording software are designed so that you can write extensive files that will play the game for you. Then it runs on top of your game doing the mouse moves, the clicks, hitting the keys, etc. This way you could concentrate on the player part, and leave things like files and file transfer to host for the Dom3 game to do. No mucking around internally
My personal favorite is AutoHotKey which I use to give Dom3 capabilities that the devs havent put in. Most wouldnt call me a programmer but I have gotten it to do some fun things. I think a programmer could do quite abit with it. http://www.autohotkey.com/docs/commands.htm |
Re: Single Player Improvement
Trouble is, autohotkey is not good at collecting information from the game. It would be a fraught task to program the collection of all the information needed by the AI to make decisions (reading the screen, counting troops, reading army reports). Probably easier to rebuild a picture of the gamestate from binary data in the save file (not thats its simple.. I've no experience of reverse engineering).
It might be realistic to use autohotkey or similar to give orders. With all the information down to commander numbers it should be relatively straight forward to predict the layout of the interface. |
Re: Single Player Improvement
Glean info from the debug log?
|
Re: Single Player Improvement
Quote:
|
Re: Single Player Improvement
We really should split this conversation to its own thread, and return this thread to the OT about his excellent program.
|
Re: Single Player Improvement
First up, I've had a play with the program - it works very nicely, so thanks :-)
I'd really like to be able to easily include CBM in particular. The ability to include other mods would be a nice bonus, though. I will have a look and see if I can work out how to do this for myself in case you don't have time. Quote:
1) Dom3 server generates .trn file 2) "Robot Artifical Intelligence (AI)" reads .trn file to understand the current situation 3) "Robot AI" decides on moves based on step 2) - hopefully in a cleverer, or at least different, fashion to what the internal Dom3 AI does 4) "Robot AI" generates .2h file containing its moves 5) File is submitted to the Dom3 server At the moment, you as a player do steps 2) through 4) using the Dom3 client. But in the proposed solution, the Dom3 client never comes into play - the external "Robot AI" does all of that, without ever opening Dom3 - thus no need to touch buttons, move things etc. This is being proposed as a way of allowing the current AI in Dom3 (which some people have an issue with) to be replaced, without having to modify the actual Dom3 code base. I personally think that this is an excellent idea. It does of course depend on having a good understanding of the formats for both .trn and .2h files, but since it doesn't remove the need for Dom3 licences from a player's perspective I am cautiously optimistic that it would be OK with the devs (never having dealt with them in person). |
Re: Single Player Improvement
I believe the one major benefit would be that you could integrate it into a server, like llamaserver, and have it take care of abandoned nations in mp games without actually turning them ai, so if you find a sub you just switch back to human control. It could work as easy as having a specific mail account for the robot, like domrobot@exampleserver.net, which you assign to abandoned nations rather than turning ai.
|
Re: Single Player Improvement
The external AI program will never get written. Without the actual codebase of the real Dom3, the amount of work you'd have to do just to generate consistently legal moves would be huge, before you even get to producing a sensible and better AI opponent. Or, Andy Murray could win Wimbledon this year.
|
Re: Single Player Improvement
Quote:
|
Re: Single Player Improvement
Quote:
- read gamestate from .trn (big task.. not sure) - program autohotkey to give commands (still a big task.. but probably better than trying to fake .2h files) - develop the ai (open ended task). Yeah, not likely. |
Re: Single Player Improvement
Part of the problem with the devs giving access to the files, or even more to the code, is that they would then be responsible for making sure that the knowledge is not used for evil. Otherwise they would face the wrath of half of the community for uncaring.
|
Re: Single Player Improvement
The problem with programming the AI, even in AutoHotKey, is that it would be HUGE. Even if it was done in a decent programming language with access to the code it would be huge.
Part of the complaint about the AI now is that there is only one. It makes decisions with very generic labels. Purchases are simply infantry, mounted, scout, mage based on cost. Scripting pretty much the same for all. So the improved AI would need to decide differently for Caelum vs Neifelheim. And even different for EA Caelum vs LA Caelum. And even then, to avoid players posting "how to beat the AI" you would want variations for Rainbow, SC, Blessed, Thug, or push to a specific spell. If there is no separation then we would have another catchall AI but just a different one (which I guess would at least be something) At least Im happy that the problem was tackled and mostly fixed with the SemiRand program. At least for starting AIs. But not for players turned AI. |
Re: Single Player Improvement
My approach wouldn't be to try and actually make the AI "smarter" in a general sense, rather use the current AI as base but teach it to handle typical situations from more accurate parameters. Then try to reduce the variables of AI play to make it limit itself to those typical situations as often as possible. Something like this:
Remove the randomly made AI pretenders. Instead premake three gods for each nation, one for each difficulty level. Preset battle scripts for these gods. The AI nations would always use these gods, but these gods and their scripts would be accessible for modding via a set of new mod commands (#AIpretender, etc). Have preset reseach targets for each AI nation, also moddable. Example: thau 4, ench 3, const 6, thau 6, evoc 2... and so on. The AI would always research in the order preset for it's nation, and the order would be determined by the player/community to find the most optimal pattern for how the AI uses mages. Make a recruits priority list for each nation, moddable. For example prioritize mages over other commanders and national troops before indies and so on. Have two moddable spell priority lists for each nation, one for rituals and one for battle. The battle list could also be used for human controlled nations, allowing each player to preset spell priorities for his own mages before the game starts, which is used whenever mages can't use their battle scripts. For human controlled nations this list should be accessible on a per game basis, to allow different spell strategies for different games, which would also improve MP. Alternately make a reasonably effective script for each mage in the game, and have the AI default to that. If the AI cannot be taught to bless it's sacreds, make all AI sacreds always blessed. If the AI cannot be taught to build forts, make them appear automatically following a preset pattern for time and placement. Preset a number of good thug builds, with preset battle scripts similar to the pretenders. Make a priorities list for each nation for building them, and make the AI try and achieve this builds as close as possible. If the AI cannot be taught to plan it's forging, make items appear in their lab automatically following a preset time schedule, and multiplied by number of forts. I don't play SP anymore, but improved AI could make it fun again perhaps, and make it a little less painful to set nations AI in MP. Options such as these could allow players/the community to design a playstyle for each AI nation. And over time we could reach a decently challenging AI This is all theory of course, since illwinter sharing the secrets of the code seems unlikely. But I don't really understand what Gandalf mean by "used for evil" from a community perspective. I can imagine ****nel considering a movement towards decreased control over the client evil, but the community would benefit. The theoretic risk is cheating of course, but if the code was only shared with a single trusted person prepared to put the workload in to build this kind of utility, would there really be a big risk? |
Re: Single Player Improvement
The closest thing to that would probably be the one of the cloning projects.
|
Re: Single Player Improvement
Yeah, there's case for designing a game to be played by an AI rather than the other way round. Not sure I want though. IMO GalCiv2 was as dull as solitaire.
|
Re: Single Player Improvement
Quote:
I do like Fantomen's idea of simply limited what the AI does to a number of well known, optimised paths. Its never going to be much good, but it can be improved. |
Re: Single Player Improvement
Oh, I think I misread Fantomen, sry. Hard-coded research goals, army compositions and suchlike definately sounds like the best way to develop an AI for such a complex game.. not that I've ever programmed an AI.
It gave me an idea.. would it be possible to create some sort of "survival mode" on a set map where preset armies attack the player at intervals? Might be possible with modded units that cast rituals that spawn whole armies or something. Would the AI use the units to attack or just do something stupid? |
Re: Single Player Improvement
The scenario options arent in Dom3 like they are in the newer game.
But you might be able to get what you want by using the tactic for switching the server mod in mid-game to slightly change the abilities or priorities of the units that are already in the game. |
Re: Single Player Improvement
Quote:
|
Re: Single Player Improvement
One day in dom5 the computer will GOR a gargoyle, equip him, and school our thugs. Thought this (below) was a cool walk down the chess AI dev path from an interesting pov.
ssj http://groups.google.com/group/rec.g...1058231a?fwc=1 |
Re: Single Player Improvement
OK some new information on the new Solo Play page of www.Dom3Minions.com
I have been playing with ALL of those mods turned on. Crazy huh? :) So far, the only crash Ive had was this... Code:
Create indep. spellbook 25 Of course by playing with all of the other mods at the same time there might be other lesser conflicts. One mod might be overwriting another mods unit id. Or maybe even just partially changing one. Later maybe someone who is organized will shift those around and fit them into a single package so we can get a massive CUM out of it (no, I meant a Conceptual Unbalance Mod. get your mind out of the gutter). But as long as they dont crash, its just some nice random surprises as far as Im concerned so Im happy enough for now. Gandalf Parker -- feci quod potui, faciant meliora potentes |
Re: Single Player Improvement
LARZ are you still around?
Ive been collecting up all of the Solo and Scenario stuff. Im sorry this thread got so sidetracked. But I do still really like your program. And I so still have some requests for it (such as the NI or BI option also including PI) |
Re: Single Player Improvement
Yeah, still here. I was actually just working on a new version of this. I created a combo mod that includes some of the best ideas as an option for inclusion. I've never used PI (partial independents?), but should be able to include it as an option if you point me in the right direction. Also, any other suggestions you have would be appreciated. I figured the new players on Desura would start out mostly SP and this tool could help them once they get bored with the vanilla AI.
|
Re: Single Player Improvement
The advantages of NI are well sung. But I prefer PI. Maybe offer a percentage setting but I generally prefer 1-in-10. That way I can still come across provinces that offer hirelings, but not so many that the AI gets carried away with them. Personally I think they also add to the game by providing important provinces to fight over. The reason NI is known more than PI is that PI kills replay on a map so it is best if generted each time. Your program would be great for that.
The only other thing I can think of at the moment is the #ally command which keeps the AIs from attacking each other. Either in teams, or all against the human. Dont remember if you have that in there or not. If you place the AIs, throwing in extra magic sites on the capital can be a big surprise. Either basic help like more gold, more resources, a sage site. Or even some major surprises like other nations capital sites which can give an AI nation the elite units of another nation. But then you are getting into my Chaos games. Ever played one? I have downloadable versions of SemiRandom, PI, and Chaos maps on Dom3Minions if you want to check them out. (the server rerolls them each day for variation) http://www.dom3minions.com/maps.htm |
Re: Single Player Improvement
OP updated with links to the new version. Changes include:
- Support for partial-indy maps (10% indies by default but changeable) - Support for CBM with limited magic. This is basically CBM(1.94) with magic restricted to a certain level. But, ALL global enchantments are removed. - Vanilla magic restriction mods have removed gem generators and global enchantments Some things that were already supported that Gandalf asked about are support for allies (you can choose the number of allied teams against you) and support for adding sites to AI capitals. |
Re: Single Player Improvement
I always enjoy those provinces where you run into things like Dark Vines or monsters that you simply cannot handle till you have jump started your nation.
Would there be a way to randomly seed a map with such indies? A province containing 30 stray neifel giants? A dragon? A worm with Awe? Oh, and thanx for what's already in there. I'm looking forward to messing around with it. |
Re: Single Player Improvement
SemiRand does that altho it can always use more provinces designed by players to increase the randoms. I think Larz program might also since he uses many of the same files.
OR you can play a Chaos game which is the same thing but a lore crazier. www.Dom3Minions.com has downloadable maps, and online games you can play, for both SemiRand and for Chaos |
Re: Single Player Improvement
Where is this chaos mod or maps hiding at?!?!?
|
Re: Single Player Improvement
If you go to www.Dom3Minions.com and click on Mods, then look for ChaosMod
Altho Id recommend more the map. Go to www.Dom3Minions.com and click on Maps the map is called a Poke in the Eye There is a new version of it every day |
All times are GMT -4. The time now is 02:31 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.