Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: Designing AI friendly maps.
Thread: Designing AI friendly maps.
fulano
fulano


Known Hero
Can I link to my own avatar?
posted June 05, 2010 02:42 AM

Designing AI friendly maps.

Do you guys have any tips on map design that can help the AI take its turns quickly?  Especially for multiplayer games.

I'd like to create some co-op maps that let the players get to high levels but don't drag on.  In my maps so far the AI takes two or three times longer to take a turn on my map than it takes on the multiplayer maps that come with the game, and it seems to take longer each turn.

Here are some specific questions I have:
-Should I use more creature dwellings and less towns for the AI so the AI doesn't have to think about what to build?
-Does giving the AI more than one race have an effect?
-Do monsters and treasures on the map slow down the AI?
____________
Link to my profile: (I can't find it otherwise) http://heroescommunity.com/member.php3?action=viewprofile&UserName=fulano

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Miru
Miru


Supreme Hero
A leaf in the river of time
posted June 05, 2010 04:17 AM

I'm don't know how the AI for HoMM works, but I'm pretty sure that first two of those don't add much compute time. The compute time is probably pathing, that is deciding where to walk on the overland map. If you make a map which is more linear with thinner walkways and less options for ways to take a turn, that would probably help. For instead you could make a big plain shaped like a circle with monsters around the edge, and the AI would have to decided which to go after in what order. But if you make it a few straight paths with monsters along the edge its more obvious to go along the path.




Also you can do this
Quote:
the best solution I know to reduce time for AI is changed its during time limit into config file from the user profile folder.

look for a file named « user_a2.cfg »

open it and search « setvar ai_time_limit = » to change the value

I think the initial value is 180000 and that is maximum in second.

I changed it for 3600 and AI is seriously faster.
but then you will probably get an AI which makes stupider moves.


This thread shows most of what is known about the AI in H5.

____________
I wish I were employed by a stupendous paragraph, with capitalized English words and expressions.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Miru
Miru


Supreme Hero
A leaf in the river of time
posted June 05, 2010 05:37 AM

Limiting the number of heroes they can recruit, and blocking further areas with tougher monsters might also help
____________
I wish I were employed by a stupendous paragraph, with capitalized English words and expressions.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted June 05, 2010 07:55 AM
Edited by Warmonger at 07:56, 05 Jun 2010.

I suggest making paths shorter, well-guarded and avoid huge circuits and grid of connections to make graph-based algorithms work faster.
It took me quite some time to solve the issue, but I came up with refilling garisons in the end. This allows to create even quite complicated map design.
____________
The future of Heroes 3 is here!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
fulano
fulano


Known Hero
Can I link to my own avatar?
posted June 11, 2010 10:01 PM

More questions:
-Does limiting the number of heroes the AI can recruit help by just keeping them from controlling several at a time?
-Does the number of towns affect the AI's speed much?
-Could it help to turn on the console to see what the AI is doing?  (I don't remember how that is done.)


Just to summarize what I need to do so far (and make sure I understand):
-I need to make branching dead-end paths instead of loops.
-I need to use narrow paths instead of open areas.
-I should put progressively harder guards on the paths instead of scattered creatures just guarding treasures.
-I need to use a smaller map size.



____________
Link to my profile: (I can't find it otherwise) http://heroescommunity.com/member.php3?action=viewprofile&UserName=fulano

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Cleave
Cleave


Promising
Famous Hero
Raging Blood
posted June 11, 2010 11:04 PM
Edited by Cleave at 23:06, 11 Jun 2010.

Try the Classic AI mod by Magnomagus http://heroescommunity.com/viewthread.php3?TID=27296

It speeds up AI turn quite a bit and makes the AI more interesting and challenging (not as challenging as a human player but better than the unmodded game).

Less heroes make the game faster.

I also noticed that the AI tends to use Instant Travel too much so you could have a look into it as well.
____________
13 Heroes

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Miru
Miru


Supreme Hero
A leaf in the river of time
posted June 12, 2010 03:16 AM

-Does limiting the number of heroes the AI can recruit help by just keeping them from controlling several at a time?
Yes
-Does the number of towns affect the AI's speed much?
Probably not significantly, unless they are placed so that heroes keep revisiting them
-Could it help to turn on the console to see what the AI is doing?  (I don't remember how that is done.)
If the console will tell you what they are doing, definitely, but I don't think it will. Someone made a mod to remove fog of war during AI turns, so if you watched them you would probably be able to see what they are doing.

-I need to make branching dead-end paths instead of loops.
No, the more they have to choose, the longer it will take for the computer to decide.
-I need to use narrow paths instead of open areas.
Yeah
-I should put progressively harder guards on the paths instead of scattered creatures just guarding treasures.
You don't need a lot of them, but if you can limit their options by how strong their army is then they will be confined to smaller areas in the beginning, and have most of it cleared out by the time they move on, meaning at any given moment less decisions to make.
-I need to use a smaller map size.
Not necessarily, if you can limit any given hero being active in a given area, and limit them to only trying to do a little bit each turn (one way to do this would be limit number of heroes), as well as limit their decisions of which part of the map to go next, AND make it so they don't have to maintain the areas they have already cleared (like no windmills or watermills), then you should be able to make big maps.
____________
I wish I were employed by a stupendous paragraph, with capitalized English words and expressions.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
fulano
fulano


Known Hero
Can I link to my own avatar?
posted June 12, 2010 08:07 PM
Edited by fulano at 00:38, 10 Oct 2010.

Thanks Cleave, I didn't know such a mod was available though I would still like to have a well designed map for those who don't know about mods.

I want to use a smaller map size as the map currently has more blank space filled with trees or grass than I want.  Plus to make the changes I might as well start from scratch rather than try to re-arrange things.

Thanks for all the info on the AI!

EDIT:
Two more questions:
If an AI's area had one path that was a large circle with things to visit along the sides would the path-finding only process the circle once?  Or would it continuing processing around the circle for it's maximum allowed time?

Does the underground take up more or less memory than the surface?  Is it better to have a small map with two levels or a large map with one level?
____________
Link to my profile: (I can't find it otherwise) http://heroescommunity.com/member.php3?action=viewprofile&UserName=fulano

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
magnomagus
magnomagus


Admirable
Legendary Hero
modding wizard
posted October 10, 2010 03:55 PM

Quote:
If an AI's area had one path that was a large circle with things to visit along the sides would the path-finding only process the circle once?  Or would it continuing processing around the circle for it's maximum allowed time?


All objects and artifacts have a certain value to the AI, minor objects for example 500, relic artifacts 12000. Adventure map behavior is guided by these values.

Quote:
Does the underground take up more or less memory than the surface?  Is it better to have a small map with two levels or a large map with one level?


Doesn't matter, it depends on the elevation complexity and the amount of objects.


____________
MMH5.5 Downloads | MMH5.5 Translations | MMH5.5 FAQ

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted October 10, 2010 04:36 PM
Edited by Warmonger at 16:37, 10 Oct 2010.

Quote:
All objects and artifacts have a certain value to the AI, minor objects for example 500, relic artifacts 12000. Adventure map behavior is guided by these values.

Nobody denies that, but we're trying to deduce actual AI algorithms here. But even simplest pathfinding doesn't allow cycles.
Quote:
-I need to make branching dead-end paths instead of loops.
No, the more they have to choose, the longer it will take for the computer to decide.

Do you try to suggest that tree pathfinding is more complex than in cyclic graph?
Quote:
I need to use a smaller map size.

I suggest so. Bigger map always mean more tiles to process. Also, long distance lowers objects' value so AI tends to not move at all... after having calculated path to every object in range of sight, that is.

Anyway, did you try to follow these tips with any / none visible success?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
fulano
fulano


Known Hero
Can I link to my own avatar?
posted October 11, 2010 07:08 PM
Edited by fulano at 07:34, 28 Oct 2010.

Quote:
Anyway, did you try to follow these tips with any / none visible success?


No... I just finally got time to try them.    These questions came up as I was designing the basic layout on Saturday.  Thanks for the help, I hope it'll be helpful for others too.

I'm pretty sure my first design was terrible because the AI's side was basically a 9x5 grid of hills with large valleys between the hills (like 30x30 squares).  This next design will have a lot less space to process.

EDIT:  Oct/27/10 FINALLY some TESTING got done!
I made the AI side of the map first since that is where I had the most trouble last time and I made the AI's options very limited.  Basically it has two dead ends and one trail that goes out to the rest of the world.  The paths are only about two squares wide.

My observations so far are that the map seems to go about the same speed as other maps.  Except the other maps have wide open spaces for the AI to roam in.  I think the only real slowdown is when they hire more heroes (in all my four test runs the AI only hired a second hero once in the first month).

It looks like the AI starts to run painfully slow when they have more than one hero.  My previous version of this map started the AI with three towns which must have caused the AI to hire at least one hero per town.  My earliest version of the map had three AIs but lots of free treasures so I bet they built lots of heroes just to collect the treasures fastest.  I bet if I switch the old map back to three AI's and clear up the free stuff it will run at a more tolerable pace, even if there is lots of open area to roam.  Of course I can't prove this until I go try it.

So that leaves me with this question:
-How to I limit the AI's hero hiring?
The only things I can think of is to not start them with a tavern (or block it in their first town) and un-check heroes of the AI's faction.  Is there an option I'm missing somewhere that might let me limit the AI's hero recruiting in another way?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted October 28, 2010 01:52 PM

Edit RPGStats file. The number of heroes for towns is defined there. Maybe you could try to play with fractional values and see if it works. If not, do the same as Magnomagus in his AI mod.
____________
The future of Heroes 3 is here!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0436 seconds