Milona Games/Milona Software: "Project Scarlet" development

I think they had more than one converter, one did normal Sprites conversion and one did sprites plus mask conversion.
(But my memory isn’t the best, so I might have imagined it.)

Retirement rather than demise, though it’s very much reality.
Even their website is gone now. What remains is forks and copies of their code.


Back on topic, I’m beginning to lean towards “the drawPlusMask bug is back”.

But I can’t really confirm that without code that’s actually in a compileable state and can thus be probed…

Yes … for someone who wanted to collaborate at the start of the thread, he is being very secretive with the whole code.

Sorry about that…
Which other part do you need?
Here’s the GitHub I just made of it:

Does that code even compile? It doesn’t for me.

Isn’t there an option to download those files? You can remove the README file for that.

Adding #include "box.h" to player.h fixes the missing declarations.

But when I compile there’s no sign of the sprite rendering bug…

Oh. I commented the animation commands in the file I uploaded…

Your images render fine …

ArduboyCapture (1)

The whole thing works when you change …

    if(!arduboy.pressed(LEFT_BUTTON) || !arduboy.pressed(RIGHT_BUTTON))
    {
      walkframe = -1;
    }

to

    if(!arduboy.pressed(LEFT_BUTTON) && !arduboy.pressed(RIGHT_BUTTON))
    {
      walkframe = -1;
    }

Okay, that solves the frame part and the mirroring part, but that doesn’t fix the bottom half.
Except that it’s clear the images are not corrupted.

ArduboyRecording

I am not sure what you mean as it appears to work fine.

This will be a lot easier of you simply tells us what you think is wrong with the code, what you have done to test it and publish working, compileable code.

This is getting weird. In your GIF the sprite looks like it’s working great but with the mirrored version rendered behind it.
Would you mind explaining what the “b” is about?

Ignore the b. It’s an artefact if my debugging.

For some reason, on my build it causes the player character’s body to glitch out.
But that’s not the case in your build. Are we using different emulators or did you do something to the code?

Did a bit of clean up:

#ifndef PLAYER_H
#define PLAYER_H
#include "box.h"
#include "scroll.h"
int direction = 0;
int walkframe = -1;
int idleframe = 0;
int ground = 0;
int pole = 0;
void player()
{
  //arduboy.fillCircle(playerx, playery, 32, WHITE);
  if(arduboy.pressed(LEFT_BUTTON))
  {
    playerx = playerx - 1;
    direction = 1;
    walkframe = walkframe+1;
    idleframe = 0;
  }

  if(arduboy.pressed(RIGHT_BUTTON))
  {
    playerx = playerx + 1;
    direction = 0;
    walkframe = walkframe+1;
    idleframe = 0;
  }

  if(!arduboy.pressed(LEFT_BUTTON) && !arduboy.pressed(RIGHT_BUTTON))
  {
    walkframe = -1;
  }

  if((arduboy.pressed(UP_BUTTON)) && pole>0)
  {
    playery = playery - 1;
  }

  if (pole <= 0)
  {
    playery = playery + 1;
  }
  
  if (playerx<8)
  {
    playerx = 8;
  }

  if (playerx>208)
  {
    playerx = 208;
  }

  if (walkframe>15)
  {
    walkframe = 0;
  }

  if (walkframe<0)
  {
    idleframe = idleframe + 1;
  }

  arduboy.print(direction);
}

void playergfx()
{
  if(direction == 0)
  {
    if(ground >= 1)
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunright_plus_mask, (walkframe / 4));
    }

    if(ground <= 0)
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunright_plus_mask, 0);
    }

    if ((walkframe < 0) && (idleframe < 40) && (ground >= 1))
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxstandright_plus_mask, (walkframe / 4));
    }

    if ((idleframe >= 40) && (ground >= 1))
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxidle_plus_mask, 0);
    }
  }

  if(direction == 1)
  {
    if(ground >= 1)
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunleft_plus_mask, (walkframe / 4));
    }

    if(ground <= 0)
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunleft_plus_mask, 0);
    }

    if ((walkframe < 0) && (idleframe < 40) && (ground >= 1)) 
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxstandleft_plus_mask, (walkframe / 4));
    }

    if ((idleframe >= 40) && (ground >= 1)) 
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxidle_plus_mask, 0);
    }
  }

  if(arduboy.pressed(LEFT_BUTTON) && (ground >= 1))
  {
    Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunleft_plus_mask, (walkframe / 4));
  }

  if(arduboy.pressed(RIGHT_BUTTON) && (ground >= 1))
  {
    Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunright_plus_mask, (walkframe / 4));
  }

  if (direction == 0)
  {
    if ((walkframe >= 0) && (idleframe < 40) && (ground >= 1))
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunright_plus_mask, (walkframe / 4));
    }

    if ((walkframe < 0) && (idleframe < 40) && (ground >= 1))
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxstandright_plus_mask, 0);
    }
    else if ((idleframe >= 40) && (ground >= 1))
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxidle_plus_mask, 0);
    }
    else if (ground <= 0)
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunright_plus_mask, 0);
    }
  }

  if (direction == 1)
  {
    if ((walkframe >= 0) && (idleframe < 40) && (ground >= 1)) 
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunleft_plus_mask, (walkframe / 4));
    }
    if ((walkframe < 0) && (idleframe < 40) && (ground >= 1))
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxstandleft_plus_mask, 0);
    }
    else if ((idleframe >= 40) && (ground >= 1))
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxidle_plus_mask, 0);
    }
    else if (ground <= 0)
    {
      Sprites::drawPlusMask((playerx - 8) - (camerax - 64), (playery - 8) - cameray, maxrunleft_plus_mask, 0);
    }
  }

}
#endif

Now it runs mostly as intended.

scarlettower.ino.hex (35.4 KB)

I expect there’s a lot of redundancy going on though given how many Sprites::drawPlusMasks there are.


@Mypka_MaxCat, are your libraries up to date?
And are you building your .hex with the Arduino IDE or Project ABE?

I’ve posted some instructions on how to use the Team A.R.G. tools from downloaded copies.

1 Like

I built it on Project ABE’s integrated development environment. (ProjectABE should be updated more often…)
Also, how does this work on your build, but not on mine? That doesn’t make any sense.
Did you change other code too to get it? We used the same emulator to show the HEX file.

Presumably because I’m using the Arduino IDE* to compile my .hex, the same as @filmote.
(* Well, technically VSCode/VSCodium, but they’re using the same Arduino IDE backend, so close enough.)

In which case it seems that the problem is either to do with the version of the compiler or the version of Arduboy2 used by ProjectABE.
Given the similarity to a bug that has since been eliminated from the Arduboy2 library,
I suspect it’s more likely to be an out-of-date Arduboy2 version rather than a compiler bug.

(I don’t actually know how to compile with ProjectABE so I have no clue how to test that theory.)

In the first comment where I reported that the sprite rendering was working:

Adding #include "box.h" was literally the only change I made at that point.

I’ve made other changes since, but even before those the rendering was working fine.

The only way I’ve been able to experience the bug is by loading the .hex you posted earlier onto my Arduboy.
All the .hex files I’ve generated from the code on your GitHub using the Arduino IDE(/VSCodium) have not had the rendering bug.

You can go to ProjectABE website, create a project, and press the “Build” button when done. This builds the HEX file on it.
Your build works great on the emulator. I can’t get the code cleanup to work when I paste it though…

Merry christmas! I just started working on the HTML5 version of Milona Scarlet, so it can be released along with the Arduboy version.
Here is an artwork on DeviantArt:

Hello, folks! I’m coming back to the community to let you know how I’ve been doing with the HTML5 version. It’s going well so far. Also, how’s this title: Scarlet Arcade?

3 Likes