Author Topic: SuperLemminiToo v1.50  (Read 7569 times)

0 Members and 1 Guest are viewing this topic.

Offline Charles

  • Moderator
  • Posts: 44
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #15 on: October 17, 2021, 06:33:53 PM »
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?

Online Simon

  • Administrator
  • Posts: 3302
    • View Profile
    • Lix
Re: SuperLemminiToo v1.10
« Reply #16 on: October 17, 2021, 06:57:52 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: Charles
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.

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
« Last Edit: October 17, 2021, 07:19:31 PM by Simon »

Offline WillLem

  • Moderator
  • Posts: 2427
  • "The truth is..."
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #17 on: October 17, 2021, 07:23:51 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:



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:


Offline Forestidia86

  • Posts: 688
  • inactive
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #18 on: October 17, 2021, 07:26:11 PM »
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.

Offline WillLem

  • Moderator
  • Posts: 2427
  • "The truth is..."
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #19 on: October 17, 2021, 07:34:41 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.

Offline Charles

  • Moderator
  • Posts: 44
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #20 on: October 17, 2021, 07:43:20 PM »
Ah of course. Okay. That should be easy enough to fix. I’ll try and do that later tonight.

Try this version.
« Last Edit: October 17, 2021, 08:34:33 PM by Charles »

Offline WillLem

  • Moderator
  • Posts: 2427
  • "The truth is..."
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #21 on: October 17, 2021, 08:48:06 PM »
Try this version (v1.10.2)

Yep, works a treat :thumbsup:

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?

Offline WillLem

  • Moderator
  • Posts: 2427
  • "The truth is..."
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #22 on: October 17, 2021, 09:29:06 PM »
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.
« Last Edit: October 20, 2021, 05:20:03 AM by WillLem »

Online Simon

  • Administrator
  • Posts: 3302
    • View Profile
    • Lix
Re: SuperLemminiToo v1.10
« Reply #23 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. 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: WillLem
Are you a Windows or Mac user?

No. :P (Linux.)

Quote from: WillLem
I'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:

Quote
number 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
« Last Edit: October 17, 2021, 11:40:13 PM by Simon »

Offline WillLem

  • Moderator
  • Posts: 2427
  • "The truth is..."
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #24 on: October 17, 2021, 11:52:48 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: WillLem
Are 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...

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:

Offline WillLem

  • Moderator
  • Posts: 2427
  • "The truth is..."
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #25 on: October 20, 2021, 05:06:00 AM »
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.
« Last Edit: October 20, 2021, 05:23:02 AM by WillLem »

Offline WillLem

  • Moderator
  • Posts: 2427
  • "The truth is..."
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #26 on: October 20, 2021, 05:19:37 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
« Last Edit: March 30, 2022, 07:50:38 AM by WillLem »

Offline Charles

  • Moderator
  • Posts: 44
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #27 on: October 20, 2021, 05:28:18 PM »
I replied to your Eclipse questions on another thread: https://www.lemmingsforums.net/index.php?topic=5801.msg94114#msg94114

Offline Charles

  • Moderator
  • Posts: 44
    • View Profile
Re: SuperLemminiToo v1.10
« Reply #28 on: October 20, 2021, 05:32:55 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
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.

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.

Offline Charles

  • Moderator
  • Posts: 44
    • View Profile
Re: SuperLemminiToo v1.20
« Reply #29 on: October 20, 2021, 05:36:38 PM »
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.