Lemmini - Lemmings for Java - public Alpha

Started by 0xdeadbeef, February 21, 2006, 06:37:50 PM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

0xdeadbeef

Spend the whole morning investigating why the java process would get more and more memory while the heap inside my program was constantly low. Indeed I found one clear memory leak (music), one resource leak (sound) and one not so obvious resource leak (painting levels). The music issue is my fault, whereas the other two issues are a little obscure since the JDK documentation doesn't really tell that the resources HAVE to be freed explicitly.

Anyway, while the memory used by 0.50 could easily reach 300MB and more (when playing lots of levels and playing lots of sounds - especially easy when using the RR buttons), the footprint of 0.51 should always stay below 64MB.

Considering the sound related crashes on Win98, this could be solved now. Give it a try.

Fixes/Changes 0.50 -> 0.51
#  Fixed (kind of) resource leak when playing sounds (Clip.close() via LineListener).
#  Fixed memory/resource leak when loading a new music
#  Fixed (kind of) resource leak when painting level (flush() is used on all Images/BufferedImages)

Mr. K

Well, the RAM usage stayed steadily at around 64MB.  That's good, but I found a bit of a bug.  Upon finishing a level, the music starts to play like the computer's frozen.  It'll play about 1-2 seconds worth, then go back to the beginning of that 1-2 second fragment and play it again, and again, and again.  This only happens on the "Level Complete" screen.  As soon as I click away from it, the music fixes itself.

I also noted that Lemmini runs smoother than any of the official ports that I've played (PC/Amiga/Mac/Win95/you name it).  I like that.

EDIT:  Another thing that bothers me is that the noise the builders make on their last 3 bricks is supposed to be the clicking noise, not that sound made when a miner hits steel.

0xdeadbeef

Quote from: Mr. Ksoft link=1140547071/105#106 date=1141569560Well, the RAM usage stayed steadily at around 64MB.  That's good, but I found a bit of a bug.  Upon finishing a level, the music starts to play like the computer's frozen.  It'll play about 1-2 seconds worth, then go back to the beginning of that 1-2 second fragment and play it again, and again, and again.  This only happens on the "Level Complete" screen.  As soon as I click away from it, the music fixes itself.
While this didn't happen at my system, I changed the music stop code a little for 0.52. Could you try it again?

Quote
I also noted that Lemmini runs smoother than any of the official ports that I've played (PC/Amiga/Mac/Win95/you name it).  I like that.
This might be due to the fact that the screen update speed is doubled to compensate for the higher resolution.


Quote
EDIT:  Another thing that bothers me is that the noise the builders make on their last 3 bricks is supposed to be the clicking noise, not that sound made when a miner hits steel.
From what I can tell, this is the same sound as in the windows version, so most probably I just don't have another one. Are you sure the sound should be different?

Mr. K

About the builder sound, I was thinking of the Amiga version, and it's like that in the Mac version too.  The Windows version wasn't right.  I checked the WinLemm data files, the CORRECT sound from the Amiga/Mac version is TING.WAV.

Will check the 0.52 ASAP.

Proxima

I'm afraid my computer at home isn't working at the moment and has had to go in for repair, so I haven't had a chance to test out the new version yet.

0xdeadbeef

Some smaller updates...

Fixes/Changes 0.53 -> 0.54
#  Fixed: stopper mask was not completely removed in case of explosion etc., which made setting a new
   stopper at the same position hard to impossible (walkers were usually not affected though).
#  Fixed: bug in LineListener. Maybe connected to "freezes" happening from time to time since
   I introduced the LineListener. Most probably not, but who knows.
#  Fixed: Lemmini doesn't work on Macs because version number contains characters (0-beta)

Fixes/Changes 0.52 -> 0.53
#  Slowed down RR changes a little
#  Fixed empty masks when using miners/bashers/builders to the left.

Proxima

OK, I've had a go with the new version.

No crashes when changing the RR as yet (though I'll keep trying and see if anything happens).

I did however get a different sort of crash when using the pause function. The music stopped, and when I opened a different window and went back to Lemmini the screen was grey and I couldn't get it to respond except by using ctrl-alt-del > End Task.

A couple of suggestions, not related to the crash thingy:

* "Squasher" is a very silly name for the third Lemmings style. Why not use one of its standard names, "pink" or "marble"?
* How about adding option-click on the release rate buttons to change it straight to the minimum or maximum?

0xdeadbeef

Quote from: Ahribar link=1140547071/105#111 date=1141768348OK, I've had a go with the new version.

No crashes when changing the RR as yet (though I'll keep trying and see if anything happens).
Ah, that's something.

Quote
I did however get a different sort of crash when using the pause function. The music stopped, and when I opened a different window and went back to Lemmini the screen was grey and I couldn't get it to respond except by using ctrl-alt-del > End Task.
Hm, interesting. Is this reproducable? How long did you wait before shutting Lemmini down? How much free RAM do you have?
If you can reproduce it, please also try to disable sound and see if it still happens.

Quote
* "Squasher" is a very silly name for the third Lemmings style. Why not use one of its standard names, "pink" or "marble"?
The name squasher stems from the LVL format description by "rt". I must admit I don't really cared since this is an "internal" name anyway. Is there any info available what's the "official" name?

Quote
* How about adding option-click on the release rate buttons to change it straight to the minimum or maximum?
I'd bet ccexplore would complain this would make some levels too easy.


BTW: It really runs pretty well under Linux (just tested with Knoppix)

Fixes/Changes 0.54 -> 0.55
#  Changed drawing in minimap (alpha value always 0xff) to avoid different background color under Linux


Proxima

Quote from: 0xdeadbeef link=1140547071/105#112 date=1141769683Hm, interesting. Is this reproducable? How long did you wait before shutting Lemmini down? How much free RAM do you have?
If you can reproduce it, please also try to disable sound and see if it still happens.
I'll keep trying.... when I have time. I'm afraid time is really difficult for me at the moment. Essays, you see.  :(

QuoteThe name squasher stems from the LVL format description by "rt". I must admit I don't really cared since this is an "internal" name anyway. Is there any info available what's the "official" name?
I don't think any of the styles have "official" names. Except on Cheapo, of course, where that one is called "pink". I've also seen it called "tile" or "marble".

QuoteI'd bet ccexplore would complain this would make some levels too easy.
It can't affect difficulty, since you could always achieve the same thing by pausing and changing the release rate the slow way. I'm not proposing it be possible to lower the release rate below the initial value for that level, of course, just that you can get back to the minimum value in one click. Just a little convenience to the player, you see. (Or a big convenience, given that wanting to change the RR to the maximum or minimum is much more common than wanting to change it to a precise in-between value.)

Proxima

I'm afraid I got the RR-change crash glitch again.

How do I find out how much free RAM I have? I seem to have 256MB but I think that's total RAM.

I'll try with disabled sound next and see what happens.

EDIT: tried, and it seems to be crash-free. The other bug I mentioned (with pausing) also doesn't happen. And I checked the fatal fall height in Tame 4; it seems to be OK now.

A few more points, though:

* In normal (non-fast-forward) mode the screen seems to flicker a lot; it makes it painful to look at and also seems to affect lemming selection -- it doesn't work if I click while the screen is flickering.

* When I nuked and then right-clicked to return to the main menu, the text in the middle of the intro screen didn't display correctly.

* Your "WALKER(c)" and "WALKER(f)" displays to show that a lemming is a climber or a floater might look neater with capital C and F to match the other capital letters. Maybe a space between WALKER and the bracket, too.

* And when there are a number of lemmings under the cursor, the display WALKER-2 looks like it's talking about a negative number  :P  Every version I've played just says "WALKER 2" with a space, no dash.

* RR change seems to be faster on Lemmings levels than ONML ones. Could be just me though.

* It's irritating to lose the player (and hence which levels I've solved) information when I download a new version. Could this be remedied somehow? Also, how about a command to delete players (if I get tired of one, or just if I typoed)?

EDIT 2: I can't seem to reproduce the pause crash glitch even with sound enabled. Could have been because I had a lot of other programs open at the time, perhaps?

0xdeadbeef

Quote from: Ahribar link=1140547071/105#114 date=1141851731I'm afraid I got the RR-change crash glitch again.

How do I find out how much free RAM I have? I seem to have 256MB but I think that's total RAM.
Phew, that's not too much. I stripped down Lemmini to use only 64MB of heap, but when playing sounds, the Java runtime environment seems to allocate additional RAM which I can't really control. I would guess that this is the source of your problems and I don't really know what to do against it.
I didn't use Win98 for many years. Doesn't the Task Manager show the available/free RAM?

Quote
I'll try with disabled sound next and see what happens.
EDIT: tried, and it seems to be crash-free. The other bug I mentioned (with pausing) also doesn't happen. And I checked the fatal fall height in Tame 4; it seems to be OK now.
I could limit the whole sound output to just some output lines. I guess this would reduce the chance of crashes since to RAM outside the JRE would be allocated when playing a sound. However this  is a major rework and I'd rather do an editor (no promise) than that. I'm also not sure if this would really fix the problem. But maybe I'll do it anyway.


Quote
* In normal (non-fast-forward) mode the screen seems to flicker a lot; it makes it painful to look at and also seems to affect lemming selection -- it doesn't work if I click while the screen is flickering.
This is a complete mystery to me. The whole screen is drawn to an offscreen buffer, than the offscreen buffer is copied to the frame buffer in one go. That's the maximum I can do to avoid flicker. I'd suspect this could be something in the JRE as well.
What colour depth does your desktop have? I'd guess Lemmini wil run best for truecolor modes. If you don't use truecolor, could you give this a try?

Quote
* When I nuked and then right-clicked to return to the main menu, the text in the middle of the intro screen didn't display correctly.
Phew, the screen is blanked and completely redrawn. This really shouldn't possibly happen. Can you reproduce this or make screenshot? Anyway, I think this can really only happen "outside" Lemmini. E.g. memory corruption or bugs in the JRE or whatever.

Quote
* Your "WALKER(c)" and "WALKER(f)" displays to show that a lemming is a climber or a floater might look neater with capital C and F to match the other capital letters. Maybe a space between WALKER and the bracket, too.
* And when there are a number of lemmings under the cursor, the display WALKER-2 looks like it's talking about a negative number  :P  Every version I've played just says "WALKER 2" with a space, no dash.
In my (fading) memories, the Amiga version had dashes. But probably I'm wrong.
@all: Any other opinions on lowercase f/c/a and dashes???

Quote
* RR change seems to be faster on Lemmings levels than ONML ones. Could be just me though.
Lemmini doesn't really know if a level is original or ONML - it just sees a level. I could only image that if your CPU load is 100% that maybe some levels with more objects are slower and the the whole redraw is slowed down which would also affect the release rate. Did you check your CPU load when running Lemmini (e.g. Task Manager). Is it close to 100%?

Quote
* It's irritating to lose the player (and hence which levels I've solved) information when I download a new version. Could this be remedied somehow? Also, how about a command to delete players (if I get tired of one, or just if I typoed)?
Hm, is it really overwritten? I must admit I didn't notice it since most of the time I play my local version of course.
I will move the player directory to the same directory as the resources.

Quote
EDIT 2: I can't seem to reproduce the pause crash glitch even with sound enabled. Could have been because I had a lot of other programs open at the time, perhaps?
Hm, how stable is your system anyway?
Just to get an impression - could you try Paradroidz? This is a Java remake of the C64 classic Paradroid in 3D:
http://www.jpct.net/paradroidz/

0xdeadbeef

Fixes/Changes 0.55 -> 0.56
#  Speed up cleaning of bgImage when changing levels (not noticeable though)
#  Moved players directory ro resource directory and player definitions from main ini to players.ini
   in the resource directory. Also allowed capital letter for players ini files.
#  Skill attributes a,c,f now displayed in capital letters A,C,F
#  Space is displayed instead of dashed for number of lemmings beneath the cursor.

Proxima

Quote from: 0xdeadbeef link=1140547071/105#115 date=1141858631Phew, that's not too much. I stripped down Lemmini to use only 64MB of heap, but when playing sounds, the Java runtime environment seems to allocate additional RAM which I can't really control. I would guess that this is the source of your problems and I don't really know what to do against it.
I didn't use Win98 for many years. Doesn't the Task Manager show the available/free RAM?
Um...... where will I find Task Manager? (Sorry to be such a hopeless n00b...... I've always hated Windows and the way it seems to go out of its way to be as user-hostile as possible. But now I'm stuck using this computer because it's the one that has the internet connection. Damnable, really.)

QuoteI could limit the whole sound output to just some output lines. I guess this would reduce the chance of crashes since to RAM outside the JRE would be allocated when playing a sound. However this  is a major rework and I'd rather do an editor (no promise) than that. I'm also not sure if this would really fix the problem. But maybe I'll do it anyway.
I don't want you to do a major rework just to make it OK with antiquated systems!

QuoteWhat colour depth does your desktop have? I'd guess Lemmini wil run best for truecolor modes. If you don't use truecolor, could you give this a try?
Yes, I do use truecolor.

QuotePhew, the screen is blanked and completely redrawn. This really shouldn't possibly happen. Can you reproduce this or make screenshot? Anyway, I think this can really only happen "outside" Lemmini. E.g. memory corruption or bugs in the JRE or whatever.
I'll have a go.

Mindless

Quote from: 0xdeadbeef link=1140547071/105#115 date=1141858631
Quote from: Ahribar link=1140547071/105#114 date=1141851731How do I find out how much free RAM I have? I seem to have 256MB but I think that's total RAM.
Phew, that's not too much. I stripped down Lemmini to use only 64MB of heap, but when playing sounds, the Java runtime environment seems to allocate additional RAM which I can't really control. I would guess that this is the source of your problems and I don't really know what to do against it.
I didn't use Win98 for many years. Doesn't the Task Manager show the available/free RAM?
No, it doesn't, it only lists tasks.  Process Explorer might tho.

lemmingzappa

Wow excellent work with this, ive just downloaded it so i'll give it a go and get back to you if I find any problems. Hopefully I wont post any which have been posted before  [smiley=cool.gif]