Giter Club home page Giter Club logo

pekaed's Introduction

Note: This project has been replaced by PekaEDS and will not receive any updates anymore.

https://github.com/Detea/PekaEDS


A modern Pekka Kana 2 level editor. Manual


PekaED in action


If you want to work on PekaED, or compile it yourself, you need to run it with the following VM argument:

-Dsun.java2d.noddraw=true

This is because the drawing of the background image(s) is rather inefficient.


All rights to Pekka Kana 2 belong to Janne Kivilahti. (http://pistegamez.net/)

pekaed's People

Contributors

danilolc avatar detea avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pekaed's Issues

Suggestion: More interactive mini map

Making the mini map something you can draw in for example would be cool, even knowing not very useful(still, big areas could be drawned using it). In the case you are wondering how would you draw in the mini map, there could be a button at the top of the mini map's window written "draw" and another at the side of it written "view", so you could switch between those.
Other thing that would be nice and can be merged with the zoom suggestion i made a couple minutes ago, is to be able to use the mouse scroll to make the white square in the mini map bigger or smaller, changing how zoomed in is the main screen.
And the last idea for this is being able to see only background or only foreground in the mini map, now i don't if this could be used with the already existing button background/foreground or with another buttons like this same thing but at the bottom of the mini map's window, so you could have your mini map showing everything while the main screen only shows the background, or the mini map showing the background and the main screen showing the foreground, and so on.

Fix "sprite list" to load all sprites of the level

There isn't a scroll button to see all the sprites of a level, and you can only see the first ones at the list(right side of screen). If this was already fixed, just put it in the closed issues folder so everyone knows this was fixed already.

"Calibrate" the mini map's zoom to the main screen

If you try using the mini map white "square"(i know it is not a square) to see the bottom part of yout map, you will never be able to see the really bottom of it, because the format of the "zoom" in the mini map is not the same as the one of the main screen. Plus, mini map has an offset at the bottom that gives an impression that there is more space in the map than it really do.

Better Linux support

I've just tested the editor on Ubuntu MATE 16.04 and it doesn't seem to use the system look and feel. Instead it uses the ugly cross platform l&f, this needs to be changed.

Also, on Linux file names are case sensitive(?). Windows doesn't care, but Linux does.

Add error logging

Have the program store errors/exceptions, via a log class. Print this log in a file, or in a JTextBox in a "Log" dialog.
This makes it easier to fix bugs.

Add support for night themed levels

Currently all the levels produced with the editor have all the same light level, whatever the background is. However, some backgrounds change the light level.

Note: Is this actually an issue? Have to test.

Fix scrolling type

PekaED doesn't store/load the scrolling type of a map correctly, probably because it uses the wrong variable for it. (use background instead of extra?)

Draw in both layers

When the both layer view is enable, the editor draws in both layers. This could be a problem when drawing key blocks for example.

Add a mini map

Add a mini map which the user can easily scroll the level panel with.

It also gives the user a rough overview of the level.

New Icon for executable

The editor needs a new and better icon for the exe, the current one doesn't look good and is pretty much just a placeholder.

Adjust the right JTabbedPane

Adjust the JTabbedPane on the right, so that it and the mini map fit on top/beneath each other. The minimum resolution this should work is one with a height of 768 pixel. Higher resolutions should stretch the JTabbedPane so that it fills the space between it and the mini map.

Tint sprites with their color

Tint the sprites with their correct color. The color value is being loaded already, but I'm not sure how to tint the sprites. Do it like the game to achieve the exact same colors? Use similar colors, that kind of look like them?

Legacy/Enhanced level mode

Legacy mode will enforce the limits of the original game, so that the levels are playable with it. Enhanced(?) mode will remove/increase these limits.

Optimize performance

Currently the editor draws the whole level ALL the time. This is absolutely unnecessary.

Only draw the tiles and background that are in the JScrollPanes viewport.

PekaED can't load about 30% of the maps

A lot of the levels that i try to load using the PekaED are not opened, when i press "open level" the editor lags for a second(still normal) but then nothing happens: It just stays at its original state. I listed the levels that didn't work:

Vanilla:

Rooster Island 1:
-Level 6
Rooster Island 2:
-Level 1 loaded, but was all messed up
-Level 4
-Level 7
-Level 8
-Level 11 loaded and looked like level 12, but was all messed up
-Level 12 seems to have switched places with level 11, like it is level 11 loaded properly(or i am going crazy)
-Level 13

Non vanilla(the ones i have in my computer at least):

Forerunner's Island(episode made by me), episode with 13 levels:
-Level 1
-Level 2 loaded, but... MESSED UP(just use the same link above)
-Level 4
-Level 5
-Level 6
-Level 7
-Level 8
-Level 9
-Level 11
-Level 12
Isla Del Luna(episode made by Mipha), episode with 13 levels:
-Level 1 seems to have switched places with other level, but was loaded properly
-Level 2
-Level 6 loaded, but it was messed up.
-Level 9 seems to have switched places with level 1, but was loaded properly
-Level 11 was the same as level 10.
Roosterfield(episode made by RowlandGardner), episode with 20 levels:
-Level 2
-Level 3
-Level 6
-Level 8...
-My PekaED bugged, windows and buttons are all at the top of each other, printscreen together with the prints of the messed up maps.
-Stopped not only because PekaED bugged, but also because i don't want to see the spoilers from this episode, i already saw the spoilers from Isla Del Luna and i won't commit the same mistake.

I hope i have helped you, have a nice day. :)

Add shortcut to test level

Pressing the 'F5' key should run the game, with the current level as parameter.
Obviously, this only works in the 'Enhanced' mode.

Add option to zoom in and zoom out the main screen

I know the mini map already exists to the user be able to travel trought the map easier and see the whole map while seeing the main screen, but zoom out is good to the user be able to draw a bigger area without scrolling the screen(and zoom in is good to more accurate drawning). This problem was already present in regular editor and since PekkaED's screen is smaller, this problem is even more problematic.

Translating the manual

The manual can be found here: https://github.com/Detea/detea.github.io/tree/master/pekaed

It is currently only available in english, but to anyone interested in translating it to their language, is very welcome to do so!

Do note, however, that (at the time of creating this issue) it will be updated with new information in the future. To document the functionalities that'll be implemented in future versions.

In case you're interested, just replace the english text with your language and create a pull request. Call the file 'index_identifier_for_your_language.html'. For example: 'index_en.html', for english.

It'll get merged when it's fully translated.

Here is a list with indentifiers:
http://www.rssboard.org/rss-language-codes

Show other levels of episode on map

When the user is working on an episode, show the icons of the other levels, in the episode, on the worldmap. The other icons are half transparent.

Add animated tiles

It'll be great if you add the tiles animation on the editor. Here are the source code of the game, each function is called every two frame (1/30s). They call PisteDraw2_DrawImage_Start() to get the 8-bit buffer of the tiles, and change it. Also there is the PisteDraw2_RotatePalette() that change the global pallete, it rotates the palettes from 224 (start) to 239 (end) and it is called every four frames (1/15s).

//Anim fire
void PK2Kartta::Animoi_Tuli(void){
	BYTE *buffer = NULL;
	DWORD leveys;
	int x,y;
	int color;

	PisteDraw2_DrawImage_Start(palikat_buffer,*&buffer,(DWORD &)leveys);

	for (x=128;x<160;x++)
		for (y=448;y<479;y++)
		{
			color = buffer[x+(y+1)*leveys];

			if (color != 255)
			{
				color %= 32;
				color = color - rand()%4;

				if (color < 0)
					color = 255;
				else
				{
					if (color > 21)
						color += 128;
					else
						color += 64;
				}
			}

			buffer[x+y*leveys] = color;
		}

	if (ajastin1 < 20)
	{
		for (x=128;x<160;x++)
			buffer[x+479*leveys] = rand()%15+144;
	}
	else
		for (x=128;x<160;x++)
			buffer[x+479*leveys] = 255;

	PisteDraw2_DrawImage_End(palikat_buffer);
}
//Anim Waterfall
void PK2Kartta::Animoi_Vesiputous(void){
	BYTE *buffer = NULL;
	DWORD leveys;
	int x,y,plus;
	int color,color2;

	BYTE temp[32*32];

	PisteDraw2_DrawImage_Start(palikat_buffer,*&buffer,(DWORD &)leveys);

	for (x=32;x<64;x++)
		for (y=416;y<448;y++)
			temp[x-32+(y-416)*32] = buffer[x+y*leveys];

	color2 = (temp[0]/32)*32;	// mahdollistaa erivriset vesiputoukset

	for (x=32;x<64;x++)
	{
		plus = rand()%2+2;//...+1
		for (y=416;y<448;y++)
		{
			color = temp[x-32+(y-416)*32];

			if (color != 255)	// mahdollistaa eri leveyksiset vesiputoukset
			{
				color %= 32;
				if (color > 10)//20
					color--;
				if (rand()%40 == 1)
					color = 11+rand()%11;//15+rand()%8;//9+rand()%5;
				if (rand()%160 == 1)
					color = 30;
				buffer[x + (416+(y+plus)%32)*leveys] = color+color2;
			}
			else
				buffer[x + (416+(y+plus)%32)*leveys] = color;
		}
	}

	PisteDraw2_DrawImage_End(palikat_buffer);
}
//Anim Water Surface
void PK2Kartta::Animoi_Vedenpinta(void){
	BYTE *buffer = NULL;
	DWORD leveys;
	int x,y;

	BYTE temp[32];

	PisteDraw2_DrawImage_Start(palikat_buffer,*&buffer,(DWORD &)leveys);

	for (y=416;y<448;y++)
		temp[y-416] = buffer[y*leveys];

	for (y=416;y<448;y++)
	{
		for (x=0;x<31;x++)
		{
			buffer[x+y*leveys] = buffer[x+1+y*leveys];
		}
	}

	for (y=416;y<448;y++)
		buffer[31+y*leveys] = temp[y-416];

	PisteDraw2_DrawImage_End(palikat_buffer);
}
//Anim water
void PK2Kartta::Animoi_Vesi(void){
	BYTE *buffer_lahde = NULL, *buffer_kohde = NULL;
	DWORD leveys_lahde, leveys_kohde;
	int x, y, color1, color2,
		d1 = vesiaste / 2, d2;
	int sini, cosi;
	int vx,vy;
	int i;


	PisteDraw2_DrawImage_Start(palikat_buffer,		*&buffer_kohde,(DWORD &)leveys_kohde);
	PisteDraw2_DrawImage_Start(palikat_vesi_buffer,*&buffer_lahde,(DWORD &)leveys_lahde);

	for (y=0;y<32;y++){
		d2 = d1;

		for (x=0;x<32;x++){
			sini = int((y+d2/2)*11.25)%360;
			cosi = int((x+d1/2)*11.25)%360;
			sini = (int)kartta_sin_table[sini];
			cosi = (int)kartta_cos_table[cosi];

			vy = (y+sini/11)%32;
			vx = (x+cosi/11)%32;

			if (vy < 0){
				vy = -vy;
				vy = 31-(vy%32);
			}

			if (vx < 0){
				vx= -vx;
				vx = 31-(vx%32);
			}

			color1 = buffer_lahde[64+vx+vy*leveys_lahde];
			buffer_lahde[32+x+y*leveys_lahde] = color1;
			d2 = 1 + d2 % 360;
		}

		d1 = 1 + d1 % 360;
	}

	int vy2;

	for (int p=2;p<5;p++){
		i = p*32;

		for (y=0;y<32;y++){
			//d2 = d1;
			vy = y*leveys_lahde;
			vy2 = (y+416)*leveys_kohde;

			for (x=0;x<32;x++){
				vx = x+vy;
				color1 = buffer_lahde[32+vx];
				color2 = buffer_lahde[ i+vx];
				buffer_kohde[i+x+vy2] = (color1 + color2*2) / 3;
			}
		}
	}
	PisteDraw2_DrawImage_End(palikat_buffer);
	PisteDraw2_DrawImage_End(palikat_vesi_buffer);
}
//Anim something
void PK2Kartta::Animoi_Virta_Ylos(void){
	BYTE *buffer = NULL;
	DWORD leveys;
	int x,y;

	BYTE temp[32];

	PisteDraw2_DrawImage_Start(palikat_buffer,*&buffer,(DWORD &)leveys);

	for (x=64;x<96;x++)
		temp[x-64] = buffer[x+448*leveys];

	for (x=64;x<96;x++)
	{
		for (y=448;y<479;y++)
		{
			buffer[x+y*leveys] = buffer[x+(y+1)*leveys];
		}
	}

	for (x=64;x<96;x++)
		buffer[x+479*leveys] = temp[x-64];

	PisteDraw2_DrawImage_End(palikat_buffer);
}

void PisteDraw2_RotatePalette(BYTE start, BYTE end){
	BYTE i;
	SDL_Color* game_colors = frameBuffer8->format->palette->colors;
	SDL_Color temp_color = game_colors[end];

	for (i=end;i>start;i--)
		game_colors[i] = game_colors[i-1];

	game_colors[start] = temp_color;
}

Multi select doesn't work

The selection of multiple tiles from the tileset and level are kind of implemented, but stil don't work quite right.

Optimizing the loading of levels

The file format is questionable, for some reason, some integers are stored as strings. This makes loading a lot of level after another (for example in a loop) very inefficient. There must be a way to optimize.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.