SuperLemminiToo v1.51

Started by Charles, October 08, 2021, 05:32:45 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Charles

Thanks for debugging that Simon, I'm not sure I would have figured out the string formatting error on my own.

I've patched the error message, but if your path is being interpreted as having %'s in it, then there's probably going to be a whole host of other related places I'll need to patch.

I'm sure one of these days I'll get a release working right out of the gates, right... ... right?

Simon

#16
Quote from: WillLem on October 17, 2021, 06:32:24 PM
What exactly is meant by "full rights"? When I go to Properties>Security, there are green ticks for all Permissions. Is this correct?

What I mean is: I remember that Windows grants you, as non-admin, read/write access only to some directories. You want to have SLT and root.lzp where you have such read/write access. Maybe write access is already enough.

I don't use Windows. >_>;; Thus I don't know what those checkmarks would be for.

Quote from: CharlesI've patched the error message, but if your path is being interpreted as having %'s in it, then there's probably going to be a whole host of other related places I'll need to patch.

Yeah, I've seen a couple similar such constructions in your Core.java, but didn't check every single one for whether the runtime string might end up containing '%'.

At least you know about this kind of bug now, and can catch it by eye. :) But if you already have doubts, then I think it's worth sanitizing the codebase for such unchecked formatstrings in the medium term.

Ideally, all your formatstrings are known by compile time -- some other languages can even typecheck the remaining arguments at compile time based on such a formatstring, and give you compiler errors on format specifier mismatch. Even in Java, which doesn't do that, you can strive to have only string literals, no + or other runtime arguments, in the formatstring.

(I'm no expert about best practices when you can't have that so easily, e.g., when you want to translate formatted error messages into different human languages. It's probably okay to let format throw a runtime exception in those cases, and catch it.)

-- Simon

WillLem

Quote from: Charles on October 17, 2021, 06:33:53 PM
I've patched the error message, but if your path is being interpreted as having %'s in it, then there's probably going to be a whole host of other related places I'll need to patch.

I'm sure one of these days I'll get a release working right out of the gates, right... ... right?

We're a step closer - I now get this message:



Quote from: Simon on October 17, 2021, 06:57:52 PM
Yeah, I've seen a couple similar such constructions in your Core.java, but didn't check every single one for whether the runtime string might end up containing '%'.

At least you know about this kind of bug now, and can catch it by eye. :) But if you already have doubts, then I think it's worth sanitizing the codebase for such unchecked formatstrings in the medium term.

I'd be happy to help with the dogsbody of this task in exchange for some Java lessons! :thumbsup:


Forestidia86

Got the same message.

If I remove the space in the directory name (e.g. SuperLemminiToov1.10.1) it starts normally. But this would only be a workaround. One shouldn't have a space in the path name.

WillLem

Quote from: Forestidia86 on October 17, 2021, 07:26:11 PM
If I remove the space in the directory name (e.g. SuperLemminiToov1.10.1) it starts normally. But this would only be a workaround. One shouldn't have a space in the path name.

This workaround worked for me, too. I figured it might have something to do with the space, since spaces tend to get replaced with stuff like % and _ for some reason. Good spot, Forestidia.

Charles

#20
Ah of course. Okay. That should be easy enough to fix. I'll try and do that later tonight.

Try this version.

WillLem

Quote from: Charles on October 17, 2021, 07:43:20 PM
Try this version (v1.10.2)

Yep, works a treat :thumbsup:

Quote from: Simon on October 17, 2021, 06:57:52 PM
What I mean is: I remember that Windows grants you, as non-admin, read/write access only to some directories. You want to have SLT and root.lzp where you have such read/write access. Maybe write access is already enough.

I don't use Windows. >_>;; Thus I don't know what those checkmarks would be for

Thanks for the explanation :)

Are you a Windows or Mac user?

WillLem

#22
One thing I'd suggest is that the number for the timed bombers appears slightly offset to the left. It's not a major issue, but it can be a bit off-putting:



I'm not sure if it's even possible to fix it, but if so it should probs look more like this:



For reference, I moved the numbers exactly 3px to the right. Again, it's barely even an issue, but if it's an easy enough fix it might be worth adding it to the next update.

Simon

#23
Charles: As helpful as the Sunday may have been, it's beginning to derail your release announcement topic. And I'm derailing it further here. >_>; Should we split the topic?

Would you like mod rights for the SL board here, so you can split topics in the future, too?

We can also split the entire board for SuperLemminiToo, or we can split it later if the interest continues.




Quote from: WillLemAre you a Windows or Mac user?

No. :P (Linux.)

Quote from: WillLemI'd be happy to help with the dogsbody of this task in exchange for some Java lessons!

I feel like we have just the right thing:

Quotenumber for the timed bombers appears slightly offset to the left.
might be worth adding it to the next update.

This bug is an ideal way for you to get into the project. One possible place to start might be GameController.java, after line 1810. (Or maybe it's to change the font images that getCountdown() returns. Or...)

Get the source and a JDK, edit the code, compile, and see what happens. When you get stuck, which is normal when trying to compile other people's larger projects, ask.

It's either this kind of jump into cold water, or hammering out your own sizeable practice project from scratch, coming back after a few months, and then jump. Consider: You have the maintainer right here for quick questions, the bug is exactly about your die-hard interests, and I see at least one plausible attempt for a fix.

Sure, Charles might beat you at fixing it, but where's the fun in not trying? :D

-- Simon

WillLem

Quote from: Simon on October 17, 2021, 11:16:38 PM
Charles: As helpful as the Sunday may have been, it's beginning to derail your release announcement topic

Which Sunday? Helpful for what? :curious:

Quote from: Simon on October 17, 2021, 11:16:38 PM
Quote from: WillLemAre you a Windows or Mac user?

No. :P (Linux.)

This was a typo, I meant to say Linux, not Windows! :forehead: You said you weren't a Windows user, and I only know of Mac and Linux as other operating systems. I'm sure there are loads more for devs though...

Quote from: Simon on October 17, 2021, 11:16:38 PM
This bug is an ideal way for you to get into the project. One possible place to start might be GameController.java, after line 1810. (Or maybe it's to change the font images that getCountdown() returns. Or...)

...

Sure, Charles might beat you at fixing it, but where's the fun in not trying? :D

Great shout! :thumbsup: I'll have a look at it tomorrow. Sleep now :sleep:

WillLem

#25
So, I had a go at changing the xPos for the countdown graphic... at least, I think that's what I've done. In the GameController class, I changed the number in line 1815 from /2 ; to /8 ;

NOTE: This change is, in fact, twice as much as is needed. The numbers only need to be moved 3px to the right.






At the moment, it's difficult to check whether this has had any effect, since I get the following error when trying to compile & run the project:



This is in Eclipse, and I'm using JDK 15. Any help anyone can offer would be most welcome! The code is full of red crosses, which I'm guessing will all be many errors which will need to be overcome before I can compile and run...

The graphic will, of course, be easy enough to edit if it comes to that.

WillLem

#26
Quote from: WillLem on October 20, 2021, 05:06:00 AM
The graphic will, of course, be easy enough to edit if it comes to that.

To that end, here is a copy of the countdown graphic which can be used as a workaround in the meantime! :lemcat: I've simply moved the numbers 3px to the right within the png.

NOTE: If you wish to do so, place these in gfx/lemming in your SuperLemmini directory. This will make the countdown numbers appear more central above the Bomber's head.

EDIT: Attachments removed following actual bugfix

Charles


Charles

Quote from: Simon on October 17, 2021, 11:16:38 PM
Should we split the topic?
Good idea. I've just created a new thread to discuss general Java programming: https://www.lemmingsforums.net/index.php?topic=5801.0
Quote from: Simon on October 17, 2021, 11:16:38 PM
Would you like mod rights for the SL board here, so you can split topics in the future, too?
Thanks for the offer, but being a board moderator of any capacity feels like more responsibility that I'm interesting in taking on. As long as I'm not creating more work for you, I'd rather leave things as they are.

Quote from: Simon on October 17, 2021, 11:16:38 PM
We can also split the entire board for SuperLemminiToo, or we can split it later if the interest continues.
Oh, I think that's going overboard -- I'm pretty sure the target audience for SuperLemminiToo can be counted on one hand. And it's still nearly fully cross-compatible with SuperLemmini.  I'm not doing much more than adding window dressing.

Charles

New Release.
This version adds an Enhanced Status Bar!

I removed the clunky full text saying In, Out, Time and replaced them with slick icons. This feature was 1st seen in the SNES and followed about a year later by the SEGA Genesis. Interesting fact, both versions used different icons!  I modeled these after the SNES versions.
And because of the space gained by using icons, I added a 4th icon for number of lemmings needed.

Also, as an extra visual indicator, I made the "In" number Red until you've saved enough Lemmings to pass the level.

Like all the other features, this can also be toggled on/off in the Options menu.