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

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

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #160 on: October 12, 2017, 09:08:15 am »
Esco may have some insight into the PSX stuff or maybe even notes.
He did trudge through SotN's engine extensively before he decided to just remake the game from scratch.

Earlier in the thread it was asked if it was possible to port enemies and bosses from one game to another.
Just to get a bit of a better idea of how much work would have to go into it, how different is the coding between the NDS games?

Also, how difficult would it be to convert a normal enemy into a boss or is that even realistic to consider?

azoreseuropa

  • Restricted Access
  • Sr. Member
  • *
  • Posts: 355
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #161 on: October 12, 2017, 10:09:25 am »

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.


I understand. I thank you. :)

LagoLunatic

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #162 on: October 12, 2017, 10:00:56 pm »
Esco may have some insight into the PSX stuff or maybe even notes.
He did trudge through SotN's engine extensively before he decided to just remake the game from scratch.

Thanks, I'll keep that in mind when I get there.

Earlier in the thread it was asked if it was possible to port enemies and bosses from one game to another.
Just to get a bit of a better idea of how much work would have to go into it, how different is the coding between the NDS games?

If we're just talking about enemy-specific code, it's not any different in my experience. For a given enemy shared between multiple games the code looks almost identical. There could be minor differences but I'm not aware of them.

I imagine the majority of the work for porting enemies between games would be figuring out every single function that enemy calls in the source game, and then finding all the equivalent functions in the destination game so that you can replace those function calls.

Some things to note:
No$GBA's "Disassemble to File" feature (under Utility) is very useful for this, not only because it saves you from having to manually type the asm code, but because if you have it set up so that No$GBA uses the right symbol files, then the disassembled output file also uses those function names in place of the pointer to the function. So if the symbol files had all relevant functions for both games, the ASM No$GBA spits out would already have all function names ready to be used in the other game.
In reality my symbol files only have a handful of the functions used by enemies, so a lot more would need to be found and added to them to get this working. But once somebody found every function used by one enemy, then it should be a lot easier for other enemies after that since a lot of these functions are shared by many enemies (e.g. EnemyCheckStatusEffects, this seems to be called by every single enemy, even ones that aren't weak to any status effects in the base game).

Also, it wouldn't be enough to port just the Create and Update functions for the enemy, even though those are the only ones shown in DSVEdit. Each enemy has several other functions that seem unique to it, like a callback function for when it takes damage from the player, a callback for when it hits the player, and if the enemy creates any projectiles the projectile also has a Create and Update function, etc. These extra functions aren't listed in the enemy DNA, you'd only find these while you're reading through the enemy's Create/Update functions.

Also, how difficult would it be to convert a normal enemy into a boss or is that even realistic to consider?

I think that wouldn't be that hard. Giant Skeleton in OoE is already both a boss and a common enemy at the same time (controlled by var A). Things that would be necessary:

Boss doors: Shouldn't need any special coding. I think they just work even with common enemies in the room based off Nest of Evil/Large Cavern.

Boss staying dead permanently: Would require a boss death flag. Thankfully this won't require you to find free space in the save file, the bitfield of boss death flags has plenty of unused bits and any one can be chosen. Then when the boss is created you read that bit, and if it's set you just delete the entity and return, or if it's not set you continue on with the normal create code. Then when the boss dies you set that flag.
For reference, in PoR, Dragon Zombie is a common enemy that uses a boss death flag to stay permanently dead when you kill it.

Spawning a full-heal orb: I don't know the specifics, but it seems to involve calling a function to create the orb when the boss dies.

Changing the music: When the boss is created it calls a function to change the music to boss music. Then when it dies it seems to call a function to mute the music. The reason it comes back when you leave the room is because the engine will actively play whatever the correct BGM for that sector is whenever you enter a room if it's not already playing, so no need to worry about that.

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #163 on: October 13, 2017, 10:07:33 am »
Cool! Thank a lot for that info. :)

EDIT: It worked like a charm. I did notice some things you might want to know about.
At first I left it in the upper right corner of the departing room and when I entered the game locked up.
Then I moved to the other side of the room and it worked fine. However, the destination room (with a teleporter; area 07, sector 00, room 01) was all white when I entered and it took a while for the white to fade out and give me back control.

Then I changed the destination to another room (0D) and it locked up again when I appeared in the floor. Another time I fell down through the floor and when I tried jumping into the room it seemed to work fine.

Are there specific ways I'm supposed to place the special objects?

EDIT2: Is there an easy way to change the number of doors in a room that I am missing?
« Last Edit: October 16, 2017, 03:07:12 pm by Vanya »

LagoLunatic

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #164 on: October 16, 2017, 10:38:44 pm »
EDIT: It worked like a charm. I did notice some things you might want to know about.
At first I left it in the upper right corner of the departing room and when I entered the game locked up.
Then I moved to the other side of the room and it worked fine. However, the destination room (with a teleporter; area 07, sector 00, room 01) was all white when I entered and it took a while for the white to fade out and give me back control.

Then I changed the destination to another room (0D) and it locked up again when I appeared in the floor. Another time I fell down through the floor and when I tried jumping into the room it seemed to work fine.

Are there specific ways I'm supposed to place the special objects?

You need to place the fake doors outside the bounds of the room similar to real doors.
The exact pixel positioning of it doesn't matter because I round down the position in the creation code. For example:

If you place the fake door anywhere inside the real door I show in that screenshot, it will have the exact same bounding box as the real door (and the fake door takes precedence, so you don't even need to delete the real door if you don't want to, though leaving it there will make it hard to click the fake door).

The fake door code I wrote does have a softlock bug: If the player is already inside the fake door on the same frame that they enter the room, then the fake door triggers a transition out of the room instantly while the previous transition into the room is still going on. This softlocks the game since the engine can't handle two transitions at once. I left this bug in since I believe it can only happen when the fake door is placed incorrectly, but it's probably fixable by detecting if there's currently a transition going on and not triggering a new one yet if so.

White screen when going into a warp room: This seems to be the warp point's fault, when you enter the room via a non-real-door transition it assumes you warped there via a warp point so it turns the screen white so it can fade it out. But I don't know why it took so long for it to fade out for you, when I tried it it happened instantly. Where specifically did you place the fake door that lead there?

Appearing in the floor of room 0D: Do you mean you appeared in the right wall of that room? If so that's normal when you go left, since you'll wind up on the right of the destination room and there's a solid wall there in this case, so you'd need to modify the level design of that room to make a hole in the right wall.

Falling through the floor: What room was that in?

EDIT2: Is there an easy way to change the number of doors in a room that I am missing?

There's not a super easy way since I haven't added the ability to edit doors into DSVEdit itself yet, but you can do it in Tiled. Right click on an existing door and select "Duplicate Object", then place the dupe door wherever and edit it however you want. When you import it back into the game, DSVEdit detects you want a new door and adds it.
Or to delete an existing door right click one and select "Remove Object".

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #165 on: October 17, 2017, 10:30:10 am »
Cool. Everything worked much better now that I placed the objects correctly.

The falling through the floor and getting stuck in the floor. Both happened in Area 07 Sector 01 Room 0D.
I should mention that when I got stuck in the floor it also softlocked.
It might just be because of the difference in elevation. It worked more or less fine when I jumped.

Edit: Out of curiosity, what is preventing the area maps from being expandable?
« Last Edit: October 17, 2017, 04:25:04 pm by Vanya »

LagoLunatic

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #166 on: October 18, 2017, 12:05:10 am »
Edit: Out of curiosity, what is preventing the area maps from being expandable?

Depending on what you mean by expand:

Increasing the total number of map tiles on a given map in PoR/OoE:
Maps in PoR/OoE only store actual map tiles that exist, not blank tiles. (DoS and AoS store blank tiles, so you can add more map tiles all you want in those games, since what you're actually doing is replacing a blank tile with a non-blank tile which is easy.)
This means that in order to increase the total number of tiles on a map, the map data would need to be relocated to free space, such as in the free space overlay.
That alone wouldn't be super hard, the actual hard part is the save file. The save file needs to store whether you've explored each map tile or not. So in order to make room for this data too, you'd need free space in the save file. I haven't started trying to figure out PoR and OoE's save file format yet, so I don't know if that's even possible. But I do partially understand DoS's save file format and save loading code, and that makes me think that expanding the save file would be very complex, since I assume quite a lot of code would have to be changed to accommodate the different size and format.
A different option that might be more doable would be to always keep the total number of map tiles in the whole game the same, but let DSVEdit shift that number between areas. So if one area has 100 map tiles, and a second area has 50 map tiles, this would let you change it so the first area has 140 tiles and the second has 10 tiles, so you have expanded the first area's map without needing to change the save file format. This should work since I believe all the areas store their map-exploration data right after each other in RAM. But if that's not true in the save file then it wouldn't work.

Increasing the height of a map in PoR/OoE while keeping the total number of map tiles the same:
The map system in PoR/OoE has some kind of performance optimization where every map has a list of how many map tiles are in each row of the map. This list is required for the map to display correctly. So to increase the height of the map you need to add new entries to this list. This requires relocating the list to free space. Compared to the above problem this one is much easier, I just need to code the logic into DSVEdit to properly handle relocating this to free space when the user change the map height is all.

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #167 on: October 18, 2017, 11:36:43 am »
OK, I figured that would be the case. For my project in particular I don't actually expect to have any issues.

Option 2 for managing the total number of map tiles would be a great compromise.
Being able to do something with the unused area in PoR would be nice, too.

Regardless, I have a suggestion for the map editor.
It would really help out if we at least had a count of the current number of map tiles used along with the maximum for the current map.
« Last Edit: October 18, 2017, 04:14:17 pm by Vanya »

DarkPrinceAlucard

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #168 on: October 18, 2017, 06:32:25 pm »
Hello LagoLunatic I have a question regarding sprite hacking.

First off let me start by saying I LOVE this tool, its really making my DS vania hacking so much easier especially within the character swapping and palette hacking department.

But one issue I'm still having is addressing some of the sprite hacking issues I'm having, my problem is that with the DSvania games most of them have their characters sprites mostly intact for the most part but then there are some of the sprites (namely running ones) that have the sprites not so put together with the torso being seperated from the head and the legs being located somewhere else entirely, I currently use both DSvania editor alongside Tile Molester where I use DSvania to pinpoint sprites and get the palettes so I can load them within Tile Molester to edit it and yet recently I have had more trouble handling those kinds of sprites since the positioning can be a bit off once I replace them within Tile Molester since the legs/torso may be positioned a bit off, I've noticed that when you export the frames as PNG that all the sprites are correctly put together and I find it would be much easier if I could edit those sprites and reinsert them back into the game, my question is would there be a way to export the sprites fully intact and edit them with new sprites and insert them back ingame using DSvania?

LagoLunatic

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #169 on: October 19, 2017, 03:06:54 pm »
Regardless, I have a suggestion for the map editor.
It would really help out if we at least had a count of the current number of map tiles used along with the maximum for the current map.

Done, I added a counter of used/max number of tiles in the corner.

Hello LagoLunatic I have a question regarding sprite hacking.

First off let me start by saying I LOVE this tool, its really making my DS vania hacking so much easier especially within the character swapping and palette hacking department.

But one issue I'm still having is addressing some of the sprite hacking issues I'm having, my problem is that with the DSvania games most of them have their characters sprites mostly intact for the most part but then there are some of the sprites (namely running ones) that have the sprites not so put together with the torso being seperated from the head and the legs being located somewhere else entirely, I currently use both DSvania editor alongside Tile Molester where I use DSvania to pinpoint sprites and get the palettes so I can load them within Tile Molester to edit it and yet recently I have had more trouble handling those kinds of sprites since the positioning can be a bit off once I replace them within Tile Molester since the legs/torso may be positioned a bit off, I've noticed that when you export the frames as PNG that all the sprites are correctly put together and I find it would be much easier if I could edit those sprites and reinsert them back into the game, my question is would there be a way to export the sprites fully intact and edit them with new sprites and insert them back ingame using DSvania?

Unfortunately that idea is impossible. To explain why I need to explain the way the sprite system works in the dsvanias:
In a modern PC game, the devs would just store each animation frame separately like the ones DSVEdit can export, since filesize isn't much of an issue on PC. But on DS they need to save space, so the devs cut the sprites up into several parts, and some of these parts are used by many many different frames of animation. Some of the torso parts for a player might be used in several different animations, for example.
DSVEdit's Sprite Editor lets you view and edit the way these parts are arranged into animations.
The problem is that when you click "Export frames as PNG", DSVEdit assembles them all into completed images, meaning the sprite data of how parts are arranged and which are used more than once is completely lost. So once you do that the data can't be imported back, it's lossy. That button is intended for things other than romhacking, for example the person who asked me to add it is making a castlevania fangame on PC.

But I have a different suggestion I think might solve your issue. Try using the "Export to darkFunction" button added to the sprite editor in v1.6. This lets you edit the way the parts of the sprite are arranged in an external program called darkFunction Editor, so if the legs and torso look off after you edited them you can just drag them so they're lined up right in darkFunction, then import them back into the game in the sprite editor.

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #170 on: October 19, 2017, 05:32:40 pm »
Coolio! :)
I feel like I had some more suggestions, but I don't remember. :P

Looking at what I'd like to accomplish with PoR, I'm pretty sure I'm going to have to delve into porting some enemies over from OoE and DoS.
Not really looking forward to that.
And I'm thinking I'm going to have to add a few new things from scratch, too.
« Last Edit: October 19, 2017, 07:06:48 pm by Vanya »

Dev Anj

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #171 on: October 19, 2017, 09:15:10 pm »
Looking at what I'd like to accomplish with PoR, I'm pretty sure I'm going to have to delve into porting some enemies over from OoE and DoS.

Interesting. What are you planning to do for PoR? I've been planning a mechanics/systems overhaul mod for it, which of course requires learning assembly to understand how the game functions work.

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #172 on: October 20, 2017, 12:26:11 am »
A remake of Castlevania 1 incorporating level layouts from CV1 NES, CV1 MSX, CV1 SNES, and CV1 X68k.
There are a few enemies not present in PoR that are in OoE and DoS.
I'll need a few new bosses that will need to be basically from scratch.
And I have no idea how I'm going to handle stairs.
If I want to be really ambitious I could try to add the whip swinging thing from SCV4, but I shouldn't get ahead of myself.
I have a long way to go before I can do half the stuff I'd like to.
And I have other stuff I have to get finished first.
At least I know building the levels will be easy.
« Last Edit: October 20, 2017, 01:07:53 am by Vanya »

ambrose007

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #173 on: November 04, 2017, 05:35:34 pm »
Does anybody know where I can find basic tutorial on how to use the editor?

Vanya

  • Hero Member
  • *****
  • Posts: 1154
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #174 on: November 05, 2017, 01:00:46 pm »
The read me has a good amount of information, but aside from that I don' think anyone has made a tutorial.

PachaWillWatchYa

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #175 on: November 05, 2017, 01:03:17 pm »
What format do opening animations use, and how could I edit them?

LagoLunatic

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #176 on: November 05, 2017, 09:29:17 pm »

I have some good news, I started implementing Harmony of Dissonance support and it's going smoother than I expected:



In just a few days I've gotten the most important things working, including tiles, entities, doors, enemies, items, and maps.
There are quite a few weird quirks to HoD though. One being that entities don't load their own graphics automatically like the other 4 games, instead the room is responsible for having a list of all the entity graphics for that room. So DSVEdit will need to update this list whenever entities are edited.
It also uses full width text for everything, so DSVEdit will need to convert between that and normal text or it will be annoying to edit text.
Also, sprite animations and hitboxes are stored separately in HoD, so I'm not sure yet if it's possible to display/edit those. But individual frames of animation are the same as normal.
So I've still got some problems to work out, but hopefully I'll be able to release HoD support relatively soon.

What format do opening animations use, and how could I edit them?

PoR and OoE's opening videos are located at /mv/vamp.vx. They use a video codec called Actimagine Video Codec. But I don't believe there are any programs available that can either view or edit these.
This page has some information on the format: https://wiki.multimedia.cx/index.php/Actimagine_Video_Codec

DoS's is located at /mv/cvop.dmd. I have no idea what this format is, I can't find any information on it based on the file extension or magic bytes.

Sinis

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #177 on: November 05, 2017, 10:08:50 pm »

I have some good news, I started implementing Harmony of Dissonance support and it's going smoother than I expected:



Recently took up an interest in doing HoD in the future so this is good news to me.  Like what I stated before and sadly will be a broken record from my part, still hoping for any future support for CotM :)

Keep up the awesome work on this :)
Castlevania 3: Dracula's Curse Community Wiki Thread
http://www.romhacking.net/forum/index.php?topic=21344.0

Discord: Sinis#4332

ikusatatsu_ushiromiya

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #178 on: November 08, 2017, 08:06:31 am »
I already made sereval hacks of Metroidvania before.But with the help of DSVania Editor,I successfully made my best hack of Castlevania AoS:
http://www.romhacking.net/hacks/3696/
I wanted to build my own castle long before.Now I realized it!!
Thank you very much!!



MaverickZero

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: DSVania Editor (v1.6)
« Reply #179 on: November 15, 2017, 07:36:31 am »
What you made was a real blessing lunatic, thanks for this great work, but i have a few questions.
Is there a way to put OoE and Dos
Background music into por?
And also, a few subweapons from Jonathan which i want to use with Richter, use Jonathan's voice itself making the use of it with Richter weird, can i disable Jonathan's voice for the sub?
And one last thing, i can actually add a jumpkick to Richter, but he uses the Chuck Norris spin kick instead of his actual jumpkick included in this game, is there a way to point his jumpkick animation to the jumpkick?
And please keep it up, awesome work!
P.S.
I found out what unknown 6 in por's character editor does, it fully plays the double jump animation even if not fully executed (was made for charlotte's witch broom riding, so she's still riding it while falling).
« Last Edit: November 15, 2017, 09:23:55 am by MaverickZero »