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


[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 4 - Lands of Axeoth > Thread: AI Labotomy due to Memory Leak?...
Thread: AI Labotomy due to Memory Leak?... [ This thread is 2 pages long: (1) 2 ]
Oldtimer
Oldtimer


Honorable
Supreme Hero
Please leave a message after..
posted April 16, 2002 08:15 PM

AI Labotomy due to Memory Leak?...

I was reading on another forum that the AI's poor performance might be, in part, due to the memory leak problem.  As the game continues, it eats up more and more memory until the game crashes, as it eats more memory the AI seems to make poorer and poorer decisions until a point where it doesn't act at all.

Can anyone confirm this?
____________
<PLEASE DO NOT WAKE THE OLD MAN!>

"Zzzz...Zzzz...Zzzz..."

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


Honorable
Legendary Hero
paid in Coin and Cleavage
posted April 16, 2002 08:23 PM

yep... that seems to be true...

when I play heroes this kinda happens...there is a limit to the memory leak (and AI decrese in skill) when i play under linux, but when I switch to windows, things become weird... the AI will just stand still and stare at me claiming free treasures...
____________
Dreams of Darkness nWoD IRC Chronicle, set in Edinburgh

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


Known Hero
Knight of Justice
posted April 16, 2002 08:44 PM

Honestly saying I havenít noticed any problems of this kind. AI acts ok. Maybe I didnít play enough. Sorry
____________
Choose your friends carefully. Your enemies will choose you.

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


Hired Hero
posted April 16, 2002 08:46 PM

What's even weirder is that I seem to suffer from the same memory leak myself. After some 10+ hours me and the AI just stands around looking at each others armies. After a few more hours I simply crash. Weird.
____________

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


Promising
Famous Hero
posted April 17, 2002 01:17 AM

Quote:
I was reading on another forum that the AI's poor performance might be, in part, due to the memory leak problem.  As the game continues, it eats up more and more memory until the game crashes, as it eats more memory the AI seems to make poorer and poorer decisions until a point where it doesn't act at all.

Can anyone confirm this?


I doubt it, except if they've allocated at the begining some fixed memory pool - have their own mallocs(), frees() - and then AI uses the fact of how much free memory there is - which is a bit of a strange... Otherwise Win32API is always giving to you virtual 2Gigs of free memory - you may never use it - but you have the address space for it.

First - multiplayer will never work (computers will think differently on each comp).

Second - it'll be much more harder for testing - and even for writing it.

Third - gee - hehe - dunno what is the third

____________

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


Known Hero
Pathetic Loser
posted April 17, 2002 05:14 AM
Edited By: brody on 17 Apr 2002

There's no memory leak.  It uses up a lot of memory because of music.  THAT ISN'T A LEAK!!!  A leak doesn't disappear when you close the program and re-open it, you have to actually reboot your computer.

For example, I can play Heroes 4 for 8+ hours and, if I have music turned on, it'll get slower.  But if I exit the game and check my system properties, I still have 92% of resources free.  Then if I start up the game again, it's running fine.

Windows caches anything that's accessed, and in games it seems to be really fervent about it (dunno if it's game code or just windows optimizations).  This is a good thing, because without this caching, your game would run slowly all the freakin' time!  Problem is, windows or the game (don't know which, though I suspect windows since I've seen it in many games) doesn't know when to let go of old memory, so it just keeps hogging RAM until you're out, and then it switches over to virtual memory.  As virtual memory is stored on your computer's hard drive, it is extremely slow, causing the slowdown some of you have seen.

In Diablo 2, the same thing happens, but you can see it more clearly because it's got a command ('fps' in chat window) that tells you frames per second, physical RAM usage, and virtual memory usage.  As there's less and less physical RAM, you see more virtual memory used, and the more that's used, the slower things get.  The old stuff you've loaded (old graphics from Act I and II, for example) loads quickly, but new things (say act III and IV) take forever.

EDIT:
Er... back on topic: can this affect AI?  Possibly.  In the game MTG for the PC (microprose, not activision's garbage), the AI was better depending on how much processing time it could use.  So on a 486, it was very weak, but on a P2 it was very strong.  I don't know exactly why, but I suspect they made the AI have a certain maximum time to search for it's "best move".  So it was basically calculating all possible cards to play (MTG PC game was essentially a wacky (but rather fun) version of the card game), and it probably adjusted values as it played things out, figuring which values were best.  Once the time ran out, it made its decision.

If heroes 4 is the same, then as the game slows down (due to cache running out or programs in the background), the AI gets "stupid", not having enough time to make a good decision.

Time for somebody to run some tests... Maybe I'll try that tonight, have the same battles multiple times, first few times with animations off, sound off, music off, etc, and next few times with everything on, plus running winamp in the background.  If this turns out to be the reason for poor AI, I'm gonna have to buy a new computer
____________

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


Known Hero
Pathetic Loser
posted April 17, 2002 05:25 AM

Quote:
I doubt it, except if they've allocated at the begining some fixed memory pool - have their own mallocs(), frees() - and then AI uses the fact of how much free memory there is - which is a bit of a strange... Otherwise Win32API is always giving to you virtual 2Gigs of free memory - you may never use it - but you have the address space for it.

First - multiplayer will never work (computers will think differently on each comp).

Second - it'll be much more harder for testing - and even for writing it.

Third - gee - hehe - dunno what is the third



Damn, should have replied to this in my other post, but it was way too long... anyway, multiplayer could still be doable in my scenario (timed responses), you'd just have to have one computer doing the processing, which is typical when one computer is the server anyway.  As for testing, dunno... if the AI is simply given a maximum time to do things (as opposed to a maximum amount of memory to use) it shouldn't present any serious problems in testing or writing it.
____________

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


Promising
Famous Hero
posted April 17, 2002 06:58 AM

back on this - why the MP3 music is compressed with GZIP in H4R files.

I wrote a tool that decompresses all H4R files - and I was amazed to see that.

So I imagine following - file is one streamed on the fly by GZIP to be decompressed - then again by the MP3 streamer... ah that's snowin stupid! Why the hell they wanna do it this way? and compression is actually saving nearly nothing - just "cutting" some leftovers.

if anyone is interrested in DECOMPRESSOR and PICTURE DECODER for H4R files - please drop me a mail - i don't have time to include internal GZIP support - so one needs to GZIP -d *.gz manually when wants some file - gee -
____________

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


Promising
Famous Hero
of Clear Water Mountain Clan
posted April 17, 2002 10:07 AM

hmm... would've been cool, though, if the AI got smarter the more RAM you had... "gettoutahere, you think you can play the game? Well, you just try the game with 1012MB RAM, and then you can come back and talk."

rambling, I know...
____________
There are 10 types of people: Those who read binary, and those who don't.

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


Adventuring Hero
Archimage
posted April 17, 2002 12:56 PM

My own homm4 experience shows:

It used to crash randomly after 1 - 2 hours.
The music used to loop.

Then I set the Directx to no hardware acceleration for the sound.
Now the music works perfectly. But after some time the HDD starts scraching and the game starts running slower and slower, until it throws me out. Interesting in the case is that when it throws me out it doesn't free the memory this time and I must restart, else Homm is not starting again.
The AI in both the cases acts just stupid.  Never picks up the resources, seldomly moves. When it can catch me - it just stays in the castle, etc. But I experienced times when it is not so stupid, especially when the hardware acceleration of the sound was on????????
____________
...and give my best regards to your family

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


Hired Hero
posted April 17, 2002 03:57 PM

My computer crashes approx. every 2 hours. I have to reboot it to play again. No problems with the music.

About the AI in the last game I played: It didn't attack a poorly defended town with its army containing 80(!) black dragons. It didn't flag ressource generators although there were no guards. It didn't level up heroes very fast - in this game on highest difficulty, I ended up with two lvl 32 heroes against a lvl 10 computer hero. It didn't build a castle in its main town. It only had two or three armys moving around in a confused way, often without a hero. It never was a real challenge.

I hope that the patch will boost the AI at least to a HoMM 3 level.
____________

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


Adventuring Hero
posted April 17, 2002 09:13 PM

AI on faster computer (LONG POST, flame)

Have been playing Homm v. the computer for 8 years and multiplayer about 8 months. Only played homm3 v. the comp on impossible lately and regularly racked up archangel scores on several of the tougher maps (i.e., the lone knight, running with the devil, etc...both outstanding maps btw, highly recommended and kudos to their designers).

Got a new computer late last year pIV 1.7 with 500mb rdram.  The AI in homm4 is not great (but then again no AI in such games has ever been great), but on my computer it does OK and certainly better than some of the descriptions posted here, leading me to believe there may be some truth to the faster chip/better ai thought.

My "testing" (via thief) of the ai has been informal and primarily on the ?xanthra's? challenge xl map (played it about 10 times) included with the game.  On that map, the ai does fairly well, exploits some of my weaknesses, builds well, manages battles well, sails well, sneaks well, retreats well, etc.  Again not great, but not that shabby (as opposed to say the "lith-dancing" ai of homm3, for instance). I am extremely excited and pleased with HOMM4 and believe it will be (once patched) one of the greatest strategy games ever, if not the greatest (and i've played most all of the great ones).

<flaming alert>

The level of whining about this game on these boards, especially about the ai, has become ridiculous and most of the gripes are moronic.  Anyone is welcome to their opinion, but when I see excellent and respectable players  making statements that they know aren't really true, or if true are immaterial, it becomes increasingly puzzling and annoying.  I am going to deal with a few of such statements here.

1.  "Multiplayer games will take too long." Yes, like the upper echelon of any other game, the games will take a long time.  This is the CHOICE OF THE PLAYERS.  If you are splitting the rogues/sprites etc. into 7 armies of one on day one, YES, THE EARLY PART OF THE GAME MIGHT TAKE A LONG TIME, LOL.  Everyone knows that 90% of the time in multiplayer is eaten up by combat, and because there is no chaining, there will probably be fewer combats per turn (yes and take longer to move armies to the front, granted, but not that big a deal...TP, DD, fly and utopias are the real "swifteners" and really, really were those good strategic elements or just broken, the more I play homm4 the more i believe the latter).

MAP DESIGN, i.e. roads, wandering monster strength (somebody complained, not in this thread, that the wandering monsters sometimes attacked a vastly superior force... that's why they are called "MONSTERS," folks, they tend to behave as such), not the game itself will make multiplayer slow or fast.  Again, this is something that everybody knows and you wouldn't think would have to be stated (and no, all the combats with one rogue really shouldn't take that long, lol).  

p.s. I have noticed that battles/castle seiges take much less time in homm4 because of stronger magic, hypnotized creatures just don't take that long to kill...

2.  "The game is too buggy." To those who truly say this with a straight face, welcome, sweet innocents, to the big bad world of software.  Lest we forget, many of the greatest strategy games ever made were made by a company called MICROPROSE (and we all know where this is going so I will shorten the thought...). MOM, MOO, DARK fricking LANDS (i know rpg primarily but homm4 is going a little in that direction), etc. All TRULY unplayable pieces of crap when released that later became TRULY great.  At least this piece of crap runs!!! I remember the fun of loading 8 of the 15 darklands disks only to find the error in disk 9, arrggggghh.  It is particularly ironic to hear folks waxing nostalgic about MOM.  Of all the idiotic comparisons i could conceive of this is the worst to make your case that homm4 isn't all that great.  I remember CRYING as a grown man and DESTROYING keyboards and one entire NOTEBOOK COMPUTER trying to install and run that game... and you are lying if you say it wasn't that bad... IT WAS THAT BAD AND WORSE.  Yes it was great, but next time you are nostalgic check the patch history for MOM... it ain't pretty.  

NWC spoiled us by releasing relatively clean running games that ran well out of the box... this is an ANOMALY in the software industry and though it is desirable, whining about bugs in games is like whining about wet in water.  Keep it up though if it makes you feel better... ROFLMAO.

3. "The AI is bad."- Have you ever played HOMM3 random map v. the comp and lost?  I haven't but I guess it's conceivable (small, impossible give comp tower and you take dungeon, lol, comp MAY win if it can get to you fast).  Have you ever noticed in HOMM3 that the "best" single player maps have to dump "time-released" heroes through a lith at your door (a lame map design tool, IMO, map-makers) or preplace huge armies that you have to get past in order to proceed.  Have you ever noticed that these maps also close the AI off so it can develop, in its retarded fashion, for (usually) months at high growth rates? Once the MP patch comes, people (at least the fanatics like us who post here) will forget that the damn game even HAS an ai, just like apparently many have forgotten just how bad HOMM3's and every other strategy game's ai sux out loud. Finally, people here seem to discount the fact that some of them are better at playing this game than they are at their JOBS!  Expecting the AI to come even close is disingenuous.  And if it can't come close, is it really material whether it's a lot better or not, really, if it can't ever get close enough, then why worry about it? Would it make you feel better that the computer player you are about to cream actually picked up the chest or flagged the mine before you got there?? LOL.

p.s., a lot of what people think is poor ai is actually poor map design of the wretched campaign maps in homm4.  Homm has always come with crappy maps/campaigns (there are a few exceptions, but HOMM2 nostalgics remember how ridiculously EASY the evil campaign was in homm2? c'mon think about things before you make statements).  This is a truly excellent game that I can't stop playing, and I have explored only a few of the strategic options. Wondering about "charm/diplo bombs/charm h&r" at the moment and how to implement.

____________
My daddy drives a UFO

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


Responsible
Famous Hero
posted April 17, 2002 09:45 PM

Good post bestanden. I agree with most of the things you have said.

I like Heroes 4 now more than Heroes 3 or Heroes 2 for that matter. Graphics are great (not only beautiful but they also work, for me at least). Especially trees are nice. I believe that it is the best of the series, at least when the patch(es) have come. I never had problems switching from Heroes 2 to Heroes 3, and neither I had them now with Heroes 4.

One thing makes me wonder though, does AI play better if you restart/load the game once in a while, or do you have to reset the computer?
____________

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


Honorable
Supreme Hero
Zapper of Toads
posted April 17, 2002 10:17 PM

Sometimes there can be explanations even to the seemingly worst Ai behaviour.

For instance. I've seen complaints that AI doesn't attack a city even though it outguns you 1000:1.

Have you tried to take a city with say 10 Black Dragons, defended by perhaps 100 Sprites?

Hmmm... Well if you have then you have been utterly disappointed by the result, because then you know that without a hero in your army the City will not change ownership!

This means that monster stacks belonging to the enemy are often harmless. Without a hero, the enemy wins very little by attacking. In this case, the attacked party would be down 100 sprites, but the Ai player wins nothing.

Similar things apply to flagging mines and creature dwellings. Without a hero in the army, you will not gain control over it.

There might be something to the fact that Ai is better in the beginning of the game.

____________
"A brilliant light can either illuminate or blind. How will you know which until you open your eyes?"

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


Adventuring Hero
posted April 17, 2002 11:31 PM

ai better when reload?

I don't know whether reloading could make the ai better as the person who suggested the ai/CPU theory by referencing other games stated that the CPU, not ram improved the ai or rather its time limit for decisions.  I have noticed that the ai does an excellent job of staying in the shroud when it can, which worries me a little because how does it know where my shroud is, lol?

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


Hired Hero
posted April 18, 2002 12:36 AM

AI in a turn based game cannot possibly be affected by available memory, unless there's a significant bug present, or it's using the time spent on your turn for processing (HIGHLY unlikely).

I doubt HOMM4 is using Deep Blue code.


____________

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


Adventuring Hero
posted April 18, 2002 07:37 AM

Anyone else notice a trend with games that has build-in MP3 players?

They all jitter and loop and take up an insane amounts of memory on most systems.

Fewk I wish they'd just license Winamp.

/Flash

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


Known Hero
Pathetic Loser
posted April 18, 2002 07:13 PM

Quote:
AI in a turn based game cannot possibly be affected by available memory, unless there's a significant bug present, or it's using the time spent on your turn for processing (HIGHLY unlikely).

I doubt HOMM4 is using Deep Blue code.




Did you even read my post at all?  The less available memory, the more the CPU slows down.  Therefore, if they have a model similar to the MTG PC game, less memory could quite easily affect AI.

I'm not saying they're using a CPU based AI model, I'm just saying it has, in fact, been done and I'm sorry some of you don't believe me.  Check out Magic: The Gathering from Microprose, released sometime around 1997.  I can't show you where it says that it uses the CPU for the AI, but as I recall it was in the actual manual somewhere.  I'll have to check on this and post later...
____________

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


Adventuring Hero
posted April 19, 2002 07:41 AM

Brody that isn't entirely correct.
Having a low amount of Ram will never slow the CPU itself down.
However, it will slow the general system performance down and depending on how they wrote the AI it's quite possible that more ram equals a better AI but most games are written so that less ram only means worse performance (i.e. a lot of swapping) without any AI nerf.

An example of RAM driven AI would be pathfinding which in some games can be set to a variable depth depending on your system performance including the amount of RAM.

/Flash

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


Known Hero
Pathetic Loser
posted April 19, 2002 08:33 PM

I'm not saying RAM does affect H4's AI, but is isn't at all impossible.  The only game I've ever seen that has variable AI is MTG, and with less RAM your system goes slower, so if the AI is dependant on processor power (as in MTG), that could be what's happening.  But I'm not saying RAM is affecting AI just because of the RAM itself, only as a performance hit to a processor-driven AI.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
[ This thread is 2 pages long: (1) 2 ] < Prev Thread . . . Next Thread >
Post New Poll †† Post New Topic †† Post New Reply

Page compiled in 0.0745 seconds