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

Author Topic: DSVania Editor (v1.6)  (Read 16645 times)

Sephirous

  • Sr. Member
  • ****
  • Posts: 356
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #140 on: September 08, 2017, 02:19:55 pm »
I'm still hoping for Bloodlines and Dracula X Snes support.

I know that is a completely different ball game but the day I get to fill in The Dracula Battle with those pits of death in Dracula X will be quite the accomplishment.
Hacking Nes Roms Is Like Making Sweet Passionate Love, Hacking Snes Roms Is Like Having Your Bitchy Mother In Law Scream At You.

Thirteen 1355

  • Sr. Member
  • ****
  • Posts: 298
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #141 on: September 08, 2017, 02:27:21 pm »
Just play Rondo of Blood  :P

LagoLunatic

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #142 on: September 09, 2017, 11:51:45 am »
Would it be possible to connect OoE areas with this?  :woot!:

Directly connecting a door in one area to a door in another?
Unfortunately it doesn't seem OoE's engine supports that. I tried it and the game just crashed. While the crash bug is fixable, the way the game loads tilesets assumes doors only take you within the same area, which would be harder to fix. And the map on the top screen won't automatically change when you go through the door, either.


Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #143 on: September 09, 2017, 09:40:46 pm »
I'm still hoping for Bloodlines and Dracula X Snes support.

I know that is a completely different ball game but the day I get to fill in The Dracula Battle with those pits of death in Dracula X will be quite the accomplishment.

Why not use the editor to create new versions of those games for DS? That's what I'm going to do for a CV1 remake based on one of the supported games.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 774
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #144 on: September 09, 2017, 09:44:37 pm »
Why not use the editor to create new versions of those games for DS? That's what I'm going to do for a CV1 remake based on one of the supported games.
AoS?  :D
Haha.
That sounds really neat tho!

Robpt1

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #145 on: September 13, 2017, 02:41:49 pm »
Glad to see you're still working on this, did 1.6 add a collision editor ?

And also, is it possible to create a patch to skip the name signing in POR ?

LagoLunatic

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #146 on: September 13, 2017, 08:06:41 pm »
Glad to see you're still working on this, did 1.6 add a collision editor ?

Yep, the tileset editor now allows editing collision as well. I linked a gif of it in action if you want to see how it works: https://i.imgur.com/U28g7lw.gifv

And also, is it possible to create a patch to skip the name signing in POR ?

That's something I've been meaning to get around to. Turns out it's pretty straightforward, here is the ARMIPS patch for it:
https://github.com/LagoLunatic/DSVEdit/blob/master/asm/por_skip_emblem_drawing.asm

Robpt1

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #147 on: September 15, 2017, 11:26:31 am »
Thank you for the name skipping patch, i made an ips patch if anyone wants it (for US version only):

https://mega.nz/#!RrZB0YqY!xW7_bERATcxUlBYjJ2DdGDym7G5eboWHeiMBa6bJB3s

You should upload it to romhacking.net

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #148 on: October 06, 2017, 12:32:55 pm »
Great work on it so far, Lago! This is a great editor.

I've been playing around with PoR for a little bit.
I have a couple of questions.
1) How do I go about making a room bigger exactly?
2) Can a door/exit in one area lead to a room in a completely different area? For example a door or normal exit that goes from the Entrance area of Dracula's Castle to the City of Haze?

LagoLunatic

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #149 on: October 06, 2017, 01:04:15 pm »
1) How do I go about making a room bigger exactly?

Go to Edit -> Edit Layers and change the Width and Height fields to the new size of the room you want, in terms of number of screens wide/tall.
The first layer in the room is always the collision layer, so changing that first one is enough for the physical size of the room to change. But you may also want to change the background and foreground layers to fit the new size. To do that just scroll through the list of layers and change the Width/Height for each of them individually.

2) Can a door/exit in one area lead to a room in a completely different area? For example a door or normal exit that goes from the Entrance area of Dracula's Castle to the City of Haze?

Nope, the engine doesn't support doors that go to different areas. I listed the bugs with it in this post (for OoE, but the same applies to PoR).

Alternatively, you could of course use portraits to go between areas in PoR. And not just to the first room of each area, the portrait's Var A and Var B let you set the destination to any room in the game.

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #150 on: October 07, 2017, 07:43:18 am »
Wow, I can't believe I missed the width and height fields! :P
Thanks for the info. I figured the door/exit thing would be the case.
Next question then; would it be easier to hack the portals to work like doors or the doors to work like portals? ;)

LagoLunatic

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #151 on: October 08, 2017, 03:41:57 pm »
Wow, I can't believe I missed the width and height fields! :P
Thanks for the info. I figured the door/exit thing would be the case.
Next question then; would it be easier to hack the portals to work like doors or the doors to work like portals? ;)

I tried modifying the way doors work to fix the bugs with going between areas. Since I'm more familiar with OoE's code I did it in OoE instead of PoR.
The first couple things were easy once I found the relevant code: The crash is because despite the sector overlay loading code calculating what the right area index should be it just uses the area index the player is currently in instead, so I just changed one line of code to use the right one. For the map on the top screen, I wrote some code to check if the area index is different during a door transition and if the player has the top screen set to the map display, and if so tell the top screen to reload itself.

The real problem is the tileset loading done in transition rooms. There's tons of bugs with it since transition rooms seem to have been coded entirely around the concept of them only leading within the same area. I fixed some of these bugs (for all the super technical details, here's the current state of my code for the patch, with comments explaining everything). In some cases it seems to work correctly, but in many others it fails to load the new tileset at all, or will just randomly crash, and I can't reproduce the crashes consistently. So I'll have to give up on this for now, since I'm out of ideas as to what the problem is.

As for the other idea: I doubt getting portraits to work like doors would be very easy, since portraits have lots of other stuff going on besides just transporting you somewhere. It might be easier to just code a new object from scratch (in PoR objects 07-15 are unused) which is the size of a screen and when the player collides with it it teleports them to a different room. The hard part would probably be reproducing the exact way doors work, e.g. if you touch the top of a door you come out at the top of the screen in the next room, etc. And also figuring out exactly how hitboxes need to be initialized for this, since you don't want them to trigger when hit by an enemy, or the player's weapon, or the partner character, only the controlled player should trigger it.

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #152 on: October 09, 2017, 02:00:05 pm »
Interesting stuff. I'm going to sit down with that document later.

Making a new object is probably the best way to go.

Edit: I read over the patch for the doors in OoE. Your solutions are pretty much what I would have thought to do. Sound logic.

Edit2: I just had a thought. Would it help at all to look at the warp points? They essentially do the same exact thing as portraits, except they transition between sectors similarly to doors. What I want is a door that functions like a portrait, so the inverse of the warp points.
« Last Edit: October 09, 2017, 02:43:05 pm by Vanya »

Robpt1

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #153 on: October 09, 2017, 09:09:12 pm »
Dawn of sorrow doesn't display the monster names on the bottom right screen when you hit them, is it possible to add it ?

LagoLunatic

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #154 on: October 11, 2017, 02:37:47 am »
Interesting stuff. I'm going to sit down with that document later.

Making a new object is probably the best way to go.

Edit: I read over the patch for the doors in OoE. Your solutions are pretty much what I would have thought to do. Sound logic.

Edit2: I just had a thought. Would it help at all to look at the warp points? They essentially do the same exact thing as portraits, except they transition between sectors similarly to doors. What I want is a door that functions like a portrait, so the inverse of the warp points.

I looked into how portraits, warp points, and magical tickets teleport the player. They all do it the same way, calling one function to set the destination area index/sector index/room index/x pos/y pos, then calling a second to trigger the actual room transition. This second function does all the hard stuff like loading tilesets and updating the map. So it should be pretty easy to just call these two functions to get a transition working, compared to trying to modify the door code to do it.

There's a bit of an issue with making a "fake door" entity though: Entities only have Var A and Var B to work with in the level editor, but we need to be able to specify the area index, sector index, room index, x pos, and y pos for each fake door individually.
So to get around this limitation we can cram those five values into two variables like this:
Var A: AASS
Var B: RRXY
Where AA means area index, SS means sector index, RR means room index, X means the x pos in screens, and Y means the y pos in screens.
This does have one minor limitation compared to real doors, which is that doors let you specify the x/y offset position in pixels, but this only lets you specify it in multiples of the screen size. But the DSVanias only ever need to use multiples of the screen size for door destinations anyway, so no real loss here.

So now this should be codable, but in ASM it'd probably be kinda tedious to write all the conditions and math and stuff. So I decided to try out something I had been looking into recently, which is using devkitPro to compile C code into ARM ASM. Figuring out all the compiler settings and such at first was quite a pain, but after that, it worked out really well.

Here's the finished code for it: https://github.com/LagoLunatic/DSVania_C_Hacking
This file specifically has the logic for the new door object.

To compile this, first use DSVEdit to add a free space overlay to your PoR project so there's room to put the code (Tools -> Add Overlay).
Then in por_interarea_doors/main.asm change PROJECT_DIR to point to where your project folder is.
Install devkitPro and in por_interarea_doors/build.bat make sure DEVKITARM points to the right path where you installed it. Then just run build.bat and it should all compile, link, and assemble correctly.
(Note that you need to reopen the project in DSVEdit for DSVEdit to notice the changes.)

Then just add a new entity to the room, specifically special object 07 ("Unused") and then set the var A/B appropriately. Voila!



Dawn of sorrow doesn't display the monster names on the bottom right screen when you hit them, is it possible to add it ?

I looked into it. There's no easy function here, doing this is really complicated and requires calling a bunch of functions to create an OAM sprite, but I did somehow manage to figure out what functions to call with what arguments, so I got the basic text display working: https://i.imgur.com/5j9O04h.gifv

It's far from complete: It doesn't have the fancy icon behind the text, the text never disappears, and the OAM slot I chose to use for it could be used for something else, I just chose one that looked unused at random. These would also likely be fairly complicated to fix.

The source code for this is also in that repository I linked, inside the dos_enemy_name_popup folder, if anyone wants to look into it. The instructions for compiling it are the same as above.

Robpt1

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #155 on: October 11, 2017, 10:04:24 am »
I had a feeling it wouldn't be simple, but the fact that you still managed to find a way to do it even if it's not complete is amazing. Thank You

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #156 on: October 11, 2017, 10:22:06 am »
I looked into how portraits, warp points, and magical tickets teleport the player. They all do it the same way, calling one function to set the destination area index/sector index/room index/x pos/y pos, then calling a second to trigger the actual room transition. This second function does all the hard stuff like loading tilesets and updating the map. So it should be pretty easy to just call these two functions to get a transition working, compared to trying to modify the door code to do it.

There's a bit of an issue with making a "fake door" entity though: Entities only have Var A and Var B to work with in the level editor, but we need to be able to specify the area index, sector index, room index, x pos, and y pos for each fake door individually.
So to get around this limitation we can cram those five values into two variables like this:
Var A: AASS
Var B: RRXY
Where AA means area index, SS means sector index, RR means room index, X means the x pos in screens, and Y means the y pos in screens.
This does have one minor limitation compared to real doors, which is that doors let you specify the x/y offset position in pixels, but this only lets you specify it in multiples of the screen size. But the DSVanias only ever need to use multiples of the screen size for door destinations anyway, so no real loss here.

So now this should be codable, but in ASM it'd probably be kinda tedious to write all the conditions and math and stuff. So I decided to try out something I had been looking into recently, which is using devkitPro to compile C code into ARM ASM. Figuring out all the compiler settings and such at first was quite a pain, but after that, it worked out really well.

Here's the finished code for it: https://github.com/LagoLunatic/DSVania_C_Hacking
This file specifically has the logic for the new door object.

To compile this, first use DSVEdit to add a free space overlay to your PoR project so there's room to put the code (Tools -> Add Overlay).
Then in por_interarea_doors/main.asm change PROJECT_DIR to point to where your project folder is.
Install devkitPro and in por_interarea_doors/build.bat make sure DEVKITARM points to the right path where you installed it. Then just run build.bat and it should all compile, link, and assemble correctly.
(Note that you need to reopen the project in DSVEdit for DSVEdit to notice the changes.)

Then just add a new entity to the room, specifically special object 07 ("Unused") and then set the var A/B appropriately. Voila!

Awesome! This should makes things much easier for me.
I really appreciate all your work. :)

azoreseuropa

  • Restricted Access
  • Sr. Member
  • *
  • Posts: 355
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #157 on: October 11, 2017, 11:04:08 am »
Quote
It is currently compatible with the US and Japanese versions of the DS games, and the US version of Aria of Sorrow.

What about the Europe vesions ?

shadow501

  • Full Member
  • ***
  • Posts: 167
  • Hex Editor
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #158 on: October 11, 2017, 03:38:50 pm »
What about PSX Castle Vania Symphony of the Night for sprite enemies  editor ?



« Last Edit: October 13, 2017, 05:45:05 am by shadow501 »

LagoLunatic

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #159 on: October 12, 2017, 01:12:16 am »
I had a feeling it wouldn't be simple, but the fact that you still managed to find a way to do it even if it's not complete is amazing. Thank You
Awesome! This should makes things much easier for me.
I really appreciate all your work. :)

No problem!

What about the Europe vesions ?

I don't think I'm gonna add support for any more versions, it's enough work maintaining the existing ones, and I'm not aware of any version differences with the European versions that would make doing it that interesting. Somebody else could do it if they want to of course.

What about PSX Castle Vania Symphony of the Night for sprite enemies  editor ?

I found address sprite Warg with Warg Fire, If you like check.

Warg 40F7-1C80:address 04B67160
Warg Fire 74C9-1C80:address 04B670EC

I'm not currently planning to support SotN since I assume it would be a totally different engine from the dsvanias so it'd take a ton of work to reverse engineer everything in the entire engine again. But eventually when I have the time I'll learn how PSX hacking works and check to see if it uses the same engine despite being on a different console, if it does I'll probably be able to support it.