 |
|
MadWoodster
|
|
A wierd and mad place called Southampton
Jan 2000 time: 05:13
|
|
Well the first thing to start with would be what each of the files refers to in the AIDATA directory.
I know that default, barbarian, scifew, scimany, milfew, milmany and slaver refer to these type of AI's but I haven't a clue what the others refer to or even what the few and many mean.
Also I was thinking about starting up a page devoted to these files on my Uni account which I may do once this page gets going.
|
|
|  |
 |
|
Nordicus
|
 |
Vancouver, B.C., Canada
Oct 1999 time: 21:13
|
|
Well, I don't think I have time right now to get into all of them, but for starters, we have the fli files.
aiploader.fli
has a file beside it with lots of info, but generally speaking, it's responsible for loading all the aip files--any additional aip files one creates must be included in here.
beginturn.fli
files have a text file as well, summarizing what it does--it's responsible for loading the appropriate fli files for each aip.
def_personality_who...
files I have never adjusted, don't know much about them; they seem to lay down a few default (output) setting for each aip. Wes did more work with the outputs department, so I'll leave this one.
Ah, the 17 diplomacy files are next--my favorite, but I'll have to get back to that...gotta run here.
Tom
|
|
|  |
 |
|
WesW
|
 |
Florence, Al., USA
Jan 1970 time: 23:13
|
|
Most of what I know I learned from CD's comments texts. I then figured out other things from trial and error and careful study of the texts.
Get CD's comments, which are in the aidata folder with the Apolyton Pack, and probably the Med mod as well. Put this together with the AAips readme, and you will have a pretty good overview of the files.
I hesitate to say much more, because most of my work was trial and error- change something and see what happened. Half the time, it came down to "Well, this *might* help the game, and I am pretty sure it doesn't *hurt* anything, so I will keep the changes."
I marked many of my changes with "//WW", or something similar, so you can open the AAips readme, and scroll down through the individual aidata files as you read, noting the "//", and figure out what I mean. There were some files I didn't do this, if I changed entire lines, or altered an AI-specific setting to that of another AI (I did a lot of this in the set_settle density fli). For these files you could compare the original files to mine to see the specific changes.
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:13
|
|
Yeah fellows, I think we've all been forced down that route. It was real nice of Activision to give us access to all these files, but it would have been even nicer if they'd given us even the slightest clue as to what was going on in them. As it is I've spent the last two months reading about Fuzzy Logic and trying to see how they've used it in CTP. Here's a very brief sketch of what I've come up with:
What we've got here is a Fuzzy Logic Inferencing System. First, a few key definitions:
the set of fuzzy truth values = [0,1], i.e., the set of all real numbers between (and including) 0 and 1.
a linguistic variable is a variable that ranges over the set of fuzzy truth values.
a membership function is a function from the set of real numbers into the set of fuzzy truth values; so given a specific real number a
membership function will return a fuzzy truth value.
A FLI system uses inference rules to transform inputs into outputs. By the way, Fuzzy logic includes Boolean logic so a lot of the inferencing the system performs is just standard Boolean stuff but done in a rather more complicated framework..
Anyway, not all the inputs and outputs in the aidata files are used in fuzzy inferencing. The ones that are used are the ones that are immediately followed by one or more left, right or tri statements. These statements serve to associate a linguistic variable with that input or output and also to associate a membership function with that variable. I guess it's time for an example; consider the input:
input distance_to_nearest_human_capitol
tri human_capitol_ten_or_less(distance_to_nearest_huma
n_capitol, 5.0, 4.5)//aiploader
tri human_capitol_ten_to_fifteen(distance_to_nearest_h
uman_capitol, 11.5, 4.0)//aiploader right human_capitol_twenty_or_more(distance_to_nearest_h
uman_capitol, 20.0, 1.0)//unused
Here there are three linguistic variables associated with the input, namely human_capitol_ten_or_less, human_capitol_ten_to_fifteen, and human_capitol_twenty_or_more. Now take human capitol_ten_or_less. It's membership function has the shape of a triangle with the vertices:
(1,5)
/ \
/ \
/ \
/ \
/________\
(0,.5) (0,9.5)
In the case of human_capitol_twenty_or_more the membership function has the shape of a right hand trapezoid:
(0,1) (0,21)
_______
/
/
___________/
(0,0) (0,19)
So, what happens is that given a specific numeric value for the input the game engine plugs this number into the above functions and then assigns the resulting fuzzy truth values to the associated variables. In aiploader, there are some inference rules in which these linguistic variables, and others, occur in the antecedents. The game engine performs some calculations (depending on fuzzy interpretations of 'and', 'or', and 'not') and passes on the resulting fuzzy truth value to the linguistic variables occuring in the consequents of the rules. These linguistic variables, which have their own membership functions, are associated with outputs and the game engine now uses this data (the fuzzy truth values of the linguistic variables and the membership functions associated with those variables) to calculate, in a not obvious way, the numeric values of the outputs. (Actually, the example I started is essentially Boolean; it's the general case where the output is associated with a string of
linguistic variables as in:
output production_tax[0.0, 1.0]=0.99
tri super_zero_production_tax(production_tax, 0.001, 0.1)
tri zero_production_tax(production_tax, 0.0, 0.00025)
tri low_production_tax(production_tax, 0.10, 0.00025)
tri med_production_tax(production_tax, 0.30, 0.00025)
tri high_production_tax(production_tax, 0.50, 0.00025)
tri super_high_production_tax(production_tax, 0.80, 0.00025)
tri max_production_tax(production_tax, 1.0, 0.00025)
where the calculation of the numeric output value can be rather complicated.)
Anyway, I realize that this hardly counts as an explanation but I'm working on a proper one and as soon as I get it done I'll send it to Apolyton.
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:13
|
|
Sorry about the diagrams, fellows. I see they didn't work.
|
|
|  |
 |
|
MadWoodster
|
|
A wierd and mad place called Southampton
Jan 2000 time: 05:13
|
|
Might be the minimum and maximum values at a guess. A nice programming tricks so you can quickly change the minimum and maximum values without editing all your source code.
|
|
|  |
 |
|
gemini
|
|
Hi Locutos, I have spent quite some time going through the aip and fli files. To answer your for eg.
Output production_tax [0.0, 2.0] = 1.9
The default value for production_tax is set to 1.9 and the [0.0, 2.0] are just ranges.
If you look at the tri statements usually underneath they set the true value of production_tax.
So a tri statment for eg.
tri yes_production_tax ( production_tax, 1.0 , 0.5)
Would set production_tax value at one.
So if there was a statement like this
if(yes_warrior and yes_settle_dense)
{
yes_production_tax
}
So if the arguments were true then production_tax is set to a value of one.
There you go, this is just my best guess, I am inexperienced when it comes to any kind of programming. So I could be wrong about this. If you want more information on inputs and outputs search up those two words on the forum and I came up with a really good thread I think started by Cd. Also I do believe cd did talk about this in his comments. Thanks Cya
------------------
Gemini
|
|
|  |
 |
|  |
 |
|
WesW
|
 |
Florence, Al., USA
Jan 1970 time: 23:13
|
|
I can see now why I went into Industrial Engineering rather than Computer Engineering. Peter, that was painful to read. I'm a junior level engineering student, and that was painful.
I can see that you guys are probably going to laugh your asses off when you go through my work with the AAips, because I had no idea about how that stuff worked. I did spend many hours, though, trying to get a handle on it.
Anyway, when you do get it straightened out, I have a few specific areas I would like for you guys to look into. These are things that would really improve the game, but that I was unable to do anything with (not surprising since most of my work was trial and error guesswork).
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:13
|
|
Wes, I'm not a computer expert either. My background is logic/mathematics and that's the angle I've approached this from. (So I could be wrong, but I'm pretty confident that I'm not.)
Anyway, as far as your other comments are concerned, I don't see how anyone could have proceeded in any other way than by trial and error. Until recently that's what I've been doing too. Apparently, this stuff is more than a little obscure. Before Christmas I met a guy who turned out to be a lecturer in Computer Science at my local university (Oxford, no less). I hastily scribbled down some left, right, and tri statements and asked him what he could tell me about them. "Looks like some sort of functions, but it's nothing I'm familiar with." So, we've been in good company.
As far as the fuzzy logic program is concerned, I've e-mailed you and Nordicus copies of what I've got so far but I've sort of put it one the back burner. When this API for the AI DLL comes out, hopefully there'll be some useful information in it.
Speaking of which, like I say I'm not a computer expert so, as I understand it, the AI DLL is what runs these files and the API (which stands for *something* programmer's interface) is the programmer's notes on how it works. Could someone who knows more about this (Skorpion59, maybe) tell us more about this and what we can expect?
|
|
|  |
 |
|
Daniel Frappier
|
|
Montreal, Quebec, Canada
Jan 1970 time: 05:13
|
|
I have a degree in computer science and I understood nothing when I first looked at the .aip and .fli files.
It is only when somebody made the first findings (I don't remember who it was) that I understood the basics. Then I went through a couple of web sites that talks about "fuzzy logic" and I understood a lot more.
If I would have an advice to anyone interested in the .aip and .fli it would be to learn more about "fuzzy logic" that should give a much more solid understanding of CTP's inner workings to anyone interested.
The possibilities behind the release of the AI's DLL headers are huge but the amount of work that will be involve in making an other DLL will also be probably huge and with CTP II coming I don't know if it will be worth it.
|
|
|  |
 |
|  |
 |
|
skorpion59
|
|
Tulsa, Oklahoma, USA
May 1999 time: 23:13
|
|
This is simplified to make it easier to understand. The DLL's are an extension to the executable. Instead of having a 6 million line straight top-to-bottom, go-to executable, the code is broken up into segments. Each segment (DLL) is capable of 'calling' (executing) other segments (EXE, DLL's) directly. The main executable is basically the controlling program that starts the whole process. The API (Advanced Programmers Interface) is simply a pre-made interface that was created to make it easier to access low-level functions. For example, say you want to write a file to disk. You simply call the 'WriteFile' API and pass it the information on the file you want written. Without API's, you would have to access the low-level (assembler) functions required to write a file. This would include allocating handles, allocating disk space, moving the memory contents, writing the file, moving file pointer, etc, etc. It actually gets very complicated. API's give you one, easy function to call which handles all the dirty work for you (talking to the operating system). Another example would be opening a new window. You simpy call an 'OpenNewWindow' API in your program. The API does the dirty work of telling the operating system HOW to open the new window. This is comparable to the old days of calling DOS INT functions. It just does the dirty work for you.
Daniel is right. The AI API's *could* be very valuable in modifying the AI behavior, depending on what API's they release. The problem is, the time required to learn and write new code will probably surpass the release of CtP2. Thus rendering it pretty much a waste at this point. However, if we ever actually get the info, there might be parts which could be implemented fairly fast. It all depends on what Activision releases. UPDATE: To make sure you understand, let me say this. Joe Blow doesn't call API's from a modified text file like the mod makers currently do. API's are used by executables only. This means writing and compiling new code. That is why Steve mentioned a "Developer" was interested. It is not meant for the normal user.
The AIP's are not computer related thus the reason computer people don't fully understand them. Fuzzy Logic is purely mathmatical in nature. The computer only comes to play in regard to how the fuzzy logic is called and executed. Fuzzy logic has been upgraded and refined since I last worked with advanced mathmatics. I understand the basic principle but that is about it.
UPDATE: In reading back over this, I realized I didn't answer the question of what to expect. Unfortunately, I will have to see what API's they give us before that will be known.
------------------
Don,
CtPMaps (Hosted by Apolyton)
[This message has been edited by skorpion59 (edited April 08, 2000).]
|
|
|  |
 |
|
Daniel Frappier
|
|
Montreal, Quebec, Canada
Jan 1970 time: 05:13
|
|
Locutus,
I haven't any specific address, it as been a while I looked at that.
If you do a simple search from Yahoo with +fuzzy +logic you will find many many sites, some are for beginners and some are directed more toward researchers and others are in between.
|
|
|  |
 |
|  |
 |
|
gemini
|
|
Hi Locutus, Yes it is possible to add new personalities, I have added 8 new personalities for my scenario.
Let's say you want to add a new personality called "gemini"
These files will have to be added.
beginturngemini.fli
def_personality_who_gemini.fli
maingemini.fli
personalitygemini.fli
Inside these files you'll have to change a few lines to include your new file. For example in personalitygemini.fli you'll have to make sure it says.
#include "maingemini.fli"
And I think a line in maingemini.fli will have to be changed but it'd be good just to check the other two files as well just incase you have to change them as well to include your new files.
Now make sure you go into civilisation.txt and add your new personality to one of the civs. for example.
CIV_PERSONALITY_MALE "gemini"
Now, the hard part is defining your new personality in the aiploader but how the game defined it's personalities is pretty simple.
It revolves around a combination of these variables.
output warrior[0.0, 2.0] =1.0
tri yes_warrior(warrior, 1.0, 0.1)
output scientist[0.0, 2.0] = 0.0
tri yes_scientist(scientist, 1.0, 0.1)
output slaver[0.0, 2.0] =0.0
tri yes_slaver(slaver, 1.0, 0.1)
output cleric[0.0, 2.0] =0.0
tri yes_cleric(cleric, 1.0, 0.1)
output barbarian[0.0, 2.0] = 0.0
tri yes_barbarian(barbarian, 1.0, 0.1)
and whether it settles densely or loosely as defined in the beginturn files.
So that's basically how they defined the personalities for eg.
if(yes_warrior and yes_settle_dense)
{
yes_warmany
}
The hard part I think is adding in all your new statements so you can have a new personality. What I did for my new 8 personalities was just add this line in each beginturn file.
action load("british.aip") when (num_cities < 100.0)
and I excluded for it to include the aiploader file.
So it will load my british.aip when the cities are less than 100. Same as how the barbarians do it. And I used the same settings for each nation as far as setting production and stuff like that. The main thing I was really concerned about was that each nation had a specific aip build list. So I never really added a new personality, just specific aip for 8 of the civilizations. So adding a new personality for specific aips isn't that hard, but adding a new personality would be probably alot of work.
Anyway, hope this helps and if you have anymore questions just ask.
This is all from memory so I hope I got everything right.
I did do extensive testing though and it does all work.
Cya!!
------------------
Gemini
|
|
|  |
 |
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:13
|
|
Don, thanks for that very thorough explanation. It certainly cleared things up for me.
I seem to recall that you were asking for suggestions about what sort of maps people might want. How about a 'Mod Maker's Testing Map'?
What I've got in mind is a gigantic map divided up into eight identical blocs. It could be completely artificial and unlike anything the CTP generator might produce, never mind the real world. This would allow a mod maker to put one civilization for each personality type into a bloc (so one's empty) and see how they variously develop while holding their geographical backgrounds constant. As for what specific geographical features it should have, I don't know. But if anyone's got any ideas, here's the place to post them.
Speaking of maps, has anyone modified the map generator in Const.txt and got maps that they're really happy with. I've tried this and got what can be described as improved maps but they're still not top grade.
|
|
|  |
 |
|
skorpion59
|
|
Tulsa, Oklahoma, USA
May 1999 time: 23:13
|
|
Peter,
I actually have a map used for that purpose which I included with my origianl Apolyton Pack add-on. I mostly use it for testing but it can be intersting to play on for real. Seeing how every Civ has an identical continent, it is fun to see how they populate it compared to how I populate it. It is also fun to see how other humans play it compared to how I play it. I didn't think many people would be interested in it so I have not really made it available to others. Perhaps I should.
I have made some extensive changes trying to produce a 'good' map through the map generater program. This is an ongoing process I explore when I have the time. Like you, I have produced better maps but not good maps. I hate those 30 tile mountain ranges so that was my first priority. I no longer get them but I also don't get as many mountains as I would like. Same with hills. They have been drastically reduced. I have also increased rivers quite a bit. In some of my latest testing, I have been able to get ice, tundra (white) tiles to only occur within 2-3 tiles of the top and bottom borders. Unfortunately, most of the changable settings work off a basic setting (as compared to being the actual setting) thus it is basically impossible to get rid of regular tiles (grass, plain, desert, swamp, forest). I have changed the percentage of each type to 0 and still get way more than I care for. Basically, at this point, I create a 'better' map and then customize it for the game.
|
|
|  |
 |
|
curtkath
|
|
Outremont, Quebec, Canada
Apr 2000 time: 05:13
|
|
I know it isn't the right forum for this, but has anyoone here tried to change what the huts can give, beyond altering the ratios? I'm thinking of changes such as giving public works points, affecting reputation, or finding a new good; something to add for variety, and to partly replace finding new advances.
|
|
|  |
 |
|
gemini
|
|
Hi Curtkath
I don't think adding any new benefits to goody huts is possible at all. It's to bad cos it would be interesting to add more benefits to goody huts.
------------------
Gemini
|
|
|  |
 |
|
Nordicus
|
 |
Vancouver, B.C., Canada
Oct 1999 time: 21:13
|
|
Wes, that might have been me, I have no clue, but it looks like a chunk from map.txt, right?
Curtkath, Gemini:
Hey...
Open up risks.txt, defeault/gamedata:
you'll find all that here, for the 4 risk levels for barbarian values; apparently, one could even add a level....but anyway,
quote:

RISK_RAGING_HORDES {
BARBARIAN_HUT_CHANCE 0.25
MAX_HUT_BARBARIANS 4
GOLD_HUT_CHANCE 0.2
MAX_HUT_GOLD 700
ADVANCE_HUT_CHANCE 0.20
MAX_HUT_ADVANCE_PREREQUISITES 2
UNIT_HUT_CHANCE 0.15
MAX_UNIT_PREREQUISITES 2
CITY_HUT_CHANCE 0.05
SETTLER_HUT_CHANCE 0.1
MIN_HUT_GOLD 350
BARBARIAN_CHANCE 0.10 #Chance of barbarians appearing at random
BARBARIAN_RANK_MAX 8
BARBARIAN_RANK_MIN 15
MAX_SPONTANEOUS_BARBARIANS 2
FIRST_BARBARIAN_TURN 20
LAST_BARBARIAN_TURN 350
MINIMUM_BARBARIAN_DISTANCE 5
}
 |
I don't know about adding things...as with other test files, you can add (thru a trial-&-error system) all types of things, and if it crashes, well, take it out; if it doesn't, start testing to see if it actually works or not or is merely sitting there torpid and useless.
|
|
|  |
 |
|
skorpion59
|
|
Tulsa, Oklahoma, USA
May 1999 time: 23:13
|
|
Yes, the map info is from the map.txt file which is the input file to the 4 map generator plugins. However, the info in the post is the default info, nothing has been altered.
|
|
|  |
 |
|
Dogmatrix
|
|
Moama, N.S.W, Australia (+11 GMT)
Apr 2000 time: 05:13
|
|
Wasn't this thread for AIP's and fli's?
Not a problem anyway cause sprouts in speech are interesting. 
Just a question, seeing as I have made all these new units for my mod I'll have to get the AI to use them. Inside each personallyties AIP file there are what units it builds for what and how often, likely it is, they will build them. For my other races I am just going to copy and change the already exsisting AIP's and fli's, setting them up with the right research ques and stuff. All I want to know is will this work?
I know that they use the function name, ie UNIT_WARRIOR, and not the string name, "warrior", so I think it should be O.k. Just wanted to know whether my assumptions were right. 
Thanks for reading this overly long post,
Dogmatrix
|
|
|  |
 |
|
gemini
|
|
Hey Dogmatrix, if you are adding units or techs to a game, the only thing you have to worry about is adding them to your aip files. Have you seen any of cd's comments?? They are in the modification area of this site. I recommend you read the information on aip files that cd has written for more info on these files.
Also for adding units and techs, if you don't want a certain personality to be able to build or research certain things don't put it in that aip personality file. Also there are more aip files for different situations that override the default aip for each personality. Just so you know if you don't already.
Hey Nordicus I see you made your way back to us. Welcome back man.
Oh Ya, your assumptions on the UNIT_WARRIOR and not using the string name "warrior" are correct.
------------------
Gemini
[This message has been edited by gemini (edited May 05, 2000).]
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:13. Apolyton Time is 00:13. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|