Once more: FFH and the AI

As a geek, I resent reinventing the wheel, so what I'm doing right now is trying to merge BetterAI with FFH. It is, as was to be expected, a shitload of work. I'm wondering if anyone before me has ever tried to do this?

I've done this sort of thing before. Once I'm available to work on the AI, I'd be free to start working on this, if you'd prefer I start on this first.
 
It seemed to me from an earlier post, xanaqui42, that a part of you was craving a thorough re-design/rebuild of the AI, so that it would meet some elegance and efficiency standards. I'm casting my vote for that, and I'm willing to wait.

If bringing in the kinda self-training power of BetterAI has to or helps to happen first, I won't stand in the way of that either.

:)
 
It seemed to me from an earlier post, xanaqui42, that a part of you was craving a thorough re-design/rebuild of the AI, so that it would meet some elegance and efficiency standards. I'm casting my vote for that, and I'm willing to wait.

If bringing in the kinda self-training power of BetterAI has to or helps to happen first, I won't stand in the way of that either.

:)

Yep. The main advantage of a re-write would be that the AI would be far more flexible to take into account future changes for this mod. On the other hand, it would take substantial time to write.

In any case, I'm presently buried in wiki work (I was taking a multi-week hiatus due to RL concerns). I'll post when I've unburied myself from the stuff I think is essential there, and see what seems to be needed most at that time.
 
The merge mostly failed with the big new stuff; there is a surprising amount of functions in there to govern mage behaviour, and all the sprawling code did get in the way somewhat. 90% of the time it was straightforward: the conflicts resulted from Kael having backported the warlords changes and the AI team having improved on those changes in a different way. Still, there were some conflicts I had no idea about and I ran into too many compile errors, so I gave up.

I only invested about 6 hours though, and that's with no C++ knowledge.
 
Thanks for pointing me to this thread, Xanaqui. Very interesting and instructive. Too bad I can't help you guys because of my basically non-existent coding skills.
 
The merge mostly failed with the big new stuff; there is a surprising amount of functions in there to govern mage behaviour, and all the sprawling code did get in the way somewhat. 90% of the time it was straightforward: the conflicts resulted from Kael having backported the warlords changes and the AI team having improved on those changes in a different way. Still, there were some conflicts I had no idea about and I ran into too many compile errors, so I gave up.

I only invested about 6 hours though, and that's with no C++ knowledge.

A few notes about the merge (w/ 0.21f):
1) BetterAI is GPL. This means that we'll need to make source code available as well as the resultant file(s). If you have any suggestions for how/where to do this, (perhaps Sourceforge?) I'd be interested.
2) Do you have any suggestions for what to call this modmod? To meet Kael's commenting style, I'm going to need to internally comment the code for any new changes (the ones from this merge are labeled with BetterAI)
3) I hope to have a releasable alpha version with a week. I guess we'll find out if I'm being overly optimistic :)
 
GPL doe not force you to publish it via something like Source forge. Kael is giving us the source of FfH here, uploaded to a ftp in a zip file. Now, if you only make changes in xml/python then it is already the code used in the game so no extra publishing needed. If you make changes in SDK with C++ then I guess you will have to publish the project you used but like I said, a zip file will suffice.

If you have a Gmail account then there is also an alternative to sourceforge, code.google with a free SVN repository, issue tracker, etc.

I hope you will get it done. The AI need a buff in some areas :)
 
[NWO]_Valis;5365766 said:
GPL doe not force you to publish it via something like Source forge. Kael is giving us the source of FfH here, uploaded to a ftp in a zip file.
I'm aware; worst case, I can just offer to give anyone who e-mails me the source code. The primary advantage of using something like sourceforge is that it would also aid development among multiple developers.
 
Keep in mind that with BtS coming out and us moving to that codebase any AI improvement that is done now only has a temporary value. Its one of the reasons I've been waiting before I touch the AI, its a lot of complex work so I'd like to be on the final code platform before I do it.
 
[NWO]_Valis;5365766 said:
I hope you will get it done. The AI need a buff in some areas :)

It builds. I'm going to work for a few hours more on fixing defects (most of them are from the FfH II source; I'll report them soon on the main defect thread), then try to run it.
 
Keep in mind that with BtS coming out and us moving to that codebase any AI improvement that is done now only has a temporary value. Its one of the reasons I've been waiting before I touch the AI, its a lot of complex work so I'd like to be on the final code platform before I do it.

At worst, I do this again. Frankly, this exercise is almost as much to familiarize myself with the AI design and the code, so I can do significant work with it, as to produce a useful product.
 
Hey xanaqui!

Sorry for my delay in replying, I was visiting a good friend in Istanbul (and in the process infecting two more Civ4 players with the FFH virus. One of them nearly missed an exam because he "accidentally" played FFH all night long, which I guess means we've got our hooks in him).

1) Code distribution. I've got root on a very decent server and could set us up a little minimal webpage there (as well as a CVS/SVN repository, whatever floats your boat). SF.net would work as well (I have an ancient account there) and I'd surely volunteer to manage that end of things. I've learned that the best way to boost a coder's efficiency is to take everything that's not coding off his hands, and I'm more than happy to take anything off your hands if that gets me an FFH with actual AI enemies (as opposed to victims ;P)

2) BtS. I'm thrilled that Kael wants to look at AI stuff when BtS is out, but I also agree with xanaqui: any work we can get done now will only benefit us. We'll get a better understanding of the things that need to be done and how to get them done. Worst case situation we have to do everything again. So what? And if we can merge better AI with FFH, I'm sure we can also merge pre-BtS FFH + Better AI with post-BtS FFH without Better AI. I hope. ;)

3) Can I please please please have a functioning version? I can't wait to try this! :D
 
@Xan and Bringa: thats cool, I love that you guys are looking into this too, I just didnt want to pull the rug out from underneath you when changes are made. I agree that this is the perfect time to try things and learn.
 
1) Code distribution. I've got root on a very decent server and could set us up a little minimal webpage there (as well as a CVS/SVN repository, whatever floats your boat). SF.net would work as well (I have an ancient account there) and I'd surely volunteer to manage that end of things. I've learned that the best way to boost a coder's efficiency is to take everything that's not coding off his hands, and I'm more than happy to take anything off your hands if that gets me an FFH with actual AI enemies (as opposed to victims ;P)
Great. I'm not very optimistic about this version strengthening the AI a lot; I don't think it's going to do a lot for the Technology tree, and it obviously isn't going to help much with the vast majority of new features.

Personally, I like source control. I presently have SVN installed, but I assume that CVS is fine, as well.

3) Can I please please please have a functioning version? I can't wait to try this! :D

Unless you have a different (preferred) distribution method, I'll start up a new thread once I have something that I've confirmed as useful to test (I'm hoping for Sunday). If you can suggest a name, I'm all ears. I'm thinking of the following starter topics for the thread:
1) Stable version (empty except for a warning that there is none yet)
2) Current version (everything at the moment; eventually just the distributed files)
3) Features
4) Planned Features
 
I don't think it's going to do a lot for the Technology tree

What do you want to do about the tech tree that can't be done with XML flavours and python?

(I guess this post is to advertize the fact RoM flavour changes seems to make the AI research better ;))
 
What do you want to do about the tech tree that can't be done with XML flavours and python?

(I guess this post is to advertize the fact RoM flavour changes seems to make the AI research better ;))
I'm glad that the flavor changes you have made are working well.

1) Have the code reflect relative values of various things better (ex: str 10 unit is better than str 1 unit).
2) Have the code acknowledge the value of various things the correct number of times (so it doesn't double, tripple, or quadruple-count builds, for example).
3) Have the code value the technologies according to the resources that it has, and (to a lesser degree) vice-versa.
4) Simplify the entry of those flavor changes into XML (say, by using a 1-100 scale, instead of an open-ended int).
5) Improve this to the extent that there's little need for the various forces that are performed in the python code.
 
Names, eh? You ask me for a name! You do not yet realize your mistake! You never ask ME for a name! So let's have some names:

Smarter Orcs
AID&D
The Smartalfar Mod (if in doubt, go for the pun)
Brains Fell From Heaven

Actually, really, don't ask me for names ;)

Very quickly about flavour changes and the AI's tech selection, because I've played extensively with those as well (in the process extending the VB functions of the editor a good bit, before capitulating and admitting to myself that if I want to keep introducing new flavour types I'd be much better off just digging into the XML itself) (I have some ideas how to make the editor more flexible if introducing new stuff that pushes things down into lower rows becomes a regular activity--but that's rather OT). Essentially, you can actually use flavour to add flavour to the game (imagine my surprise!)--my Ljosafar actually did favour archery and scout, my khazad ended up building lots of cannons etc. The thing is that through flavours all you can do is help the AI to the things that will tend to be smarter in standard situations. It does nothing for contextual decisions (there's no bronze or iron anywhere--maybe I should not go for melee) (not so bad in 2021 anymore, but still a major factor), which means that in most all situations where good decision-making is a make or break factor for the AI's game, the flavours don't help.

Having said that, I enjoyed the hell out of a few games where I helped the AI with flavours. Subjectively they performed a lot better, and especially "difficult" races for the AI like the Calabim were suddenly real enemies (they actually rushed vampires). This is a decision we'll have to take at some point during our mini-mod: do we only want to boost the actual performance of the AI or do we want to look into these things that make the AI feel like they're performing better? I'll definitely have a look at what maniac did with his flavours in RoM. I've actually added 23 flavour types in my current version of FFH (one for most races, and one for each combat unit type--siege, disciple, melee etc)


Okay, back to our topic. Xanaqui, do you know how much Better AI improved the AI's decision making in selecting techs? Because the things you listed do make a lot of sense and I'd be surprised if Better AI doesn't address that at all.

Concerning this:

5) Improve this to the extent that there's little need for the various forces that are performed in the python code.

There are only minimal forces, and that's mostly racial stuff (Ljosafar and Khazad hurrying their respective religions, everyone hurrying exploration for whatever reasons), and it can already be addressed with flavours (simply give the religion techs very high flavours for those races).

Xanaqui, do you have an SVN server installed there at an easily reachable PC? (dyndns or somesuch?) We have multiple options concerning SVN, but I'd propose we simply get ourselves a sourceforge account and use that. If you need more control for some reason, I can poke around the svn server I have installed on my root server. I've only used it locally (coding through putty, wee), but it won't be very hard to enable remote access via apache 2 and webdav. (actually I just figured out that it won't be very easy to do that after all with apache 1.x, which we're running, so let's just go for sf.net) I volunteer for managing the sf.net project.

1) Stable version (empty except for a warning that there is none yet)
2) Current version (everything at the moment; eventually just the distributed files)
3) Features
4) Planned Features

I can do that topic. Basically, I'd do it like this:

<state very concisely what our aim and our current status is>

Stable Version: point out that there is none, right now

Current Version: link to sourceforge I'd say. I don't know how big a file we can upload to civfanatics itself, and I don't expect very big files (cvgamecore will hardly grow beyond 5mb, no?), but you never know, and it'd make sense to keep everything in one place.

Features. Basically a list of stuff we've got working. Maybe this will also be a good point to mention that we've basically merged Better AI with the FFH source, and link to Better AI. Once we move beyond Better AI, we list the basic points that we've tried to change here. I don't think we should get too bogged down with a very detailed changelog. If you employ a consistent and informative commenting style we can pull some stuff straight out of your comments.

Planned features: I'm not sure we need this at all. Maybe there can be a more general "about this project" section here, where we describe what the weaknesses we perceive are and what our ideas are for fixing them.


Should we post that topic before we have any files to put up? I'd say we wait until you have a first version, no matter how pre-alpha it will be, that people can download and play with. Having a topic with a great mod idea but nothing to download is such a, uhm, rooster-tease.
 
Names, eh? You ask me for a name! You do not yet realize your mistake! You never ask ME for a name! So let's have some names:

Smarter Orcs
AID&D
The Smartalfar Mod (if in doubt, go for the pun)
Brains Fell From Heaven

Actually, really, don't ask me for names ;)
I like Smarter Orcs :) Unless I think of a better name prior to the initial release, Smarter Orcs (a FfH II mod) it is.
Very quickly about flavour changes and the AI's tech selection, because I've played extensively with those as well (in the process extending the VB functions of the editor a good bit, before capitulating and admitting to myself that if I want to keep introducing new flavour types I'd be much better off just digging into the XML itself) (I have some ideas how to make the editor more flexible if introducing new stuff that pushes things down into lower rows becomes a regular activity--but that's rather OT). Essentially, you can actually use flavour to add flavour to the game (imagine my surprise!)--my Ljosafar actually did favour archery and scout, my khazad ended up building lots of cannons etc. The thing is that through flavours all you can do is help the AI to the things that will tend to be smarter in standard situations. It does nothing for contextual decisions (there's no bronze or iron anywhere--maybe I should not go for melee) (not so bad in 2021 anymore, but still a major factor), which means that in most all situations where good decision-making is a make or break factor for the AI's game, the flavours don't help.

Having said that, I enjoyed the hell out of a few games where I helped the AI with flavours. Subjectively they performed a lot better, and especially "difficult" races for the AI like the Calabim were suddenly real enemies (they actually rushed vampires). This is a decision we'll have to take at some point during our mini-mod: do we only want to boost the actual performance of the AI or do we want to look into these things that make the AI feel like they're performing better?
My thought is "both". Frankly, I'm more interested in the former, but the later can make dramatic playability changes with less effort.

I'll definitely have a look at what maniac did with his flavours in RoM. I've actually added 23 flavour types in my current version of FFH (one for most races, and one for each combat unit type--siege, disciple, melee etc)
When you get a chance, I'd suggest putting those changes into this modmod, as well. Obviously, when I do Tech. SDK changes, it would have an effect on the XML.

Okay, back to our topic. Xanaqui, do you know how much Better AI improved the AI's decision making in selecting techs? Because the things you listed do make a lot of sense and I'd be surprised if Better AI doesn't address that at all.
My perception is that there are some mild improvements, but that one "improvement" for Vanilla is actually significantly worse in many cases in FfH (it heavily favors Unique Units - which makes sense for most civilizations in Vanilla or Warlords, but not in FfH II, where many Unique Units are unique for the name and/or graphics).
Concerning this:



There are only minimal forces, and that's mostly racial stuff (Ljosafar and Khazad hurrying their respective religions, everyone hurrying exploration for whatever reasons), and it can already be addressed with flavours (simply give the religion techs very high flavours for those races).

Xanaqui, do you have an SVN server installed there at an easily reachable PC?
(dyndns or somesuch?)
No. Could I set up this PC to be an SVN server? Probably, but unless we were planning to make that a permanent arrangement (something I wouldn't advise), I don't think it would be worth the time.
We have multiple options concerning SVN, but I'd propose we simply get ourselves a sourceforge account and use that. If you need more control for some reason, I can poke around the svn server I have installed on my root server. I've only used it locally (coding through putty, wee), but it won't be very hard to enable remote access via apache 2 and webdav. (actually I just figured out that it won't be very easy to do that after all with apache 1.x, which we're running, so let's just go for sf.net) I volunteer for managing the sf.net project.
I like that. I will initially post the sources on a thread in a .zip file. We can replace that with a link to the Sorceforge project once it's set up.

I can do that topic. Basically, I'd do it like this:

<state very concisely what our aim and our current status is>

Stable Version: point out that there is none, right now

Current Version: link to sourceforge I'd say. I don't know how big a file we can upload to civfanatics itself, and I don't expect very big files (cvgamecore will hardly grow beyond 5mb, no?), but you never know, and it'd make sense to keep everything in one place.
The present candidate is already over 5 meg (although about 1.3 zipped). I think that I'd prefer to do the "release" through the mechanisms here, and the sources through Sourceforge.

Features. Basically a list of stuff we've got working. Maybe this will also be a good point to mention that we've basically merged Better AI with the FFH source, and link to Better AI. Once we move beyond Better AI, we list the basic points that we've tried to change here. I don't think we should get too bogged down with a very detailed changelog. If you employ a consistent and informative commenting style we can pull some stuff straight out of your comments.

Planned features: I'm not sure we need this at all. Maybe there can be a more general "about this project" section here, where we describe what the weaknesses we perceive are and what our ideas are for fixing them.


Should we post that topic before we have any files to put up? I'd say we wait until you have a first version, no matter how pre-alpha it will be, that people can download and play with. Having a topic with a great mod idea but nothing to download is such a, uhm, rooster-tease.
I think I largely agree with you here.
 
Concerning my flavors:

1) I will first have a look at what Maniac did with RoM; it's quite possible he invested more time and thought into this than me, in which case I will (with his permission, of course ;)) steal that stuff from him.

2) My current flavors are based on some older patch... 2021d I think. I'll see how well stuff merges. Theoretically it shouldn't really be a problem. 2021f looks like it'll be the last patch for the 2021 line, right?

3) I haven't actually finished flavoring UNITS (because doing that with the editor is suicide, so I have to dig through the xml, and there's a LOT of units), so I'll probably be doing that while you work on the other stuff.

Looks right now like we'll pretty much need at least a complete assets\xml folder in the repository, plus the sources of course. You're working on 2021f sources, right?

I'm gonna go set us up with a sourceforge project at some point today and get back to you with the details.

Really happy this is moving forward :)
 
Concerning my flavors:

1) I will first have a look at what Maniac did with RoM; it's quite possible he invested more time and thought into this than me, in which case I will (with his permission, of course ;)) steal that stuff from him.

2) My current flavors are based on some older patch... 2021d I think. I'll see how well stuff merges. Theoretically it shouldn't really be a problem. 2021f looks like it'll be the last patch for the 2021 line, right?
I would guess so, barring a major defect fix that they feel they have to release ASAP.
3) I haven't actually finished flavoring UNITS (because doing that with the editor is suicide, so I have to dig through the xml, and there's a LOT of units), so I'll probably be doing that while you work on the other stuff.

Looks right now like we'll pretty much need at least a complete assets\xml folder in the repository, plus the sources of course. You're working on 2021f sources, right?
I'd suggest the python as well, although that can wait until someone works on it. Yes.
I'm gonna go set us up with a sourceforge project at some point today and get back to you with the details.

Really happy this is moving forward :)
 
Back
Top Bottom