News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: eDKit - Donkey Kong '94 (GB) Level Editor  (Read 22427 times)

Raccoon Sam

  • Jr. Member
  • **
  • Posts: 59
  • Left is Right and Right is Wrong
    • View Profile
    • Twitter
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #20 on: March 13, 2014, 04:39:25 pm »
Well, after replacing each instance (and one #include <QtGui/QFileDialog> with #include <QFileDialog> it gives me these

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #21 on: March 13, 2014, 04:55:22 pm »
Sorry, this is an error on my side.
See my small commit here: https://github.com/bailli/eDKit/commit/48e349e75eb04821d9c5fe15d9cb79819b1edbea

Raccoon Sam

  • Jr. Member
  • **
  • Posts: 59
  • Left is Right and Right is Wrong
    • View Profile
    • Twitter
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #22 on: March 14, 2014, 11:44:47 am »
Great! I got it to compile and run. However, it says this immediately upon opening:
"You need a base.gb in the editor's directory!"

There is a file called base.gb in the editor's directory. A verified clean dump of the 1.0 version.

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #23 on: March 14, 2014, 12:51:15 pm »
Hm,

maybe Qt has some weird file/path handling under OS X?
If you replace in main.cpp the line starting with QMessageBox::warning with this one:
Code: [Select]
QMessageBox::warning(NULL, "Error", "You need a base.gb in the editor's directory!\nChecked file: " + qApp->applicationDirPath() + "/" BASE_ROM);and the error message will show you exactly what file the editor checked for. The file handling is case sensitive  - at least under *nix...

You could try to skip the check for the rom by commenting out/deleting the if block from line 10 to 14 in main.cpp. But I am not sure this will work.

Btw: Could you post/PM me the changes you made to get it compile. I will try to include them so it compiles straight for Qt 4 and 5.

Raccoon Sam

  • Jr. Member
  • **
  • Posts: 59
  • Left is Right and Right is Wrong
    • View Profile
    • Twitter
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #24 on: March 15, 2014, 05:08:33 am »
You're right. Whereas Windows has just the single .exe, OSX programs are .app-'files' which are actually folders where program assets (and the executable itself) are stored. I moved the .gb to eDKit.app/Contents/MacOS/base.gb and now it works. Awesome!
 :thumbsup: smooth job

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #25 on: March 30, 2014, 08:12:18 am »
I am currently trying to display the levels with their correct SGB palette.
But I am having trouble following the code.

What I know:
The routine at 0x26DF first calls 0x0DC3. The relevant part of this function is to load a byte from rom bank 0x0C. The byte is at 0x4F97 + 2*(0xC85C (16bit)) + 1. Return. Now this byte gets subtracted by 0xC8 and the result is stored at 0xC862.

The routine at 0x0E70 is the one which "assembles" the PAL_SET SGB packet and stores it at 0xD88D. Here the only "variable" is the first palette number which is 0x180 + the byte from 0xC862.

My problem is that I have trouble tracing the This origin of the 16bit value at 0xC85C.

Do you have any ideas - or even better maybe some old research - about this?

ItsRainingGravy

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #26 on: March 30, 2014, 05:57:44 pm »
This project is absolutely amazing. I have always wondered why nobody has made a hack/level editor for this game, as the creative potential practically oozes from the seams. For years, Donkey Kong '94 has been one of my favorite games of all time, and it remains to be the most impressive game on the Game Boy's library to me (rivaling Pokemon). You have my utmost respect, bailli. I hope that everything goes well with this project, and I wish you the best of luck.

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #27 on: April 09, 2014, 03:13:14 am »
Hm so what I wrote in the last post about the SGB palettes is not completely correct. I *think* I display the correct palettes now. The next problem is that I need to find the (GB's) background palette register value for each level to fully get the level colours right...

@Raccoon Sam
Do you have a recommendation where I should look for the base.gb rom on OSX? Or is the current path fine (now that you know where to put it)?
Also what did you modify for build against Qt5? Did you only remove the "QtGui" part from QFileDialog, QApplication and QMessageBox ?

Update:
I just pushed a commit to git. The levels should now display with their correct colours. I also tried to fix compilation against Qt5. Raccoon Sam, could you give it a try?
« Last Edit: April 09, 2014, 06:09:03 pm by bailli »

Revenant

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #28 on: April 10, 2014, 01:04:11 pm »
I sent a pull request with a couple of other tiny Qt 5 fixes, but otherwise I can confirm that it builds and runs on Windows (with MinGW), at least.

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong \'94 (GB) Level Editor
« Reply #29 on: April 10, 2014, 02:19:01 pm »
Thank you! Just accepted the pull request ;D

EDIT: First post got a bit updated.

April 12, 2014, 04:54:15 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Added cross-compiled win32 binary in the first post ;)
« Last Edit: April 12, 2014, 04:54:15 pm by bailli »

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #30 on: June 04, 2014, 01:39:59 pm »
So I picked my project up again.
Sprites are displayed (almost) correctly now. I updated the static win32 binary as well.

Changing the level size is still mostly untested and probably buggy!

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #31 on: July 07, 2014, 09:24:27 am »
I still now what I did last month (thanks to git log ;)):

Moving around, deleting and adding sprites should work now.
What is currently displayed as "additional sprite data" is partially interpreted and editable (only in the editor - not written back to ROM! -- flipped sprites and moving speed for 0x54 0x80 0x98 and 0x7F)

win32 build is outdated.

NiO

  • Full Member
  • ***
  • Posts: 123
  • Let's bring order to chaos
    • View Profile
    • https://www.facebook.com/groups/retrogamersmx/
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #32 on: July 10, 2014, 11:39:40 pm »
really interesting work... would be cool to see some video footage of it, so far I like it!  :woot!:

Hunter Cadre

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #33 on: February 11, 2015, 02:25:42 am »
Hi! I just wanted to let you know that I've been fooling around with this for a little bit and think it's fantastic!

I'm curious about how some multi-tiled items like 3UP hearts will function normally simply by being placed, but Hammers won't. Is that something you have to code in for each item? Which ones do you support at the moment? I'm dying to get my hands on the Floor and Ladder spawning blocks.

People are still interested in this and you should keep up the great work!
I noticed a lack of DK94 speedruns online which led me to this. I wonder how far you'll end up taking it, even though I know it's a hobby for you.

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #34 on: February 11, 2015, 02:42:07 am »
Hi,

I suspect you placed the hammer as "tile" - but it is actually not a tile but a sprite.
So you have to add it using the sprite tab. Somewhere on page one I wrote that the editor currently does not filter the tiles list...

Multi-tiled items are "in game code" only represented by the top left tile, the others are added "on runtime" and overwrite tiles which might have been placed there. That is the reason why the editor works with 16bit tile indices when the GB only uses 8bit. (All indices > 0xFF get "deleted" on compression/insertion)

As for picking up the editor again... (Did you came here because of my post in the Zelda2 for GB thread... ?)
I think what threw me of the project last summer was the inconsistency in the sprite attributes section. The game has quite some "left over" bytes in there which makes it very hard/tedious to determine what bytes actually make a difference, what is the "default value" etc...
I think I will push this part back and try to debug the "switch code" sometime soon(TM) ;)

EDIT: Hm I somehow missed the question about the ladder/floor blocks...
I have to admit I don't remember whether I tested them, but I *think* just adding them as tiles should work?

Also I feel honoured you joined to post here :D

EDIT2: It seems I have not fully woken up... You already said you came here because of the lack of speedruns... When I worked on the editor I also thought the game would make an interesting speedrun - there are some many moves/tricks Mario can pull off.
« Last Edit: February 11, 2015, 02:51:59 am by bailli »

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #35 on: February 19, 2015, 02:25:50 pm »
Long time no update... but just now I just did a push to github.

There are 2(?) commits from last summer which did not leave my notebook. These commits make editing (no writing back yet!) of the sprite flag byte possible. I haven't figured out what these flags do for the different Donkey Kongs and for the "key" in level 95 where you lock DK Jr. in...
These commits mainly did not make it to the public git because the editing dialogues are very basic and ugly... I plan to reorganise the GUI a bit, but I don't know how yet...

Brand new from last week is "decoding" of the switch data. I think I have figured all parts out, but the editor currently only does print some text about the switches...

EDIT: Context menu on sprites to edit their flag byte...
« Last Edit: February 19, 2015, 02:55:52 pm by bailli »

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #36 on: March 27, 2015, 02:03:00 pm »
I just pushed an update to git (including an updated win32 build).

Editing of switch data is now supported. With this feature full editing of a "normal" level is possible.
Next step: Find/fix bugs in edited ROMs... anybody interested in bug hunting?

I might add a "export/import individual level" feature to make saving of levels independent of a full ROM possible...

RetroHelix

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #37 on: March 28, 2015, 05:58:38 pm »
If I only had time to play around with this :(

Nice work. Keep it up!

bailli

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #38 on: April 01, 2015, 05:44:17 pm »
No actual new features, but an important step to an usable editor:
The tile selection is now much more user friendly. It only shows usable tiles, nicely grouped together and even shows the full image it is a super tile.

I also moved around some parts of the main screen but I am still not really satisfied with the layout. The text will probably vanish in some of the next updates...

90s Retro Gamer

  • Full Member
  • ***
  • Posts: 149
    • View Profile
Re: eDKit - Donkey Kong '94 (GB) Level Editor
« Reply #39 on: April 03, 2015, 09:58:06 pm »
Level-Editors are awesome. I know you're probably too busy, but it would be great if someone like you wrote a document educating the reader how to make a level editor for a game.