Page 1 of 1

Ninja Mitsuo - platformer game with SGDK

Posted: Sat Feb 02, 2019 12:30 pm
by vnsbr

WIP #1

Video of WIP 1
https://www.youtube.com/watch?v=r96Xo9z ... e=youtu.be


New project I am working on mostly to learn SGDK and sega genesis programming in general. It still in the early works and a lot of to do. I still need to learn what is the best way to capture the screen so I can post anything other than static images here in the forum, any ideas? for the moment I will post a screenshot of the level I have been using to test collisions, enemy AI and such.

The graphics (apart from the character) are done by ansimuz. Character and coding is done by me for the moment.

Ninja Mitsuo is a game heavily inspired by Ninja Gaiden but still new ideas and its own pacing.

Re: Ninja Mitsuo - platformer game with SGDK

Posted: Tue Feb 05, 2019 12:32 am
by nemezes
Really nice!

Ansimuz knows how to pixel!! Great art! Ansimuz released an art pack called "warped city" that I think fits very good in a 16 bits mega drive game.

Re: Ninja Mitsuo - platformer game with SGDK

Posted: Thu Feb 07, 2019 2:43 pm
by vnsbr
nemezes wrote:
Tue Feb 05, 2019 12:32 am
Really nice!

Ansimuz knows how to pixel!! Great art! Ansimuz released an art pack called "warped city" that I think fits very good in a 16 bits mega drive game.
You are right, his art makes me want to make all type of games :P and warped city is especially good ehehe It could be a nice bonus level :P

I have recorded a video with start of level 1!

https://www.youtube.com/watch?v=r96Xo9z ... e=youtu.be

Re: Ninja Mitsuo - platformer game with SGDK

Posted: Fri Feb 08, 2019 4:44 pm
by tryphon
Your ninja is almost the same colour as the background and it makes it difficult to spot.

But... awesome pixel art :D

Re: Ninja Mitsuo - platformer game with SGDK

Posted: Sun Feb 10, 2019 10:58 am
by danibus
Nice video, but Moon colors are the same like skulls, maybe you need to change this, in my opinion :oops:

Re: Ninja Mitsuo - platformer game with SGDK

Posted: Mon Feb 11, 2019 1:31 pm
by Chilly Willy
It's a blood moon, man! :lol:

In all seriousness, there are times when the atmosphere causes the moon to take on colors other than gray. Or you could just say the game isn't on Earth. And finally, Rule of Cool.

Re: Ninja Mitsuo - platformer game with SGDK

Posted: Mon Feb 11, 2019 2:12 pm
by vnsbr
thanks guys, I have been with little spare time but I am still trying to work in the engine at least.

Speaking of colors and moons :lol: the sprites werent made with the sega genesis palette and I have a hard time showing all the details and it really pisses me of :x

I used aseprite to match the genesis palette and it got a little better. Still losing details like in the cloud compared to original art. I also wrote a little program and it gets better results in some images.. but others not.

I also worked on a temporary life bar.
Fusion 3.64 - Genesis - SAMPLE PROGRAM 11_02_2019 11_07_13.png
Fusion 3.64 - Genesis - SAMPLE PROGRAM 11_02_2019 11_07_13.png (19.13 KiB) Viewed 1503 times
and the C# code to find the colors, maybe it helps someone

Code: Select all

       
       static List<Color> genesisColors = new List<Color>();
        static Dictionary<Color, Color> dicColor = new Dictionary<Color, Color>();
       
        private static void FindBestColors(string directory)
        {
            for (int i = 0; i < 255; i += 34)
            {
                for (int j = 0; j < 255; j += 34)
                {
                    for (int k = 0; k < 255; k += 34)
                    {
                        genesisColors.Add(Color.FromArgb(i, j, k));
                    }
                }
            }

            foreach (var file in System.IO.Directory.GetFiles(directory))
            {
                if (!file.EndsWith(".png"))
                    continue;
                var bmp = (Bitmap)Image.FromFile(file);
                ReplaceColor(bmp);
                var encoderParameters = new EncoderParameters(1);
                encoderParameters.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 1L);
                bmp.Save(Path.GetDirectoryName(file) + "\\best\\"+ Path.GetFileName(file), GetEncoder(ImageFormat.Png), encoderParameters);
            }
        }
        
        private static double ColourDistance(Color e1, Color e2)
        {
            long rmean = ((long)e1.R + (long)e2.R) / 2;
            long r = (long)e1.R - (long)e2.R;
            long g = (long)e1.G - (long)e2.G;
            long b = (long)e1.B - (long)e2.B;
            return Math.Sqrt((((512 + rmean) * r * r) >> 8) + 4 * g * g + (((767 - rmean) * b * b) >> 8));
        }

        private static void ReplaceColor(Bitmap bmp)
        {
            var lockedBitmap = new LockBitmap(bmp);
            lockedBitmap.LockBits();

            for (int y = 0; y < lockedBitmap.Height; y++)
            {
                for (int x = 0; x < lockedBitmap.Width; x++)
                {
                    var oldColor = lockedBitmap.GetPixel(x, y);
                    if (dicColor.ContainsKey(oldColor))
                    {
                        lockedBitmap.SetPixel(x, y, dicColor[oldColor]);
                    }
                    else
                    {
                        Dictionary<Color, double> imageDictionary = new Dictionary<Color, double>();
                        foreach (var color in genesisColors)
                        {
                            var dist = ColourDistance(oldColor, color);
                            imageDictionary[color] = dist;
                        }
                        imageDictionary = imageDictionary.OrderBy(d => d.Value).ToDictionary(d => d.Key, d => d.Value);
                        Color newColor = imageDictionary.FirstOrDefault().Key;
                        int i = 1;
                        while (dicColor.ContainsValue(newColor) && i <= dicColor.Count)
                        {
                            newColor = imageDictionary.Skip(i++).FirstOrDefault().Key;
                        }
                        lockedBitmap.SetPixel(x, y, newColor);
                        dicColor[oldColor] = newColor;
                    }
                }
            }
            lockedBitmap.UnlockBits();
        }
        
Color distance is based in some article I found on internet :oops: and lockbitmap class: https://www.codeproject.com/Tips/240428 ... n-Csharp-3

Re: Ninja Mitsuo - platformer game with SGDK

Posted: Tue Feb 12, 2019 11:07 pm
by Miquel
Ok, let’s prepare comfy chairs because this is a potential winner, I can see that.

But there is something I have to mention; in this darker approach you have taken now, main character is barely visible: you need contrast colors there. Also the animation when striking is unnatural, with dynamic loading you can have extremely large animations going on.