![]() |
Perking up the AI
After playing a few SP games, I've come to the conclusion and so probably have all of you, that the AI struggles to fit the pieces of the game together. It may be possible to help it out in the bless deparment by giving some of their commanders Holy 3 enabling them to cast divine blessing.
It is not uncommon for an AI to have atrocious scales but a major investment in magic. I know the AI recruits sacred but it never seems to plan for the bless trigger. Some nations don't have H3 access apart from the prophet and it is unlikely the AI would priorities sacred to be with the prophet. So, would it be possible to mod the nations to have H3 commanders? What sort of difference would you think it'll make to the AI's use of bless? Should all their commanders be H3? (this might overkill summons though.) Could you move divine blessing over to another magic path? maybe all level 3 magics? this would keep the balance regarding holy assaults on the dead... Just musing on this, just a change for the AI. |
Re: Perking up the AI
I think you have a good idea there.
There have been some extensive conversations in the past about what the AI does and doesnt do well. I have always wanted to see versions of the nations, or even completely new nations, which are to make use of the AIs abilities and work around its faults. It seems to me ( altho Im a minimal modder) that it would be easier in some ways. The longest and most complicated discussions in a modded nations thread involves balancing it for multiplay. Points to consider: The AI loves to put gods to sleep. Much more so than human players do. There are some interesting tactics around that. The AI is stupid in the early use of its god. It does well with immobile gods, and gods which are SC but almost impossible to give magic to. It does terrible trying to rainbow an SC god, or SC a rainbow chassis. Limiting it to immobiles with cheap magic, or brutes with expensive magic seems to help Certain nations seem to choose scales which can kill them. However most nations have empty magic-site slots. Granting some specific magic sites can help alleviate the damage. Such as sites which grant cold, or heat, or food, or resources. You could even invent a site if there isnt one already that fills the bill Gandalf Parker |
Re: Perking up the AI
Quote:
It seems there are too many things that need consideration, but we know that an effective bless is a big bump in power; if a small change could fix this aspect, then we are a little further in front. Again, stipulating SP only changes. Just reading up on how to mod things. I'm inherently lazy and enjoy playing other peoples work. But Dom3 is different - I seem to care more about it. |
Re: Perking up the AI
So, I know it's possible to set AI gods using map commands. Ballbarian's SemiRandom program will put AI gods on the map, choosing from a library of human-made gods suitable for particular races. So using that would be a huge improvement.
As for blessing, one excellent solution would be to put #onebattlespell "Divine Blessing" on all the AI's commanders. That makes them cast it before the battle starts, without needing any magic skill to do so. The only trouble is that there'd be no nice way of making a mod that was very reusable but didn't affect the player's commanders. If people were happy with the player's commanders also auto-casting divine blessing (creating a fair solution in which blessing simply didn't need to be cast any more), I could put together a mod to do that in literally a couple of minutes. |
Re: Perking up the AI
Actually it would be marvellous if someone actually applied SemiRandom to a couple of maps and uploaded them as SP scenarios. I believe it's a little tricky to get the hang of (although someone wrote a tutorial last week so it's eminently doable now), but I think that finished maps would get a lot of use.
I would have a go but my server and my mod projects get priority at the moment (after my... thesis!!!). |
Re: Perking up the AI
Quote:
Is there not a master list of all units where by one could add divine blessing to a select group of commanders and leave the rest alone? or does it as you describe above become a global of sorts and effect every one? If i want to play Marverni in SP for example, could all the other nations have commanders with divine bless except for my own? If not how would this be achieved? would i have to create a completely new set of nations with this change included? And mate, your sig is on the money - this will be my second unit completed with an average mark. This game invades my brain - i can't think about unit content and potential buffs at the same time :confused: |
Re: Perking up the AI
Sorry if I was confusing hEad. Yeah, you could make a mod that affected everyone but Marverni. It might just be a bit faffy.
What I was going to do was generate a mod which added #onebattlespell Divine Blessing to every unit in the game. Being as it only has effect on commanders, that would have the desired effect. You could then go through and remove those lines which affected Marverni commanders, and it would be job done. The only trouble is that you'd have to make a different variant for every nation you wanted to play in SP. |
Re: Perking up the AI
Quote:
I think it would make a hell of a difference to AI competitivess – hordes of blessed troops lurking around! |
Re: Perking up the AI
llama: Have we established whether or not non-commander units actually cast #onebattlespell? If so, then the replays would be extremely long if every unit in the game cast Divine Blessing.
I am very interested in this idea, but realize this shifts balance, especially for offensive blesses. Since #onebattlespell effects go off before the _defender's_ first turn, sacred units on the attacker's side have the benefit of their bless before the defender can attack them. This can shift the tactical advantage of combat to the attacker. Consider Sohei with an Air Bless. This mod would greatly increase this particular use of them. The blesses that are primarily improved by this would be any Air bless, Earth-9 bless, any Astral bless, pre-9 Nature bless, and Blood-9 bless. In a few situations, a Nature-9 bless would actually be worse under this mod. Also, if you do this, could you add Apostacy to all nations? This would give nations with good sacred troops an even greater advantage over nations with poor sacred troops, and thus Apostacy might be a good way to counterbalance this. |
Re: Perking up the AI
Quote:
Has anyone with a bit of modding nounce tried this yet? |
Re: Perking up the AI
1 Attachment(s)
Yep. Mod attached. It applies to every commander except the Goat Sun and the Mandaha - I removed it from them because it overwrote their Heat from Hell and Darkness effects respectively. If there are any other base game units which autocast things then it will have broken them too, but according to Edi's database there aren't.
If you wanted to tailor it for a particular nation, you'd have to find the unit numbers of that commander's nations (look at their descriptions and hit Shift+I), then go into the mod and stop the lines which refer to those commanders working. You can do that simply by replacing the hashes on those lines with hyphens, e.g. "#selectunit" -> "-selectunit". Or you could just delete the lines, but I prefer to leave them there in broken form as documentation of what's been done. |
Re: Perking up the AI
Quote:
|
Re: Perking up the AI
Thanks lch, that was very helpful. I've fixed them and updated the zip above. I assume that was from code diving, rather than simply being better at reading Edi's DB?
I'd also have been concerned with clashes with pretenders which gain #onebattlespell from CBM, but for some reason it doesn't seem to overwrite them (despite being loaded second in my test game). I guess I don't really understand what's going on there, and don't have to time to investigate. Do you know which pretenders need doing lch? I may as well do a thorough job while I'm at it. My feeling is that people won't want to use something they perceive as slightly broken. |
Re: Perking up the AI
ahh you legend! I'll give it a whirl once the kiddies are in bed!
|
Re: Perking up the AI
Quote:
Most of these are spells to have some additional troops at the start of battle. The Crone automatically has the Returning effect cast on her. |
Re: Perking up the AI
Great, thanks lch! Okay, the version posted above has been updated, and now, so far as I know, will have no unwanted side effects.
hEad, let me know what you think when you've given it a go. The effects should seem pretty straightforward - sacreds will essentially always be blessed in battle. |
Re: Perking up the AI
Well so far so good. At the 2 year mark and just beaten back a nasty little rush by helheim. I'm situated centrally north, Helheim to the left of me in the north western corner. They declared war and invaded with 2 decent armies - both with a reasonable complement of valkyries. One attack i was unprepared for, Valkyries hit my back line and annihilate me with a fat bless of att+2 Airshield 20%, Reinvig +3, MR+2 and affliction +%250. So far these 2 armies have taken 4 provinces and i have had to adjust my battle map strats accordingly.
I have whittled one army down and killed his prophet but still the blessed Valkries keep dealing me some hurt. I like it! Now all those absurd pretender magic picks are not going to waste. I'll post more as i go. Anyone else tried this? |
Re: Perking up the AI
I have, but mainly to see what I can do with it, instead of what the AI can do with it.
That is, I'm testing to see what happens to certain sacreds with it. Air-9 Astral-9 Sohei are certainly less vulnerable to crossbows... |
Re: Perking up the AI
1 Attachment(s)
Ok. This definitely makes a difference. If the AI comes at you with a hoard of troops replete with blessed units, casualties occur on a bigger scale than I am used to. Sure, there are still deficiencies in the AI’s conduct, but this at least, provides for the negation of one of its weaknesses.
I think together with BI mod, this may make another huge difference – I intend to try this when I get the time. I have been playing Marverni and have removed the auto bless from their troops just to make me work a bit harder. Its not hard to remove the auto bless from the units of your fav nation so if there are any requests… Here is the Marverni divine blessing mod if you’re interested. Thanks again Llamabeast and Ich (see you got your hands dirty there) |
Re: Perking up the AI
Quote:
|
Re: Perking up the AI
That would indeed be great. It'd be a big project though, and not one I personally can even attempt being as SemiRandom is a windows program and (a) my server is Linux, and (b) I don't have a lot of skill in doing interesting things in Windows. Otherwise I might succumb to temptation and add it to the LlamaServer some time.
|
Re: Perking up the AI
What language is SemiRandom written in Ballbarian?
|
Re: Perking up the AI
SemiRandom is written in Yabasic, which should work in Linux. The RanDom front end that builds the command line for dom3 is written in VB6. SemiRandom is where most of the work was done and is manipulated through an external text/cfg file.
I really wish that I was able to utilize a more advanced cross-platform gui solution, but I get very frustrated with not immediately knowing how to perform simple tasks. :p Can anyone recommend the direction of least resistance for an old windows user who started programming in basic on an TRS80 back in the early 80's and now is stuck in VB6 for his GUI needs? Don't get me wrong, I love VB as it is much more powerful than it gets credit for and allows me to generate fairly complex solutions quickly and painlessly for work. I just wish I could compile my work as a functional web page or something along those lines. Guess I should take the time to do some more research. Anybody familiar with VB6's web programming features? |
Re: Perking up the AI
Define 'least resistance', BB. I don't recall very much of VB (mainly because I sucked at it), but I do know both C and Java.
From comments I've picked up in my classes, Perl is apparently widely known for its ability to take virtually any syntax and parse it correctly. This may allow you to write it 'VB code' and get a working web app. Other than that, I'd suggest Java, due to the incredible ease of making web-ready apps with it. And I say this as someone who started dabbling in programming not long after you. |
Re: Perking up the AI
Quote:
As a compliment to the Llamaserver I beleive it could prove one of the most important improvements yet to this great game. Just think of it, compiling a "random" scenario to your liking and then seamlessly start it up on the Llamaserver with a mix of human players and predesigned AI:s to your own liking. wow. Don´t misunderstand me I know this is perfectly possible already using the current semirand but it´d be on a whole new level of availability, like something poeple would do regularily every day. I use osx myself and I can´t seem to overcome the hassle of emulating semirand through some yet to be installed windows partition and then ship the files back and then... If someone would undertake this grandiose mission I´ll do my part and make cheery uneducated comments daily! promise :angel |
Re: Perking up the AI
As I wrote for another YaBasic program before, things that are compiled for Windows don't work on Linux or Mac out of the box. YaBasic is available for other platforms, though, and with the source code, the users could use the program natively as well.
Somebody expressed interest in reimplementing the SemiRand program in Python, IIRC it was pyg. Python is one of those newer hip programming languages that are "web-aware" because they are interpreted script languages that can be told to get input from and give output to a webserver. There's even the possibility to use modules that run the program in its own mini-webserver. Another programming language that comes from the realm of web applications is PHP. It is probably the one that is supported and used the most across the web. Personally, I would advise against Perl because I consider it a little bit archaic. I haven't used modperl to know if it's any different, but there are a few pitfalls with CGI programs that make it hard to develop. Instead of getting useful tracebacks, you'll more often than not will be greeted with just a "500 Server error" if there is any kind of problem with your program. I don't know much about Ruby other than the Rails framework. Another option would be C# or other programming languages from Microsoft's Sharp family, which is probably a lot more accessible for web tasks than any VB-extensions. This would once again limit you to the MS-World, though the Mono project manages to get some things across to other platforms. As for GUIs, Python has bindings for almost every popular GUI framework there is: Qt, wx, GTK and it's own TkInter among others. They are all usable, with just some differences. So if you are ready to learn a new programming language, I'd definitely recommend Python to you. If you want to learn as little as possible, look at Microsoft's SharpDevelop suite. Just download the latest free version of Visual Studio to start. P.S.: I read VedalkenBear's post now, which I didn't before. Syntax-wise, PHP can be used in a multitude of ways, too. You can have a completely object oriented program, if you wish, with PHP5 it's possible to have exactly the same programming as in Java, but you can have it all very functional as well, or just use it like a minimal templating language. AFAIK there are extensions to have Java for webservers, but its biggest strength comes from being able to embed it as applets where the code isn't run on the server, but on the user's machine. This could open some interesting opportunities for some projects. The only problem might have been that Java was pushed to get widespread use long before the machines were fast enough to handle the virtual machine that it uses well, so now it has the reputation of being very slow. Nowadays Java applets aren't that much of a drag anymore. I think that it's a little hard to get into it, depending on your background maybe, but development-wise you will get very detailed tracebacks if there are problems that you run into. |
Re: Perking up the AI
Quote:
Quote:
If you want to stick with Basic there are plenty of options. Check out http://www.thefreecountry.com/compilers/basic.shtml There are quite a few that offer simpler and more cross-platform guis than vb. Also there exist many cross-converters for source code. Bas to C, or bas to php, or bas to java script. And there are also compilers for VB to linux. They can be handy to write in one and convert to another. Especially if you are trying to learn the other language its handy to see how your old code would be written in the new one. If you feel like switching, here is a fun first-stop site for checking out new languages. http://www.99-bottles-of-beer.net/ Its the same program (99 bottles of beer on the wall) done in over 2000 programming languages. A great way to get a quick feel for how far off it is from what you already know. Quote:
Gandalf Parker -- For programmers: 42 = "Hello World" |
Re: Perking up the AI
Quote:
|
Re: Perking up the AI
Ich: The only reason I didn't suggest Java more strongly is because it is highly adapted to OOP, and VB (to my knowledge) is... not.
If someone could explain the underlying logic of SemiRandom, I could try programming it in Java. |
Re: Perking up the AI
I am definitely going to give Python another look (as well as Java). A lot of great information there guys! Thanks a ton. :) When I get home from work, I am sure I will have some more questions if the OP doesn't mind me dragging his thread further into the depths of "off-topicness".
|
Re: Perking up the AI
Quote:
The RanDom front-end is not so bad on the code side, but I left out a ton of much needed error checking and the like. That is what happens when you don't know where you are going until you get there. |
Re: Perking up the AI
I understand that Python is mega-lovely. I'm a big fan of Perl, and apparently Python is nicer.
http://xkcd.com/353/ |
Re: Perking up the AI
Quote:
http://www.dom3minions.com/~minion/SemiRandom.shtml The program is based on the fact that map commands allow much more management than most maps use. Some, such as Faerun, have programmed provinces with logical population choices, defenders, magic sites, name, etc. Those are great (and way too few) but the pro and con is that there is some loss to replayability. My totally chaoticized maps are called "interesting" but they can be irritating in the total lack of logic in what it throws into the map. This projects concept is allowing all players to design a province. Such as: "The Shire" with a population of hoburgs, magic sites boosting supplies, and some interesting defenders. These are converted to Dom3 map commands and placed in a file where the name of the file includes codes to specify something such as "farmland" to control its placement. So the SemiRandom program reads a map file and randomly places these planned provinces. You can tell it the percentage you want as designed vs being left to the games randomizer. As SemiRandom reads the map file, if it finds a farmland province then it chooses a farmland file and inserts it there. When it writes out the modified version of the .map file there will be special provinces included. Thats the basic of it (pun intended). Of course Ballbarian has added wonderful extensions. The @ sign allowing for a small list so something like the guards equipment or name can be randomly selected from a short group of logical choices. And recognition of special provinces such as island, lake, peninsula, volcano, cave, etc. And lately the ability to add pre-designed logical gods/scales for AIs The effectiveness of the program depends on having many pre-designed provinces and god files. Enough that we dont seem to keep running into the same things over and over. I think we are getting close to that but Id love to see more people turn in some so we can get more variety. Gandalf Parker -- The Socializing Soloist, the Mad Mapper and the Minimalist Modder, the Lord of Chaos, the Prophet for Random, Experimenter of Extremes, He Who Will Not Normalize Standardize Specialize (or Finalize), He Who Public Domains All. |
Re: Perking up the AI
I think what SemiRand really needs (borrowing from the rest of the winding journey of this thread), is a browser based designer. So for example, a page on the dom3minions server might have the same dialogues that are currently found in the downloadable exe, but the overt ease of creation and submission could likely spark a deluge of submissions - I am thinking that many people don't want to bother with it all for 1-2 provinces, but if all of those 1-2 province people were cajoled into submitting through the webservice, it would hugely magnify the number of available provinces.
|
Re: Perking up the AI
The main problem that I have with web services is designing forms. I hate design work. :) I haven't yet found a good way to be able to just code and have forms for user interaction generated automatically, without using an overblown framework that tries to abstract the whole thing with MVC, forcing you to jam your logic into their structure and using their database abstraction instead of giving direct access to these kinds of things. I have in mind to get a web version of catgod, maybe I'll find something for it.
|
Re: Perking up the AI
JM: (OT: Thanks for switching your pic. I love that lolcat.)
Piggy-backing on your idea, if we had such a framework (and that shouldn't take much; I'll look into it) we could set up a 'pay-to-play' service where someone to use a MP server for a game had to contribute a province to 'the file'. My OOP class was very big on knowing how to format text correctly, so I'm fairly certain I could write a Java app that could take this information and format it for SemiRandom. |
Re: Perking up the AI
Im not so much an old programmer as I am an old internet admin. I was part of the early protocol discussions. So its not the programs, or what they are written in, which concerns me.
We can have a ton of apps. But I think that we should try to do is come to agreements on formats. The DomMap project developed some agreements on how .maps should be annotated. Some of that was carried over to the SemiRandom project. And some of the future developments for SemiRandom are most likely to use Edi's spreadsheet format as a database. If all of the apps use an agreed on format for the province adds, god builds, sprites, etc then we can share libraries. And use data files which use Edi's spreadsheet, or at least an export from it, so that the apps stay current easier. We might want to start an RFC thread on it. Actually the format of the province and god adds might be reaching a limit. The "appropriate" tags might want to be shifted to the first line of the file rather than the file name but thats something Ballbarian would have to agree to (but I could automate the file changes). Gandalf Parker -- The Socializing Soloist, the Mad Mapper and the Minimalist Modder, the Lord of Chaos, the Prophet for Random, Experimenter of Extremes, He Who Will Not Normalize Standardize Specialize (or Finalize), He Who Public Domains All. |
Re: Perking up the AI
Well Ive put in a fairly full day.
I know I dont finish many of the other projects but if no one shows an interest most of them just sit in the "who cares anyway" list. :) But the server stuff I do better with. I have now added a new game type for SemiRandom games. http://www.dom3minions.com/HostedGames.htm Gandalf Parker -- The Socializing Soloist, the Mad Mapper and the Minimalist Modder, the Lord of Chaos, the Prophet for Random, Experimenter of Extremes, He Who Will Not Normalize Standardize Specialize (or Finalize), He Who Public Domains All. |
Re: Perking up the AI
Quote:
I split away from the MicroSoft programming languages in the late 90's when the power of PHP blew ASP out of the water. Never dabbled much in VB, .NET, ASPX etc since then. The Dom3Bak utility I wrote was in Python because I wanted to see the power and ease of it. I'd certainly recommend it as an easy way to program. I'm guessing Java is closest to VB and C++ but I never spent much time with that language. Most of my coding work is still PHP. I'm guessing that if you are wanting to bring your VB code to the web you would need to construct the GUI in ASPX with .NET and then use your VB code to power it. As far as adding to this discussion about bringing programs like SemiRandom to the web, the hardest aspect will be to build the maps through Dominions3 and distribute them. Needs a lot of grunt and then the distribution files will be large. It seems that the rest of the process is essentially manipulating and compiling text-based data - which would be the easier part to build. There could even be randomising rules built into the config files to help mix things up a bit. Eg. Percentage chance for a certain sorcerer to be in the province or random number of troops between a designated min and max. |
Re: Perking up the AI
In a way, there is. The @ sign in a SemiRandom file designates a random selection. So you could designate the number of troops to be an @ list with 10, 20, 40, 60 troops to select from.
|
Re: Perking up the AI
Quote:
|
Re: Perking up the AI
So much that I want to respond to, but I am rapidly running out of minutes before I have to get ready for work. :p
I am currently giving Python another look. Now I remember what held me back before. I think the language itself is not a problem, but I am struggling to decide on a GUI and have not found an IDE yet that peeks my interest. I quickly get frustrated with the minutia of coding UI objects like buttons and frames. I would much prefer to have a WYSIWYG editor for laying out components and generating the code in the background. There is likely a utility out there and I have just overlooked it at this point. Meanwhile, I will keep browsing. das123, What tool sets did you find useful when creating Dom3Bak? (Nice app btw!) |
Re: Perking up the AI
Quote:
Anyway, most of my Dom3 experience has been SP and my favorite map is the SemiRand version of AoMOgre although it hosts slow for me because it is so big. Beautiful map, fun and exciting things to run into! I tried a little to get SemiRand to run in Wine but gave up easy. I'm interested in porting it to Python (command line, someone else can gui it) and adding it to dmg although it just changes the .map file right? Like a previous poster said it might be fun to add SemiRand stuff on the fly to MP games and/or make it more accessible. [Un]fortunately winter is nearing the end and I will soon be too busy to fool around on computers as much. Is SemiRand open and can I look at it, port it, etc.? |
Re: Perking up the AI
Quote:
Anyone who knows any programming language might want to check and see if there are some available modules for accessing an Open Office spreadsheet. And code for tga2jpg or gif or png (I do have imagemagick on the server which can do that quite nicely). That way a web interface could be written to directly use Edi's database, the library of dom3 sprite images, and Ballbarians source files. Updating would be simple when those libraries are updated. As a lazy alternative, there are a few people who have volunteered to convert loose ideas into turn-in code. If anyone has an idea for a province or god build (we seem to particularly need early and late era gods) then feel free to PM them to me. I might eventually get them done. |
Re: Perking up the AI
Quote:
That said, I am fairly sure that there should be some kind of GUI designer tool for the Qt port. And getting a GUI together with wx wasn't too hard. You will spend most of the time that you're programming on the GUI of course, no matter how complex the other code may be. :( |
Re: Perking up the AI
Quote:
I hunted around for a while trying to find something similar to VB where you can just drag and drop components into a frame. Everything I read about GUI and Python was contradictory. I tried placing the components by code but was a pain. There are a number of GUI libraries for Python, but that also makes it tricky. In the end I found what many said was the simplest setup (and I agree with them):
|
Re: Perking up the AI
Oohh, very nice, I'll have a look at that later. As I wrote, I found wx quite good to work with, too, without any IDE or WYSIWYG interface even. I made a GUI for a batch image downloader from hand. The one nuisance that I have with wx: The Python documentation isn't 100% complete. If you really want to know about all the usuable things there are in wx, then you need to look at the non-Python documentation for it. Apart from that, I like it the most from the options there are.
|
Re: Perking up the AI
Boa does indeed look nice. But, it does not appear to have been updated for the past 1.5 years. I guess if what is already there works well, then great. I probably wouldn't want to get too wedded to it though, as it will probably break against newer versions of wx at some point.
|
Re: Perking up the AI
Most of the info about wx is available, and for the tricky questions I just asked at http://bytes.com/topic/python/ where the community was very helpful.
As far as Boa not being updated for some time, I remember that that worried me as well. But then I found a post where someone said that it is active but mature and really is a case of 'if it ain't broke - don't fix it.' Even though it looks like it is Alpha or Beta with the version numbering, it really does a very good job - especially for Python newbies like me. I had a quick look at kTinker etc but it looked more complicated. Give me drag and drop any day. :) |
Re: Perking up the AI
Well, yes, the wx information is available... It's just that the docs about the Python bindings for it are lacking! There are whole classes missing or being undocumented how to use them. "Use the source, Luke" is prolly the best answer if you want to know about all there is available. That's pretty much what I was told in the wx IRC channel, too.
|
All times are GMT -4. The time now is 05:27 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.