Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#101 2022-12-07 20:59:58

Minimania
Moderation Team
From: PbzvatFbba 13
Joined: 2015-02-22
Posts: 6,377

Re: Everybody Edits Offline: Project M (1.1.0) [HAPPY HALLOWEEN!]

MartenM wrote:

Heyyo, is there a file with the minimap colours of EEM?
Cannot seem to find it my self.

In ItemManager.as, block color is written at the end of the line of code for each new block. It would be a huge hassle for someone adding new assets to have to pick out every color individually, so most assets, including almost all of the Project M ones, use "-1" instead of a hex code. This makes the client pick a color automatically, a summation of all of the pixels in the asset.

So, unfortunately, this all means that the hex codes aren't in a list, and in order to get them, they have to be extracted by hand.


21cZxBv.png
Click the image to see my graphics suggestions, or here to play EE: Project M!

Offline

#102 2022-12-07 23:04:50, last edited by capasha (2022-12-08 14:44:25)

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: Everybody Edits Offline: Project M (1.1.0) [HAPPY HALLOWEEN!]

Minimania wrote:

So, unfortunately, this all means that the hex codes aren't in a list, and in order to get them, they have to be extracted by hand.

Nope, this can be made with programming. Loop through the list and grab minimap colors.

I could make a tool for this, but for what use is it?

Edit:

I think I can do it much more advanced, but this is easier.
Block-Data-u8k-BMi-Bcmv.png

Offline

Wooted by:

#103 2022-12-08 17:09:49, last edited by MartenM (2022-12-08 17:22:20)

MartenM
Member
From: The Netherlands
Joined: 2016-03-31
Posts: 925
Website

Re: Everybody Edits Offline: Project M (1.1.0) [HAPPY HALLOWEEN!]

Minimania wrote:

In ItemManager.as, block color is written at the end of the line of code for each new block. It would be a huge hassle for someone adding new assets to have to pick out every color individually, so most assets, including almost all of the Project M ones, use "-1" instead of a hex code. This makes the client pick a color automatically, a summation of all of the pixels in the asset.

So, unfortunately, this all means that the hex codes aren't in a list, and in order to get them, they have to be extracted by hand.

Yeah definitely not going through that by hand //forums.everybodyedits.com/img/smilies/smile
If the client can do it programmatically so can we!

capasha wrote:

Nope, this can be made with programming. Loop through the list and grab minimap colors.

I could make a tool for this, but for what use is it?

Edit:

I think I can do it much more advanced, but this is easier.

That looks rather convenient. Mind sharing the tool or the exported list? Format doesn't really matter as long as it it's from block-id -> color values.

As for why this is useful, I want to recreate the image in C# for a bot I am developing. It works for the normal EE worlds but not yet for the PmLvls.

Edit: I'm trying to find the (project M) source code. Is it somewhere on Github?


lm3hgg8.jpg

Ingame: marten22        My steam: MartenM

Offline

Wooted by:

#104 2022-12-08 22:46:29

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: Everybody Edits Offline: Project M (1.1.0) [HAPPY HALLOWEEN!]

The source code can be found in the download drop down. If you want the code for converting images into color. I write it below.

private static uint GetBlockColor(Bitmap bmd) {
	uint r = 0, g = 0, b = 0;

	for (int x = 0; x < bmd.Height; x++){
		for (int y = 0; y < bmd.Width; y++){
			uint color = ColorToUInt(bmd.GetPixel(x, y));

			r += (color & 0xff0000) >> 16;
			g += (color & 0x00ff00) >> 8;
			b += (color & 0x0000ff);
		}
	}

	r /= (uint)(bmd.Width * bmd.Height); //256
	g /= (uint)(bmd.Width * bmd.Height); //256
	b /= (uint)(bmd.Width * bmd.Height); //256

	return 0xff000000 | (r << 16) | (g << 8) | (b << 0);
}

private static uint ColorToUInt(Color color) => (uint)((color.A << 24) | (color.R << 16) | (color.G << 8) | (color.B << 0));

Offline

Wooted by: (2)

#105 2022-12-09 23:15:17

MartenM
Member
From: The Netherlands
Joined: 2016-03-31
Posts: 925
Website

Re: Everybody Edits Offline: Project M (1.1.0) [HAPPY HALLOWEEN!]

Got it up and running. Thanks a lot!


lm3hgg8.jpg

Ingame: marten22        My steam: MartenM

Offline

#106 2023-10-22 08:05:42

TowerOfDustAndDecay
Member
Joined: 2021-01-03
Posts: 84

Re: Everybody Edits Offline: Project M (1.1.0) [HAPPY HALLOWEEN!]

This might come off as incredibly stupid and not worth the gravedig, but would it be okay for this to get uploaded on Flashpoint by any chance? Other Flash emulators tend to be wonky.


2015-2018 - Beginning of the brain's decomposition.
2019 - Not knowing any better.
2020 - A disasterous return.
2021 - OW THE EDGE OW OW STOP IT HURTS
2022 - Actual redemption!
2023 - Remorse. Lots of it.

Offline

#107 2023-10-22 13:28:18

Snowester
Member
From: Mars
Joined: 2017-05-31
Posts: 622

Re: Everybody Edits Offline: Project M (1.1.0) [HAPPY HALLOWEEN!]

TowerOfDustAndDecay wrote:

This might come off as incredibly stupid and not worth the gravedig, but would it be okay for this to get uploaded on Flashpoint by any chance? Other Flash emulators tend to be wonky.

Flash emulators? What OS are you using?
There's a flash projector for each of the 3 major OS, and it was actually given from Flashpoint iirc, but you could find them from EEO discord > #how-to-play

Offline

#108 2023-10-22 20:02:53, last edited by TowerOfDustAndDecay (2023-10-22 20:03:03)

TowerOfDustAndDecay
Member
Joined: 2021-01-03
Posts: 84

Re: Everybody Edits Offline: Project M (1.1.0) [HAPPY HALLOWEEN!]

Snowester wrote:
TowerOfDustAndDecay wrote:

This might come off as incredibly stupid and not worth the gravedig, but would it be okay for this to get uploaded on Flashpoint by any chance? Other Flash emulators tend to be wonky.

Flash emulators? What OS are you using?
There's a flash projector for each of the 3 major OS, and it was actually given from Flashpoint iirc, but you could find them from EEO discord > #how-to-play

11. What, am I supposed to be on something earlier?


2015-2018 - Beginning of the brain's decomposition.
2019 - Not knowing any better.
2020 - A disasterous return.
2021 - OW THE EDGE OW OW STOP IT HURTS
2022 - Actual redemption!
2023 - Remorse. Lots of it.

Offline

TowerOfDustAndDecay1698001373798114

Board footer

Powered by FluxBB

[ Started around 1701844711.7528 - Generated in 0.037 seconds, 10 queries executed - Memory usage: 1.49 MiB (Peak: 1.65 MiB) ]