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

Author Topic: Castlevania III - Disabling enemies droping subweapons  (Read 659 times)

Marcelo_20XX

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Castlevania III - Disabling enemies droping subweapons
« on: April 21, 2019, 09:45:21 pm »
I am working on a personal project to tweak some aspect of CV3 but I stumbled on this issue. I want to remove the Random dropping of subweapons from enemies, can someone shed some light on it, thank you!

FAST6191

  • Hero Member
  • *****
  • Posts: 2487
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #1 on: April 22, 2019, 05:48:15 am »
I am not so familiar with Castlevania III (I usually go for the GBA and DS entries in the franchise) so going for the more general approach.

Do they drop anything other than sub weapons? It is not particularly troubling if they do but it might change something, or make something marginally more tricky.

Anyway do enemies have health here, or even better regenerating health? If they do then do the infinite health cheat search routine but for their health (might want to nerf your character as best you can to give you more searches). Probably better if you don't do it with a boss character as their drop routines might not be the same.

Once you know the health location for the enemy you can set a breakpoint on the health location. When it is reduced to 0 it will trigger a whole bunch of things ranging from death animation to any experience, loot drops and whatever else.
Hopefully it calculates the loot drop there and then with a random generator but it could go another way. If there are multiple things then you can force it to be one of the others somehow (whether you forcibly add something, set a given return or do the whole "IF blah then do this ELSE carry on as normal" thing). If it is just the one drop type then force the drop or not thing to give you nothing.
On rare occasions games will decide if and what to drop as soon as the enemy is created but the death/zero health thing will still allow you to figure out what you need to do here.

If they don't have health you are still going to want to find out what happens when they die. Score increases, experience points, enemy counter for final report on the game... find something that happens as a result that you can reasonably search for via a cheat and go from there. If there is nothing else then time to play with hit detection but I try not to go there right away if I don't have to.



For the GBA and DS games you do also sometimes have an "increases drop rate" equip which can help narrow things down a bit, or at least provide another approach if it factors such a thing into the calculations somewhere.

Marcelo_20XX

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #2 on: April 22, 2019, 11:26:50 pm »
Thank you for your advice, regular enemies (not Bosses) have random drops and one of them are subweapons, but they could drop hearths, Big hearths and if the conditions are met the II and III item (which enable to fire 2 or 3 consecutive subweapons at once). They appear to have health as some enemies die in more than one hit...

The cheat search approach is a good start as I managed to change things on SNES with this method followed by good old assembly...

Is NES assembly harder than SNES one?

FAST6191

  • Hero Member
  • *****
  • Posts: 2487
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #3 on: April 23, 2019, 07:14:02 am »
I am not terribly well versed in NES assembly, and as I tend to come from later systems I find some of its limitations and underlying concepts a bit strange* but it is nothing too troubling.  https://wiki.nesdev.com/w/index.php/6502_instructions

*from a PC and GBA/DS where there are dozens of general purpose registers and instructions act like said registers are just part of the command to the NES where there are 3 or so depending upon how you want to view it and instructions are considered as unique to those registers...
Similarly such things are a bit limited compared to later systems with regards to the operations available. Still can do things but you have to build up to it. Some also come to enjoy its simplicity, can't say I do myself but I can see where such people are coming from.

As far as this hack is concerned it should be no great issue as it is not like you are trying to wedge in a whole new routine as much as disable something a game does, tweak within existing parameters or divert existing functionality away from an outcome.

Looking at https://strategywiki.org/wiki/Castlevania_III:_Dracula's_Curse/Items it seems like this might be a slightly more complex than I thought it might be (I was thinking three drops rather than between 7 and 15 depending upon how it is counted -- the NES being 8 bit means that while you could do random, or a biased random which usually means a different range, between 0 and 15 I could also see one bit per drop type and the sub weapons being kicked to another, which might also help with the different characters being denied different things. Still you should see a random calculation somewhere in there for it all and you would have to figure out what means what there. Or at least enough to tell it "if sub weapon do this instead".

I also had a look at http://datacrystal.romhacking.net/wiki/Castlevania_III to see if it might have something. Sadly not, and while some of the hacks messed with item stats they did not necessarily have an easy path to drops. Did tell you where the score was held in RAM though so you can start with that if you like for the search rather than find health. Health might be better as things flow from that, as opposed to score which is probably one of the results of it, but easy enough to carry on working backwards for one or two steps.

Marcelo_20XX

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #4 on: April 26, 2019, 08:06:10 am »
I am just "this" close to finally disable the subweapons drops from regular enemies. The thing is that I found the routine on the original Castlevania rev A, but with some luck I hope it will be mostly the same on Castlevania III. I will update this post when I have found the solution along with some tweaks I already made on the first game like:
- Dont lose subweapon, whip power and double/triple when dying

EDIT 1: Regarding the differences between NES and SNES assembly I can tell that, as one would expect, there is less opcodes to work on the NES and the biggest change I miss is that there is not a Branch Always Opcode
« Last Edit: April 27, 2019, 04:21:05 am by Marcelo_20XX »

FAST6191

  • Hero Member
  • *****
  • Posts: 2487
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #5 on: April 27, 2019, 06:21:05 am »
EDIT 1: Regarding the differences between NES and SNES assembly I can tell that, as one would expect, there is less opcodes to work on the NES and the biggest change I miss is that there is not a Branch Always Opcode
Assuming you don't care to abuse JMP then you could probably define a pseudo instruction to BEQ and BNE back to back (had a quick check and there was no mention of flags resetting when activated but we are somewhat outside my comfort zone at this point). I don't know if any assemblers have such a thing already but I would not be entirely surprised.

Failing that http://www.6502.org/tutorials/6502opcodes.html#BEQ
Quote
There is no BRA (BRanch Always) instruction but it can be easily emulated by branching on the basis of a known condition. One of the best flags to use for this purpose is the oVerflow which is unchanged by all but addition and subtraction operations.

Marcelo_20XX

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #6 on: April 30, 2019, 07:04:51 pm »
I miss the BRA opcode because it makes so easy to quickly browse existing code by modifying a single byte and see if it changes something on the game, JMP is always a 3 length byte opcode so you cant replace any existing branch opcode