You must be logged in to post messages.
Please login or register

AI & RM Scripting
Moderated by Sebastien, Leif Ericson

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Is it posible to go against custom ais in a multiplayer rm
« Previous Page  1 2  Next Page »
posted 09-22-09 05:56 PM CT (US)   
Is it posible to make a custum ai enter an rm game.

Like to fill in the slots when needed.

For multiplayer.

[This message has been edited by cecilpaladin (edited 09-22-2009 @ 06:19 PM).]

Replies:
posted 12-21-09 09:12 PM CT (US)     51 / 73  
Thank you Leif.^^

ARFFI: A scripter from japan : Main script ARFFI-De'gel
posted 12-27-09 01:45 AM CT (US)     52 / 73  
ARFFI, here are the maps you requested. Sorry for the late response.

Custom Team Islands - This map is just like the team islands map, but the AI treats it as a custom map.

Migration Islands - This map is like migration but there is more water and there are islands with gold and stone on them.

I could not find an easy way to get a map for your second request. Whenever you make a new map, an AI always treats it as a custom map, whether or not you tell it that it is a team islands map.

However, I found two ways around this. The best method is to use Mod Pack Studio. Open up the "Maps" section and open one of the files that says "Resource #54201" (open up either one). Find the line in the file that says "ai_info_map_type ARABIA" and change it to "ai_info_map_type TEAM_ISLANDS". Save your mod. Then load up a random map game and choose the arabia map. The AI will now treat the Arabia map as a Team Islands map. Make sure to change this line back to ARABIA after you're done testing your AI or you'll see AI's building docks in the Arabian oasis lakes.

The second method is to generate an arabia map in the scenario editor, then go to the Terrain tab and change the AI Map Type drop down menu to Team Islands. However, this method would still have that map-size problem that the scenario editor has.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
posted 12-28-09 00:43 AM CT (US)     53 / 73  
Thank you Leif.

Great happiness to have them on the last day online (this year).lol
Now I can take tests for migration till next year.^^
Wish me luck.

Also, thanks for the tests that I was planning.
So is it like this?
1)Using ModPack, the Arabia map will be detected as Team_Island but and has map-size problem? (no comment so I assume)
2)For scenario, the map-size-problem is still there.
3)Cause you have not commented anything, Custome_TI you made has the same map-size trouble.

If so, it is a great help to know that the map-size problem is not an issue with the "map-terrian-tab" and the map-style-itself.
Sorry but the MPS has some trouble with my PC (cause not english version?) so I will be happy if the map-size problem is still there with MPS too.
I am quite interested in this problem as a scripter.^^

[Edit]
Leif, I have some problems with the DL.
It just jumps to http://www.filedropper.com/ and no file is found...

ARFFI: A scripter from japan : Main script ARFFI-De'gel

[This message has been edited by ARFFI (edited 12-28-2009 @ 00:46 AM).]

posted 12-28-09 01:56 AM CT (US)     54 / 73  
Sorry about the links not working. I think something is wrong with the site. I tried to upload an mp3 file there recently and it would always redirect to the home page. Is there another site you know that works that doesn't require registration or making an account?

I had to reread this topic to refresh my memory. I believe the Arabia-map-detected-as-Team-Islands map will have the normal sizes for both random maps and scenarios. However, I could easily be wrong, and the sizes could be different for random maps and scenarios (the random map would then be bigger than the scenario). It all depends on whether the script or the tag is what changes the map size.

I'm pretty sure that the custom-team-islands map will have the same problems that the team islands map has. But, like the map above, it needs testing.

Changing the AI Map Type in the scenario editor after the map is generated doesn't change the size of the map, though the AI might see it as a different size.

I'm sorry I'm not sure about what settings will cause what. My mind is so blank on this and I don't have the time tonight to test. If you are really interested I can test tomorrow or the day after. Also, I can make a .dat file if you really want to use that method with MPS (which I believe is the better option).

I'll post the settings that are caused by the random map generator and the editor in the game. However, with these new random maps it may produce different results. Here they are anyway:

ARABIA MAP (random map and scenario editor):
Map Size:
TINY MAP
SMALL MAP
MEDIUM MAP
NORMAL MAP
LARGE MAP
GIANT MAP
Number of Tiles:
120 x 120
144 x 144
168 x 168
200 x 200
220 x 220
240 x 240
AI reads map as:
TINY
SMALL
MEDIUM
NORMAL
LARGE
GIANT


TEAM ISLANDS MAP (random map):
Map Size:
TINY MAP
SMALL MAP
MEDIUM MAP
NORMAL MAP
LARGE MAP
GIANT MAP
Number of Tiles:
144 x 144
168 x 168
200 x 200
220 x 220
240 x 240
255 x 255
AI reads map as:
TINY
SMALL
MEDIUM
NORMAL
LARGE
GIANT


TEAM ISLANDS MAP (scenario editor):
Map Size:
TINY MAP
SMALL MAP
MEDIUM MAP
NORMAL MAP
LARGE MAP
GIANT MAP
Number of Tiles:
144 x 144
168 x 168
200 x 200
220 x 220
240 x 240
255 x 255
AI reads map as:
SMALL
MEDIUM
NORMAL
LARGE
GIANT
GIANT


Archipelago maps, fortress maps, islands maps, and migration maps act the same as team islands maps. All other maps are normal.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´

[This message has been edited by Leif Ericson (edited 01-22-2010 @ 02:20 PM).]

posted 12-28-09 02:30 AM CT (US)     55 / 73  
Thanks Leif for the data and all.

It is quite interesting that the maps that has the size trouble has some easy detection for AIs.
The point is that the wall-completed-percentage will be 100% without any walls with all of these maps and the map-size-problem might be somthing related for that.
After we test more, lets take about this.^^

Also, I can not use MPS for some reason.
Sorry, but thanks for the proposal for the .dat file.
(I wish to let ARFFIs be adaptable with MPS maps too tough.)


Ex. Island detection rules for ARFFI's

(defrule
(game-time > 10)
(goal g-temp0)
(or(goal g-map-typeLAND_CONTINENT)
(goal g-map-typeNM_L_CONTINENT))
(building-type-count town-center > 0)
=>
(enable-wall-placement 2)
(set-goal g-temp-1)
(chat-to-player my-player-number "Island Detection. Credit to Bothorth.")
(disable-self)
)

(defrule
(game-time > 10)
(goal g-temp0)
(goal g-map-typeLAND_CONTINENT)
(wall-completed-percentage 2 == 100);<-this is the key
(players-building-type-count my-player-number stone-wall-line < 50)
(players-building-type-count my-player-number palisade-wall < 50)
(building-type-count town-center > 0)
=>
(set-goal g-map-typeS_ISLAND)
(set-goal g-temp-1)
(chat-to-player my-player-number "Detected Island")
(disable-self)
)

ARFFI: A scripter from japan : Main script ARFFI-De'gel
posted 12-28-09 02:38 AM CT (US)     56 / 73  
I would like to know the logic behind Bothorth's method. Does it work just because walls on island maps use a small amount of wall blocks?

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
posted 12-28-09 03:08 AM CT (US)     57 / 73  
No.
<c.f. Link to related post for scripters64
http://forums.aiscripters.com/viewtopic.php?f=8&t=2026&start=90>

I am not a "hacker" so I do not know "Why" but I can assume by watching the AI's bahavior.
This Island detection method has some error on ice-maps.
(Also triggers if you have some ice-land-conection with enemy where AIs can not build any buildings on. I forgot the terrian name of the ice-land... Some maps as frozen lakes.)
(So you need the additional code posted bellow for bug-fix)
This error leads me to think that the AI is thinking that if they can not build a wall in the "path" that the AI detects, they will ignore the place for the calculation of "wall-compleated-persentage" ending up with 100% wall-comp-per.
(the "shore" of the islands are not possible to build buildings else of docks for AIs.)


It seems that the AI always calculate some "path" from one point to the other when they move units.
These paths seems to be calculated by every scaling-time and that is what you see as a entrance in the palaside walls.
(1 block size non-walled places with high walling percentages)


(defrule
(or(players-current-age every-enemy < feudal-age)
(and(players-unit-type-count every-enemy fishing-ship == 0)
(players-unit-type-count every-enemy war_ship == 0)))
(or(players-unit-type-count any-enemy villager > 0)
(or(players-unit-type-count any-enemy scout-cavalry-line > 0)
(or(players-unit-type-count any-enemy eagle-warrior-line > 0)
(players-building-count any-enemy > 0))))
(players-unit-type-count my-player-number transport-ship == 0)
=>
;(chat-to-player-using-id every-ally ID_ENEMY_SIGHTED)
(chat-to-player every-ally "16 Enemy found")
(chat-to-player my-player-number "16 Enemy found")
(disable-self)
)

(defrule
(game-time > 10)
(goal g-temp0)
(goal g-map-typeS_ISLAND)
(or(taunt-detected any-ally 16)
(taunt-detected my-player-number 16))
=>
(set-goal g-map-typeLAND_WITH_SEA)
(set-goal g-temp-1)
(chat-to-player my-player-number "Detected Island with sea")
(disable-self)
)

(defrule
(goal g-temp0)
(goal g-map-typeNM_S_ISLAND)
(building-type-count town-center > 0)
(or(taunt-detected any-ally 16)
(taunt-detected my-player-number 16))
=>
(set-goal g-map-typeNM_L_W_SEA)
(set-goal g-temp-1)
(chat-to-player my-player-number "Detected NoMad Island with sea")
(disable-self)
)

;End Island detection

ARFFI: A scripter from japan : Main script ARFFI-De'gel
posted 01-22-10 01:35 PM CT (US)     58 / 73  
Hello Leif Ericson!

I'm back to the forum and I've just read the updates on this topic. I had a special look at the test results you posted above on post #54, and I believe they are not correct Allow me to argue about this

Like you already know, I tried to solve this size/detection bug on a thread with Berserker Jerker (on the Scenario/Design Forum), but he never replied to my final post, so I was left alone bumping that thread, without success :S

I will reproduce here what my final conclusion was there. Obviously, since he never replied, I'm still without a verdict on whether my conclusion is valid or not, but I think it is valid. I will use the Medium size Team Islands map as the example. Here it goes..

Initially, when I discovered that a Medium size Team Islands RM would be 200x200 and not 168x168 (which is the default size for a Medium size map), I thought that the AI creators knew about this jump in sizes for Team Islands (and the other 4 maps you mentioned). So, with the RM being reported as a Medium size one on the map specs, I thought that the AIs would assume that the map was going to be 200x200 (one size up), by knowing it was Team Islands and Medium size, because I thought the creators knew of the size jump and took that into the AI code: "if it is TI and Medium, then the map will be 200x200 and not 168x168" (algorithm).

Well, this seems not to be the case. They don't know about the size jump, so they look at the map as a Medium default 168x168 Team Islands, in RM mode.

We have a RM size creation bug (Medium TI being 200x200 and not 168x168) that, judging by what Berserker Jerker said, it's being done on purpose, because of layout factors. But, it will introduce a bug on the AI detection of the map. The AI will detect a smaller map (168x168) than the real size (200x200) of it.

But now we have a big turnaround when we look at the scenario editor stuff. When we generate a Medium size Team Islands on the editor, we will have a 200x200 map that will be reported as a Normal size map when we load the scenario on the SP or MP screen. Which means that we will have a 200x200 Team Islands reported as a Normal size map. Which means that the bug on the AI map size detection in RM situation disappears directly on the CS situation. Which means that the stuff that I initially was (mistakenly) proclaming it was a major bug (Medium size TI CS reported as a Normal size map) is the stuff that directly solves the bug introduced on the AI map size detection in RM, for the 5 maps that have been mentioned. What an ironic turnaround!

So, the AI will detect a wrong size in RM, but it will detect the correct size in CS, which means that he will play those 5 maps in perfect conditions only through a CS. Fantastic stuff that goes according to my wishes, because I must use CS to play MP with custom AIs.

Well, one of the arguments I was using initially was that, in CS, Alliance detected the Team Islands map as a RIVER type map and not ISLAND type map, like I thought it should and like it was detecting on the RM situation. So, judging by what was said, it seems that the RIVER type map is the correct detection for Team Islands. This is the only strange fact still left about all this...

This was my final line of thoughts about this issue, on that other topic. I'm moving it here, to see if anyone can confirm these facts...

**********************

Well, comparing these thoughts with the results you wrote on post #54, my corrections (for Team Islands) would be that, on RM, a Medium Size TI would be 200x200 and the AI would detect a Medium size map (168x168) and not Normal size map (200x200), so we have a bug; on the scenario editor, a Medium Size TI would be 200x200 and the AI would detect a Normal Size map (200x200), a fact that solves the previous bug. This stuff that I wrote is exactly the same I said above.

Please give your thoughts on this and correct me if I'm wrong with my ideas . It's all very complex

Best regards!
posted 01-22-10 02:26 PM CT (US)     59 / 73  
Anyone who has viewed my tables in post 54, please look at the tables again. They are fixed now.

Because of your posts, LightTree, I decided do to another test and it turns out my previous post is incorrect. I've updated my post so that the correct settings are displayed.

In random map games, team islands maps are bigger than the rest. While a standard medium map is 168 x 168 tiles, a medium team islands map is 200 x 200 tiles, and the AI still thinks that it is a medium size map.

In custom maps the same is true for team islands maps. When you tell it to make a medium map, the size is 200 x 200 tiles. However, the AI system will now treat this as a normal map instead of a medium map.

So, LightTree, you conclusions are correct. The only problem is that AIs were made to play random maps not scenarios, so they usually try to account for having a larger size (or containing more fish). So, AllianceThundaEmpire will probably still treat the map as a rivers map.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
posted 01-22-10 03:09 PM CT (US)     60 / 73  
Hello!

Thanks Leif for the tests

So, CS is the way to go when playing those 5 maps with AIs, even on single-player, correct?

When you say that "AIs were made to play random maps not scenarios, so they usually try to account for having a larger size (or containing more fish)", I didn't understand it clearly... What bugs can happen from this? I mean, are you saying the only problems would be with AIs that use the fish method to detect the map type? In which way can this be a problem? That's the stuff I haven't yet got clearly...

Best regards!

[This message has been edited by LightTree (edited 01-22-2010 @ 03:10 PM).]

posted 01-22-10 03:41 PM CT (US)     61 / 73  
Yes, AIs that use fish to detect map type, such as AllianceThundaEmpire will suffer because there is less fish on the map, and it will think that the islands map is a rivers map. This is the primary problem. Another small problem is that there isn't as much space for the AI to use, but it probably won't have any effect on AIs.

ARFFI, if you still want those maps I've found another site that I can upload them to.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
posted 01-22-10 04:12 PM CT (US)     62 / 73  
Hmm, I still haven't got it.

Let me explain/ask more clearly. I want to play a Team Islands Medium map with AIs, for example. If I go via RM mode, then I will get the size detection bug for the AI, like I already explained above. If I go via CS, I will have a 200x200 Team Islands map that the AI detects correctly as a Normal size map (altough it was intended to be Medium, but what matters is the correct detection of the real size), like I also explained above.

So, if the AI (for example, AllianceThundaEmpire) is detecting the size of the map correctly, how can the fish count/tests be done in a wrong way? The editor generated the normal fish count for a 200x200 Team Islands map/scenario (equal to a RM Team Islands map) and that is the size being reported to the AI engine. The size is being reported/detected correctly, so it shouldn't mess with the fish tests. Or I am wrong? Am I missing something?...

Best regards!

[This message has been edited by LightTree (edited 01-22-2010 @ 04:18 PM).]

posted 01-22-10 06:21 PM CT (US)     63 / 73  
So, if the AI (for example, AllianceThundaEmpire) is detecting the size of the map correctly, how can the fish count/tests be done in a wrong way? The editor generated the normal fish count for a 200x200 Team Islands map/scenario (equal to a RM Team Islands map) and that is the size being reported to the AI engine. The size is being reported/detected correctly, so it shouldn't mess with the fish tests. Or I am wrong? Am I missing something?...
I just wanted to explain how this method works. Maybe you get the idea why this isn't 100% accurate.

You set two constant values for every map size. If the amount of sea-fish (ID: 905) is small then the lower then you have a land map. If the amount of shore-fish (ID: 933) is between both values and the amount of sea-fish lower then the higher value, you say its mixed. And if the value of sea-fish higher, then its sea-map. So did I in my Nemesis AI 5 years ago.
By looking into the Alliance code, Mabuse did this a bit different. He only took one value and if either sea or shore fish is higher, he claims its a mixed map and if both are higher he claims its a water map, however it seems that his method is a bit imprecise.

You can get quiet good values from empiric testing, however its still some sort of guessing. Also in maps that contain no or an abundance of fish this method will fail.

[This message has been edited by zergs (edited 01-22-2010 @ 06:22 PM).]

posted 01-22-10 08:44 PM CT (US)     64 / 73  
All right, hopefully this explanation makes more sense.

Like zergs said, AllianceThundaEmpire detects the amount of sea fish and shore fish on the map and decides whether the map is an islands style map, a rivers style map, or a land style map.

On a medium map, if both the sea fish count and the shore fish count are above 80, the AllianceThundaEmpire thinks it is an island map. If either the sea fish count or the shore fish count are above 80, but not both, then AllianceThundaEmpire thinks it is a rivers map. If both fish counts are below 80, then AllianceThundaEmpire thinks it is a land map.

The problem is that the scripter who made AllianceThundaEmpire probably did many tests on random maps to get these values. In medium random maps the size of the map is 200 x 200. Let's say on an a particular medium random map there are 85 sea fish and 85 shore fish. An AI will treat this 200 x 200 map as a medium map. However, these numbers for medium maps won't work in scenarios.

For AIs playing a team islands map in a scenario it will treat a 168 x 168 map as a medium map, even though you set the map size to small in the editor. On this allegedly medium map only 168 x 168 tiles, there will be far fewer fish than on a medium random map and it is likely that either the shore fish count or sea fish count will drop below 80, thereby causing AllianceThundaEmpire to treat the team islands map as a rivers map, or even worse, a land map.

In short a map treated as medium size by an AI (200 x 200) in random maps will have much more fish than a map in a scenario that an AI will treat as a medium map (168 x 168).

I was surprised to find that I found this hard to explain. I hope that you understood my explanation.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
posted 01-22-10 09:10 PM CT (US)     65 / 73  
Okkk

Got it now, yes, so simple to understand now that you explained clearly how Alliance detects the map type. Sorry

But reflecting on that, we can conclude that the creator of Alliance had to adjust those fixed parameters based on maps with the size bug (the 5 we mentioned) together with maps where the size was reported correctly, am I correct? For example, he adjusted the Medium size map parameter based on 200x200 maps (the 5) and 168x168 maps. Hard task no?

What would you recommend to fix this issue with AIs thats use this method? Readjusting the parameters? Is it possible in a easy way? What can you say? You guys are the real experts on this, what do you recommend?

Best regards!
posted 01-22-10 09:12 PM CT (US)     66 / 73  
First, Thanks you LightTree and Leif for the correction.
The data helps much.

The sea-map-detection seems to stay as one of the problems for AIs.
Maybe asking the humans by taunt is better for now.^^
(I like the wall/fish detection though.^^)

@Leif
I really wish to have the maps I requested before.
Thanks.^^

By the way, as a map-editor, is it normal to set water(sea) maps as below?

base_terrain WATER
At least for custom TI and Island maps, I see this.
(Not for highland and continent, so it seems one difference for "sea main maps".)
If so, I will just try to find if AIs can detect the base_terrain.^^
(Just a easy idea. Don't expect much though.^^)

@zergs
Thank you for the explanation.
I really do not know much about scripting water-map-AIs so it is good to know.

ARFFI: A scripter from japan : Main script ARFFI-De'gel
posted 01-23-10 00:44 AM CT (US)     67 / 73  
ARFFI, here are the files:

Custom Team Islands

Migration Islands

The Custom Team Islands map is exactly the same as the standard team islands map. I discovered that all maps that we can make are treated as custom. The only way otherwise is to overwrite the code of another random map script.

The Migration Islands map has several islands of gold and stone with a few trees on them. The player islands and the big island is smaller to accommodate for them.


LightTree, a scripter names Bothorth discovered another way to detect island maps by checking to see whether walls could be built or something similar to that (AIs have problems with building walls on islands). ARFFI knows more about it than I do. That may be a better method, and it won't be affected by the tile size of the map. ARFFI, could you please post the code for the wall method?

ARFFI, yes it is common to use base_terrain WATER for water maps or any map that uses a water around the edge of the map, such as coastal. Unfortunately, I don't know a way of detecting the base_terrain of a map using AI, so I don't think this method will work.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´

[This message has been edited by Leif Ericson (edited 01-23-2010 @ 00:46 AM).]

posted 01-23-10 02:35 AM CT (US)     68 / 73  
LightTree, a scripter names Bothorth discovered another way to detect island maps by checking to see whether walls could be built or something similar to that (AIs have problems with building walls on islands). ARFFI knows more about it than I do. That may be a better method, and it won't be affected by the tile size of the map. ARFFI, could you please post the code for the wall method?

Sorry. today, I need to go home now.
Next week I will.

ARFFI, yes it is common to use base_terrain WATER for water maps or any map that uses a water around the edge of the map, such as coastal. Unfortunately, I don't know a way of detecting the base_terrain of a map using AI, so I don't think this method will work.

Well, I will try.^^

Thanks for the maps.

ARFFI: A scripter from japan : Main script ARFFI-De'gel
posted 01-24-10 06:29 PM CT (US)     69 / 73  
LightTree, a scripter names Bothorth discovered another way to detect island maps by checking to see whether walls could be built or something similar to that (AIs have problems with building walls on islands). ARFFI knows more about it than I do. That may be a better method, and it won't be affected by the tile size of the map. ARFFI, could you please post the code for the wall method?

Yes, but that means that we would have to change a lot of code in the AIs, to replace one method by another. Maybe changing the parameters according to the situation would be an easier way no? The values are already at the code, it was just changing its position, depending on the type of game to be played...

Are there that many AIs that use this method? The majority of the AIs seems to use the normal map detection...

Best regards!

[This message has been edited by LightTree (edited 01-24-2010 @ 06:30 PM).]

posted 01-24-10 10:55 PM CT (US)     70 / 73  
I was talking about using that method for future AIs. For old AIs, yes just changing the values would be easier. I don't know of any other AIs that use the fish method besides Alliance, but I'm sure there are more. But I think the majority just try to detect the random map chosen, and plan to use navies on every custom map or scenario in case either of them have water.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
posted 01-24-10 11:19 PM CT (US)     71 / 73  
Sorry for the late reply.

Code
See the post 55 and 57 of this thread.
I had posted it.^^
(cf.)
;Credits Bothorth
;Modified version of the Bothorth's original rules.
Maybe changing the parameters according to the situation would be an easier way no? The values are already at the code, it was just changing its position, depending on the type of game to be played...
Well it is possible for the player to modify it every time they play against an AI and this is the best method.
Still, it is quite hard to modify AIs made by someone else, cause we might break the AI by accident.
(most great AIs are very complicated...)

Ex.
In ATE, open "Basic.per" in "-=T13=-" folder and add the rule bellow with the following number at the place I show as ";<-add the rules here!".

1)If you are playing Island maps.

(defrule
(true)
=>
(set-strategic-number sn-coop-share-information 0) ;Differ Exploration
(set-strategic-number sn-coop-share-attacking 0) ;Differ Targeting
(set-strategic-number sn-coop-share-attacking-interval 1) ;Short
(set-strategic-number sn-target-evaluation-continent 9990)
(set-strategic-number sn-minimum-water-body-size-for-dock 3001)
(disable-self))

2)If you are playing River maps.

(defrule
(true)
=>
(set-strategic-number sn-coop-share-information 1) ;Share Exploration
(set-strategic-number sn-coop-share-attacking 1) ;Share Targeting
(set-strategic-number sn-coop-share-attacking-interval 1) ;Short
(set-strategic-number sn-target-evaluation-continent 9995)
(set-strategic-number sn-minimum-water-body-size-for-dock 3001)
(disable-self))


*****Where to add the rules******
;"Basic.per" in "-=T13=-" folder
;========================MAP-CHECK==============================================

;<-add the rules here!

#load-if-defined TINY-MAP
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == 3000)
(or
(cc-players-unit-type-count 0 933 >= 40);one of both
(cc-players-unit-type-count 0 905 >= 40))
(nand
(cc-players-unit-type-count 0 933 >= 40);but not both RIVERS
(cc-players-unit-type-count 0 905 >= 40))
...


>Are there that many AIs that use this method? The majority of the AIs seems to use the normal map detection...

AIs for non-custom-maps do not use this fish-count method.
Still, as zergs's post, some scripters whom wish to make an all-map-playable AI tends to use the fish-count due to the fact that it was the only method to detect the map-style till now.

Also, there is some method to detect that resource is only left in other islands (SN-d-min == 255) to detect map-style, but it takes time to find out.

ARFFI: A scripter from japan : Main script ARFFI-De'gel
posted 01-24-10 11:31 PM CT (US)     72 / 73  
Yup, and for those ones that use the normal map detection, I will never have problems through CS on any map.

First, because of what I/we've said on the posts above, by concluding that those 5 maps are correctly played by AIs (that use that detection method) only through CS.

Second, because, for every scenario I set up on the editor, we can always use the 'AI Map Type' option in the editor to tell the AI the exact random map that is being set up (in case we generate a random map in the editor) or a close idea of it (in case we create a new/custom map by hand).

So, only in the case of Alliance, I have to change the values before playing the CS, so that it detects the correct map type.

Best regards.

[This message has been edited by LightTree (edited 01-24-2010 @ 11:35 PM).]

posted 01-25-10 00:17 AM CT (US)     73 / 73  
Thanks for the info.^^

Well, some players will make SC without the "AI map-type" or use custom-random-maps were the AIs has to use these detection, but it may be better to leave this problem to players as you say.
Thanks.^^

ARFFI: A scripter from japan : Main script ARFFI-De'gel
« Previous Page  1 2  Next Page »
Age of Kings Heaven » Forums » AI & RM Scripting » Is it posible to go against custom ais in a multiplayer rm
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames