Latest Posts

Topic: AI - game speed too high - in trunk

greenlion
Avatar
Topic Opener
Joined: 2015-11-04, 14:51
Posts: 7
Ranking
Pry about Widelands
Posted at: 2015-11-08, 12:55

I've noticed in trunk that when running on very high speeds (> x25) than AI stops doing anything and there are error messages "AI: game speed too high, jobs are too late" in console. In b18 I it was able to properly run on x100 speed. Is it a regression or intentional? As of usecase - I was interested to simulate how AI behaves on a map and used no fog game.

Edited: 2015-11-08, 13:04

Top Quote
wl-zocker

Joined: 2011-12-30, 16:37
Posts: 495
Ranking
Tribe Member
Location: Germany
Posted at: 2015-11-08, 13:05

I experienced the same problem. It would be really great if the AI would still do something at high speeds - I tried to test a map, too.


"Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg

Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-11-08, 21:02

Oh, you are right to some degree.

Current AI is designed to be called by game engine every ~500 ms and do one small task. Even when the period is longer (let say up to 2 sec) everything works. But if you speed up the game too much and the period is very long, things became to be broken. So this is why I introduced the warning into console so that a tester has an idea what is going on.

We are talking about game's time not real time, of course.

But I have an idea of improvement - AI simply needs to be less nice and do more jobs at one call, if it is called after longer time. I will try to code some fix for this...


Top Quote
einstein13
Avatar
Joined: 2013-07-28, 23:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-11-09, 08:55

Tibor wrote:

But I have an idea of improvement - AI simply needs to be less nice and do more jobs at one call, if it is called after longer time. I will try to code some fix for this...

We can add this functionality only when "game speed is too high" (the message will activate the functionality). That should solve some problems. But also can decrease the real speed (FPS)


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-11-09, 20:20

einstein13 wrote:

Tibor wrote:

But I have an idea of improvement - AI simply needs to be less nice and do more jobs at one call, if it is called after longer time. I will try to code some fix for this...

We can add this functionality only when "game speed is too high" (the message will activate the functionality). That should solve some problems. But also can decrease the real speed (FPS)

You know, this is not binary situation not late or late, in fact we can exactly calculate delay of most late task and based on this number decide how many task will AI run this time. Of course if game engine calls AI once in 100 seconds things can not go well no matter what.


Top Quote
einstein13
Avatar
Joined: 2013-07-28, 23:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-11-09, 21:41

Yes, you're right. This solution is only partial. Also it is not working bad with 95% (or more!) of games. Most of the games are with speed up to 3x, some up to 5x, where AI works perfectly.


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote