Ai turns

How much faster it went?

It seems 0.94’s AI is much faster.

Here’s apk of 0.94: a.pomf.se/faklhi.apk . Sadly VCMI crashes with SIGBUS when entering castle so this version is not really playable either.

F/libc    (22066): Fatal signal 7 (SIGBUS) at 0x00000000 (code=128), thread 22097 (CGuiHandler::ru)
I/DEBUG   (  114): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  114): Build fingerprint: 'samsung/espresso10wifixx/espresso10wifi:4.0.3/IML74K/P5110XWALD2:user/release-keys'
I/DEBUG   (  114): Revision: '10'
I/DEBUG   (  114): pid: 22066, tid: 22097, name: CGuiHandler::ru  >>> is.xyz.vcmi.nightly <<<
I/DEBUG   (  114): signal 7 (SIGBUS), code 128 (SI_KERNEL), fault addr 00000000
I/DEBUG   (  114):     r0 2e7644a9  r1 2d17eab8  r2 2e764170  r3 2e6326a8
I/DEBUG   (  114):     r4 2e7644a1  r5 6096faa8  r6 2a2338a0  r7 00000000
I/DEBUG   (  114):     r8 5ec7bb28  r9 2d25c890  sl 2a2338a0  fp 6096fbac
I/DEBUG   (  114):     ip 00000000  sp 6096fa40  lr 5e9659e5  pc 5e965a02  cpsr 600f0030
I/DEBUG   (  114):     d0  32545845434e4254  d1  ffffffffffffffff
I/DEBUG   (  114):     d2  4144414430c22882  d3  0000000031031882
I/DEBUG   (  114):     d4  401c000000000000  d5  401bf8d6d33ea848
I/DEBUG   (  114):     d6  408f400000000000  d7  0062e08000000000
I/DEBUG   (  114):     d8  4082c00000000320  d9  44a0000000000000
I/DEBUG   (  114):     d10 00000000443c0000  d11 0000000000000000
I/DEBUG   (  114):     d12 0000000000000000  d13 0000000000000000
I/DEBUG   (  114):     d14 0000000000000000  d15 0000000000000000
I/DEBUG   (  114):     d16 0000000000000000  d17 0000000000000000
I/DEBUG   (  114):     d18 41bf93e1ae000000  d19 3fd99b7c3731d10b
I/DEBUG   (  114):     d20 3f974c074a362e68  d21 3fe5568b9401f367
I/DEBUG   (  114):     d22 3fd24aaf828e1369  d23 3fcc745e0ab0ad85
I/DEBUG   (  114):     d24 3fc748e72055a505  d25 c050800000000000
I/DEBUG   (  114):     d26 3fc2f112df3e5244  d27 40034eeae0000000
I/DEBUG   (  114):     d28 0000000000000000  d29 0000000000000000
I/DEBUG   (  114):     d30 0000000000000000  d31 40034eeae0000000
I/DEBUG   (  114):     scr 20000013
I/DEBUG   (  114): 
I/DEBUG   (  114): backtrace:
I/DEBUG   (  114):     #00  pc 0031ea02  /data/app-lib/is.xyz.vcmi.nightly-2/libapplication.so (void CDefFile::loadFrame<CompImageLoader>(unsigned int, unsigned int, CompImageLoader&) const+53)
I/DEBUG   (  114):     #01  pc 0031e9e1  /data/app-lib/is.xyz.vcmi.nightly-2/libapplication.so (void CDefFile::loadFrame<CompImageLoader>(unsigned int, unsigned int, CompImageLoader&) const+20)
I/DEBUG   (  114): 
I/DEBUG   (  114): stack:
I/DEBUG   (  114):          6096fa00  0000a228  
I/DEBUG   (  114):          6096fa04  00000004  
I/DEBUG   (  114):          6096fa08  2e764170  [heap]
I/DEBUG   (  114):          6096fa0c  4003766f  /system/lib/libc.so (dlmalloc+4278)
I/DEBUG   (  114):          6096fa10  5ec854f8  
I/DEBUG   (  114):          6096fa14  6096fa1c  
I/DEBUG   (  114):          6096fa18  4007203c  
I/DEBUG   (  114):          6096fa1c  5ec854f8  
I/DEBUG   (  114):          6096fa20  00000006  
I/DEBUG   (  114):          6096fa24  0000a21f  
I/DEBUG   (  114):          6096fa28  6096fad8  
I/DEBUG   (  114):          6096fa2c  001367cc  
I/DEBUG   (  114):          6096fa30  00000018  
I/DEBUG   (  114):          6096fa34  2d0d2440  [heap]
I/DEBUG   (  114):          6096fa38  df0027ad  
I/DEBUG   (  114):          6096fa3c  00000000  
I/DEBUG   (  114):     #00  6096fa40  2d0d8390  [heap]
I/DEBUG   (  114):          6096fa44  00000000  
I/DEBUG   (  114):          6096fa48  2d17eab8  [heap]
I/DEBUG   (  114):          6096fa4c  4003766f  /system/lib/libc.so (dlmalloc+4278)
I/DEBUG   (  114):          6096fa50  6096fad8  
I/DEBUG   (  114):          6096fa54  77ffffd0  
I/DEBUG   (  114):          6096fa58  2d07da20  [heap]
I/DEBUG   (  114):          6096fa5c  00000018  
I/DEBUG   (  114):          6096fa60  2d0d2440  [heap]
I/DEBUG   (  114):          6096fa64  001367cc  
I/DEBUG   (  114):          6096fa68  6096fb00  
I/DEBUG   (  114):          6096fa6c  00000000  
I/DEBUG   (  114):          6096fa70  00000024  
I/DEBUG   (  114):          6096fa74  2e636a88  [heap]
I/DEBUG   (  114):          6096fa78  4007204c  
I/DEBUG   (  114):          6096fa7c  2e6326a8  [heap]

Honestly did not help (

s1.radikale.ru/uploads/2014/3/18 … 0-full.jpg
Wladca.h3m (78.6 KB)

Generally it runs slower, as algorithms are more complex. But it’s negligible in typical situations.

However, that shouldn’t be an issue, as AI should behave better in extreme situations. In general the issue is not to choose one of multiple solutions. The problem arises when there are no options left and AI needs to check entire map over and over with no success. That part was improved in numerous ways (mostly exploration and clearing the way). The goal is to lower upper bound of AI time.

The remaning issues are some loopholes in rare situations and incorrect conditions, like what Povelitiel shows.

Also, if Android device runs 100 times slower on more than my PC, there’s not much chance for improvement, either.

In this savegame, that’s what you mean?

Or this?

(purple turn)
looked save please
GG.rar (838 KB)

I do not know we know it or not, but the AI ​​is afraid garrison
Garnison.rar (260 KB)


One thing I know is this doesn’t belong to this thread.

Okay, I found a solution to stop AI from checking exploration possibilities many times with same hero, without loosing funcionality. This limits most extreme turn times, however does nothing to improve average AI speed.

The conditions are listed in r3819:

I optimized most expensive function in r3834. Apparently pathfinder was crippled by recalculating hero bonuses for every tile.

Huh… such cases should be covered bonus system caching. Wasn’t it working at all or was it just too slow?

Well, actually getting catched bonus was the function that caused significant CPU usage. Reading catched string is of course faster than navigating bonus tree, but still can take time if called thousands of times. Streams are slow.

I found another bottleneck specific to water-based maps only. Fixed in r3830.

Is it possible to change the enemy movement speed?

In the in-game settings menu there is an option, to change your own movement speed, but the movement speed for the enemy is disabled.

Additionally in Heroes II is an option the change the whole ai speed.

This option works for AI heroes as well.

Okay, are you happy with AI speed in 0.95b?

Nope. In case AI generates a lot of heroes with 1-4 creatures on a small area, it produces a lot of warnings like: Another allied hero stands in our way
and it becomes extremely slow. Makes me annoyed.

But this is exactly how it worked since 0.95 and no one reported such issue.

The AI is much faster than in previous version and this is definitely noticeable. But there is one thing that really bother me - heroes which belong to different players don’t fight each other.

+1 for Kantor
About AI, it definitely became better, but it becomes very slow in such cases I’ve described.
In scenarios where you play with Gelu everything is ok, in scenarios where you play with Sandro the area is quite limited and it becomes such a pain to wait 5-6 mins for 1 turn.

not quite
forum.vcmi.eu/download.php?id=660