Multilevel converter for nes and other

Discuss other PoP1 related things here.

Moderator: English Moderator Team

Post Reply
salvadorc17
Calif
Calif
Posts: 527
Joined: August 27th, 2011, 2:04 am

Multilevel converter for nes and other

Post by salvadorc17 » March 11th, 2017, 9:31 pm

Hey, im working on a converter for dos to nes version and maybe will add support for other, have decided between those because file format similarities, and im starting parsing with the Nes Editor all rom important data, will post update here, with more info.

salvadorc17
Calif
Calif
Posts: 527
Joined: August 27th, 2011, 2:04 am

Re: Multilevel converter for nes and other

Post by salvadorc17 » July 28th, 2017, 9:33 pm

I found this program in my pc, allowed to convert dos/nes to apoplexy/snes. So why not post it and let you try it.

Requieres apoplexy png files, or can include with them.
princeconverter.png
PrinceConverter.rar
(15.87 KiB) Downloaded 7 times
Last edited by salvadorc17 on July 29th, 2017, 9:30 pm, edited 1 time in total.

David
The Prince of Persia
The Prince of Persia
Posts: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Multilevel converter for nes and other

Post by David » July 28th, 2017, 10:19 pm

salvadorc17 wrote:I found this program in my pc, allowed to convert dos/nes to apoplexy/snes. So why not post it and let you try it.
What do you mean by "found"?

Problems:
* It needs the png folder from Apoplexy. Without it I get an endless stream of ArgumentNullException errors.
* Only level 1 is shown correctly. Other levels show mostly-empty rooms with a few scattered random tiles.
* Level 4 room 5 and further rooms seem to show distorted versions of level 2 rooms.
* I get an IndexOutOfRangeException if I increase Room beyond 23.
* By the way, rooms should be numbered from 1 to 24, not 0 to 23.
* I get an endless stream of IndexOutOfRangeException errors if I try to load level 11.
* SNES Export gives me a NullReferenceException and creates a zero-byte file.
* XML Export creates a file with an empty <level /> tag.
* Well, it has some xmlns attributes, but no level data.
* The L/R/U/D buttons don't work.
* Are those "00"s meant to be the numbers of adjacent rooms?
* Certain tiles don't show up. Example: the level door on level 1.
* NES empty rooms (stored as a 0xFF byte) are not handled well. Example: level 1 room 12.
* Tiles don't overlap as they should.
* Options -> Tiles -> Palace doesn't work.
* File -> Save does not save anything.

salvadorc17
Calif
Calif
Posts: 527
Joined: August 27th, 2011, 2:04 am

Re: Multilevel converter for nes and other

Post by salvadorc17 » July 29th, 2017, 9:27 pm

Found it, because it was creatd time ago, and now i recovered files, also seems weird you get all those issues, it works good for my in most cases, i can confirm it need apoplexy png files and yes 00s are for adjacent rooms.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3167
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: Multilevel converter for nes and other

Post by Norbert » August 5th, 2017, 11:29 pm

salvadorc17 [url=http://forum.princed.org/viewtopic.php?p=21653#p21653]here[/url] wrote:Can you add my multi games level editor to the [popot.org] list.
The website popot.org has a lot of content, but it's not my goal to include everything on it. It really only includes software and documentation that is solid and user-friendly. There are some exceptions, but these exceptions are included only for legacy or historical reasons. If, for example, FreePrince would've been released today then I would not list it. There are many programs and documents related to PoP modding not available on popot.org.

Your PrinceConverter is a program that I cannot run properly on Linux with emulation.
Its window shows up, then I get a bunch of messages...
Spoiler: show

Code: Select all

fixme:wincodecs:PngDecoder_Block_GetCount 0x16ce660,0x33e548: stub

[...]

Unhandled Exception:
System.ArgumentNullException: Argument cannot be null.
Parameter name: image
  at System.Drawing.Graphics.DrawImage (System.Drawing.Image image, Int32 x, Int32 y, Int32 width, Int32 height) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:DrawImage (System.Drawing.Image,int,int,int,int)
  at PrinceEditor.Form1.timer1_Tick (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Timer.OnTick (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Timer.FireTick () [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Timer:FireTick ()
  at System.Windows.Forms.XplatUIWin32.GetMessage (System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax, Boolean blocking) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUIWin32.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000] in <filename unknown>:0 
  at PrinceEditor.Program.Main () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Argument cannot be null.
Parameter name: image
  at System.Drawing.Graphics.DrawImage (System.Drawing.Image image, Int32 x, Int32 y, Int32 width, Int32 height) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:DrawImage (System.Drawing.Image,int,int,int,int)
  at PrinceEditor.Form1.timer1_Tick (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Timer.OnTick (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Timer.FireTick () [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Timer:FireTick ()
  at System.Windows.Forms.XplatUIWin32.GetMessage (System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax, Boolean blocking) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUIWin32.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000] in <filename unknown>:0 
  at PrinceEditor.Program.Main () [0x00000] in <filename unknown>:0 
Shutting down finalizer thread timed out.
...and then the program closes. If I'm unable to test/run a program myself, I almost never mention it on popot.org. An good example is the Roku port of PoP, which is probably pretty solid software, but still it's not listed.

Your PrinceConverter is also not open source or free software. From the start, almost all the software created by community members has been free and open source software. All the way back to at least 2003, when the GPL was picked for Princed software (source). The About page of Princed still mentions "Free Software", as it did in 2008 (source) and even further back in 2004 (source).

Looking at David's feedback, where he mentions (potential) problems/bugs, it's also not clear to me what the target audience of your PrinceConverter would be today. As I see it, it is closed source software, that I cannot run, that appears to not yet be solid and user-friendly enough to list. This is why I choose to, at least for now, not list it. Hopefully you understand my reasoning and choice. If people believe a different approach is preferable, I'm open to suggestions.

David
The Prince of Persia
The Prince of Persia
Posts: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Multilevel converter for nes and other

Post by David » August 6th, 2017, 3:37 pm

Norbert wrote: Your PrinceConverter is a program that I cannot run properly on Linux with emulation.
Its window shows up, then I get a bunch of messages...

Code: Select all

System.ArgumentNullException: Argument cannot be null.
Parameter name: image
  at System.Drawing.Graphics.DrawImage (System.Drawing.Image image, Int32 x, Int32 y, Int32 width, Int32 height) [0x00000] in <filename unknown>:0 
That one error can be fixed if you copy the png folder from Apoplexy to the folder of this program.
Or, alternately, copy this program to the folder of Apoplexy.

(It seems that the program swallows the exception that comes from loading a nonexistent image, then it chokes when trying to *draw* it instead.)

However this doesn't fix all the other problems, so your reasoning still applies.
(But at least you can see those other problems.)
salvadorc17 wrote: also seems weird you get all those issues, it works good for my in most cases,
Then you probably didn't test it thoroughly.
For example, you should try to look at level 2...

salvadorc17
Calif
Calif
Posts: 527
Joined: August 27th, 2011, 2:04 am

Re: Multilevel converter for nes and other

Post by salvadorc17 » August 6th, 2017, 9:59 pm

Norbert wrote:
Your PrinceConverter is also not open source or free software.

Looking at David's feedback, where he mentions (potential) problems/bugs, it's also not clear to me what the target audience of your PrinceConverter would be today. As I see it, it is closed source software, that I cannot run, that appears to not yet be solid and user-friendly enough to list. This is why I choose to, at least for now, not list it. Hopefully you understand my reasoning and choice. If people believe a different approach is preferable, I'm open to suggestions.
Yes i forgot that converter is target for the converting dos/nes levels into apoplexy or snes standalone. It does requieres apoplexy png folder, maybe i should include that into download link. Seems some errors are caused by parsing wrong the binary level files.

Also it can be free software and public license, have uploaded code to my github repository for Rom editors:
https://github.com/salvadorc17/Roms-Editors

David
The Prince of Persia
The Prince of Persia
Posts: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Multilevel converter for nes and other

Post by David » August 12th, 2017, 9:51 am

salvadorc17 wrote:Seems some errors are caused by parsing wrong the binary level files.
Here is the code that loads DOS levels: https://github.com/salvadorc17/Roms-Edi ... m1.cs#L291
It's wrong, because it assumes that level 2 tiles are immediately after level 1 tiles.
In reality, level data is much more than just tiles, but I guess you already know that.

salvadorc17
Calif
Calif
Posts: 527
Joined: August 27th, 2011, 2:04 am

Re: Multilevel converter for nes and other

Post by salvadorc17 » August 12th, 2017, 9:24 pm

David wrote: It's wrong, because it assumes that level 2 tiles are immediately after level 1 tiles.
In reality, level data is much more than just tiles, but I guess you already know that.
Heh yes a little mistake i forgot to change in code, will skip those remaining bytes for each level struc will do the job??

David
The Prince of Persia
The Prince of Persia
Posts: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Multilevel converter for nes and other

Post by David » August 13th, 2017, 10:33 am

salvadorc17 wrote:Heh yes a little mistake i forgot to change in code, will skip those remaining bytes for each level struc will do the job??
Yes, probably.
But it would be better if you used the index in DAT files to find where each level starts.
You might also want to read the Format Specifications, if you haven't read it yet.

salvadorc17
Calif
Calif
Posts: 527
Joined: August 27th, 2011, 2:04 am

Re: Multilevel converter for nes and other

Post by salvadorc17 » August 18th, 2017, 10:20 pm

David wrote: But it would be better if you used the index in DAT files to find where each level starts.
You might also want to read the Format Specifications, if you haven't read it yet.
Yes i have readed that, and have made some changes to read levels properly skipping unused data, now i need to complete rom linking, but cant understand what are the default values, for snes seems it uses room ids, how does change here?

David
The Prince of Persia
The Prince of Persia
Posts: 1505
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Multilevel converter for nes and other

Post by David » August 19th, 2017, 8:47 am

salvadorc17 wrote:Yes i have readed that, and have made some changes to read levels properly skipping unused data,
Now it's almost good, but level 2 is still off by one tile. Level 3 is off by two tiles, and so on...
You need to skip one more byte between levels.

Also, maybe level 0 should load the demo level.
salvadorc17 wrote:now i need to complete rom linking, but cant understand what are the default values, for snes seems it uses room ids, how does change here?
Room links are almost the same on SNES and DOS.
SNES numbers rooms from 0 to 23, and "no room" is 255 (or 254).
DOS numbers rooms from 1 to 24, and "no room" is 0.

Post Reply