Castlevania Dungeon Forums

The Castlevania Dungeon Forums => Fan Stuff => Topic started by: TheouAegis on April 01, 2011, 09:47:12 PM

Title: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on April 01, 2011, 09:47:12 PM
So, there's been some issue, it would seem, about simulating stairs and other features in NES style Castlevania games in GameMaker and other frontends. You always see games where the heroes are able to jump onto and off of stairs, but pretty much never games where once you're on the stair you're stuck there. People complain that these kinds of Castlevania games are annoying and suck, but face it folks: they're realistic. If you try to jump on stairs like Castlevania's heroes have been able to do these days, you'd have to be a freaking gymnast to be able to handle the footwork and balance involved. And if you misjudge your leaps, you'll fall backward and become a paraplegic or fall forward and shatter your shins.

Current Version: 0.31 Alpha

UPDATE LINK!
Download it here (http://www.mediafire.com/?u4ki5kuc3ub4ju8)
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: uzo on April 01, 2011, 10:14:36 PM
Pics/video/demo or it never happened.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Oralox on April 01, 2011, 10:35:16 PM
Pics/video/demo or it never happened.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 02, 2011, 03:19:38 PM
I'm interested in this.  Please show us some pix.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 02, 2011, 04:58:47 PM
O ye of little faith...

http://www.youtube.com/embed/LiASylKBbA0?rel=0 (http://www.youtube.com/embed/LiASylKBbA0?rel=0)
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 02, 2011, 06:31:15 PM
Belmont Engine (early alpha) (http://www.youtube.com/watch?v=LiASylKBbA0#)

Very nice early start.  It really mimics the NES version. :D
Also, would you like it embedded on the forum post, like how I just did it?  Just put the link into the post and the forum will auto-embed.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: X on April 02, 2011, 09:32:25 PM
I could certainly use that code script for my CV game I'm trying to put together! The only thing else that I would need is rope climbing, the crawl-walk and a more faster whip attack like Simon from CV2SQ.

-X
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 03, 2011, 01:35:48 AM
If you put in the turbo-whip (hold the whip button whilst on stair) you'll be mimicking the NES titles exactly. :D
Then you can start to put in purdy graphix. :3
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 03, 2011, 05:41:23 AM
Actually I had that. I might have it already, actually. I noticed that when I was debugging early on. I was like, "Shoot I have a bug with the attacks on the stairs! I need to fix this! ... or do i?" Then I went back to the game, walked up a stair, held attack. "Oh, it's supposed to do that." I think in the vid I was just tapping the key.

I can't get it to embed videos. What the heck?!

Other things included that I may or may not have put in the vid or have since changed:

Trevor will land awkwardly if he drops a distance higher than 64 pixels but not if he attacks at the right moment (but if his attack finishes before landing, he'll land awkwardly). Currently I'm working on the code for that, trying to clean it up. I have to go back to the game and measure his falling rates. I'm hoping my arbitrary timeline positioning was wrong and that the coding can be much simpler than what it is right now.

Trevor cannot jump when there is a ledge right over his head. Have to check the game to see if he "hiccups" when trying to jump, which he currently does in my engine. I think I changed some line of code yesterday because I don't remember him hiccuping when I first wrote the code.

Trevor will jump through ledges that are at least 16 pixels above his head. (This is currently buggier than the Forgotten One.)

The whip can be upgraded, although this is still very much a work in progress. I've assigned variables for whip level (in Simon's Quest terms, thorn whip, chain whip, flame whip, etc.), whip damage (based on an array), and whip multiplier (the [ I I ] and [ III ] glyphs hidden in walls).

Numerous bugs common to many Game Maker games, including those made by Mark Overmars himself, have been fixed. I still have a (growing) list of bugs I'm currently trying to work out. Most deal with collision problems, such as jumping through ledges when Trevor's supposed to bump them or the whip locking up. (This latter bug has appeared in other Castlevania fan games, from what I've read.) All these years of not making games because I just get fed up with all the bugs in Game Maker gave me a lot of knowledge about various bugs, so I'm taking the time now finally to try and figure out what's causing my bugs. When I remember to, I document the bugs as I find them and then document my fixes for them. I've found that writing out my bugs descriptively makes fixing them a lot easier.

Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: X on April 03, 2011, 06:08:18 AM
Good plan. But in terms of Trevor landing awkwardly it shouldn't be that big a deal. I've seen him land awkwardly in CVIII from such a high distance fall. It's as though for a brief moment, his legs enter the block he falls on, but then recovers as if nothing was wrong. Is that the problem you are having?

-X
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Chernabogue on April 03, 2011, 09:13:48 AM
Wow, looks great, dude!
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 03, 2011, 07:42:06 PM
Good plan. But in terms of Trevor landing awkwardly it shouldn't be that big a deal. I've seen him land awkwardly in CVIII from such a high distance fall. It's as though for a brief moment, his legs enter the block he falls on, but then recovers as if nothing was wrong. Is that the problem you are having?

-X

Sorry, by landing awkwardly I mean he goes into his crouch and stands there for a bit, which he's supposed to do. I wasn't complaining about it, just saying that it's a feature I made sure I implemented. I was considering imitating the ground-sticking you mentioned, because I noticed that too. He drops down 1-3 pixels into the ground then snaps back to the right position, depending on his fall height and current sprite. But then I decided that was probably one aspect of the games we could all live without as it looked to me like it was just the NES's inability to execute certain commands fast enough. Plus with the engine I'm using, emulating that would be a pain because mine checks for collisions every pixel (which is okay for an NES clone but probably not for modern games).
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 03, 2011, 11:07:32 PM
I actually really liked the dramatic crouch stop.  It was a cool feature in the old games.  Really made the character feel hefty.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 04, 2011, 09:52:35 PM
The only thing giving me a headache right now is debugging collision detection. Game Maker has some of the worst collision detection functions ever. I have one bug where attacking while jumping can potentially make Trevor fall through the ground with no collision detection whatsoever. I have another bug where when he jumps forward he moves inside the ledge rather than sliding up and over it. I tried to fix this last night, but my solution brought back another bug I had where Trevor would get stuck inside ledges over his head. So now I'm left looking at two bug fixes that refuse to work together. I refuse to add items in until I get these blasted collision bugs resolved.

Oh yeah, another feature I implemented into the engine is if you press right and left at the same time, depending on the level orientation, it will ignore one key or the other. So if you're supposed to be progressing through the level from left to right, the game will give priority to the right key (you have to press only the left key in order to walk left). I haven't decided how I'm going to handle vertical stages, whether to default to right key priority or what. Minor issue, though.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Dremn on April 05, 2011, 01:29:59 AM
Looks near identical to the original, impressive.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 06, 2011, 01:04:22 PM
Here's an update of my engine: It's not ready to be released because of bugs that Game Maker is responsible for! ... Okay, I may have had some part to play in all of this.

Current Bug List Preventing Release


Depending on my code, if Trevor is a certain distance away from the first ledge in the video, he will fall through it when jumping towards it either always or when he attacks prior to reaching it. This bug has been crippling my engine from the outset and after every update I make to my coding I check if the bug has been resolved or worsened. ... Apparently it's worsened, so I had to scrap my last edit. I am pretty certain it is my coding partly and GM itself partly. Yes, GM has various bugs. The one that caused me to stop editing my engine two nights ago involves mirroring sprites with image_xangle -- GM increases the size of the bounding box by 2 pixels if image_xangle=-1.

I had an issue where walking back and forth on the stairs would make Trevor shift left or right a couple pixels away from his norm. I traced this to a line of code I forgot to edit (it had a sister code elsewhere which I edited but forgot to edit both of them at the time). So currently the only bug I am aware of on my stairs seems to involve my coding for attacking. When Trevor attacks while ascending or descending, he offsets the sprite away from its norm. I don't know why this is, since I've overloaded my code with so many conditionals (by the way, I am working on cleaning up my conditionals since some have been resolved with recent bug fixes). Therein may be the root of my problem, if I have a conditional in the stair code hindering movement and not in the attack code where I have been looking.

I don't have Items coded yet.

I don't have a single enemy coded yet, although that's probably not as important to all of you as Trevor's code.


If anyone can help me with the AI coding for crows and owls in Castlevania III, I would appreciate it. Other minor enemies seem to more or less follow a clear-cut boring pattern of their own, but crows and owls base their movement on Trevor's position relative to them. They appear to have two or three specific movements and then change them up depending on where Trevor is. If you can narrow down their coding into a set of timelines and conditionals, I would appreciate that.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 07, 2011, 12:54:27 PM
Gah! I fixed all my bugs, or so I thought. Then right before I clapped my hands and declared Trevor bug free, I discovered 2 more bugs that either weren't there before or were there but had been covered up by the last one I fixed. I realized when Trevor fell through a ledge and dropped continuously that it was because my collision detection was set to keep moving if he was inside a ledge. Yes, I wanted that but not while he was trying to land. Located it. Fixed it. Adjusted collision detection. Now he defies gravity while in a ledge and I can't find the conditional that's letting him do that! So I turned off my comp and pretended to go back to work until I get some sleep and/or food in my belly.

Don't forget to read the post above. I still await help deciphering crow/owl AI.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 07, 2011, 02:53:22 PM
I will play some CV3 today to try and figure it out.
I needed to do this for my Castlevania Chronicles: Dracula's Curse game as well and, while I got a 'similar' mechanic, I never looked at the details on how the ravens work.

However, here are the owls:
1. The owls have spawn points in the forest area, recognized as 'black spots' in the forest trees.
2. An owl stays hidden for about four seconds (they do three 'blinks'), and all you can see are its eyes.
3. It takes three animations frames for the owl to come into view, and then one for when it opens its wings.  I don't know the timing of these three frames, though  The entire sequence seems to take about a second.
4. After it opens its wings, it will do an arc dive attack at whatever spot Trevor''s upper body sprite is, at that time (it seems to come after your face).  You can 'fool' the Owl by being in the air about to jump, so that when it comes at you you can whip it.  However, if you're on the ground, it will be difficult to hit him before he hits you, if his spawn point is, say, right over you.  It seems to come to the spot you're on the moment after its wings are extended, wherever that position is.
5. Whether it misses you or not, it will continue that arc up into the three upper rows of blocks on the stage to whatever X position that happens to be on (this means he goes up high enough and far enough where only an axe could reach it... maybe...).  It then will do one more dive attack, this time aiming at your lower body (it seems), and do one fast long sweeping arc.  Whether it hits or misses you, it will continue and go off-screen as if the arc were to end at the area of tiles above the screen.  It then will disappear and re-do its 'blinking' animation at the next spawn point.

The ravens are harder to predict.  They seem to change their movements depending on what animation/motion Trevor is doing.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 09, 2011, 02:15:59 AM
I'm torn between doing more programming or just uploading what I have done. I have the bugs worked out. Just have to add the Items, which should be bug-free because, except for holy water, they don't involve collision detection.

For those curious, for detecting if Trevor is standing on ground, I used collision_rectangle(bbox_left,bbox_bottom,bbox_right,bbox_bottom+1,ground,0,1) rather than place_meeting. I did use place_meeting for horizontal collision detection because there seems to be a "bug" with collision_rectangle allowing a sprite to keep moving. I didn't see anything in my code that would allow that to happen, so I'm assuming it's a bug. I couldn't use instance_position or instance_nearest because my system for handling tile collision involves scaling the boundary objects (doesn't get rid of empty objects but at least cuts down on the number) which renders various forms of object and collision detection useless.

EDIT: I wanna cry. The damn bounding box glitch in GM has left me with one minor yet annoyingly game breaking collision bug. One more day of debugging and i should finally be bug-free.

EDIT #2: OMG All that time trying to make Trevor walk through a ledge if he lands inside of one and supposedly he can't do that! There are limitations to it apparently. Now I need to find any places where such limitations exist. Like, let's say a "tilespace" is 16 pixels. Each "block" takes up 1 tilespace. So let's say you have a block. Then 1 tilespace to the right and 2 tilespaces down you have another block. If you jump onto that second block such that you land with your head inside the first block, you can move right (towards the second block) but not left (towards the first block to drop down). *bangs head on desk*

Anyone know of places in NES Castlevania games that look like:

       _  _  _
      |_||_||_|

          _  _
         |_||_|

 _  _  _
|_||_||_|
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: X on April 11, 2011, 03:00:03 AM
I've just gone over the maps for CV1 and CV3. There are some block placements that come close but not to what you're inquiring about. CV2 has no-such block placements due to the nature of it's program (not allowing you to jump through blocks from underneath).

-X
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 11, 2011, 04:33:52 AM
*****
Anyone know of places in NES Castlevania games that look like:

       _  _  _
      |_||_||_|

          _  _
         |_||_|

 _  _  _
|_||_||_|
**********

If the distance between the block tiles is two block tiles, then there couldn't be a place like this.
Trevor cannot jump at all if the space between his feet and his head is two block tiles.  It's the same for CV1 Simon.

I'm not quite understanding Trevor's position in those blocks.  Further explanation is required.
Let me break it down to see if I get it:

"So let's say you have a block"

Ok

"Then 1 tilespace to the right and 2 tilespaces down you have another block"

Ok, so it's below the original block by two.  This means that Trevor is going to walk off to the right and he would 'fall' two blocks on to it.

"If you jump on to that second block such..."

Stop right there for a sec.
Jump on to that block.... from where?  From below, or from another set of blocks you haven't mentioned?

Assuming that you're jumping on to that block from some place below, I think I can find a place like that... let me see...
Oh, here you go!  Check out the bottom-most room of the Haunted Ship!
(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fwww.inverteddungeon.com%2Fjorgefuentes%2Fimages3%2FLv40E.gif&hash=144197bae25e4ee77ecb6a2f55abdefd226a2d23)
-----------------------------------This area here, above this text, ↑↑↑↑↑↑

Trevor comes from the upper left staircases, and fights some skeletons and some ghosts, and then has to jump to the right, then jump up and to the left.  Then he has to do another jump and then climb the stairs on the right.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: X on April 11, 2011, 05:00:17 PM
There are several sections throughout the game that also contain those same block placements. I saw one in the lost shrine of poltergeists.

-X
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 11, 2011, 05:24:23 PM
X is right.
Here's the spot, in that stage:
(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fwww.inverteddungeon.com%2Fjorgefuentes%2Fimages3%2FLv6A3.gif&hash=fd8f02df1b19855b8f9cfc72fcdb82b2d5a57f9a)
↑↑↑↑↑↑ Right there, on the upper floor, Trevor/Alucard/Grant have to jump through the two brick sections prior to walking the upper section to reach the Bone Dragon King.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 11, 2011, 07:42:18 PM
Now extend all those upper-level blocks over 1 more tile so they completely cover the ledge below them. You figured out what I meant, but I was looking for the extreme case. Because yeah, in each of those situations you found (which were the right situations by the way, sorry for being so vague), if you jump from the lowest ledge onto the middle ledge such that you land with only the front foot on the middle ledge and Trevor's head inside the highest ledge, Trevor can keep walking forward along the middle ledge but not backwards (which would lead him through the highest ledge but in turn also allow him to just fall off the middle ledge back down to the lowest ledge).

Well, I made use of collision_line() which seems to cause some slowdown in parts of the game, so I rearranged my code to hopefully reduce the slowdown (so only one collision_line() command would be executed at a time, I hope). The only problem with collision_line() and collision_rectangle() is they detect collisions differently than place_meeting() or instance_meeting(). They allow my code to be more accurate and so far seem to simulate the scenario I mentioned at above at the start of this post, and they make it easy to have Trevor stop outside a ledge while walking but fall inside a ledge while falling (which Trevor can do by 2 pixels either side of a ledge). But right now I'm having an issue which is no doubt caused by collision_line() because I've never had it any other time in my programming: if Trevor jumps and connects with a ledge such that his feet or legs touch the ledge but his upper body is still in open air, he will effectively land IN the ledge and be able to walk through it (because my horizontal collision_line() doesn't need to deal with his feet being inside of a ledge), but if his face or chest bump a ledge he falls down like he's supposed to. I might just need a second conditional to check against, but I'm open to suggestions.

I might make a backup and then try recoding for strict tile collision checking, but my current engine is just soooooo close to being perfect! :(
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 11, 2011, 10:11:46 PM
Indeed, I think you will need another conditional.

CV3 seems to have covered its bases, as it currently has is thusly:

When Trevor Jumps at a platform
AND he can land on it
//Trevor cannot land on a platform with no floor.  A 'Wall' platform.
//Trevor also cannot land on a platform if the jump trajectory does not allow it.
AND there's a platform above
//Seems the game knows where the edges, floors, and ceilings of platforms are.  It needs to, because it needs that information for Grant's Wall-climbing abilities.
AND Trevor is at the edge of said platform's side wall when he lands
//So the game checks specifically for these goofy instances.
THEN he can walk in the direction away from that platform's side wall
//So he cannot get stuck.
and only in that direction.
//but cannot go back to the lower platform.

The game does not have instances where there's another block tile.  However, there may be some instances regarding Alucard's Bat Transformation, that might create a 'stuck' situation, though in those cases, I'm pretty sure the heroes can just 'jump through' that plaform.


Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 11, 2011, 11:22:13 PM
Yeah the game allows for jumping up through a platform. Don't know if I"ll go so far as to emulate that aspect specifically. So much mechanics involved in the games. :( Every time I play it I find some mechanic I missed before, then I feel compelled to go back and try to fit that mechanic into my engine. Blah. Getting sick of it already.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 11, 2011, 11:23:20 PM
At least you're not programming WallClimbing with Grant! :o
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: X on April 12, 2011, 12:24:50 AM
Well, I made use of collision_line() which seems to cause some slowdown in parts of the game, so I rearranged my code to hopefully reduce the slowdown (so only one collision_line() command would be executed at a time, I hope). The only problem with collision_line() and collision_rectangle() is they detect collisions differently than place_meeting() or instance_meeting(). They allow my code to be more accurate and so far seem to simulate the scenario I mentioned at above at the start of this post, and they make it easy to have Trevor stop outside a ledge while walking but fall inside a ledge while falling (which Trevor can do by 2 pixels either side of a ledge). But right now I'm having an issue which is no doubt caused by collision_line() because I've never had it any other time in my programming: if Trevor jumps and connects with a ledge such that his feet or legs touch the ledge but his upper body is still in open air, he will effectively land IN the ledge and be able to walk through it (because my horizontal collision_line() doesn't need to deal with his feet being inside of a ledge), but if his face or chest bump a ledge he falls down like he's supposed to. I might just need a second conditional to check against, but I'm open to suggestions.

Dude! I've seen this happen in CV2 Simon's quest! It almost always happens in the first mansion I visit. I jump to a ledge that's two blcks away from me and one block higher. And if I land it right, Simon is walking through at least four pixels of the block but is still able to move through it.

-X
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 12, 2011, 01:53:35 PM
Yeah, I had wall-walking enabled prior to fixing my ledge-landing glitch. The glitch I was having when I was about to cry bloody murder yesterday I solved (for now) by putting a vertical collision check in a horizontal collision check event. I was trying to avoid such sloppy programming, but it seems it couldn't be avoided. Then I was having some glitch with my stairs, which I realized was because I messed up on some if-then hierarchy (I cleaned up my code to hopefully reduce memory usage but in the process made it harder to read because of all the spanned-out brackets). So now I have just one bug left to work out as far as I can tell: letting Trevor walk out of a ledge if he finds his head stuck in one, but of course only if there's a blank spot ahead of him. The solution (I hope) came to me on the bus ride home from work this morning, so I'll see if my idea works in a few minutes. The solution was so simple that it eluded me last night... Ok, it didn't elude me, I just felt it was too simple to be right so I made it more complicated to the point that it didn't work and then gave up on it.  :-\

In short, I should have Trevor ready to upload by tonight (cuz I sleep during the day). Cross your fingers.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 12, 2011, 02:02:55 PM
And I guess you're uncomfortable just 'snapping' him out of the edge of the platform and into the center of the block?
That's what I would do.  It's not the best-looking of solutions but it's forgivable.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 12, 2011, 04:28:25 PM
I got it to work. I'm working on the holy relics now. The "simple" solution was to check for no collision 16 pixels ahead of him. Of course it's up to the level designer to make sure no situations exist that would make my solution not work, for if at any time my solution doesn't work, the level is not true NES Castlevania-style.

And something I posted on the Game Maker forums just now: While testing some ledge collisions in CV3, I found what appears to be the NES equivalent to Game Maker's image_xscale=-1 bug. If you're not familiar with it, when you use image_xscale=-1 to mirror an object's sprite, the sprite's bounding box increases by 2 pixels on the left side (or 1.5 on left and .5 on right... don't ask). In Castlevania 3, collisions when Trevor moves left are offset by 2 pixels compared to when moving right. I haven't tested this with other games yet.

And while debugging my engine I think I also figured out how/why the World -1 Easter Egg in Super Mario Bros. worked (and if I did, props to Nintendo for thinking "hey! Let's exploit a bug in our game!").
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 12, 2011, 04:31:58 PM
Did you jump towards a 'wall' of bricks, and cause the character to scroll through it? xD
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 12, 2011, 06:11:28 PM
My guess is it has to do with what your Y-value is at the time of the collision with the wall. It's very precise, since they (as you can tell in Castlevania games) very likely just set a vertical variable and didn't calculate every step (which is what my engine does, so in that regard it's different than Castlevania), so it takes a lot of trial and error the first few times you attempt it.

Anyway, it just occurred to me after considering that image mirroring is bugged in the NES just as it is in Game Maker and that, upon inspecting the graphics data in my Castlevania 3 ROM, the sprites initially face left rather than right like in the sprite sheet I've been using, my collision engine is overly complicated. Had I worked with a left-facing sprite sheet all along, my engine would have likely been completed two or three nights ago since I wouldn't have been preoccupied with trying to get Trevor to fall through ledges a certain amount.

And I also realized a 1:2 view-to-port aspect ratio messes up image_xscale=-1 even further. I set my views to a 1:3 ratio and voila the pixels line up at either image_xangle.
*flips his computer the bird then goes to bed*
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Viper on April 13, 2011, 05:27:10 AM
image_xscale isn't bugged in GM at all.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 13, 2011, 02:37:05 PM
Prove it. Prove that increasing the bounding box by 2 is precisely what image_xscale is supposed to do.  I threw into my debugger object the following codes:

Code: [Select]
with(all) draw_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom, 0)
draw_text(x,y,obj_Trev.bbox_left)
draw_text(x+80,y,obj_Trev.bbox_right)

And the rectangle was visibly larger when image_xscale = -1 and the value of bbox_left did indeed change by an offset of 2. That implies there's a bug.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Viper on April 13, 2011, 11:27:37 PM
I suppose this is bbox function bug. Or some issues with your sprite's origin.
Just have tried to draw flipped symmetric sprite over non-flipped one - pixels fit perfectly.

Anyway, as long as image_xscale flips sprite's mask, best solution for you is to have symmetric rectangle mask for your character. Maybe even have a separate object for "character with walls" collisions, that helps much by the way.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Aridale on April 14, 2011, 12:55:28 AM
yeah if your sprites origin isnt centered your gonna have issues when the character turns left and right. Its best to have a sprite thats an odd number size so theres an exact middle pixel to set as the origin.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 14, 2011, 01:37:56 PM
Collisions aren't a problem for me now. My collision detection works well enough.

I just noticed last night Trevor's standing attack sprite is 33 pixels wide (if you put all the frames into one sprite) because his upper metasprite is shifted forward 1 pixel. I'll test Aridale's suggestion on odd-value sprites. But image_xscale should, even if sprites aren't odd-valued, still put the pixel offset evenly on the left and right sides, but it puts all of the pixel offset on the left side when it bugs out.

Currently in my engine I'm working on the cross and holy water. I have the dagger and axe more or less finished. Do you guys think I should release just the Trevor Engine or release it with the game room as well (meaning that bit at the top of the screen)? I'm almost ready to share my Trevor code. If you look through the timelines I'm using in it, you might even figure out an algorithm to simplify parabolic motion in the game (interestingly, since Galileo wasn't yet born during the time of Castlevania, objects of different sizes fall at different rates of speed).
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 14, 2011, 03:01:32 PM
Parabolic motion for the axe and holy water?
Also, if you make a multi-layer level editor, I'll make stages.  GameMaker's level editor seems to be quite evil.
I can also update the Trevor sprite while keeping it the same size, to make it look modern, just in case you don't want that 8-bit look or would like a modern alternate costume or something.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Chernabogue on April 14, 2011, 04:20:45 PM
Wow, it seems to become very serious! :) Good job!
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 14, 2011, 05:54:06 PM
I was hoping to make an NES-style sequel to LoI, so I would need a CV3-style Leon. I was going to incorporate crystals (make those boss drops do something for once... ok say they did something in LoI too) and possibly allow double jumping or something. It would play like a blend of Simon's Quest and Dracula's Curse in that you start in the countryside near a village and you talk to a few people as you progress (most of whom all die) but it won't be Metroidvania, it'll be true Castlevania. Last night I planned on starting the game in  a forest with owl and cuckoo calls (using the triangle channel I'm guessing, or maybe the square with Duty 1) which overlap with an ominous simple tune and as you progress through the forest, breaking standing torches (like in the beginning of CV3) you come across a town whose inhabitants have mostly been slaughtered and you talk to a survivor, then a cat nearby freaks out and zombies appear then the action proceeds from there.

I'll post sprite specs when I get my engine further developed. I think I'll go work on it some right now until I fall asleep.

And yeah, parabolic motion is weird in CV3. Trevor jumps in a 5----3--------2--1--0-1-0--1--2------3----5----6----7 motion, but the axe moves in a 5--45-4--3--2--1--21--010--12--1--2--3--4-54--5--6--76-7---8---9---10 motion. I haven't looked at the holy water yet. I'm GUESSING it's an augmented axe motion.

As for level making in my engine, at least in this beta version, all  I would need is stages using 3 layers:  Layer 1000000 for solid ledges, Layer 999999 for passable backgrounds, and 999998 for passable foregrounds (don't know if these were ever used in Castlevania games, but i was thinking of something like walking through a graveyard with tombstones in front of you). And yes, the NES can handle foregrounds, but a foreground tile cannot overlap a background tile, so whatever the primary background color is for the room will be what's shown behind Trevor in the transparent parts of the tile (which is typically black in a graveyard). You could also do foreground trees or grass in this way (which some of the Mega Man games did). The Famicom-style remake of Mega Man 8 (I think it was 8, the one with Slash Man) had people saying the T-Rex couldn't be done on a real Famicom, but the remake's designers blended foregrounds and backgrounds with sprite blocks in a way the NES was more than capable of. Anyway, the engine then places a ground object over tiles in layer 1000000 and scales each object to cover the tiles. But more on that later.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 14, 2011, 06:33:44 PM
Ah, I see...

So, none of this, then?
(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fwww.inverteddungeon.com%2Fjorgefuentes%2Fimages3%2FTrevor-mini-animation1.gif&hash=fc6d7184aebb8063660bc55a7e30dd3185caa5ac)
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Aridale on April 14, 2011, 10:05:40 PM
shit jorge thats awesome! you finish the whole sprite?
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 14, 2011, 10:30:34 PM
I could probably get it done by the end of tonight if I get compelled enough, haha.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: X on April 14, 2011, 11:06:36 PM
Isn't Trevor supposed to have blond hair with a red sash draping from his belt like in the CV3 box art?

-X
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 14, 2011, 11:20:25 PM
Mine's a combination of all Trevors I know.  He's got the dark hair of CoD Trevor, the headband from CV3 Instruction Booklet Trevor, the armor plates of ZombieTrevor/Greatest5Trevor, and the gold colors of CV3 BoxArt Trevor.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 15, 2011, 02:26:30 PM
I wouldn't mind sprites like that, but I would want sprites like that for EVERYTHING. ... It'd be nice because I could use sprites from the 16-bit games with all their colors (even though I've already gone and done up 4-color sprite sheets for such beloved enemies as Behemoth. (Contrary to what may be popular belief, many enemies from recent games are still close in size to the NES sprites, so pitting Trevor against Behemoth isn't a farfetched idea.) I did a recolor of the sword skeletons in CV3 so their armor is brass, and a couple other 6-color edits. I was planning my game out while I was recoloring sprites, trying to think what two palettes I would be using in each area (because typically you have 2 palettes for Trevor and 2 for enemies and 4 for the background ... Although I could be wrong about that and if I am I'll be pissed).

Currently hung up on Holy Water. Worked on it for 4 hours this morning but it's still buggy. I'm not going to mess with half-steps like the original had (meaning if you threw a holy water right next to a ledge, half the time it would pass under the ledge and the other half it would hit the ledge), but the collision box seems too small for me to work with, even with my block object set at full bounding box. Oh wait, I didn't spend 4 hours on the holy water, I spent half that time working on the font and putting the NES palette in. ... Cuz I wanted the font color to match the palette. I'm thorough, dammit. Then I had to work out a bug with my hearts system (stupid if-then brackets). Restructured some stuff. The usual.

I'm going to be working full time and on a shift that won't let me have my computer at work, so I won't be getting as much done from here on out it would seem. But it seems I've got most of the difficult stuff out of the way (aside from the holy water), so maybe progress will be smoother. I'll post a video update soon.Won't be pretty, though, because I can't be assed to make nice backgrounds for Trevor to walk around on.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: abaldwin360 on April 15, 2011, 03:53:30 PM
Wow.

I have been working on a remake of the original Castlevania using SOTN/ROB sprites and backgrounds.

I started having issues trying to program the "stun" effect when Simon (re-colored SOTN fake Trevor sprite) fell too far, I was also having issues programming walking up and down steps.

Are you going to release your code to the public? I would definitely give credit!
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 15, 2011, 07:54:10 PM
Yes, this will be shared publicly. I'm typing up (and revising as I go) an info sheet/instructions for how to work with what I"ve programmed.

To Do List
Finish Holy Water
Look for formulae for parabolic motion in order to get rid of timelines (minor issue)
Status window drawn at the top of NES games
Make Vampire Killer upgradable (about halfway done)
Make torches
Make hearts

Make relic drops
Make a Skeleton
Test item and whip hit detection on above Skeleton

Make rotating/trap floors


For now that's all I have planned on adding prior to release (originally was going to release with a lot fewer options).
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 16, 2011, 04:50:25 PM
I want to cry. I just looked at the PPU again. You're allowed one palette for enemies. :( The whole reason for Blood Skeletons is that's one of the only ways to have more than one palette for enemies in use in a room at the same time. One palette for Trevor. One palette for the relics, money bags, and whip upgrades. One palette for hearts, torches, and explosions (from torches and death animations). And then one palette specific for enemies. But it's not SPECIFIC to enemies! The whip flashes all 4 palettes -- meaning the whip won't flash the same colors from room to room. I'll have to go back and recolor my sprites. :(
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 16, 2011, 05:27:48 PM
You'd have to swap in different graphics for the whip, as if it were a new object.  That'd be the only way to get it to flash.
As for enemies, you'd have to have a shared common palette.  Thankfully all of the enemies use generally the same palette if you're going NES-style, so they'd be 12 colors at most, but you 'could' make a large common palette of 256 colors and add duplicate sprites/tiles to the sheet so that you simulate the flashyness of the whip.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 16, 2011, 06:51:19 PM
Wait, what? What was that last part you said?


Currently, all I had planned for the whip was 3 frames for the sample engine (each frame of the whip's animation is actually a separate sprite, which makes sense because it doesn't proc when Trevor's arm is all the way back at the start of the animation). But in my final version, I was going to have a variable in each room called room_palette which my obj_Whip would cross-reference in its Create event and then when the whip reaches the 4th frame it uses whatever sprite matches that palette. Of course, to keep the file sizes down, I'd have to limit the number of enemy palettes I'd have to choose from.

And currently, since to my knowledge I'm stuck using multiple tile sets and duplicate sprites for breakables, I'm kind of already looking at having a lot of wasted memory just in sprites and tiles. Unless of course there's some way to pull off a palette swap with a greyscale base sprite and tile set. I'm open to suggestions there.

I have to go back to CV3 and look at the Name Tables some more to see how they pulled off some things. Breakaway floors seem to clearly be in the tile layer, but rotating trap floors appear to be sprites based on where they're located in the ROM data.

And I'm QQing about the palette limit because I wanted that plant lady in my game and I had her down to 6 colors (2 sprite sets), but now I can't use her or I can't use those colors at least because neither palette I gave her can be substituted with one of the constants. Unless of course I make her a background (which I'm doing with Behemoth, who only uses 3 colors per layer -- 3 in the background part and 3 in the leg/mouth sprites). I'll admit, I may have had an unrealistically diverse palette assortment in my sheet, but I tried to keep it small and in fact a couple of the palettes I could have merged together because they're not too different. But still... *wipes away a tear*
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Aridale on April 16, 2011, 07:33:37 PM
why are you so worried about it? Its not like its gonna run on a REAL nes so why go outta your way to try to make it all match nes specs? As long as everything is 8bit the actual palettes arent gonna matter to 99% of the ppl that play the game. Same for the whip flashin. Make your sprites for the whip have the different color frames in the animation and be done with it. No one will notice. As for memory concerns... the GM exe is gonna take more memory than all your graphics combined most likely and unless someones tryin to run it on windows 3.1 its not gonna matter anyway
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 16, 2011, 09:30:17 PM
YOU DON'T UNDERSTAND!
*runs back to his room with tears streaming behind him and slams the door shut behind him*

And some people will notice. People complained about Mega Man 7 FC and Mega Man 8 FC and even Mega Man 9 and Mega Man 10 because they didn't stick close enough to NES specs. There are picky people like that. Just look on these forums even. People bitch about Trevor's and Simon's clothes even.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 16, 2011, 09:46:21 PM
Only jerks like Uzo would notice that sort of thing.
Ha ha!  I kid, Uzo, you know we're pals.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: uzo on April 16, 2011, 10:51:24 PM
You're completely right though. I analyzed MM9 and 10 for their authenticity seeing how far they deviated. It's not as much as some people would have you believe though. People sometimes underestimate the NES.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 16, 2011, 11:35:20 PM
Like I said, I supported the MM8 FC guys. And like, I was under the impression you couldn't change tiles unless you changed all the tiles, but obviously in CV3 they wouldn't have made spiked ceiling traps. I'm just wondering how backgrounds really work on the NES. I read about it but I forgot. But I could tell MM8 FC was pretty close to the NES's power.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: uzo on April 17, 2011, 02:02:33 PM
MM8 FC is a complete sack of garbage. Not only do they completely ignore the NES limits, they changed many things in game cause they fail at properly replicating it in NES styled terms.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 17, 2011, 03:19:34 PM
And yet, it's still a pretty alright game.  If they really wanted to mimic the NES, they should've made it a NES ROM instead of a PC game.  It's just fine as a PC title that happens to have retro graphics and sounds.

It's no big deal to 99.9% of the populace, so the developers shouldn't give half a frozen shit about that last 0.1%.
If that 0.1% is stopping you from pushing the title out, then it's but a trifle.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 17, 2011, 04:15:27 PM
The palettes looked a little off in some places, but other than that, what else was wrong with MM8FC? I downloaded it but haven't played it much yet. I try to Google complaints for them but no one ever says what the games do that couldn't be done on a real NES. I'm not talking about the intro movie thingy. I mean actual gameplay.

... I know we're getting off-topic but this is my thread, so it's ok.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: uzo on April 17, 2011, 06:10:16 PM
With MM8FC its not just technicalities, its blatantly obvious that it cant be done by an NES. Even casual gamers who have had some experience with the NES can notice the differences or at least feel something is off about it. That and the blatant changes because the programmers had no skill to duplicate it in any fashion, not just conversion to NES style difficulties. It's a terrible port all the way around.

MM7FC had a few small technicalities against it but did a really awesome job of porting all the features to near perfect standards. MM8FC didn't even come close.

MM9 and MM10 did a great job as well. Right up there with MM7FC.


If they really wanted to mimic the NES, they should've made it a NES ROM instead of a PC game.

For what? To make it LESS accessible? Force use of an emulator? Create emulation dependent issues? To make it lower compatibility? Exclude tons of standard PC options? To make it way harder to code, using a dead obscure language?

That makes no sense.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 17, 2011, 07:02:53 PM
Well I'm just thinking a lot of people, in fact most people, consider the NES incapable of parallax or incapable of handling tons of sprites on the screen at the same time. Then you show them games like Crisis Force (lots of sprites and vertical parallax), Sword Master (gorgeous horizontal parallax), or Gradius 2 (so many freaking sprites on the screen at once and not a mess like Capcom's Commando) and they're like "wow I didn't know the NES could do that." And I remember when I first played Moon Crystal I was like, "O_O NO EFFING WAY! This is an NES game?!" Later games proved the NES was capable of a lot of things that people didn't think it capable of. And yes, they did port Commando to the NES... and no, the system couldn't handle it but that doesn't mean it was impossible for the NES, just needed some extra editing that Capcom didn't want to waste time with.

The later in a console's life a game comes out, the more likely it will have done something with the system most people didn't think possible. Take Tales Of Phantasia on the SFC for example. It had a freaking JPOP intro! The sound samples were a little coarse, sure, but my god man it sounded nearly as good as an actual recording! And then they still made a decent-sized game on top of that with EVEN MORE audio samples (every spell was vocalized by one of 4 different voice actors). Of course, it was really not much different than Vocaloid, but it was still an eye-opener.

Hell, just look at the Genesis. In the epic battle between Sega and Nintendo, what the Genesis lacked in audio samples it more than made up for graphically. Ecco The Dolphin, Vectorman, Pulseman, Virtua Racing, and anything made by Treasure. Hell, even Bloodlines did more than what many people considered the Genesis capable of. And Comix Zone was eye-candy. All this with a very limited palette.

And since I'm a fan of the Sega Saturn, which most gamers of my generation and of the younger generation seem to typically diss on, I'm inclined to mistrust any criticism of a game console or of games that try to simulate games on an older console unless hard examples are given. In defense of the FC, the NES sucked in comparison to the FC. And in defense of the Saturn, I liked its games more than any game on the Dreamcast.

Don't misunderstand -- I believe that there are things in MM8FC that wouldn't work on an NES and i have read a few things about it, such as it being made by different programmers than the ones who made MM7FC and how there are a lot of bugs in it. And I remember all the comments in its early days about getting rid of the intro and Duo's interlude and all that. But when people just say, "You can't do B because anyone who's done A can see not B," I take it with a grain of salt.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: uzo on April 17, 2011, 08:26:04 PM
Preaching to choir. San Sidera and myself were a leading force for debunking "NES CANT DO THAT!!11" against MM9. There's a lot of things the NES can do, and I have a good understanding of what and why. MM8FC tips the scales way too far though. They break even the most rudimentary rules, like the 4x4 palette limit.

There's a lot of things that are excusable in NES mimicking, such as the 64 sprite limit, flickering, etc. But there comes a point where you break these rules outright and it's very noticeable and ruins the illusion.

It all comes down to the developer. If they want to do a good job, they will.

MM7FC was made by a different team. A team that cared. MM8FC was a lazy team, riding off of the fame of MM7FC, and were unable to live up at even the slightest expectation of them.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 18, 2011, 09:51:50 PM
Fair enough. ... And we're still not talking about game intros, right?

I did see a MM8 intro that looked pretty NES-capable a while back, but wasn't by those guys. I also remember thinking while looking through the sprites for MM8FC on their site that there seemed to be too many people working on it and I do remember thinking "they're just trying to recreate the sprites, I don't see anything that shows they have a set palette anywhere".

And that's what I"m trying to avoide in my game. Like I said, when I started working on recoloring sprites, I went through it with the mindset that I would have a palette for the Belmont, a palette for hearts and blood skeletons, then two palettes per room to mess with for my enemies. I had completely forgotten about Items (0Fx0Dx22x36) ... which just happens to also be the same palette for bony enemies. Watching the PPU, it looks like Konami planned on more enemies in some areas than there were. I made a list of each palette used and so far I have 3 that I haven't pinpointed. One I could have sworn I saw used with ghouls/zombies. But anyway, I went back through to see what I had to work with and now I realize I have to recolor my sprites, especially my 6-color ones. Items having the same palette as skeletons is good news for my brass armored skeleton swordsman, but like I said, my plant girl will need a palette overhaul because I don't think I colored her in a way that would work with 1 default palette and 1 enemy palette. I don't think I even colored her for use with a background (or at least any background I was intending on using).

By the way, is the underlying background in an NES game from a specific palette range or can you specify any color from the NES palette? Need to figure out what stages I can use foregrounds with. Nighttime scenes are obviously feasible because I know black is a usable BGC. I remember reading specs on NES graphics and tile functions a while back, but forgot where.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: uzo on April 18, 2011, 11:03:59 PM
NES palettes:

Sprites:
4, 4 color palettes
Color 1 is ALWAYS invisible. It is your mask.

Backgrounds:
4, 4 color palettes
Color 1 is ALWAYS invisible. It is your mask.

Flush:
1 color

Each color in these palettes can be different. Each is selected from the standard NES palette. You have 25 color slots with all the palettes (not counting masks) and flush color combined.

---------------------------
How it works:

At the beginning of each frame, the ENTIRE screen is wiped to the FLUSH color. Typically the flush color is set to black.

Then the tiles and sprites are drawn on top of that solid color screen. Typically sprites are drawn above background tiles, but it doesn't have to be.

---------------------------
A common trick:
The flush color is black, and the invisible color of the tiles is what the black would have been if it was not invisible.




Now, go forth and make me proud.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 19, 2011, 01:30:07 AM
Was gonna work on my program some more today but work tuckered me out. ... Oh my god I sound old.

I gotta figure out which tiles and sprites need to be mirrored. The ROM is freaking annoying to work with. Most everything in it needs to be mirrored before use, but some things need to be flipped as well (the Dagger, for example) and some things don't need to be edited at all (mostly the labels they threw in, like "blood" and "old mansion" or something... just guessing on what they actually said). Some of the things in there (talking CV3) made me think they recycled parts of Simon's Quest. I'll go back through the game a little more carefully some day and see if I can pinpoint what the "blood" label actually goes to. But yeah. Gotta play the game. Look at the ROM. Rip a sprite/tile. Find said sprite/tile in the game. Mirror sprite/tile accordingly.  :'(
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 20, 2011, 01:09:41 AM
Before I get too far along with candles in my engine (have small hearts coming out of busted candles so far), I'm looking for some feedback on what people think might be the best way to handle candles. I posted this on GMC but figured I'd also ask the guys that actually know what I'm talking about and would understand the quandary.

Room creation control: Have the Room Creation event dictate what each candle will drop
Separate Candles Per Drop: Each item has its on candle object, such as obj_candle_smheart or obj_candle_axe
Controller Object: Similar to Room Creation control but with an object in the room guiding the candles
All-Call Script: Each candle calls a single script that has all the candle drops pre-ordained
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: X on April 20, 2011, 03:44:30 AM
The only thing you'll have to really work to figure out is the whip upgrade that you receive from candles. They aren't prefixed like hearts, weapons or moneybags. I've found that depending on how many hearts you collect after the first upgrade, it will determine when the next upgrade will appear. The same can be said with the double and triple shots. Depending on how many candles or enemies you kill with the sub-weapon will determine when you receive the next shot upgrade. I could be wrong but it seem the most likely scenario.

-X
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 20, 2011, 10:33:55 AM
Upgrades are hierarchical and guaranteed in some places, but yeah I noticed that candle thing once wihle playing through CV3. It was weird, don't know how it worked -- I went up the stairs in Clocktower, then backtracked downstairs. If I broke the candle at the bottom of the stairs with my whip, i got a heart. But if I threw a relic at it, I got a multiplier. I'm baffled on that one.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Aridale on April 20, 2011, 07:18:03 PM
the way i did candle drops is i made constants for each drop then in the creation code in the room i assign a droptype var to the constant i want that candle to drop then when its destroyed i use that var to work out whatever code needs to happen based on the constant and spawn that item at the candles location
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 20, 2011, 07:32:49 PM
In CV4, it's 10 enemies/candles destroyed with the subweapon means the next small heart candle or the next random drop from an enemy becomes a DoubleShot.  Same with the Triple Shot.

For the whip upgrades, if you're just starting (or recently died), then the first small heart candle becomes your first Whip Upgrade, and afterwards, you have to kill either three or five enemies/candles and then the next enemy drop or the next small heart candle becomes the second Whip Upgrade.

This is exactly the same rule for Alucard's Ball of Destruction magic upgrades.

EDIT:
Also, in the later games, if a candle is supposed to have a subweapon you already have, that candle instead has a large heart.
However, in CV1 and 3, it has a small heart instead (ripoff!). :P

This is also true if a breakable wall is supposed to have a double/triple shot but you already have your double/triple shot (cv1 has a small heart, cv3 has a large heart).
Similarly, there are some breakable walls that are only supposed to have large hearts, don't know why (just to be cool?).

You also have to calculate the alternate subweapon if you have a partner.

Trevor: Dagger, Axe, HolyWater, CrossBoomerang, PocketWatch
Grant:  Dagger, Axe, Dagger, Axe, Pocketwatch
Sypha: Flames Book, Flames Book, Ice Book, Thunder Book, Pocketwatch
Alucard: small heart, small heart, small heart, small heart, Pocketwatch (ripoff!)
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 20, 2011, 08:59:09 PM
Thanks Jorges. I'm not doing partners in my game, but I was trying to remember that pairing when I played as Sypha. So if someone wants to do partners, they can program that in themselves. .... Or I'll do it for them since now that I've thought about it, it won't be hard to do at all.
And yeah some walls were just hearts, I know. Like the first wall in the clocktower, the first wall right after the pendulums in the clcoktower. .... Dunno where else. I'm sure I haven't found ALL the walls. I don't use guides.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 20, 2011, 09:23:54 PM
You don't need to use guides.  There's a program called "ReVamp" that will load up the Castlevania III ROM and give you what each candle in the game has.  It also tells you enemy locations/fields, etc.

Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 24, 2011, 06:17:08 AM
Status Update:

I threw in a skeleton. He's comprised of two sprites: legs and head. The legs are the object, the head is drawn on top of the legs. Why? Because I was thinking it would be less memory-intensive that way. Sure, I have two sprites instead of 1, but those two sprites would require fewer pixels. ... That and the skeleton's icons line up in the GUI, so its mini-icon looks bigger when you expand the sprite directory. :D  

The skeleton paces 196 steps, turning around when at a wall or edge of a ledge just like in CV3. Yes, I counted. ... Okay, I used a video editor and just looked at the frame indexes.

The skeleton is destroyed upon contact with the whip or a relic.

The Belmont takes damage when coming in contact with the skeleton. If standing, ducking or jumping, he gets knocked back and starts flashing 2 frames into being knocked back. If he's on stairs, he flashes and pauses for 32 steps before progressing to the next step, also preventing his attacking in the process.

The Belmont dies if health drops below 1.


To Do Eventually: Adjust my stair-climbing code so the Belmont is at the correct sprite upon starting ascending stairs. I think I'm executing the sprite change too early.

Tomorrow is Easter, so I won't be programming much. Now that I work 40 hours a week and don't get to bring my laptop to work, this is going slowly. ... That and I keep getting distracted, making it take even longer. But I have you all in mind, which encourages me to keep pushing myself. I told some of my customers I'm programming a game and that there are people already waiting for my program so I need to get it done.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on April 25, 2011, 04:26:44 PM
I got some of your Leon Belmont frames done.
They're in that other thread.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on April 30, 2011, 06:03:19 PM
Hey question to Uzo (I think 'twas Uzo): In some games like CV3 flashing is done by cycling through all the palettes on a layer. In other games though I'm sure I saw flashing done by changing a palette entry directly. So my question is can you have both in a room in the same palette layer? Or is flashing by changing palette entries only for backgrounds or what? I had an enemy I was spriting that would require changing a single palette entry but since the chainwhip uses a cyclical flash, I don't know if that's possible.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: uzo on May 01, 2011, 12:05:46 AM
A sprite, or background tile has a palette 'link' so to speak. That link is basically a number, 1-4. The number corresponds to the palette you want to use. You can also change that number any time.

Flashing can work both ways. Either you change the palette you are linking the sprite to, or you change the link number. Be very careful about changing the palette itself, as it will effect any other sprites being drawn with it. Changing the palette link number is the more safe way in most cases. You have to decide which to use for each situation.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on May 01, 2011, 02:38:10 AM
I like having someone that knows technical stuff about the NES.

Another question:

I have a sprite I'm considering using for a mid-boss, but it's HUGE. I counted the sprites it would require and it's up to 8 at one point (really, i don't want to use sprites that are more than 4 across, so I'm looking through my sprite sheet carefully). So I was thinking of doing the obvious: Convert it to a background. Well, if I remove the walking animation, that's not a problem at all, but there is one concern I have:

What CAN I do with the Name Table? I know every 16x16 block on a standard NES cart must share the same palette entry. And I know from playing through CV3 that you can edit a single tile within that block. So does that mean I could make a mid-boss using nothing but background tiles that, if he only has 3 frames of animation, could be entirely animated by changing name table references? Or what about animating him across 6 frames entirely in the name table? ... Dunno how I'd handle collisions just yet. If a sprite's invisible, it doesn't count towards the sprite limit does it?
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: uzo on May 01, 2011, 02:57:54 AM
Sprites can be 8x8 8x16 or 16x8. Under NES technical limits, you can't display more than 64 of these sprites art one time. I assume it just doesn't draw the remainder once 64 is reached.

As for backgrounds, you can theoretically have as many 'frames' as you want by changing the tile pattern. You have to be careful with this though. You can divide the screen up by displaying portions of the two name tables on the screen (horizontally divided only as far as I've seen). Like, for example, you can have the top half of the screen as one name table, and the bottom half as another. Just remember you CAN'T overlap the name tables, only split the screen up between them. Think of it like split screen.

In this case you're talking about having a completely flat ground level as one name table, while having another name table which you are sliding around and rewriting the values to simulate animation. Perfectly doable, just be very mindful of those limitations involved so it looks authentic.

Megaman has some good examples for their final fortress bosses. Go check a few out. The octopus mid-boss in Megaman 5's Wave Man stage is also another good example.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on May 02, 2011, 03:31:42 AM
Forget the rotating traps. I'll finish putting in the 2nd chain whip upgrade and maybe try to fix the stair climbing sprite issue tomorrow after work and then upload what I have done so far; that way I can get some feedback on what still needs to be added (I don't care about feedback for my code, I already know it's slow and messy but that's what happens when you take debugging super seriously). Better than keeping you all waiting.  I had plenty of time to work on it this weekend but i kept getting distracted by the TV. So all I got done was the stopwatch, most of the coding for the item drops (simple stuff), and cleaned up the skeleton's code by adding a parent for it. I'll have to comment some more lines of code and write up the info file too before I upload it. What's a good free site for hosting small files?
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Chernabogue on May 02, 2011, 07:01:19 AM
What's a good free site for hosting small files?
It depends on what you're really looking for, but Mediafire (http://www.mediafire.com/) is perfect for uplaoding and sharing stuff IMO.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Aridale on May 02, 2011, 11:39:44 AM
yeah mediafire is the best Ive found. Theyre gettin a slight bit worse with the ads but theyre still fast at startin DLs and they dont cap speed
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: Jorge D. Fuentes on May 02, 2011, 12:50:33 PM
Yeah I recommend Mediafire.  I've got all my music uploaded there.
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on May 03, 2011, 10:49:51 AM
Media Fire's being a bitch right now. So I had to use MegaUpload for the time being.

http://www.megaupload.com/?d=I17Z08T0 (http://www.megaupload.com/?d=I17Z08T0)

EDIT: MediaFire finally let me upload. So here's a mirror. You should use this one instead of the other one because I removed a commented code before uploading to MediaFire.

http://www.mediafire.com/?i3aw750l12cwia9 (http://www.mediafire.com/?i3aw750l12cwia9)
Title: Re: I made NES-style Castlevania Belmont for GameMaker! Yay!
Post by: TheouAegis on May 04, 2011, 10:08:58 PM
Bump. The post above this one has the MediaFire link to the alpha version of my file, yo! ... In case nobody noticed the edit.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on May 04, 2011, 11:56:07 PM
theres an error when duck whipping with the morning star. Its still the morning star but its really short
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 05, 2011, 02:46:19 AM
Wtf? I made sure I added that.... Oh crap I know what I did! I used the wrong column! HAHAHA d'oh!  Thanks for pointing that out. I'll fix it for my next release, which will just be a few enemies and maybe I'll get a room or two in there. I'm planning on adding the following rooms (as samples):

Room with stairs leading up
Room with stairs leading down (naturally follows from room with stairs leading up)
Room with a door
Room that scrolls up as you move up (Clocktower beginning)
Room that scrolls up on its own (CV3 Dracula's Gate tower)
Room that scrolls down as you move down (CV3 Clocktower after beating Grant)
Room that scrolls down on its own (CV3 Dracula's Clocktower)

Edit: oh, I still had to alter some code for the whip I guess. I forgot ever doing that for the standing whip. Was just one line.  :P
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 10, 2011, 07:41:58 AM
Great work so far. I may have no choice but to use your engine just to save myself a lot of time in the creation of my project.
Looking forward to seeing your progress. ^__^

Edit: Alright. Tried it out and I have to say it's pretty damn awesome! Feels very much like the original NES version of the game. The only thing I saw that seemed off at all was that the sub-weapons all disappear when they hit candles & fire-stands. Only the knife should have this behavior, not the axe or cross. I did run into the whip glitch when jumping from a long distance. Also your debug code had the watch cycle to 'Dagger' instead of 'Knife' which breaks the spacebar's functionality. Other than that the mechanics seem spot on. Huzzah!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 11, 2011, 11:07:27 PM
Oh thanks for pointing out the relic glitch. I thought I had coded it for just the Dagger but must have missed a second reference. I'll get that taken care of.

BTW There is one MAJOR (i.e. game-breaking) bug in that version concerning Trevor's jumping and moving. It's fixed now, kinda, at a minor cost (took me a long time to figure out what was causing it). If you want, try to find the bug. ... And maybe you'll find one I haven't found yet in the process!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 11, 2011, 11:49:22 PM
I only get a black screen when I try to play.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: OdenAndEvil on May 12, 2011, 04:01:02 PM
way to go! Coming out a castlevania 4 homebrew for nes? ;)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 12, 2011, 06:32:50 PM
That would essentially be a demake of a remake. LOL ^__^
I'm sorta doing that with my "Castlevania: The Demon Castle" retro game, but I'm combining all the stage elements from all 4 distinct remakes of CV1. And, yes, I'm planning on including the features of the games too which really just amounts to adding those from SCV4 + sub-weapons from the other games. It'll get done way faster with TheouAegis' engine under the hood too. ^__^

Although, I imagine all sorts of interesting things could come out of this engine once it's done. I always wanted to make a version of CV2 with a standard CV1/CV3 engine. I suppose I could have just hacked CV3, but I didn't ever feel like dealing with ASM. A remake of Castlevania Quest with a more retro feel might be nice. Not to mention a version of Dracula's Shadow with better graphics would be nice. no offense to the creator of said game, but the Belmonts in it look like they were put through the devil's meat grinder along with a box of ugly sticks after having been beaten to death with same said sticks. Hell, I'd even want to make an upgrade to CV3 with all the censored content and a better Alucard and a magic system. The possibilities are endless, though. Brand new retro style CV titles could be made just as easily as de-makes of existing games. Could you imagine a kick ass retro/-ish 1999 game made by us, the fans? Or how about de-make of SotN with classic Alucard?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 12, 2011, 09:31:59 PM
Jorges, do you have GM8?
Although it shouldn't matter cuz the first room in the demo only has a room_goto or whatever. ... Which I don't think uses any code new to GM8. I'll check on it.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 13, 2011, 02:01:46 AM
I'm using GM8 and I had no issues.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 13, 2011, 02:13:54 AM
I have Game Maker 8, yes.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 14, 2011, 04:35:59 AM
If at first you don't succeed, try try try again? Don't know what else to say.

My creativity is waning this week. Having issues programming quickly and well. For some reason the code for my bat was causing serious bugs. I think controllers are object-based, so I'm going to build it as such. As in, if the controller object is within the view, create a bat or Medusa head at the edge of the screen. And then I get sleepy and put the whole project on hold for the day.  :-[
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 20, 2011, 12:04:43 AM
That sounds about right. I think I'm gonna start tinkering with creating enemies for your engine. If you'd like I can send their resource files to you as I go along.

Edit: Found another bug. Rapid button presses seem to launch up to 2 of the current weapon during one animation sequence.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 20, 2011, 02:41:29 PM
I'll look into that. ... Just how rapid?

There were actually quite a few attack bugs in that which i've been trying to work out. And this week had some weird bug where if the visual fx was miscoded in whip by improperly tagging a variable, rather than getting an uninitialized variable error, the entire conditional would be ignored regardless if there was any other code inside the conditional. Once I gave the variable the proper address, everything went back to normal. Well, almost everything. I did something to the enemy parent to stop the skeleton from pacing properly (I think I added a faulty conditional).

And I think I still have a bug where getting hit inside a ledge causes Trevor to get stuck inside the ledge (he can jump out, but that shouldn't be happening at all), which to date has been my biggest headache. I resized Trevor's bounding box back down to his eyes to prevent him from being hit by enemies above him. However, such collisions did in fact occur in CV3 with some enemies, so I will need to definitely solve the in-ledge collision bug.

Wait until I release v0.02 tonight (probably around 9pm Pacific Standard Time), since the enemy parent has been coded and has much more control over enemies than in my first release. ... You'll also see how slow I've been to code lately. It has a few major bug fixes, a nearly-complete Bat and Bat Controller (untested), an incomplete Medusa Head and Medusa Head Controller (both untested), and a few miscellaneous fixes such as some conditional branching to hopefully ease off on memory requirements. Oh, and the chain whip works now too.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 21, 2011, 01:24:58 AM
Sounds like you've been busy. The sub-weapon things seems to happen if you tap the key pretty fast.
I just upgraded to GM8.1, is that what you're using or do you still have 8.0?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 21, 2011, 09:25:10 AM
I'm using 8.0. I've read there are some issues with 8.1 that I don't want to deal with.

I fixed the relic attack bug. At first i thought it was item_multi doing what it was supposed to, but then I set item_multi=0 (was originally 2) and the bug was still there, so I tweaked the code to prevent that and to also slow down the rate between throwing and whipping, since in the initial release you could throw a dagger then immediately whip (now there is a slight delay based on Trevor's sprite, didn't waste any alarms).

Fixed a couple other bugs, that's why it hasn't been released by 9pm like I said. I had added an extra function to line_collide() but forgot to use it, so Trevor getting hit caused lots of bugs. Fixed that, though. And now for some damn reason, I had fixed enemies not dying by whip, but once again they don't die by whip and now the whip hit effect is executed twice. I'm glad I caught that double-hit bug now, since that will be important when I get to making armored knights and bosses, but I don't know why enemies won't die by whip anymore. The code is nearly identical to relic collision code and that works just fine. So it will be a couple more hours until I release it. When I finally do, take a look through the prt_enemy object, since all non-boss enemies will use that, ideally.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 21, 2011, 03:56:04 PM
Sounds like a plan. I'll be waiting to check it out.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: darkmanx_429 on May 21, 2011, 04:42:52 PM
Does anyone have a thread for experience with Multimedia Fusion 2?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on May 21, 2011, 08:40:20 PM
I tried messin with MMF once... it looked more like it was for power point than makin games. Dunno how ppl have managed to make full games with it
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 22, 2011, 01:33:51 PM
Version 0.02 has been uploaded. The link has been updated in the first post, but here it is also:

Castlevania Engine 0.02a (http://www.mediafire.com/?l1h8z0569qygsrl)

Bats and Medusa heads work pretty much as they're supposed to. I still have to work out the deactivation area for the controllers. There is an empty parent object prt_enemy_pacer, which simply calls prt_enemy, so I may remove it in later versions depending on how I decide to handle deactivations. I have to do some more measurements of the source material. No significant changes are planned for prt_enemy object, but some variables may become obsolete in later versions, but if that happens it will be easy to compensate for the missing variables, so don't worry too much about that.

You'll also notice that I started using fractional movement in the timelines. The thing to remember is the smaller step goes first. So for example, if an enemy moves: [2,2,1,2,2,2,1,2,1,1,2], the correct translation would be [2,2,7/4,3/2,4/3] ... I think. You'd have to test it in slow motion. I try to avoid counting more than 3 steps.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 22, 2011, 04:55:41 PM
I still only get a rectangular box, with no gameplay to speak of. :(
See enclosed pic.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 22, 2011, 09:43:56 PM
Why aren't you running the GMK in Game Maker and then testing it through there?

I'll test the runtime, but that would imply a GM error, not my error.

EDIT: The executable worked just fine for me. You aren't trying to simply rename the file from .gmk to .exe are you?

I did notice one error just now in my program: if hit and bumped back toward a ledge, Trevor ends up in the ledge. Implies a sprite error. I'll have to check my bounding boxes.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 22, 2011, 10:16:18 PM
Do any other GM games give you the same problem?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 22, 2011, 11:07:20 PM
Update on that weird glitch I noticed in the post above, although it wasn't weird back then. After Trevor dies from taking too much damage, when the room resets, anytime he gets knocked back, he gets placed 3 or 4 pixels further back after he lands regardless of a wall being there.

Anyone have any ideas what would cause that? I'll ask around GMC too.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 23, 2011, 12:32:00 AM
Why aren't you running the GMK in Game Maker and then testing it through there?

I'll test the runtime, but that would imply a GM error, not my error.

EDIT: The executable worked just fine for me. You aren't trying to simply rename the file from .gmk to .exe are you?

I did notice one error just now in my program: if hit and bumped back toward a ledge, Trevor ends up in the ledge. Implies a sprite error. I'll have to check my bounding boxes.

I'm running the .exe that you posted.  It's got a red ball icon and says "TheouAegis Productions" and it's named cv_fcengine.exe
I also tried compiling a stand-alone EXE from my version of Game Maker.  No dice.
Lastly, I also tried running off of my Game Maker on debug mode.  I still just get a black square.  See the enclosed image?

BTW I'm using Game Maker 8.0 Lite.  Don't know if that helps.


Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 23, 2011, 02:12:40 AM
WTF I never included any "exe" in my download. I only uploaded the "gmk" and the change log.

Granted, I do use GM8 Pro... Open the GMK in GameMaker and set the global game settings to show all errors. I must have disabled that or something if it's not even showing errors. But GM should tell you when you try to run it if anything that's Pro can't be used.

...
Btw if you want the pro version i can give it to you. :3

Another bug I noticed: Trevor doesn't die right if he's on the stairs when he actually dies. Worked before, but now I messed it up.

EDIT: In the next patch, I will fix lives and score as well as room0, which will become room_init. The variables score and lives will be set in room_init and when Trevor dies he will be transported to room_init. The variables mapX and mapY have been converted to globalvar and will be set throughout the course of the game, but are initialized in room_init. Just letting you guys know I'm aware of the bug that setting these variables in Trevor's object creates.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 23, 2011, 03:43:30 AM
There is no checkbox in my Global Game Settings to toggle all errors.
There is a Graphics tab, a "Other" tab, a "Loading" tab, and an "Info" tab.

The graphics tab is the one with the most options, here's what it's got:
-start in fullscreen mode
-scaling (radio button) fixed scale, and a field for percentage, a keep aspect ration (default), and full-scale
-interpolate colors between pixels (checked)
color outside room region
-allow the player to resize game window
-let the game window always stay on top
-don't draw a border in windowed mode (checked)
-don't show the buttons in the window caption (checked)
-display the cursor (checked)
-freeze the game when the form loses focus (checked)
-disable screensavers & power saving actions (checked)

The "Other" tab has:
-Let ESC end the game (checked)
--Treat the close button as ESC key (checked)
-Let F1 show the game information (checked)
-Let F4 switch between screen modes
-Let F5 save the game and F6 load a game
-Let F9 take a screenshot of the game (checked)

Loading tab:
-show your own image while loading
--make image partially transparent
--make translucent with alpha value (255)

Radio button for loading:
-no loading progress bar (chosen)
-default loading progress bar
-own loading progress bar
--scale progress bar image

Game Icon (red circle)
Game Identifier (900001)

An "Info" Tab.

So yeah... no "Show all errors" section anywhere in Global Game Settings.


Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on May 23, 2011, 03:54:26 AM
Change the global game settings -> Errors -> Display error messages
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 23, 2011, 04:42:33 AM
Funny, that showed up the second time I opened the file, but not the first time.  The other time it only had four tabs.

Anyway, here's my error:

_______________________________________ ____
EXECUTION ERROR in creation code of room room0
Error in code at line 9:
   global.face=font_add_sprite(font,vk_space,0,0);
               ^
at position 14: This function is only available in the Pro Edition.

----
Laaaaaaaaaaaaaame....
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on May 23, 2011, 11:47:23 AM
and there ya have it lol its a pro edition only editable file lol. So you can only play it as an exe unless you register GM. That... is fun times!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 23, 2011, 10:27:30 PM
font_add_sprite is a fucking Pro function? Dammit! I'll see what I can do about that. Unless someone wants to do me the favor of turning the CV3 font into a stand-alone font. For the time being, and also to see if there are any other pro functions i'm using, delete the global.face= line. It's in the creation event for room0. In the newest version (which you don't have yet), I made face a globalvar, but it still uses the pro function. Or is it the global declaration that's pro only? I read the help file just now and it doesn't say font_add_sprite() is a pro function.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 23, 2011, 10:35:31 PM
I might make the CV3 font into a true-type font at some point in the future, but I'm working on music tonight (yay) so that would have to wait.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 26, 2011, 01:14:54 AM
Found a little bit of a bug. Was standing all the way to the right of the test room next to the big wall and hitting the jump button did zilch. I'm guessing it's detecting the block on the upper right of Trevor's head. Also, I threw a knife at a candle that was half way off the screen and the knife disappeared before it made contact with the candle. Maybe give the weapons some leeway before you kill them for being off screen. Here's another thing... Putting a plat form near the top and Tossing an axe when Trevor is off screen makes him go into an animation fit that I think is probably caused by the sub-weapon being immediately destroyed.

By the way, could you explain to ma how the stage init goes about creating the block objects?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: uzo on May 26, 2011, 01:24:05 AM
I might make the CV3 font into a true-type font at some point in the future, but I'm working on music tonight (yay) so that would have to wait.


Didn't Anapan already do that?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 26, 2011, 01:27:12 AM
I don't know.
I know there's a CV3 Raster font out there, but I never saw a true-type font.
I can make one for CV3 and one for Akumajo Dracula (CV4), just for a goof.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 26, 2011, 01:56:49 AM
Sorry guys, I haven't done any programming at all so far this week. My life's been a mess these past few days. After my Rammstein concert I was popping pills in part for the post-headbang whiplash and in part just for recreation. But then my mom ran away from home for a couple days after a fight with my stepdad and I watched my aunt die in the hospital yesterday, so I've been trying to avoid turning to chemicals for comfort because that's what makes people junkies. ... In other words, I haven't been in the mood to program as of late.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: X on May 26, 2011, 02:50:19 AM
Sorry guys, I haven't done any programming at all so far this week. My life's been a mess these past few days. After my Rammstein concert I was popping pills in part for the post-headbang whiplash and in part just for recreation. But then my mom ran away from home for a couple days after a fight with my stepdad and I watched my aunt die in the hospital yesterday, so I've been trying to avoid turning to chemicals for comfort because that's what makes people junkies. ... In other words, I haven't been in the mood to program as of late.

Yeah you sound like you need some serious R&R after all that unneeded drama. You don't want to end up with a light touch of PTSD  :P If you can find ways to help put your mind at ease then by all means: DO IT!

-X
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 26, 2011, 06:54:25 AM
Holy crap! My sympathies, dude. Hope things get better for you.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 29, 2011, 12:03:37 AM
Found a little bit of a bug. Was standing all the way to the right of the test room next to the big wall and hitting the jump button did zilch. I'm guessing it's detecting the block on the upper right of Trevor's head. Also, I threw a knife at a candle that was half way off the screen and the knife disappeared before it made contact with the candle. Maybe give the weapons some leeway before you kill them for being off screen. Here's another thing... Putting a plat form near the top and Tossing an axe when Trevor is off screen makes him go into an animation fit that I think is probably caused by the sub-weapon being immediately destroyed.

By the way, could you explain to ma how the stage init goes about creating the block objects?

I missed your post completely, Inccubus. I noticed the wall glitch last night myself and I've been working on it. I know how to fix it, but I have to be careful because what's causing that glitch is also preventing another glitch. I'm working out the cure-all for that.

I've fixed the candles so that they disappear when they're supposed to and they should proc with items and the whip when they should, although I'm still working.

I'll look into the axe issue. You're most likely right about the problem. It should be fixed automatically since I'm going to stop using instance_deactivate. It's a glitchy and unruly command that's not flexible enough for me.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 29, 2011, 11:32:08 PM
Cool. Looking forward to testing out your progress! ^__^
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on May 31, 2011, 12:10:08 AM
As an added bonus (ok, I got pissy and went off on a programming tangent), I added sprite clipping to the torches and am currently working on sprite clipping for the skeleton (WIP because for some reason it only works properly when image_xscale=1 although I have seen glimpses of it working for a split second when image_xscale=-1 and the sprite is completely off the screen).

If anyone thinks they can help me figure out sprite clipping for the skeleton, here's my problem posted on GMC:
http://gmc.yoyogames.com/index.php?showtopic=509386 (http://gmc.yoyogames.com/index.php?showtopic=509386)

EDIT: Just fixed it last night. Did some testing in debug mode and realized when it said the sprite_width was -18 (i had to pillow the sprites because of some weird bug in GameMaker) that it reversed everything on the sprite. It eventually occurred to me that the only thing not changing was the sprite's actual width, that is, sprite_width-sprite_width/2. So I changed it to draw_sprite_part_ext(sprite_index,-1,sprite_width/2*image_xscale,0,sprite_width,sprite_height,...,1) once I understood how the script works and that when image_xscale=-1, whatever pixels are at x=8 in the sprite are now at x=-8, but the "width" argument in the draw_sprite_part_ext function itself doesn't actually change, is just a reference point. Then I ran it, noticed how the new sprite lined up, and deduced the view orientation conditional for it. So now it works! ... Just wish I didn't have to pillow all my sprites.

Oh, and I just helped someone else make scrolling text using GM Lite :D  I'm sure there was a tutorial for it already, but I'm proud of myself for figuring it out... ... in under an hour. >_<

Also, although I'm not sure yet entirely, I'm considering having an early boss fight with Balore. Yeah, 2bpp Balore. Dunno how I'm going to pull that off quite yet with the 8-sprite/scanline limit, but it's just an idea for now. If anyone wants to make an NES-compatible Balore sprite/tile set (meaning most of him will have to be background tiles and the moving parts will be sprites since he's so big), let me know. I may need to change my story up a bit if he wouldn't be feasible. *looks at uzo* Basically, what I have in mind for him is Leon enters a church in a town overrun by zombies and the priest chastises him for unleashing the evil upon the rest of the land, then Balore busts through the wall. The priest runs away and Leon fights Balore. Something like that. Or if need be, Leon hops up to the roof of the church and fights Balore on the steeple while Balore moves side to side behind the steeple (this I know can be done as tiles if handled properly).
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 31, 2011, 10:27:30 PM
I've been mulling over the larger bosses in 8-bit style, but I decided it would just be better to ignore the per scan line limit on sprites especially since my games are built on a hypothetical cross between the NES and MSX. I really started thinking about it when I considered the inclusion of the giant stone golem from Haunted Castle.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 31, 2011, 10:34:54 PM
The way to do it would be to have the giant balore face fade in from the background like how Death's Skull does it in CV3, and then have two 'fist' sprites fall somewhere as if it were a BANG, then change it up by having them come in from the side like how Wily's Gamma Bot does it in MegaMan III.

The heroes can ride the fists up to where the face is and hit it in the eye or something.

But in order for that to work and look good, the background has to be pitch-black.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on May 31, 2011, 10:39:39 PM
That sounds like a great way to execute Balore, Jorge. I think you could get away with some basic BG tiles for broken bars or something; just along the top and bottom fringe of the screen.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Jorge D. Fuentes on May 31, 2011, 10:48:28 PM
Ha!  If you use bars you can get away with even more, as they can hide the huge sprite or maybe make you have two sets of smaller sprites.
I may draw you a concept tiles art for this, but I'd need to know your screen resolution for the game.  Is it like the NES (256x256 or 256x224)?

EDIT:  Here's some concept boss stage work for you.
NOTE: THE FISTS WERE JUST A QUICK PLACEHOLDER, I KNOW THEY LOOK TERRIBLE BUT THEY GET THE POINT ACCROSS! xD

Aaaanyway...
So in here, the little 8x8 spot where the eye lasers come out, would be the weak point.
I shrank and messed with the AoS Balore face sprite to give you the general idea.

(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fwww.inverteddungeon.com%2Fjorgefuentes%2Fimages3%2Fbaloretest01.png&hash=1fbaa4c30c85c9a80247d9cd349c237a88747183)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 01, 2011, 06:26:31 AM
That looks like a pretty damn good start!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 01, 2011, 09:09:07 PM
He even included Leon in the pic :D
A for effort
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 04, 2011, 01:06:38 AM
So yeah, the axe going off the screen and glitching Trevor issue is fixed more or less, but there is one issue I know exists but I'm having trouble capturing it so I can narrow down the scope of the bug: When Trevor whips at a bat, I swear there are times where the bat is dying BELOW the whip. I already gave it a narrow enough bounding box, I thought, but I could be wrong. If you can help me trace the bug, I'd appreciate it.

Oh, and I'm going over the bat movement again. It seemed off and in the timeline I had it moving with vspd=1/4 in a few cases, but looking back on it that was dumb of me (in trying to simplify timelines, I made them more complicated). So yeah, by next patch bats will move like they're supposed to hopefully.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 04, 2011, 01:29:33 AM
I'll see what I can come up with, but I don't recall any issues with the bat dying below the whip.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on June 04, 2011, 02:00:58 AM
if your usin precise collision and/or individual masks per image in the whip sprite it could be an xscale error. You can xscale a player sprite that works fine but when its somethin that needs to be wholly to one side of a centered player xscale -1 doesnt work its like this
P = Player

P------> xscale = 1
P<------ xscale = -1

Im pretty sure its a bug in GM but its so hard to actually prove I dont think its been brought up much. Basically just make a different set of sprites for the whips and mirror them then use them when the players xscale is -1

I fought with one of my systems for days tryin to figure this out before I finally just said fuck xscale flippin and made mirrored sprites instead. Then the next time I made a new engine again I encountered it again and remembered then just tried separate mirrored weapon sprites and it worked fine. I havent forgot again lol

Its hard to notice cause the sprite IMAGE flips fine with xscale -1 but the collision masks dont
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 04, 2011, 02:08:56 AM
Actually in GM8.1 what I see is that it seems like the bats are dying above the whip. Hmmm...

Edit: Kind an important thing I noticed about your system for automating the placement of ground objects. It only supports 16x16 blocks. I think it would be a better idea to convert it to use 8x8 blocks instead since CV on NES had them set up that way. Say, GM would be a lot better if it could attach basic collision code to tiles directly with out having to mask them with objects wouldn't it? I think I'll suggest that as an added feature.

Edit Again: Modified your room init script to support 8x8 blocks and made it more efficient by having stretch both x and y independently.
Here's the code:

Code: [Select]
var s;
var r;
for(i=0;i<=room_height/8;i+=1)
{
    for(j=0;j<=room_width/8;j+=1)
    {
        if tile_layer_find(999998,j*8,i*8)
        {
            if!collision_line((j-1)*8,i*8,j*8,i*8,prt_ground,0,1)
            {
                brick=instance_create(j*8,i*8,prt_ground);
                s=0;
                r=0;
                with(brick)
                {
                    while(tile_layer_find(999998,x+s*8,y))
                    {
                        image_xscale=s+1;
                        s+=1;
                    }
                    while(tile_layer_find(999998,x,y+r*8))
                    {
                        image_yscale=r+1;
                        r+=1;
                    }
                }
            }
        }
    }
}
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 06, 2011, 10:00:42 PM
The reason I set it to 16x16 is because floor tiles (the simple square ones) are always 16x16 in CV3.  The tiles themselves, graphically, are 8x8, that is true. However, since tiles are always arranged in 16x16 metatiles (NES limitation), it was faster and more sensible to set the script to work with 16x16 tiles. I have further modified the script in the version I'm working on to check the variable "orient" and shift the y-factor by 8 accordingly. This is because in CV3 levels that progress horizontally are offset 8 pixels (there's an 8-pixel row of solid black at the bottom of the screen that even stairs don't pass through); but in a vertically scrolling level, the tiles go all the way to the bottom. I haven't played CV1 in a long time. I'll download it again and take a look at it, then maybe make "universality" changes if I see fit.

But what's really pissing me off right now are those damned bats. I can't find the looping point in their movement patterns (they have two movement scripts, one for while hanging and one for when appearing off-screen). I also have to make my sprite clipping script work for bats too. So far it works for skeletons, candles and torches. (What is sprite clipping? NES sprites are 8x8, but many game sprites are 16x16 or 16x32. The NES will only draw a sprite if its origin at [0,0] is in view, so as a game sprite crosses the left border of the view, a 16x16 sprite becomes 8x16. I'm working on making this work for all sprites. Note: background tiles aren't affected by clipping.)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on June 07, 2011, 03:20:30 AM
the only difference between a tile and an object is that objects have the overhead of all the states (create step draw etc) thats the only difference. If you made tiles programmable theyd just be objects and as such be way slower. Theyre the way they are for a reason.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 07, 2011, 09:53:44 AM
@Theou: Castlevania 1 definitely uses collision detection in an 8x8 arrangement. They are defined by tile too. Have a look at the Stake editor for CV1 by Dan. When you construct meta-tiles certain 8x8 tiles are automatically set to have collision. The use of 16x16 meta-tiles isn't really a limitation, but rather a technique to save on storage space for the tile arrangement data for rooms in most NES games. With a big enough cart they could store this data by 8x8 tiles. Actually some games also use 4x4 meta-tile groups to further shrink tile data.

As far as the bats, aren't they two different objects? One for hanging and one for off-screen? Maybe you should treat them as such too since you seem to be trying to make this engine as close to the NES games as possible. Speaking of which, why program in the sprite clipping thing? I know that's how the NES did it, but wouldn't it be an improvement to fore go that oddity since GM draws them until they are completely off screen anyway? I don't think most people would notice if the sprites don't clip anymore.

@Aridale: I think they could make a simple system that doesn't make the tile a full-blown object that simply allows you to define a tile as solid. I'm sure we could program an algorithm by which the player object simply checks for the existence of tiles on a certain layer, much how TheouAgis' room init script works, and have the player object act as if there were a collision there dynamically. As a matter of fact isn't it the sprites that have the collision data? There's no reason why tiles can't have collision data too. I don't think that would slow things down terribly since it's the objects that process code and not the sprites or tiles. If anything the problem could be an explosion of RAM usage for storing the extra data for the tiles.At least that's what I think anyway.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 08, 2011, 01:11:31 AM
Make a backup of my current engine version and then, when I upload my enxt version, compare the two. Visually I guarantee you will notice a difference that will make it feel very retro.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 08, 2011, 03:18:52 AM
I have a back up already.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 08, 2011, 10:13:18 PM
I have one of the bat timelines fixed. I'm going to try to keep the bat sprite down to a 16x16 sprite rather than the 16x32 I've had it at recently. Will make bounding boxes cleaner. I gotta check out GM handles the offset of an additional 4 pixels though.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Claimh Solais on June 08, 2011, 11:52:04 PM
A quick question. How do you apply this to Game Maker? I'm a GM noob, so I really don't know what I'm doing. And is there a specific GM I need to use?

And if you've already posted it, feel free to derp me in the right direction. ^.^
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 09, 2011, 01:19:42 AM
8.0. Supposedly 8.0 pro. 8.1 may or may not work. I've heard 8.1 is derp. I say stick with 8.0, personally. I could also hook you up with the Pro version. I have no desire to upgrade to 8.1.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Claimh Solais on June 09, 2011, 01:48:32 AM
Hooking me up with Pro would be great. I somehow downloaded 8.0 Lite, dunno what that means.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on June 09, 2011, 02:35:32 AM
Lite is the standard version the free one. Pro is the paid one. And yes 8.1 is pretty buggy atm Id stick with 8
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 09, 2011, 08:12:44 AM
I haven't had any problems with 8.1 thus far. Just sayin'.

Just noticed something. Trevor won't jump if there is an 8x8 block positioned 16 pixels above his head. In other words there's an 8 pixel space, but he still won't jump.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 09, 2011, 11:14:02 PM
I'll try to recreate that, but I think you messed up on your map design if that happens. I think there should only ever be a 3 or 4 pixel gap over Trevor's head. Tiles were never placed in 8-pixel gaps in CV3. Trevor isn't supposed to jump if a block is 32 pixels above ground.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 10, 2011, 12:23:49 AM
This is me coming from the CV1/versatility point of view. In CV1 you can place 8x8 blocks and it would make your engine more versatile in general to allow it. Just a suggestion.

Also, if the blocks in CV3 are only ever in 16x16 configurations then there should never be less than a 16 pixel gap between Trevor and the ceiling, right?

BTW, shouldn't it be that Trevor can't jump if a block is directly over his head?

Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 10, 2011, 02:36:14 AM
Look at Trevor's sprite. There's a 3 pixel gap over his head. His sprite isn't 32 pixels high.

I'm working on a conditional to prevent that from happening. And that reminds me, I have to d/l CV1 still. Oh wait, I know something easier.

Ok I'm looking at the maps. Help me out here: where are the ground tiles laid out on an 8x8 grid? A stage at least would be nice. I'm looking at the Stage 6 Clocktower and the beginning map so far and both of those are aligned to a 16x16 grid.

Okay, I think maybe we have a misunderstanding and I think you may have a serious misunderstanding. When I'm talking about 16x16 tiles and being aligned to a 16x16 grid, I mean every block -- that is, every ground tile that serves to obstruct Trevor's vertical and/or horizontal movement -- is comprised of a 16x16 metatile comprised itself of four 8x8 tiles, with each metatile aligned to a 16x16 grid such that if at any time any two blocks occupy the same scanline, they share 16 scanlines, which means they're always aligned to a 16x16 grid. When designing your rooms, you can and should place tiles on an 8x8 grid, but always bear in mind that the block metatiles must align to a 16x16 grid (offset vertically by 8 pixels in horizontal rooms). Everything I'm seeing in the NES version of Castlevania 1 validates my explanation. Are you perhaps talking about MSX or Commodore Castlevanias instead?

Here is how a Castlevania map is designed:
The strictest map is a horizontal one, so we'll go over that one. A map must be 224 pixels high or 256 pixels wide. Since we're dealing with a horizontal map, we will limit ourselves to the 224px height and set our map length to a multiple of 16 larger than 256, such as 512 (yeah, I'm lazy). However, there is a trick we will want to use to make it simpler (in Game Maker). Set the room height to 240 pixels, which gives us an extra 16 pixels to work with. The status window is 40 pixels high, or 2.5 metatiles (a metatile is 16pixels x 16pixels). We will deal with that .5 later, but fill in the very top two rows in your room with a black box. In a horizontal room, the very bottom 8 pixels are solid black, so fill in the very last row of metatiles in your room with a black box. In between these black boxes you can design your map aligned easily and properly to a 16x16 grid. When your map is finished, make sure you're in the Tiles tab in the Room Editor and click the Shift Tiles button, then shift the tiles vertically +8. Do this with each tile layer (in my engine, you would need to shift 1000000 and 999998, but if you added layers you would need to shift them too). Then click on the Objects tab in the Room Editor and click the Shift Objects button, then shift the objects vertically +8. Now set the room height to 224 pixels and you're set! TIP: Don't set the room to 224 pixels until you're ready to release.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 10, 2011, 04:37:59 PM
The small 8x8 blocks underneath the first door inside the main hall that make up the right most wall are not aligned horizontally to a 16x16 grid.

Now I just double checked in both the Stake editor for CV1, and the ReVamp editor for CV3 and the metatiles or TSA's as they are called in those programs are not in fact made up of 4 8x8 tiles. They are in fact made of 16 8x8 tiles. The difference between CV1 and CV3 is that the collision data in CV1 is assigned to the pattern table allowing you to place them anywhere on an 8x8 grid. CV3 seems to use some wierd 16x16 metatile arrangement but only for the collision data. You can still place 8x8 tiles anywhere, but they aren't recognized as solid unless they're arranged into a standard block. I checked out the behavior of solid 8x8 tiles in CV1 and they work fine horizontally, but a little wierd vertically. If you place an 8x8 solid tile at an off height it freaks out when you land on them from above making Simon kind of slowly spasm forward until he falls off the tile. From below they work more or less fine not blocking Simon's jump even if the are at an off height, but they continue to process side collision even if Simon is in the middle of jumping through an adjacent one. So they aren't fully supported, but they are present and usable as walls. Now regardless of all that, alls I'm saying is putting in support for an 8x8 tile grid would make your engine far more versatile even if it isn't exactly like how CV3 did it. It would allow users to make SCV4 and CVC style stages too.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 10, 2011, 06:32:27 PM
I downloaded Stake and I see what you're saying, but your own post alone should have tipped you off that something was wrong. The reason Stake is set up in a 32x32 fashion is because CV1 stages were comprised of copy-and-paste 32x32 sections. By all means, go ahead and do that yourself, but the block tiles must always be aligned properly or else the game, not just my engine, will glitch. The fact of the matter remains you're still designing the room wrong if a block isn't placed at (0,0) or (16,16) in the TSA. A graphical glitch while running the game means your room is bugged, plain and simple.

I get what you're saying about making it more flexible and one of these days I might do that, but it doesn't change the fact:
Code: [Select]
     ##
      ##
##
##


########
########
This arrangement is a valid NES block arrangement in all CV games
Code: [Select]

      ##
      ##
##
##

########
########
This is not a valid arrangement. Period.

Even Rondo Of Blood holds to this rule of level design.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 10, 2011, 07:01:02 PM
Then everything is agreed, then.
How's the new version of the engine coming, BTW?
Smoothly, I hope.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 11, 2011, 12:52:27 AM
Slow and steady wins the race! .... I didn't take antibiotics today so I might be able to stay up later working on it. I passed out last night 5 minutes after booting up GM, then had to wake up for work.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on June 11, 2011, 03:10:13 AM
lol dont ya hate that. It sux gettin rdy to do somethin only to wake up an hour later and realize youve dozed off and not accomplished shit lol
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 12, 2011, 01:49:39 PM
LOL Yeah, that's a pain in the ass. ^___^
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: X on June 12, 2011, 05:07:40 PM
I didn't take antibiotics today so I might be able to stay up later working on it. I passed out last night 5 minutes after booting up GM, then had to wake up for work.

Personally I'd avoid antibiotics since they just as much damage to your body as they would to your current affliction.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 12, 2011, 08:52:36 PM
I had a bad cavity, was on the antibiotics to keep the infection from worsening. Was just a 1 week prescription, which I didn't even finish because they wanted me to take it even while I was asleep.

These damn bats are pissing me off!
I have the normal bat timeline done, from when the bat flies in from off-screen, but the timeline for the sleeping bat has no cycle I can find! I used ReVamp to put a bat near the door of the first stage then I recorded Trevor waking the bat up and running the whole length of the stage chasing after the bat (the bat's a tad faster than Trevor). I so far have 364 frames of movement recorded. I plotted the bat's movement as I had written it down in Excel and discerned that indeed I was seemingly plotting the movement correctly: The sleeping bat has a cyclical movement of 101 frames, meaning every 101 frames it will be at the very same height on what should be more or less the same path, meaning if it is moving up at point A it will also be moving up 101 frames later at point B. But the bloody increments aren't the same!At point A he might have a vertical speed of 1/2 but at point B he'll have a vertical speed of 2/3. I've already plotted 3 cycles and haven't seen a pattern! .... I know logically that doesn't sound right, and to be honest I only compared a couple coordinates against the cycle. I mean, logically if there's a cycle then there's a pattern, right? Something's wrong. :(
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 15, 2011, 10:36:15 AM
Finally figured out what caused you to throw multiple relics. Now I have to go clean up all the extra conditionals I added. You weren't throwing multiple relics, you were actually throwing the same one twice. I noticed this when throwing the Axe because when the second one would appear, the first one would disappear. Was a two-part bug I finally got fixed. Still have a couple gamebreakers I'm working out before next patch. Sorry.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 15, 2011, 02:28:28 PM
Awesome. I'm sure it was a hassle tracking that one down and squashing it. By all means take your time getting the bugs out before the next release. I'm sure no one will mind it as this engine is a godsend for most of us fangame designers that haven't had time to actually make a really good engine. Thanks for all the effort you've put into this! ^___^

Edit: Not sure if I mentioned this before, but when I throw a tire iron and walk the opposite direction it dies when it reaches the edge of the view instead of changing direction. Also, it's supposed to reverse the animation when it changes direction.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 20, 2011, 02:03:05 AM
It didn't change animation when it reversed when I looked at it. I'll look at it again.

Edit: Don't let the cops catch you throwing tire irons.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 21, 2011, 12:15:43 AM
Don't worry, I have special dispensation to use Tire Irons for testing purposes! ^__^

I should probably have mentioned that I was looking at the CV1 tire iron, not the CV3 one.

BTW, just something for your consideration. After you've finished making this a perfect clone of CV3 how about programming in all the sub-weapons & whip forms from CV2 as well? I'm sure those wanting to do a CV2 based game would greatly appreciate that stuff already being integrated.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: X on June 21, 2011, 04:29:30 PM
Quote
BTW, just something for your consideration. After you've finished making this a perfect clone of CV3 how about programming in all the sub-weapons & whip forms from CV2 as well? I'm sure those wanting to do a CV2 based game would greatly appreciate that stuff already being integrated.

The Holy water from CV2 isn't all that different from it's CV1/CV3 counterpart. It just doesn't have the fireball graphics and is weak as hell. The dagger is pretty much the same deal but there are three of them with one being more stronger then the last. That and the flashy graphics of course  :) But doing things like the rebound diamond and the fire pillar will take some time to do no-doubt. I'd like to see these too.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on June 21, 2011, 09:36:09 PM
The diamond bounce is easy. It just moves in the opposite direction of how it hit
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 21, 2011, 09:58:22 PM
The CV2 versions of CV1/3 sub-weapons should be a snap to make from the existing sub-weapons with little effort, I think.
Knife --> Nerfed Knife, Silver Knife, Golden Knife, & Stake.
Holy Water --> Nerfed Holy Water, Holy Flame, & Garlic. (Note, I'd just turn the garlic into Bibuti anyway.)
Holy Cross --> Rebound Jewel
Stop Watch --> Invincibility Laurel & Healing Herb (X68K)

Hell, all the code for all the sub-weapon effects could be in the parent object and just a single variable could be used as a switch.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Mega Man Model T 101 on June 23, 2011, 11:24:27 PM
Hey TheouAegis, is it possible to use this engine with sprites like this?(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fwww.inverteddungeon.com%2Fjorgefuentes%2Fimages3%2Fgirlhunter-1-1.png&hash=2b10978547f6e95f4b76441b54e87958f926bf6c)

Just wondering if the size difference an animation lengths and such would make it an issue.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on June 24, 2011, 10:05:58 PM
Sorry for no update yet, I've uh...  ;) got me a girl

On the issue of sprite size limits, there are some issues I still have to work out which I will fix in the next patch. I would have forgotten about it if you hadn't asked that. In the currently released (which is very old now, I know) version, that sprite would be hella bugged as a hero, since some lines of code use precise calculations rather than variable measurements, such as the height of a ledge Belmont couldn't jump under (which is currently set to 48 pixels above Belmont's feet). This is an easy fix I just haven't gotten around to, which is simply replacing "base-48" with "base-sprite_height-16". There may be some more and I'll look for them this weekend or next week. I won't be working on the project at all July 1st-July 5th because I'll be down in California feeling up my girl.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on June 24, 2011, 11:57:36 PM
Have great time in California, dude! Hooray for boobies!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on July 04, 2011, 09:25:52 PM
Well, here's an update. My fiance -- yes, you read that right -- says I'm not allowed to program while we're apart until February (she's in nursing school down here in Cali until then). I swore to her that I wouldn't let my programming interfere... too much. So I may or may not be able to get a lot done with it. If the programming makes me too quiet or forgetful, I'm in deep shit.

I'll upload my latest version very soon.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: X on July 04, 2011, 10:55:11 PM
Quote
Well, here's an update. My fiance -- yes, you read that right -- says I'm not allowed to program while we're apart until February (she's in nursing school down here in Cali until then). I swore to her that I wouldn't let my programming interfere... too much. So I may or may not be able to get a lot done with it. If the programming makes me too quiet or forgetful, I'm in deep shit.

This doesn't sound like a 'sound' relationship to me. No-one, not even those you love have the right to tell you what you can and cannot do with you're own time. Because it's you're time, only you get to make that call. If programming and other constructive hobbies are what you love doing then your fiance is in the wrong and you should let her know this. You should let her know about how you feel when it comes to how you spend your time apart from her. And if she can't understand this then she's not the one for you. No offense to your future relationship or your girl there TheouAegis. But you should let her know where you stand in your life and that meaningful relationships are of an equally shared union where both respect the others time and hobbies.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Mega Man Model T 101 on July 05, 2011, 12:11:32 AM
I'm going to have to agree with X on this here. While I can undrestand not wanting someone to obesse and love another thing more than the one they are going to spend the rest of their life with, it's sounding like she doesn't actually love you, as want you to simply obsesse over her like a slave.

No offense to the woman, but she honestly doesn't sound like the kind of woman I'd like to be my girlfriend or fiance.(Anyone who thinks being a slave to a hot woman needs to be slapped.)

I'm not saying that one shouldn't make changes for the one they love, but it depends on just how extrame and downright insane the changes they demand are. Seriously, does she even know what sort of programming you do? Does she even know that you litterally were putting that aside for today to properly be with her?

It sounds creepy, wrong, nuts, on so many levels. And I'm saying this as a fellow man to another, I think you need a new girlfriend, but it's a take it or leave it situation. It is your own choice in what you do. We're just trying to give some advice. I hope this works out for you somehow.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on July 05, 2011, 01:21:39 AM
I as well, with all due respect to you both, but putting aside something you enjoy to appease the person you're with is wrong and unhealthy. The people you love should let you do what you love as long as that is done reasonably and safely. Never let your hobby take time away from your loved ones, but don't abandon it for them either. I tell you this not only as a fellow man, but as a fellow programmer who was married to a person that expected me to abandon my passion for 6 years. Again, no offense intended, but I cannot stay silent about something so close to me personally.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Claimh Solais on July 05, 2011, 08:58:41 AM
Guys. Maybe she meant she didn't want him doing it too much. It's a possibility.

Anyone think about that?

EDIT: Edited to word it better.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on July 05, 2011, 11:47:03 AM
dont go too hard on him guys it might just be a cop out way to not have to work on this anymore =P
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: X on July 05, 2011, 04:16:12 PM
Quote
Guys. Maybe she meant she didn't want him doing it too much. It's a possibility.

Anyone think about that?

It occurred to me, however anyone weather or not are a loved one, telling someone else what they can and cannot do that goes against their personal choices is in direct violation of the declaration of human rights. This is how I personally feel about it. Others may feel different or not really care.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Claimh Solais on July 06, 2011, 04:38:06 AM
It occurred to me, however anyone weather or not are a loved one, telling someone else what they can and cannot do that goes against their personal choices is in direct violation of the declaration of human rights. This is how I personally feel about it. Others may feel different or not really care.

What if she worded it incorrectly? Or what if TheouAegis worded it incorrectly (which I'm unsure about).

However, I doubt she meant any harm from it, and would apologize if she knew if this is how people would react to her saying that. That's just my guess, since I know jack shit about her. :P
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: X on July 06, 2011, 04:18:49 PM
Quote
What if she worded it incorrectly? Or what if TheouAegis worded it incorrectly (which I'm unsure about).

However, I doubt she meant any harm from it, and would apologize if she knew if this is how people would react to her saying that. That's just my guess, since I know jack shit about her.

Can't argue with that either.  :) We need to get TheouAegis to post again so we can get this thread back on track.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on July 07, 2011, 10:19:03 AM
Indeed. Worst case scenario, though, I'd be willing to continue his work.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on July 07, 2011, 11:55:25 AM
I thought about makin somethin like this but more like an all integrated system with lvl editor and stuff included. Then you basically just add graphics and you can make CV games. Then include a player exe so you can use it to have "standalone" games without the editors and stuff. Ive thought alot about it but itd be a shitload of work
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on July 07, 2011, 03:46:40 PM
Well this engine is a damn good start for such a project. Even the early version I'm working with has all the basics finished it just needs some tweaking.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on July 09, 2011, 01:20:04 AM
She let me work on it a little last night, but I fell asleep so didn't get a whole lot done. But yeah, she told me I could work on it a bit as long as I don't ignore her. We argued over it, so she relented a teensy bit.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Esco on July 09, 2011, 02:53:07 AM
She let me work on it a little last night, but I fell asleep so didn't get a whole lot done. But yeah, she told me I could work on it a bit as long as I don't ignore her. We argued over it, so she relented a teensy bit.

I will skip writing some politically correct BS like most people here did and just get to the point with you: man up.  Otherwise someone who knows how to act like a man will roll up, snatch your chick, and start doing it for you. Women only like BOYS (notice I didn't say men... no man would let this trash fly) that act like you are doing for so long, then they get bored and move on. :rollseyes:

It's one thing to only do something in moderation and not neglect your chick (if you don't already know to do this, again I say the same thing.... man up. You should know better).... it's another thing to let someone tell you what to do.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: darkmanx_429 on July 09, 2011, 06:04:10 PM
She let me work on it a little last night, but I fell asleep so didn't get a whole lot done. But yeah, she told me I could work on it a bit as long as I don't ignore her. We argued over it, so she relented a teensy bit.
Dude I am an 31, married for 3 years, in the military and also going to Game Design School full time. I will be finish in 5 quarters. My wife works and she knew I was passionate about video games when we met. When I am not working, 99% of the time I am doing my homework in front of a computer. I am either doing some digital art, or modeling, or learning a scripting language. When the brief opportunity comes up and I can relax or have a break, naturally I want to work on my game (here on the thread) or network and do that type of thing. Even if there is no time (when does really anyone have enough time) I make time for her and we do things together. The point I am trying to make we have never once "argued" over me doing my gaming thing because she knows that I am passionate about it and I am working hard to make a better life for us. That also means staying current with whatever new game design programs are out there. If she can't support you dude find someone else that does. No offense, but maybe she just isn't feelin you anymore and just using your programming thing as an excuse to piggie back on and leave. And just so you know my wife has two degree's and is a mortician. She did work at SOE for a year, but she is just a casual game player. It's not really her thing, like with me.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on July 16, 2011, 07:35:56 PM
I'm still working on it. Was recreating Wallachia Village, trying to get a working door (almost finished, having an issue with views), and then a room transition. Probably will throw in a Zombie. Sadly I have nowhere near as much done as i was hoping, but we already had this discussion...
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on July 21, 2011, 01:54:15 PM
Update: Got the door working now. It looks nice. For those of you who hate timelines, sorry, it uses a timeline again. And like my other codes, the code is spread out in multiple places. Tonight I hope to get vertical room transitions (climbing up or down stairs to the next area).

Still also trying to work out the vertical scrolling tiles issue that Dracula's Curse seemed able to handle simply because of name tables. I'm toying with two ideas so far to deal with how Dracula's Curse deleted 16 tiles from the room every 256 pixels: Either use two views as the player nears the x256 marks, or just shift all the tiles down 16 or 32 pixels depending on their location in the oom. Both have their drawbacks, though...
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on July 21, 2011, 06:48:30 PM
Is there any discernible reason why they would have done it that way? And to be honest, it seems like a waste of time to implement something the player would never see and the end user could do without. Seriously, why implement a feature that just seems to makes it more difficult to put a stage together for the end user? Most of your users won't even know about these missing tiles unless they ever tried to hack CV3. Just saying it seems like a waste of your talent to recreate something inherently inefficient.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Claimh Solais on July 21, 2011, 06:56:58 PM
As cool as it would be to mimic the NES CV games right down to the finer points, I'll have to agree with Inccubus in saying that, yeah, it's something that can be done without.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on July 21, 2011, 09:32:48 PM
thats what Ive been sayin since he started this project... Its pointless to try to exactly mimic an NES game with gamemaker because it could never ever ever be run on that console. Make it SEEM like it could be on the nes but use modern programming techniques and application. Dont make things just cause thats how the NES did it. The NES is almost 30 years old
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on July 21, 2011, 10:21:38 PM
Well this is for me more than any of you and that's what I want! That and if someone wants to build their game with 32x32 pixel TSAs, then that's what they'd need. I mean, if you want to recreate CV3 with its backgrounds intact, either you work with TSAs or try to place 100s of 8x8 tiles in a room. And in order to recreate the cathedral or clock tower with TSAs, you either need the game to auto-delete 16 pixels or double up the tile count.

And some things are meant to be drag-n-droppish, such as enemies and what not. To keep things small, I'm obviously not making multiple candles/torches/etc for each drop placement, so there will still need to be some user customization. But the doors are designed to be automatic. Enemies will be automatic (btw if someone knows what the drop ratios are for enemies, i'd appreciate the info). Belmont will be automatic, obviously. Rooms will require only minor customization (stage number if #-01, maybe candle drop specifics). It's just taking time cuz i don't think out what i'm doing ahead of time, just program it as i get an idea.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Claimh Solais on July 21, 2011, 11:46:41 PM
Well this is for me more than any of you and that's what I want!

Well, when you put it like that, then I can't argue with you. That's exactly what I do with my projects, so, yeah. If you wanna do it, then go for it. :)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Aridale on July 22, 2011, 01:01:44 AM
well thats all fine and good make it however you wanna make it but dont put it out there for other ppl to use as an "engine" when your only makin it to your own specific standards
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on July 22, 2011, 02:19:25 AM
Indeed. It's fine if you just want to do it like that for your own benefit. As a programmer I can understand that. However, I can guarantee once this is out there and you present it to people as a CV engine they are definitely not gonna be very enthusiastic about having to use TSAs when they can just build the maps quickly enough by placing their tiles in any size arrangement they choose. It isn't limited to 8x8 tiles. Having to build the TSAs out of the existing tile set is an extra step that people won't want to waste time on. But, of course this is from an end user point of view. I definitely appreciate the work your doing regardless. It saves me a bunch of time and effort even if I have to implement my own stuff into it. So thanks for making it.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: uzo on July 22, 2011, 05:09:49 PM
I have to agree the idea of adding that quirk in has absolutely no logical meaning behind it. CV3 used it as a work around because they couldn't do it easier. You can do it easier, so why?

It only hurts the potential users of your engine to make their own games. It benefits NO ONE, and the end user, the player, will never see the difference regardless of which you do.

Why hurt the potential developers, for something the players will never see the difference in? If anything, you should be making development easier, not harder.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Corpsecrank on July 22, 2011, 08:37:55 PM
Looks really accurate. I may have to make something with this since I already have an 8bit character sheet I made up a while back as well as some enemy sheets.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on July 23, 2011, 04:56:16 AM
It's actually very fast to make TSAs, in my opinion. Once I got used to the arrangement of my TSA sheet, I could recreate Wallachia Village quickly with little problem. Would take much longer in my opinion to build one tile at a time rather than pre-arranging the tiles and just building rooms 4 tiles at a time.

But whatever. Pray my girlfriend gets a job so I can spend more time on the program. She told me I could work on my program and now she's bitching that I don't pay attention to her when I'm programming. >_> Girl needs a job to fill her time.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on July 23, 2011, 11:22:35 AM
It's actually very fast to make TSAs, in my opinion. Once I got used to the arrangement of my TSA sheet, I could recreate Wallachia Village quickly with little problem. Would take much longer in my opinion to build one tile at a time rather than pre-arranging the tiles and just building rooms 4 tiles at a time.

I'm sure it works great for re-creating an NES game and you already know what the TSAs are. However, no one making an original game is gonna waste the extra time to plan out what their TSAs might be when they can just arrange their blocks right on the tile sheet and select any size block of graphics in the room editor. That's just my opinion of course. And believe me, I've made some hacks of CV1 & CV3 stages in their respective editors and there's nothing worse than getting stuck wishing you could ditch the TSAs just so you could get this one block in this one spot. And I just thought of this, there's nothing stopping people from simply making their tile sheets into blocks of TSAs on their own and setting it up appropriately in GM directly. And even then they'd still have to lay their ground tiles on a separate layer. I'm not saying not to do it if you want, but don't expect it to be a popular feature of the engine when GM already has a perfectly efficient interface for tiles that many users are already accustomed to. That said, I am looking forward to seing how you recreate the TSA system out of sheer, morbid curiosity.

But whatever. Pray my girlfriend gets a job so I can spend more time on the program. She told me I could work on my program and now she's bitching that I don't pay attention to her when I'm programming. >_> Girl needs a job to fill her time.

On a personal note, that's exactly what my ex-wife used to do to me. She'd bitch and complain that I never got any projects done, but the second I dedicated any time to it she got pissed that she didn't get enough attention.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on July 24, 2011, 02:57:37 AM
I'll add a second conditional to the stage_init() to allow also building on one tile layer.

ANyway, back to spending my time with the girl for tonight.
Title: Notice to Anyone Currently Using my Engine
Post by: TheouAegis on July 31, 2011, 12:11:41 AM
In the next version, the block tile layer will be changed from 999998 to 999990 because of my insistence on using Tile Square Assemblies for my maps. To make vertical rooms easier for me to handle, I freed up layers 999991 thru 999999, which means you will need to go through each of your rooms if you have any already designed, click on the TILES tab, select layer 999998, then click CHANGE and type in 999990. It's simple and shouldn't cause any problems. Just wanted to give you all a heads up since many of you might overlook the change notes and wonder why stage_init() starts giving errors.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on July 31, 2011, 02:42:00 AM
Got it, I'll keep that in mind. I only have the two rooms done so it shouldn't be a big deal. I figured you might have to do something like this so I've been working on other stuff in the mean time.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on August 23, 2011, 03:29:37 PM
I will release an updated patch soon, don't worry. I'm working out a couple kinks in my code for vertical stages. No, it has nothing to do with my TSA rules; my code handles that without issue (quite nicely, too! no noticable lag or restructuring!). There's just an issue in my stage scrolling code that's causing some chop, but I'm certain I spotted the issue while looking through my code last night. I'm also cleaning up Belmont's code to make editing the step event a little easier by compiling similar codes into scripts.

Anyway, I just wanted to post here because I think I forgot to mention in my last progress report that in order to accomodate those who will not use TSAs, I scripted stage_init() to search the room on a tile-by-tile basis at layer 1000000 (the default tile layer) and check it against the tilesheet. So if you have a tilesheet with the "solid block" tile at tilesheet coordinates [0,0] (top-left corner), it will place the block object over that tile. With some simple editing, you can have multiple "solid block" tiles in a tilesheet and check against each of them. This method negates the need for layer 999990, which is necessary for TSAs (actually it's not, but my current method for dealing with TSAs is only slow when stage_init() runs but not afterward since stage_init() deletes tile layer 999990 when it's done compiling the stage). Keep in mind when using this method that you must place tiles one at a time. You cannot select 4 tiles in the tilesheet while holding shift to place a tile block, as GameMaker treats tile blocks as one tile; or at least I think that's the case seeing as how when I ran in debug mode it wouldn't display the info for each tile, only the tile blocks.

Also, arrange doors in your tile sheets as follows:


 ____  ____   ____  ____
|    ||    | |    ||    |
|____||____| |____||____|
    ||
    ||
    ||
    ||

They can go anywhere in the tile sheet, but make sure the "open" tiles are immediately to the left of each door combo. In TSA terms, these should be [1x2] in size, or [4x8] tiles. Yes, this is a bit wasteful and jacks up the file size a tad, but it was the easiest way for me to program doors for all tile sets.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on August 23, 2011, 11:14:49 PM
Anyway, I just wanted to post here because I think I forgot to mention in my last progress report that in order to accomodate those who will not use TSAs, I scripted stage_init() to search the room on a tile-by-tile basis at layer 1000000 (the default tile layer) and check it against the tilesheet.

I'm curious how you did this 'cause I was gonna do it myself, but never got around to and have left it to the side for now.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on August 24, 2011, 10:11:08 PM
As I said before, I think in the Game Info if not here, tiles have their origins at (0,0) in the room. They also have their origins in the tile sheet. You can use tile_get_left() and tile_get_top() to check against the tile sheet. I will post the stage_init() script tonight.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on August 24, 2011, 10:49:13 PM
Cool. I'll keep an eye out for it.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on August 25, 2011, 06:16:31 PM
Code: [Select]
//Checks in the tile sheet if the tile is specified as a "solid" tile
//Expand this conditional for each "solid" tile in the tile sheet
        tile_id = tile_layer_find(1000000,xx*16,yy*16);
        if tile_id > -1 && !collision_line((xx)*16,yy*16,xx*16,yy*16,prt_ground,0,0)
        {
            if (tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
            {
                brick=instance_create(xx*16,yy*16,prt_ground);
                span=0;
                with(brick)
                {
                    tile_id=tile_layer_find(1000000,x+span*16,y);
                    while (tile_id>-1)
                    {
//Checks if adjacent tiles are "solid" tiles according to the tile sheet
                        if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                        {
                            image_xscale=span+1;
                            span+=1;
                            tile_id=tile_layer_find(1000000,x+span*16,y);
                        }
                        else tile_id=-1;
                    }
                    span=0;
                    tile_id=tile_layer_find(1000000,x,y+span*16);
                    while (tile_id>-1)
                    {
                        if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                        {
                            image_yscale=span+1;
                            span+=1;
                            tile_id=tile_layer_find(1000000,x,y+span*16);
                        }
                        else tile_id=-1;
                    }
                }
            }
        }

This is the "non-engine" format I guess. >_> You can look through it and see how I did everything. In this case, no tiles are deleted. This also includes the more efficient version of the block placer whereby the block object gets stretched out. Test it, make sure it works right. If you have suggestions, let me know. The code isn't "perfect" because I think I gave vertical checks priority over horizontal checks, since you're more likely to find vertically long walls. This code has should have little effect on stairs, although it just occurred to me that the following would be less efficient than my old code:


A  ■■■■■■■■     B   ■■■
  ■■■■■■■■■■■      ■■■■■■
■■■■■■■■■■■■■      ■■■■■■■■


In A, it would create 7 blocks I think. In B, I think it would create 4 blocks. In both cases, the old code would have made 3 blocks. ... I think. I need to test that out. I could be wrong and it could work just fine as is, maybe. {EDIT: Actually, as the code is now, it works fine in both cases with no change in the number of block objects created, however the objects would overlap in the primary corner, which may just be wasteful or it may also create future bugs.} Also, in my code, it creates overlapping blocks. Also, in cases where you have niches in a wall on the right-hand side, this would make the niche solid too. So yes, there are still some glitches in my "efficient" version, although for the MOST part it is more efficient.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on August 25, 2011, 08:57:47 PM
Yeah, I ran into similar problems when I was messing with the old code before. In particular it would either refuse to make the upper right block if I had an upside-down "L" pattern set up or fill it up as if it was box the size of the two arms of the upside-down "L".
I'll have a look at the new code and see what I can come up with. Thanks!   ;D
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on August 26, 2011, 12:35:56 AM
I derped my code earlier. Here's a revised version (with the missing conditionals I forgot to include in my last post):

Code: [Select]
for(yy=0;yy<=room_height/16;yy+=1)
{
    for(xx=0;xx<=room_width/16;xx+=1)
    {
            tile_id = tile_layer_find(1000000,xx*16,yy*16);
            if tile_id && !collision_line(xx*16,yy*16,xx*16,yy*16+1,prt_ground,0,0)
            {
//Checks in the tile sheet if the tile is specified as a "solid" tile
//Expand this conditional for each "solid" tile in the tile sheet
                if (tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
                {
                    brick=instance_create(xx*16,yy*16,prt_ground);
                    span=0;
                    stretch=0;
                    with(brick)
//Checks if adjacent tiles are "solid" tiles according to the tile sheet
                    {
                        tile_id=tile_layer_find(1000000,x+span*16,y);
                        while (tile_id && !collision_line(x+span*16,y,x+span*16,y+1,prt_ground,0,1))
                        {
                            if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                            {
                                image_xscale=span+1;
                                stretch=span;
                                span+=1;
                                global.haha=span;
                                tile_id=tile_layer_find(1000000,x+span*16,y);
                            }
                            else tile_id=-1;
                        }
                        span=0;
                        tile_id=tile_layer_find(1000000,x,y+span*16);
                        tile_id2=tile_layer_find(1000000,x+stretch*16,y+span*16);
                        while(tile_id && tile_id2)
                        {
                            if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                            {
                                if tile_get_left(tile_id2)=0 && tile_get_top(tile_id2)=0
                                {
                                    image_yscale=span+1;
                                    span+=1;
                                    global.hehe=span;
                                    tile_id=tile_layer_find(1000000,x,y+span*16);
                                    tile_id2=tile_layer_find(1000000,x+stretch*16,y+span*16);
                                }
                                else tile_id2=-1;
                            }
                            else tile_id=-1;
                        }
                    }
                }
            }
        }
    }
}

I tested it a little more. There may still be some bugs, so let me know if you find any. Currently, there is one "bug" that I am not considering a bug per se because I coded it to allow said bug:

■■■■■
■□■■■
■□■■■
■■■■■

In this case, the empty squares would be rendered impassable. Unlike the previous code, however, the following would work correctly to my knowledge:

■■■■■
■■■■□
□■■■□
■■■■■

The above case should create 4 blocks with the empty spots left open. In other words, as long as the empty spots are on the far left or far right of a set of block tiles, they won't be covered with the block object.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on August 26, 2011, 02:30:47 AM
OK. Yoinked the new version.
As for your "bug", yeah, I really wouldn't call it a bug. Makes sense not to bother leaving empty spaces if they're surrounded by solid blocks on all sides.

I'll test the new routine in the morning and report back when I finish.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on August 26, 2011, 03:56:35 AM
My breakable wall script will eventually render holes in the wall moot, as it will probably force a rewrite of the block objects. Haven't messed with it much yet, but i have my worries that it may cause some slight hiccups in gameplay. Either way, we'll know when the time comes. For now, I'm still working out all the kinks in vertical scrolling stages and stair transitions (they work going up, but i'm having issues going down). THAT'S WHAT HE SAID!

Also, delete global.haha and global.hehe from the script. For starters, it would tip me off that you used my code and if u didn't give credit by final release... tsk tsk. And anyway, it was just for debugging purposes. I forgot to take them out when I posted the code for you.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on August 26, 2011, 05:19:27 AM
Got it.

About the breakable walls. Aren't those handled as separate objects in CV3? They are in CV1 as far as I can tell.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on August 26, 2011, 02:14:00 PM
There may be an object associated with them, but they're still part of the actual background in CV3. Hitting a breakable wall forces a change in the name table. It's actually the same with CV1. So in other words, yes there is an object involved, but the object itself alters the game's background tile data.

While I could in theory program my engine to run off tile collision entirely, working with objects is much easier. So if it comes down to it, I may have to convert breakable walls to strictly object-oriented to simplify things. But for now I will relish the challenge of keeping it as I had started it.
Title: EUREKA! The ultimate tile solidification script!
Post by: TheouAegis on September 17, 2011, 02:02:54 PM
I've done it! I think I've officially completed my tile solidification script that first debuted in its alpha form in the first release of my Dracula's Curse engine. The new script is vastly improved over the original in the following ways:

*Works with both TSAs and single-layer tile arrangements
*Large rectangular or square groups of tiles will be covered by one block
*Inaccessible holes deep inside walls will be treated as solid, which makes sense
*Gaps in ceilings will not be blocked off
*Complicated block or ceiling patterns are now economized/more efficient
*BLOCK COUNT REDUCED DRASTICALLY!

I am releasing this code outside of my engine because I'm sure it will be useful to a lot of people that use GameMaker. The TSA version is a bit of a misnomer, though. Really, it's just for any multilayered tiling. So the earliest releases of my Dracula's Curse engine used two layers (1000000 and 999998), so they would use the TSA version. Using the single-layer version requires a bit more work to use.

Here's a screencap of it in use. The blue represents covered areas. For those who are wondering, the blue shows up over the black areas too in the developmental stage.
(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fimg546.imageshack.us%2Fimg546%2F1725%2Fdemoscreen.png&hash=dc6735b12c567e0fb4b00990636c1fd77e650825)

TSA/Multi-layer Tile Version
Code: [Select]
//Shifts TSA tiles up every screen in vertical scrolling stages
//Use a new tile layer between 999981-999990 for every 256 pixels of height
if room_height>256
{               
    h=floor(room_height/256)-1;
    room_base-=16*h+27;
    with (all)
    {
        if y>256
        {
            y-=16*floor(y/256);
        }
    }
    repeat(h)
    {
        tile_layer_shift(1000000-h,0,-16*h);
        tile_layer_shift(999990-h,0,-16*h);
        h-=1;
    }
    for(i=1;i<10;i+=1)
    {
        tile_layer_depth(999990-i,999990);
        tile_layer_delete(999990-i);
    }
}

//Places prt_ground objects over each tile in layer 999990
for(yy=0;yy<=room_height/16;yy+=1)
{
    for(xx=0;xx<=room_width/16;xx+=1)
    {
        tile_id = tile_layer_find(999990,xx*16,yy*16);
        if tile_id
        {
            if!collision_line(xx*16,yy*16,xx*16+1,yy*16+1,prt_ground,0,0)
            {
                brick=instance_create(xx*16,yy*16,prt_ground);
                span=0;
                stretch=0;
                with(brick)
                {
                    tile_id=tile_layer_find(999990,x+span*16,y);
                    while (tile_id && !collision_line(x+span*16,y,x+span*16,y+1,prt_ground,0,1))
                    {
                        image_xscale=span+1;
                        stretch=span;
                        span+=1;
                        tile_id=tile_layer_find(999990,x+span*16,y);
                    }
                    span=0;
                    tile_id=tile_layer_find(999990,x,y+span*16);
                    tile_id2=tile_layer_find(999990,x+stretch*16,y+span*16);
                    while(tile_id && tile_id2)
                    {
                        image_yscale=span+1;
                        span+=1;
                        tile_id=tile_layer_find(999990,x,y+span*16);
                        tile_id2=tile_layer_find(999990,x+stretch*16,y+span*16);
                    }
//This section checks for gaps in ceilings with TSA tiling.
//Ideally, your stages should rarely need to actually use this script.

                    span-=1;
                    hole[0]=0;
                    for (i=1;i<stretch;i+=1)
                    {
                        hole[i]=0;
                        tile_id=tile_layer_find(999990,x+i*16,y+span*16);
                        if !tile_id
                        {
                            hole[i]=1;
                            hole[0]=1;
                        }
                    }
                    if hole[0]=1
                    {
                        while hole[0]=1
                        {
                            image_yscale-=1;
                            span-=1;
                            hole[999]=0;
                            for (i=1;i<stretch;i+=1)
                            {
                                tile_id=tile_layer_find(999990,x+i*16,y+span*16);
                                if !tile_id
                                {
                                    if hole[i]=1
                                        hole[999]=1;
                                }
                            }
                            if hole[999]=0
                                hole[0]=0;
                        }
                    }
                }
            }
        }
    }
}
tile_layer_delete(999990);

Single-Layer Tile Version
Code: [Select]
for(yy=0;yy<=room_height/16;yy+=1)
{
    for(xx=0;xx<=room_width/16;xx+=1)
    {
        tile_id = tile_layer_find(1000000,xx*16,yy*16);
        if tile_id && !collision_line(xx*16,yy*16,xx*16,yy*16+1,prt_ground,0,0)
        {
//Checks in the tile sheet if the tile is specified as a "solid" tile
//Expand this conditional for each "solid" tile in the tile sheet
            if (tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
            //||tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16
            {
                brick=instance_create(xx*16,yy*16,prt_ground);
                span=0;
                stretch=0;
                with(brick)
//Checks if adjacent tiles are "solid" tiles according to the tile sheet
                {
                    tile_id=tile_layer_find(1000000,x+span*16,y);
                    while (tile_id && !collision_line(x+span*16,y,x+span*16,y+1,prt_ground,0,1))
                    {
                        if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                        //||tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16
                        {
                            image_xscale=span+1;
                            stretch=span;
                            span+=1;
                            tile_id=tile_layer_find(1000000,x+span*16,y);
                        }
                        else tile_id=-1;
                    }
                    span=0;
                    tile_id=tile_layer_find(1000000,x,y+span*16);
                    tile_id2=tile_layer_find(1000000,x+stretch*16,y+span*16);
                    while(tile_id && tile_id2)
                    {
                        if tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0
                        //||tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16
                        {
                            if tile_get_left(tile_id2)=0 && tile_get_top(tile_id2)=0
                            //||tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16
                            {
                                image_yscale=span+1;
                                span+=1;
                                tile_id=tile_layer_find(1000000,x,y+span*16);
                                tile_id2=tile_layer_find(1000000,x+stretch*16,y+span*16);
                            }
                            else tile_id2=-1;
                        }
                        else tile_id=-1;
                    }
//This script checks for gaps in ceilings with single-layer tiling.
//Ideally, your stages should rarely need to actually use this script.

                    span-=1;
                    hole[0]=0;
                    for (i=1;i<stretch;i+=1)
                    {
                        hole[i]=0;
                        tile_id=tile_layer_find(1000000,x+i*16,y+span*16);
                        if  !tile_id ||
                        (
                            !(tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
                        //  &&!(tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16)
                        )
                        {
                            hole[i]=1;
                            hole[0]=1;
                        }
                    }
                    if hole[0]=1
                    {
                        while hole[0]=1
                        {
                            image_yscale-=1;
                            span-=1;
                            hole[999]=0;
                            for (i=1;i<stretch;i+=1)
                            {
                                tile_id=tile_layer_find(1000000,x+i*16,y+span*16);
                                if  !tile_id ||
                                (
                                    !(tile_get_left(tile_id)=0 && tile_get_top(tile_id)=0)
                                //  &&!(tile_get_left(tile_id)=0 && tile_get_top(tile_id)=16)
                                )
                                {
                                    if hole[i]=1
                                        hole[999]=1;
                                }
                            }
                            if hole[999]=0
                                hole[0]=0;
                        }
                    }
                }
            }
        }
    }
}

Note: In the single-layer version, the commented-out line is an example. tile_get_top() and tile_get_left() check the X and Y coordinates of the tile you want to be treated as a solid in the tile sheet. So in the script here, the default solid tiles would be at the very top-left corner of the tile sheet, and the commented sample would be right below it in the tile sheet. As I said, this version requires a bit more editing.

If you have any questions, just message me or Inccubus, since I've been kinda keeping him in the loop during development.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on September 17, 2011, 07:47:08 PM
Great work, dude!  ;D
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on October 10, 2011, 04:58:29 AM
I swear, 40% of my bugs I spend hours trying to fix are stupid typos, such as image_index instead of image_xscale, or timeline_index instead of timeline_position. Gotta say, they make for some interesting bugs when I make them, though.

Hang in there, the next alpha release will be soon.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on October 10, 2011, 04:44:52 PM
That happens. Logic error are always a bitch. Can't wait!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: TheouAegis on October 16, 2011, 12:32:59 AM
*cries*  :'(

One reason I haven't released my current version yet is because I'm trying to clean up my variables. I discovered today that I use too many variables. There are so many things I need to check in order to prevent certain bugs that I can think of, but then I forget which variable actually does what. Spent all day today (literally) trying to debug my Sword Skeleton, only to just now realize the following:

1) I used "hspd" to specify how fast the enemy moves horizontally
2) I used "dir" to specify what direction the enemy is actually moving (simplified my timelines this way)
3) I used "image_xscale" to change directions on enemies that don't need "dir"
4) I made a series of conditionals to check if a wall or pit is in front of an enemy
5) I based said conditionals on the enemy's hspd
6) ...

If that didn't set off any alarms, I guess I'm not alone. In other words, said conditionals worked as intended only when "dir" wasn't involved. In other words, the "if hspd<0" conditional was never met in the Sword Skeleton, which uses "dir", so all day long I've been trying to debug a script that wasn't bugged at all. It was doing exactly what I had told it to do. ... I just told it to do the wrong thing.

*tries to remember all the other right things he thought were wrong today and put them back how they were this morning*
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (File included now!)
Post by: Inccubus on October 18, 2011, 06:17:34 PM
Dude, what a pain in the ass. I've done things like that myself from time to time. Nothing worse than thinking something was wrong, changing it, and then realizing it was perfectly fine to begin with. Then you get that dreaded feeling that you're gonna spend the next hour putting it back, hopefully, the right way. And then at the end end of all that work you still have to figure out what was really causing the bug. But, at least by the end of it all you've learned about what not to do, which is just as useful and important as doing correctly the first time. ;)
Title: Alpha version 3 available for download and review!
Post by: TheouAegis on October 19, 2011, 11:10:44 PM
At Inccubus' insistence, I've uploaded alpha version 0.3 earlier than I wanted. It still has a lot of bugs because some things were hastily left unfinished or untested. With that said, it should go without further saying that you should use this at your own discretion. Hell, it even says that in the info file. Speaking of the info file, be sure to read the game info (in GM, it's the button with an "i" in a circle). It doesn't cover everything, though (as I said, Inccubus pushed me to upload what I have done so far and the info file isn't one of the things that's done).  Enemies are especially buggy and are my current WIP. Feel free to play around witht he ones I have done, though. Axe Knight has not been tested at all and zombies have no script to speak of. In later releases, they will have working scripts.

As always, if you are using this for a game that is already in production, BACK YOUR GAMES UP IN CASE ANY OF MY RELEASES MESSES UP YOUR CURRENT GAME!! I will not be held responsible for your ineptitude and inability to follow orders and experienced advice.

Version 0.3 alpha  Download from here (http://www.mediafire.com/?u4ki5kuc3ub4ju8)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on October 20, 2011, 05:21:22 AM
Groovy.  ;D
I'm gonna bite into this as soon as I'm back in front of my pc.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on October 21, 2011, 08:44:14 AM
Skimmed over your code for Trevor an I have to say it is infinitely better organized.
When I get a chance I'll look into the room transition stuff. Probably not until Saturday, though.
Title: Pre-v0.4a Script Update
Post by: TheouAegis on October 23, 2011, 05:03:00 PM
edit

Is there a delete post option? Or do I have to waste space like this?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on October 24, 2011, 05:48:31 PM
You gotta get Jorge to delete it. And while you're at it get him to delete this waste of space too. =P
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Jorge D. Fuentes on October 24, 2011, 11:03:13 PM
Delete what, now?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on October 25, 2011, 03:05:20 AM
I was posting a fix, then I realized it wasn't fixed, so I wanted to delete the post. But all I could do was delete the text in the post and leave something stupid like "edit" to hide my old false post.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on November 13, 2011, 06:53:12 PM
In case you haven't noticed my forum signature yet, I've started a developer's blog. This way I can just blog rather than working on my program. ... Wait, that's not how it works, is it?

Anyway, I'll just post a couple quick updates on the status and also make a request. To date, the only person kept in the loop has been Inccubus. It's only fair I let others in on it as well.


So yes, I do have a request. Enemies are a pain in the F'ing ass to script. Some things I'm having issues with that will need to be resolved eventually that I would like assistance with are:
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on November 14, 2011, 03:15:49 AM
I did a simple deactivation code for the enemies in my mod already. It should be like one line to make all enemies deactivate when outside a certain range of the view. I'll post it in the morning. I'm tired from volunteering at a ren faire today. Been on my feet for almost 12 hours. :P
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Belmont Stakes on November 19, 2011, 10:40:03 AM
So, there's been some issue, it would seem, about simulating stairs and other features in NES style Castlevania games in GameMaker and other frontends. You always see games where the heroes are able to jump onto and off of stairs, but pretty much never games where once you're on the stair you're stuck there. People complain that these kinds of Castlevania games are annoying and suck, but face it folks: they're realistic. If you try to jump on stairs like Castlevania's heroes have been able to do these days, you'd have to be a freaking gymnast to be able to handle the footwork and balance involved. And if you misjudge your leaps, you'll fall backward and become a paraplegic or fall forward and shatter your shins.

Current Version: 0.31 Alpha

    Download it here (http://www.mediafire.com/?u4ki5kuc3ub4ju8)

     Gymnast indeed. But when you think about it doesn't Romania produce great gymnasts?

I am more of a fan of Simon's animation in the original Castlevania than I am of him in the second game or Trevor in the third one. I don't like the way Trevor moves his feet or the sound that is made when whip is swung. All the same I want to see the finished product when this is done. And as always, thank you for your contributationington.
UPDATE LINK!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on November 27, 2011, 02:52:06 PM
My fiance and I broke up. It's been a month in the making and technically we broke up already a couple weeks ago, but she tried to lead me on that we weren't separated. But in my mind we already were and when I checked her Facebook profile, it was clear we already were in her mind as well. Then last night I was finally like, "Fuck you bitch, I'm sick of your bullshit. Fuck off and let me not be miserable for the first time in four months."

She was the biggest boost to this engine. I wasn't allowed to play League Of Legends without her, so I just sat at home waiting for her to come online and worked on this program a bit. Now I don't have to sit around waiting for her all the time! But that means I can go out with my friends now. And I'll probably spend my days sleeping the sorrows away. But I will try to work on the program whenever I can and try not to get distracted by video games.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Jorge D. Fuentes on November 27, 2011, 03:47:20 PM
Just don't rebound.  Focus your energies directly into something you love, and look to your friends for some good support.
We'll be here for you.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on November 27, 2011, 06:06:48 PM
Definitely. Rebounding sucks ass. Try to avoid it. Best thing you can do is worry about your own situation for a while and let the universe take care of the rest. Everything happens for a reason anyway.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on November 27, 2011, 08:08:49 PM
Yeah but those fucking reasons are driving me to drink and to eat close to 2 lbs. of food in a meal. Reasons fucking suck. ... It's a good thing i'm such a lightweight with alcohol.

-passes out on bed after 6 shots of whiskey-

I miss her... but i don't. ... How fucked up is that? That's royally fucked up! That's more fucked up than me getting my ass kicked time after time in Ruvas Forest cuz of those damn cyclopian floating pods!

woooo my eyes are dancing, and not very well i might add...
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on November 27, 2011, 09:05:43 PM
All that is perfectly normal, dude. The key is not to think about reasons, just accept that there are good reasons whether you know them or not. That will give you some bit of comfort. Don't be resentful, and don't take things personally. It's not easy, I know, believe me. Try to still be friends. Who knows. Maybe you were both not ready for such a serious relationship. Be glad it happened now and later on. There's nothing worse than getting married only to end up in divorce. I went through that and it sucks to the n'th degree. Hang in there, bud. You'll get through it and be stronger for it. I promise.

Edit: And as a rule of thumb. Never drink alone. Go out with your friends and do it together.
Title: Anyone else getting motion blur?
Post by: TheouAegis on December 04, 2011, 06:55:14 PM
Hey, can you guys check this and tell me if the sprites and background tiles get darker/blurred whenever they move. I know the status bar won't change (and I have some idea why), but I need to know if this is a bug in GM, a bug in my game, or a bug in my monitor.

http://www.mediafire.com/download.php?mumq95thmysl0mv (http://www.mediafire.com/download.php?mumq95thmysl0mv)

Stand-alone executable so anyone can test, not just GM users.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Mega Man Model T 101 on December 04, 2011, 07:28:16 PM
Seems alright to me. And I gotta say, it's pretty much exactly like the first stage in CV3. It's pretty much an exact replica of the emulator just about.
Title: Re: Anyone else getting motion blur?
Post by: ScionOfBalance on December 04, 2011, 10:25:21 PM
Hey, can you guys check this and tell me if the sprites and background tiles get darker/blurred whenever they move. I know the status bar won't change (and I have some idea why), but I need to know if this is a bug in GM, a bug in my game, or a bug in my monitor.

http://www.mediafire.com/download.php?mumq95thmysl0mv (http://www.mediafire.com/download.php?mumq95thmysl0mv)

Stand-alone executable so anyone can test, not just GM users.

It's fine in my pc.By the way,good work.As Mega Man Model T 101 said,it's a very well-made replica. ;)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on December 05, 2011, 03:24:46 AM
By the way, you can break the wall on the far right of the first room (after the door, where the skeletons are). If you can make it all the way to where the blocks are supposed to be, I may have set the drops for them, too. The wall in the first room though was just for debugging. Still have to redo the drops for the walls, since when I first scripted them I didn't realize a breakable block without anything above it has a different "origin" than a breakable block with another breakable block over it. But yeah, go ahead and try breaking the far right wall before you go up the stairs and walk through it. Not a magic trick, the wall is actually gone. And I designed the rooms with TSAs, which if you're one of the people that's actually looked at my stage_init() script, it's understandable that I'm proud of it.

Oh yeah, that reminds me. Inccubus, I'll need you to test my next "pre-release" to make sure breakable walls work with single-layer tiling, since all my rooms are dual-layer.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on December 05, 2011, 03:29:15 AM
1) Excellent job so far! The physics are perfect so far.
2) If you have a digital display then a bit of blurring is normal especially on older ones.
3) Send it to me and I'll test it right now. :)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on December 06, 2011, 03:07:43 AM
DAMN YOU PLUS SIGN!
DAMN YOU MINUS SIGN!

YOU CAN BOTH BURN IN HELL!!!!

...
Fixed the bug that made it so when you walked back from the church section to where the skeletons are, the view would start too far to the left. .... The signs were half the problem.

I'll send it tomorrow probably. I want to try to figure out why the hell the stair leading to rm_1_3 goes back to rm_1_1 instead. I swear, some of my bugs boggle my mind.

And eventually I'll draw up a map so I can remember which objects and which scripts do what...  :-X

EDIT: OMG it was such a noob glitch...  :-[ Used "border_bot." instead of "other." *facepalms*
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on December 06, 2011, 08:25:31 AM
LOL.  ;D

Logic errors are a bitch.  :P
Title: Which scheme looks better?
Post by: TheouAegis on January 20, 2012, 04:18:44 AM
Hopefully someone will make me a new tile set for my actual game, but for now for programming purposes I'll just use CV3's name entry and password screens. Rather than simply using what they already have, I wasted 2 hours recoloring the tiles. So really this has nothing to do with anything, but which color scheme for the name entry do you prefer? (I hated the original's blue bricks.)

(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fimg214.imageshack.us%2Fimg214%2F7904%2Fnameentry.png&hash=d67e2bc0535ec0b7f10910a858acbd3b48ad35ee)
(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fimg21.imageshack.us%2Fimg21%2F8654%2Fname2bl.png&hash=f8dbe3a9ea1ec24197755a4ae88c1f8144424aa1)

And for those interested, this was the recolor I did for the password screen:
(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fimg851.imageshack.us%2Fimg851%2F9061%2Fpasswordq.png&hash=e1e6efa54f13536632edc9792519b6366f82cbc1)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on January 20, 2012, 04:32:55 AM
Red bricks over purple hands down.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on January 20, 2012, 05:02:35 PM
Really? Gah!
*goes back to using red*
I liked the red at first too, but zoomed in it didn't seem as nice. And the more I looked at it, the dead ivy stood out better on the purple and the grey didn't seem to clash so much. But initially I went for the red too.

On that note, my name entry screen is done. Working on the password now.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: thernz on January 20, 2012, 10:38:46 PM
Purple. It's much more of a complementary color and looks smoother to look at imo.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on January 21, 2012, 10:16:57 AM
Shit, now we're tied (I can't be the breaker).
Now I need another opinion.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: VladCT on January 21, 2012, 10:48:39 AM
Let's see...purple looks better IMO.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on January 21, 2012, 12:15:30 PM
Poor Inccubus.

Purple it is. Although, as I said, this doesn't really much matter in the long run, probably.  :D
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Jorge D. Fuentes on January 21, 2012, 12:36:19 PM
I get a 'no hotlinking' error for those images, so I cannot opine.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Dark Nemesis on January 21, 2012, 02:27:27 PM
I can see them clearly and i like the red ones!!!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on January 21, 2012, 08:00:09 PM
Purple! You're all crazy!! :P
Try the red with darker ivy.
Out of curiosity, why not just use the original color?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on January 21, 2012, 11:57:45 PM
The original was too blue. Or do you mean the ivy color? I didn't like the green ivy cuz, well... ... well, cuz it's a haunted castle. Why would the ivy be green? Nothing's been cared for and i'm sure the demonic miasma permeating the castle compound could have been good for the soil and other plants.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on January 22, 2012, 07:24:01 AM
Except in the case of une's corpse weeds, and Venus Weeds, right?  ;D
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on January 26, 2012, 02:07:32 AM
Bleh

...We'll see. Maybe I'll make them green again.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on January 26, 2012, 04:53:36 AM
It's not a huge deal so, don't sweat it. ;)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on January 27, 2012, 02:07:22 PM
On that note, why would Corpse and Venus Weeds be green? They have no use for chlorophyll.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on January 28, 2012, 12:57:06 AM
On that note, why would Corpse and Venus Weeds be green? They have no use for chlorophyll.

Apparently they do, and would you say the same about pitcher plants and fly traps?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on January 28, 2012, 06:12:26 AM
Quote
The leaf blade is divided into two regions: a flat, heart-shaped photosynthesis-capable petiole, and a pair of terminal lobes hinged at the midrib, forming the trap which is the true leaf.

Well that answers your question. Answers mine hypthetically, but we don't know for sure that they require photosynthesis.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: thernz on January 28, 2012, 06:27:02 AM
But there is usually no sun where they sprout.
Title: Big News on the GMvania Blog!
Post by: TheouAegis on January 28, 2012, 07:04:11 PM
Yeah, they tend to be in caves or catacombs, don't they? ... Or libraries. ... WTF@the library.

On a happier note, big news posted to the GMvania Blog (http://gmvania.blogspot.com/2012/01/ive-made-some-progress-today-on-writing.html)! I might be a lazy fucker who doesn't finish what he starts and gets distracted easily, but I haven't given up on GMvania. I'm sure this latest news will pique some people's interest.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on January 28, 2012, 09:03:12 PM
Excellent! So, will this warrant a new update?

May I make a suggestion for your, blog? Yes? OK. Darken the background so it's easier to read. Thanks. :)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on January 28, 2012, 09:45:28 PM
Yeah, yeah. I know. I know. I hate it too.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on January 28, 2012, 10:08:08 PM
There, is that better? I know it is.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on January 29, 2012, 02:39:24 AM
Waaay better!! That's an interesting bit about the alarm variables. Could get a tiny bit hairy keeping track of them if overused, but definitely a neat trick.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on February 03, 2012, 06:18:35 PM
I was wrong about alarm[12]. It's alarm[0]. I think alarms cycle back around after alarm[11]. Oh well. I'm prone to mistakes. Live and learn. What doesn't kill me will leave me crippled.

I wasn't planning on uploading release 0.4a, but instead make it 0.35a because I hadn't actually completed much on it. However, if my room transition script passes the debugging, I'll upload my current workbench as 0.4a by Monday morning at the latest. I know I'm horrible about keeping deadlines, though, so don't keep your hopes up. Still, I've written up the guide and now I just have to copy the code from my guide into a demo script, debug it, then apply my guide to the current engine. I'm pretty confident it will work.

Things to look forward to in v0.4a
Name entry screen (keeping it old school, no typing allowed)
Password screen with algorithm check (you'll have to provide the algorithm)
Classicvania room transition
Working draw_clipped() script (not that anyone else cares)
Spiked Crusher
Simple Falling/Rising Platforms (not the ones that go up-and-down)
Trap Doors (no guarantee this will be beyond the workbench stage, though)
Possibly Floating Spikes (haven't checked their motion algorithm yet, may put these on hold)
A more complex code base to work with (I haven't pruned it much just yet)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on February 04, 2012, 09:42:54 AM
Sounds good.

BTW, I'm fixing to set up my own development blog soon. I'll be including a page for "Castlevania: The Demon Castle", so I'll link back to your blog from there if that's ok with you. ;)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on February 05, 2012, 07:36:50 PM
Ok the release will be delayed. The transition script is far from bug-free. For some reason the scrolling part is running at half speed and the player walking is done right but at 1x scaling. I may need to talk to torigara about this. I expected the scaling issues. I'll try to figure out the speed issue on my own.

Update:
Only two bugs to work out that I've found so far. The biggest problem with it right now is it seems to be running at 30 fps even though it's programmed based on 60 fps. For something that's supposed to increment in steps, I swear it looks like it's running in half-steps. The other bug is minor. For some weird reason Trevor is ending on the wrong image_index even though I ran the numbers and it should be working just fine.
Title: Need some more alpha testers
Post by: TheouAegis on February 06, 2012, 03:01:07 AM
Okay, this is pissing me off. I hope it's just my computer, but I seriously doubt it. And even if it is just my computer and not an issue with GameMaimer, it still pisses me off because I don't want the stupid bug to happen on ANYONE'S computer.

Anyway, here:
http://www.mediafire.com/download.php?7yy3ei5yg9hy767 (http://www.mediafire.com/download.php?7yy3ei5yg9hy767)

Run it. Go through the door. Tell me if the room transition is noticeably slower than the rest of the game. If you can't tell, go play Dracula's Curse or watch a speed run on YouTube to see how it's supposed to look. This piece of shit is hard-scripted frame by frame so there's no fucking reason in hell it should be running as slow as it is when I test it.

But yeah, that's the only issue with it that I've found so far. More updates in the future. Won't have anything up by Monday like I promised, though. But then, I did warn y'all.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: VladCT on February 06, 2012, 03:13:34 AM
Whoa, that's quite a hissy fit over a minor slowdown bug. :-X
And ironically, it is Monday over here. lol
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on February 06, 2012, 10:59:17 AM
Well when you go from 60 fps to 30 fps in the blink of an eye and have to sit through it multiple times in the game, that can be an issue.
Title: Classicvania Room Transition for GameMaker *HOT*
Post by: TheouAegis on February 07, 2012, 06:07:12 AM
  8)

It ain't what many of you have been looking for, but it's what many of you have been looking for.
...
 :-\

Drum roll, please!
 :o
 barumbarumbarump
 :o
barumbarumbarump

http://www.mediafire.com/?m79fdkbwzei5qii

It still runs at a bloody 30 fps, but you can compensate for it (for now) by just halving the duration. The guide included in the Info window explains in long-winded detail 90% of what I did.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on February 07, 2012, 02:23:50 PM
I tried out the exe and it seems to run perfectly compared to CV3 running on FCEU.
Honestly everything seems to be running perfectly.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Jorge D. Fuentes on February 07, 2012, 04:13:43 PM
_______________________________________ ____
EXECUTION ERROR in creation code of room room_init
In script global_init:
Error in code at line 25:
       face            =   font_add_sprite(font,vk_space,0,0);
                           ^
at position 26: This function is only available in the Pro Edition.
------------------------------------------------------------
These bullshit gimped programs fucking suck.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on February 07, 2012, 07:09:38 PM
You trying to run the GMK, Jorge? The script can actually be used in the LITE version but you will need to prescale all your sprites and fonts and stuff. The script will take quite a bit of editing but it can work in GM Lite.

I will PM you a GM8 Pro crack if you want. I know i should be supporting YoYo Games, but meh.

@Inccubs: Are you asying it ran at 60 fps on your computer during the door transition of the EXE file I had uploaded Sunday night? Or do you mean the EXE created using the GMK I uploaded last night? The EXE from Sunday night runs over 405 steps and on my laptop does so at 30 fps. The GMK is set to run over 203 steps, thus simulating 60fps on my computer, even though it's still 30 fps on my computer. If you are saying the EXE from Sunday is actually running at 60fps on your computer, then that's important to know. It means anyone using that transition will need to let the player choose between high-end or low-end computer performance and then adjust the transition speed accordingly.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on February 07, 2012, 09:24:20 PM
I mean the exe from Sunday. It looked perfect on my machine. (Recently upgraded BTW)
If that random 60 on the right side of the HUD is the frame counter, it never changed from 60 the entire time.

Edit: And as a matter of fact, the shortened script in the gmk runs way too fast. Also, the exe runs way smoother than CV3 running on FCEUX. Now if you'll excuse me I have to get back to work on my kilt.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on February 08, 2012, 02:36:40 AM
Well shit, then. That means it's as I said; anyone using my script should give an option for running the script on slower computers. Because obviously my laptop can't handle the room transition but your computer can. Seriously, the GMK runs at the right speed more or less on my computer, whereas the EXE runs too slow.

The irony of the EXE running smoother than CV3 on FCEUX is I based it off a video recording of CV3 in FCEUX.  :-\

The benefit to this script too is it does away with many of the scripts and functions I was using in v0.3 of my engine. Although some things I do have to recode now as a result of it. That's why I released this tech demo and not the whole engine because the engine will take some time to revise to work with the transition script.


MY SCRIPT MADE IT TO THE "STAFFER'S CHOICE" SUBFORUM ON GAME MAKER COMMUNITY!  ;D 8)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on February 22, 2012, 03:44:57 AM
Yay! Blog update! It might not be an engine update and I might be a month late in releasing my engine when I said I would  :-X but the reason I'm so late will be apparent when you check out my blog update.

 ;D
Title: Castlevania III Password Encryptor coming to a Dungeon near you!
Post by: TheouAegis on February 29, 2012, 01:37:33 PM
On a related note, last night I traced some RAM offsets and found most of what I need to make a Password Encryptor for CV3. The password encryption uses 7-to-9 variable bytes. Bytes $0000 and $0001 (and $0003 and $0004 when decrypting) are for temporary storage and get updated typically once every step (sometimes more often). Byte $001A simply increases by 1 each step, basically a 256-step counter; I think it's used in the encryption for some randomization element. Byte $002E is the most important; it holds the current stage. Byte $003A holds the current partner (set to -1/$FF when Trevor is alone). The trickiest byte to trace was $07F6, which holds the quest/difficulty. I still have yet to figure out what byte $078A is for; usually it's set to 0, although once I saw it set to 1 during the password encryption process and haven't been able to find code that sets it at any other time (except to 0), so maybe it's a dummy variable (and I'm the dummy).

What does all of this mean for you? Well, for starters, now you know what bytes to set in the Cheat Menu if you want to change any of those (btw byte $0035 is for Trevor's remaining lives, $003C is for his HP based on 1 bar per 4 HP, and $003D is the boss's HP). It also means when I'm done with this next side project (whose open source will be included in GMvania), you can enter any player name you want, set the difficulty, choose a partner, and pick a starting stage, then generate a password for it. You won't need to be called Okuda or Fujimoto or Akama ever again. ... But to my knowledge, only Help Me can have 10 starting lives, as that is handled by a separate subroutine. (But seeing as how I don't know what $078A is for, I could be wrong about that.)

I'm still a long way off from coding the decryptor, though. It's a little longer and messier. Since I'm still learning how to read Assembly, it's not easy.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on March 01, 2012, 04:10:17 AM
The hacking community will probably want that info on the password system in CV3, when you're done I encourage you to post that info at ROMHacking.net or Data Crystal or both.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on March 05, 2012, 02:10:54 PM
Sorry for lack of upload. I've had the password generator done for a while now, but when I got started on the decryption I realized some drawbacks to how GM works and changed my coding method. Wanting to keep things uniform, I decided to go back and recode the password generator to match the scripting method I'm using for the decryption. Unfortunately this means it will be harder to read and understand, but since the two are related in actual use, I decided it's best this way.

It also means I'll have to write up a guide on how to read my script because it's become so convoluted now. Seriously -- try scripting entirely with ds_grids instead of arrays and single variables like normal people. (Data Structures can be destroyed, making it more difficult for hackers to trace, or at least that's my opinion.)
Title: CV3 Encryption Code (kinda)
Post by: TheouAegis on March 07, 2012, 03:45:32 PM
Here's the encryption code for CV3 that I've written up. DOn't know if it works yet. because I haven't tested.

Code: [Select]
/*
This script encodes the password. It must be called at the start of the Game Over's
password screen. This script is NOT used in the password entry screen.
 
Use:    pw_encrypt()
 
Simple enough, huh? The following game variables are used:
 
ally    (the current ally, use -1 or $FF for no ally)
stage   (keep in mind some stages actually take up two values)
quest   (as in whether the player is on the 2nd Quest hard mode)
 
The decryption script uses an additional optional variable:
 
path    (no idea, but it is only set for two stages for Grant)
 
The player name is carried over from the name entry via the global array name[v].
 
Numerous bitwise operations based on 6502 Assembly are used here. They are located
in the "bitwise" script group. You shouldn't mess with these, just learn how to
use them. You can figure it out by looking through this messy code.
 
In order to alter this script for your own program, you must change pw_decrypt()
and cryptos() as well, since pw_decrypt checks what this script creates and
cryptos() contains the constants used to modify the variables.
 
The comment at the top is merely for keeping track of which cells correspond to
which Zero Page byte in the original assembly code. You can ignore them.
 
Grids are used for the variables and the displayed password because they can be
easily destroyed; this won't prevent hacking, but will make it slightly harder.
Same goes for the password itself, which is stored in a list. Also, grids offer
slightly more flexibility, even if they are more tedious to deal with and take
up more RAM when created, but this is freed up after one step.
 
This was coded almost straight from the original assembly code, with a few
minor shifts of variables. If it seems convoluted and repetetive, that is
because it is, but in some cases this is necessary. There are certain
functions used in the original code that are not available in GM, so the
bitwise scripts were created to simulate some features, namely the carry bit,
stored in the variable cbit. Understanding how cbit is used is important to
understanding how this script works.
*/
 
//A=0, X=1, Y=2, 00=3, 01=4, 04=5, 05=6, 88=7, 02=8, 03=9, 89=10, 08/0f=11/18
 
temp=ds_grid_create(12,1);
ds_grid_clear(temp,0);
pwt=ds_list_create();
ds_list_add(pwt,0);
pw=ds_grid_create(4,4);
var v01a;
v01a=irandom(255);
ally &= $FF;
 
//This subscript encrypts the player name and sums up the letters. Carry flag cleared.
for(ds_grid_set(temp,1,0,0);ds_grid_get(temp,1,0)<
8;ds_grid_add(temp,1,0,1))
{
    ds_grid_set(temp,0,0,name[ds_grid_get(temp,1,0)]
);
    adc(0,cryptos(0,ds_grid_get(temp,1,0)));
    cbit=0;
    adc(0,ds_grid_get(temp,0,0));
    sta(3);
}
cbit=1;
amp(0,$7);
sta(3);
 
ds_grid_set(temp,0,0,stage);
//Change $11 to the highest resumable stage value
cmp(0,$11)
if cbit ds_grid_set(temp,0,0,$11);
stage=ds_grid_get(temp,0,0);
lsr(a);                         //  These
ds_grid_set(temp,0,0,stage);    //  lines
lsr(0);                         //  simply
rol(3);                         //  shuffle
ds_grid_set(temp,0,0,v01a);     //  cbit
lsr(0);                         //  around
repeat(3) rol(3);               //  just for this line
ds_grid_set(temp,0,0,ally);
//This checks if Accumulator is positive. Anything greater than $80 is negative.
if ds_grid_get(temp,0,0)>=$80 or ds_grid_get(temp,0,0)<0 ds_grid_set(temp,0,0,0);
ora(0,0,3);
asl(0);
ora(0,quest);
sta(7);
ds_grid_set(temp,0,0,v01a);
lsr(0);
ds_grid_set(temp,5,0,$50+$50*cbit);
 
tma(7,8);
amp(8,$F0);
tma(7);
repeat(4) asl(0);
sta(9);
cbit=0;
adc(0,0,8);
sta(4);
tma(5);
eor(0,0,8);
sta(3);
tma(5);
eor(0,0,9);
cbit=0;
adc(0,0,3)
repeat(4) lsr(0);
ora(0,0,4);
cbit=0;
adc(0,stage);
sta(10);
 
tma(7,3);
for(ds_grid_set(temp,1,0,0);ds_grid_get(temp,1,0)<
8;ds_grid_add(temp,1,0,1))
{
    lsr(3);
    rol(11+ds_grid_get(temp,1,0));
    lsr(4);
    rol(11+ds_grid_get(temp,1,0));
}
cbit=1;
ds_grid_set(temp,2,0,stage);
lsr(2);
for(ds_grid_set(temp,1,0,2);ds_grid_get(temp,1,0)>
=0;ds_grid_add(temp,1,0,-1))
{
    ds_grid_set(temp,3,0,cryptos(1,ds_grid_get(temp,2,0)));
 
    amp(3,$C);
    repeat(2) lsr(3);
    ds_grid_set(temp,0,0,cryptos(1,ds_grid_get(temp,2,0)));
 
    amp(0,$30);
    ora(0,0,3);
    if cmp(0,cryptos(2,ds_grid_get(temp,1,0)))==0 break;
}
tma(1);
repeat(3) asl(0);
adc(0,0,1);
sta(2);
for(ds_grid_set(temp,1,0,0);ds_grid_get(temp,1,0)<
9;ds_grid_add(temp,1,0,1))
{
    ds_grid_set(temp,4,0,cryptos(3,ds_grid_get(temp,2,0)+1));
 
    amp(4,$30);
    ds_grid_set(temp,0,0,cryptos(3,ds_grid_get(temp,2,0)+1))
    amp(0,$3);
    repeat(2) asl(0);
    ora(0,0,4);
    ora(0,0,11+ds_grid_get(temp,1,0));
    ds_list_add(pwt,ds_grid_get(temp,0,0));
    ds_grid_add(temp,2,0,1);
}
cbit=1;
ds_grid_set(temp,2,0,stage);
lsr(2);
ds_list_replace(pwt,0,cryptos(1,ds_grid_get(temp,2,
0)));
ds_grid_destroy(temp);

It will make more sense once I upload it. ALl that matters is "pwt" stores the actual password. Another script will translate that password into the grid we all know and love from CV3 and CV4; that script is short and sweet and I already finished coding it before I typed out this monstrosity. All the unknown 3-letter scripts are just 6502 Assembly instructions in GML script because I had to incorporate the carry bit ("cbit" in the script) into certain basic functions.

If this exacerbates your senses, then don't even think about looking at the decryption script when I upload it. It's bad enough it'll be coded by me, but the original script was pages and pages of mind-numbing assembly with branches within branches. ... This script here was straightforward by comparison.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on March 11, 2012, 02:30:17 AM
Damn you, dollar sign!!
Damn you for making 50 into 80!
DAMN YOU TO HELL!!

*tries to solve all the bugs in the password generator*
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on March 12, 2012, 02:03:29 AM
Heh heh heh. :)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on April 08, 2012, 01:44:37 AM
Spring Cleaning time. Cleaning up the code a little (finding some wasted code, unneeded variables, redundancies). Thought I finally fixed my Sprite Clipping script (the one that nobody would probably ever use if I didn't include it by default). Made it work properly with enemy torsos. Then I set image_xscale to -1 and it's still bugged.

Sometimes I wonder if mirroring sprites is worth it. I know it cuts back heavily on resources, but when you look at all the noobie posts on GMC that make you think, "Wow noob, nice waste of resources there," and then see all the follow-up posts asking how to do something while using image_xscale, it kinda makes you wonder if the resource management is worth it.

Gotta get back to debugging the script again.  :'(
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on April 13, 2012, 01:35:08 AM
Woohoo! Finally tackled my sprite clipping script and got it working!

... As I've acknowledged many times, I'm probably the only person in the whole world that gives a rip about simulating a purely visual aspect of the Nintendo Entertainment System. (Well it wasn't purely visual, it also allowed rendering of more sprites on the screen). But screw you haters, I accomplished what I set out to do!

Special thanks to Torigara over at GMC for his advice over the months.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on April 13, 2012, 01:15:50 PM
As an end use I will most assuredly not ever use the sprite clipping system. On the other hand, as a programmer myself, im interested to see how you did it. Either way, congrats on getting it to work! Huzzah!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on April 13, 2012, 07:17:39 PM
Code: [Select]
//Use: draw_clipped()

//Emulate's NES limitations by clipping sprites (8x8) from metasprites on the left screen edge
if clip_sprites
{
    //NOTE: Sprite origins must be centered.
    var _lbox,_left,_wide,_xspr;
   
    //Find left edge of sprite in room   
    _lbox=x-abs(sprite_xoffset);
   
    //Check if left edge is outside view
    if _lbox<view_xview
    {
        //Calculate partial sprite pixels outside leftmost view
        _left = min(ceil((view_xview-_lbox)/(8*abs(image_xscale)))*8*abs(image_xscale),abs(sprite_width));
       
        //Calculate remaining visible pixels for full sprite
        _wide = (sprite_width-_left*sign(image_xscale))/abs(image_xscale);
       
        //Calculate the x-coordinate for the partial sprite
        _xspr = _lbox+_left;
       
        //Account for negative scaling
        _left = min(_left,sprite_width+_left)/image_xscale;
       
        //Draw the clipped sprite
        draw_sprite_part_ext(sprite_index,-1,_left,0,_wide,sprite_get_height(sprite_index),_xspr,y-sprite_get_yoffset(sprite_index),image_xscale,image_yscale,c_white,1)
       
    }
    else
    //Hide the sprite if no partials are fully visible on the right
    if _lbox+8*abs(image_xscale)<view_xview+view_wview
    {
        //Draw sprite as normal
        draw_sprite_ext(sprite_index,-1,x,y,image_xscale,image_yscale,0,c_white,1);
    }
   
    if head
    {
        //Reverse Bone Pillar's head
        var head_xscale;
        head_xscale = image_xscale;
        if object_index=obj_BonePillar
            head_xscale*=-1;
       
        //Find left edge of sprite in room   
        _lbox = x-sprite_get_xoffset(head)*abs(head_xscale);
       
        //Check if left edge is outside view
        if _lbox<view_xview
        {
            //Calculate partial sprite pixels outside leftmost view
            _left = min(ceil((view_xview-_lbox)/(8*abs(head_xscale)))*8*abs(head_xscale),abs(sprite_get_width(head)*head_xscale));
       
            //Calculate remaining visible pixels for full sprite
            _wide = (sprite_get_width(head)*head_xscale-_left*sign(head_xscale))/abs(head_xscale);
           
            //Calculate the x-coordinate for the partial sprite
            _xspr = _lbox+_left;
       
            //Account for negative scaling
            _left = min(_left,sprite_get_width(head)*head_xscale+_left)/head_xscale;
       
            //Draw the clipped sprite
            draw_sprite_part_ext(head,-1,_left,0,_wide,sprite_get_height(head),_xspr,y-sprite_yoffset-sprite_get_yoffset(head),head_xscale,image_yscale,c_white,1)       
        }
        else
        if _lbox+8*abs(head_xscale)<view_xview+view_wview
        {
            //Draw sprite as normal
            draw_sprite_ext(head,-1,x,y-sprite_yoffset,head_xscale,image_yscale,0,c_white,1);
        }
    }
}
else
{
    //Draw sprites as normal
    draw_sprite_ext(sprite_index,-1,x,y,image_xscale,image_yscale,0,c_white,1);
    if head
        if head=spr_BonePillar
            draw_sprite_ext(head,-1,x,y-sprite_yoffset,-image_xscale,image_yscale,0,c_white,1);
        else
            draw_sprite_ext(head,-1,x,y-sprite_yoffset,image_xscale,image_yscale,0,c_white,1);
}


The true beauty of my "head" method of drawing sprites larger than 16x16px becomes apparent in this script, as it should properly render any and all sprites taller than 16px.
Title: Password Generator AND Verifier early release
Post by: TheouAegis on April 22, 2012, 10:07:47 PM
I could have put this in my other thread, but they're all related anyway.

http://www.mediafire.com/download.php?zrixfum2gz4o9h2 (http://www.mediafire.com/download.php?zrixfum2gz4o9h2)

There's the GMK of my Password Generator & Verifier for CV3. You can see the code (at least as far as I've managed to clean it up) for not just the password generator but also the password verifier as well (the one I put off working on for so long because it was such a pain). It actually wasn't as painful as I thought it'd be, perhaps because I already figured out how to debug them when I made the generator script. It still took me quite a while -- maybe 8 or 10 hours of debugging. And then I finally narrowed it down to one of the dumbest of many follies I've foolishly committed over the weeks: confusing $0010 with #$10. If you've never worked with 6502 ASM, $0010 doesn't mean "10" it means "byte 10", in other words it's an address. I was too elated from getting it to work to slash my wrists over the stupidity.

So for those of you interested in how Konami coded their password generator (and subsequently the password verifier), have yourselves a peek.
Title: I'm kinda proud of this creation
Post by: TheouAegis on May 07, 2012, 02:33:30 AM
Mind you, it's nowhere near the level of sophistication as anything Esco's put out, but for a newbie like me who never programmed anything beyond "LICK MY FUCKING NUTSACK!" in BASIC on the school's library computers, this is a very satisfying moment.

So this weekend I worked on the spinning trap doors found in the NES Castlevanias. You know, those ones that spin clockwise or counterclockwise depending on which side you land on and make you drop through, sometimes with spikes on the other side so you can't backtrack safely if you make one spin. THey might not seem that difficult, but the mechanics to them are tougher than scripting most of the enemies. An Axe Knight is a cakewalk compared to the spinny trap doors.

This is the code I came up with. The satisfying part is waaaaay down near the end dealing with spiked trap doors.

Code: [Select]
//Calling Script

if argument0.bbox_left>=sprite_get_bbox("bbox_right")-4 || argument0.bbox_right<=sprite_get_bbox("bbox_left")+4
    exit;

with argument0
    if obj_Belmont.x!=ceil(mean(sprite_get_bbox("bbox_left"),sprite_get_bbox("bbox_right")))
        if obj_Belmont.jump == 1
        {
            visible = 1;
            image_speed=1/12;
            image_xscale=sign(obj_Belmont.x-ceil(mean(sprite_get_bbox("bbox_left"),sprite_get_bbox("bbox_right"))));
            with obj_Belmont belmont_land();
        }

Code: [Select]
//Step Event in Trap Door object

var tile_L,tile_R;
tile_R=tile_layer_find(1000000,x,y);
tile_L=tile_layer_find(1000000,x-16,y);
if tile_L==tile_R
    tile_L=-1;

if (image_index==2/12 || image_index==5+2/12)
{
    tile_add(tile_get_background(tile_R),void_left,void_top,16,8,x,y,999998);
    tile_add(tile_get_background(tile_R),void_left,void_top,16,8,x-16,y,999998);
    if sprite_index == spr_trapspike
    {
        tile_add(tile_get_background(tile_R),void_left,void_top,16,8,x,y+8,999998);
        tile_add(tile_get_background(tile_R),void_left,void_top,16,8,x-16,y+8,999998);
    }
}   

if image_index==1 || image_index==6
{
    image_speed=1/11;
    if obj_Belmont.y==y && obj_Belmont.timeline_running=false
        obj_Belmont.y+=1;
}

if image_index==4 || image_index==9
    image_speed=1/12;

if (image_index==5 || image_index==0) && image_speed!=0
{
    tile_delete(tile_layer_find(999998,x,y));
    tile_delete(tile_layer_find(999998,x-16,y));
    if sprite_index = spr_trapspike
    {
        tile_delete(tile_layer_find(999998,x,y+8));
        tile_delete(tile_layer_find(999998,x-16,y+8));
        if image_index==0
        {
            tile_delete(tile_layer_find(999999,x,y+16));
            if tile_L
                tile_delete(tile_layer_find(999999,x-16,y+16));
        }
        else
        if image_index==5
        {
            tile_R=tile_add(tile_get_background(tile_R),tile_get_left(tile_R),tile_get_top(tile_R)+(y & 16)*dual_layer,tile_get_width(tile_R),16,tile_get_x(tile_R),tile_get_y(tile_R)+16+(y & 16),999999);
            tile_set_scale(tile_R,1,-1);
            if tile_L
            {
                tile_L=tile_add(tile_get_background(tile_L),tile_get_left(tile_L),tile_get_top(tile_L)+(y & 16)*dual_layer,tile_get_width(tile_L),16,tile_get_x(tile_L),tile_get_y(tile_L)+16+(y & 16),999999);
                tile_set_scale(tile_L,1,-1);
            }
        }
    }
    visible     = 0;
    image_speed = 0;
    image_xscale= 1;
    image_index = round(image_index);
}

Code: [Select]
//End Step in Trap Door object

//Handles collision of Belmont with spikes
if !obj_Belmont.hit
{
    if sprite_index==spr_trapspike && image_speed==0
    {
        if image_index==5
        {
            with obj_Belmont
            if sprite_get_bbox("bbox_left")<other.bbox_right && sprite_get_bbox("bbox_right")>other.bbox_left
            {
                if vspd>=0
                {
                    if y==other.y
                    {
                        enemy=other.id;
                        belmont_touch();
                    }
                }
            }
        }
        else
        {
            with obj_Belmont
            if sprite_get_bbox("bbox_left")<other.bbox_right && sprite_get_bbox("bbox_right")>other.bbox_left
            {
                if vspd<=0
                {
                    if sprite_get_bbox("bbox_top")<other.bbox_bottom && sprite_get_bbox("bbox_bottom")>other.bbox_bottom
                    {
                        enemy=other.id;
                        belmont_touch();
                    }
                }
            }   
        }
    }
}   


If you actually read all that, you probably noticed it uses 3 layers of tiles. The original in CV3 altered the background tiles, but you can easily edit the code to just keep the trap doors visible at all times. But if you want to stick with using tiles -- like me -- then you can bask in the awesomeness that is those lines with tile_add(). It works for both normal 16x16 tiles and 32x32 TSAs. ... Or at least I think it does. I tested it with TSAs.

Yes, I'm prouder of that than of my Crusher. Even though the Crusher is probably cooler (it uses draw_sprite_part() to draw the chain), it didn't use tiles like the source material. My spinny trap doors are close to the source and still useable in projects that don't actually rely on tiles (although why you wouldn't use tiles is beyond me since even Symphony of the Night can be recreated with tiles).
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on May 08, 2012, 12:14:36 AM
Nice work, my friend. Well done indeed.
Title: Should I code my stair triggers like CV3's or keep them as they are now?
Post by: TheouAegis on May 13, 2012, 07:24:58 PM
So I had an idea for use in my game if I ever get around to actually making it, but first I wanted to see if it would even work in a CV3 hack. So, I tried something maybe other people never tried: I moved a stair trigger from the top of a staircase down to the middle of the staircase. My theory was Trevor would climb the stairs, hit the trigger and then fall to his death because there was no floor under him. What I learned was that stair triggers don't do anything except tell Trevor where the stairs start; he stops climbing when he actually reaches a platform.

So this totally blew my idea out of the water. Then I started wondering if I should redo my stair triggers so they work as in CV3 (just make Trevor start climbing until he reaches a prt_ground) or if I should keep them as they are currently in my engine (tell Trevor when to start climbing and when to stop climbing). What do you guys think?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on May 13, 2012, 08:57:21 PM
Question: What the hell do the stair top objects in CV3 do then?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on May 14, 2012, 03:14:29 AM
Just tell Trev when pressing down starts his stair climbing back down, opposite for stair bot objects. I guess it makes sense.  :-\
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on May 14, 2012, 03:16:14 PM
OK. Then if you want to be as accurate as possible to the original rearrange your set up accordingly. Functionally, I think it will be of little consequence either way.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on May 14, 2012, 10:33:45 PM
I just realized it would matter in the Forest stage and stages like that. Note you can't walk back down those stairs leading to Stage 2 (the part with the crushers is stage 1). There's no stair object there so he just walks up until he hits ground and starts from there.

... I dunno, I think I will change it after I get my enemies working again (changing over to my new collision method messed them all up).
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Jorge D. Fuentes on May 17, 2012, 10:08:28 PM
I thought that was awesome, the way he just 'rose out of the ground' and ends up in the forest part after the clocktower.
It's as if there was a trap door there, hidden, that he happened to rise out of.
Title: Bone-Throwing Skeleton code nearly complete!
Post by: TheouAegis on May 22, 2012, 01:31:40 PM
As some like Inccubus probably already know, I already have a near-complete Sword Skeleton, but it's far from perfect -- it uses 6 or 7 timelines randomly to simulate the movement in CV3. Of course some people might argue that is pointless since the movement could just as easily be done with some random variables and alarms without timelines.

When tracing the random movement patterns for Bone-Throwing Skeletons and having accumulated 8 or 9 distinct patterns in the measurements, each spanning 42 steps but with varying distances, I realized I needed to do something Esco seems to be vehemently against -- trace and read the ASM. Well, it took me a while for it to even bear any fruit, but I figured out the code and how it works. Right now the only reason it's not complete is because, I think, I have conflicting conditionals or a faulty collision check telling the skeleton to throw its bones instead of jumping. But the important thing is I have the movment down.

Bad news for Inccubus: the enemy movement script is getting an overhaul to accomodate enemies like these skeletons that have this random moment type.

I haven't verified yet if this is the same format of random movement code used in Bone Skeleton and possibly even the platforms from hell that I mentioned in my argument with Esco, but I have a strong hunch this is indeed the same method. Once I get the Bone-Throwing Skeleton finished, I"ll be able to check on that.

Here is the gist of CV3's random movement method, at least with the Bone-Throwing Skeletons:

One byte (when I say "byte" I mean a variable that does not exceed 1 byte in size) sets the direction and "speed" of the skeleton. This byte is either set to $FE (-2) or $01 (+1) and is augmented each step toward 0; specifically, it is added to $FF (-1) with the carry bit of the status flag. In conjunction with the next two variables, this speed gradually decelerates ($FE becomes $00, $01 becomes $FF). When the skeleton runs into a wall it can't jump over (it jumps over one-block walls) this byte is subtracted from $100.

One byte is set to $30(+$A0 if the byte above is negative) and then adjusted by 4 opposite the direction the skeleton is moving. So if the skeleton is moving right (positive), the byte is decreased by 4; if the skeleton is moving left (negative), the byte is increased by 4. When the byte exceeds 0 or 255 and the carry bit is set, the byte above is adjusted toward $00. After the bone is tossed, the byte is reset to $30(+$A0 if the byte above is negative). When the skeleton runs into a wall it can't jump over this byte is subtracted from $100.

One byte starts at $0 when the enemy is spawned and is increased by whatever value the byte above is set to. Everytime this byte exceeds 255, the carry bit is set. The first byte is subtracted from $FF unless the carry bit is set, in which case there is no change. In this way the skeleton will appear to slow down before throwing his bone (if you watch the movement in slow motion, it does in fact decelerate).

The rest of the movment -- the bone toss and the jumping off ledges -- are just typical "you can do this with a timeline" routines.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on May 22, 2012, 02:57:49 PM
That's pretty cool, actually. I've personally always thought that reading the ASM is a good way to as near to perfectly reproduce the movement of an object in a NES game without having to reverse engineer the code from the data.
Title: I'm still here!
Post by: TheouAegis on June 12, 2012, 02:56:52 AM
I'm still here and still working on GMVania. If i worked the graveyard shift, I"d have more time to work on GMvania (I used to do most of my sprite ripping and programming during my 3 hour break at work, also got decent exercise lugging my old laptop to work with me every night).

Lately I've put scripting platforms and game mechanics on hold. The draw_clipped() script was begging for attention, refusing to draw my Sword Skeleton correctly (it worked for my Axe Knight, though), so I decided to scrap it for now (the code will still remain in GMvania but the function will be disabled by default). Instead, I set my sights on cracking movement codes in CV3. I'm not much interested in Simon's jumping mechanics, although later I may work on cracking that after all; what I have been really interested in cracking is the movement for those damned platforms that bob up and down. I realized in order to do that I would need to acquaint myself with a similar movement code -- Medusa Heads. That's right, I wanted to crack Konami's method of sinusoidal movement in Castlevania.

And I must say, it's pretty nifty in its simplicity.

The sword and bone skeletons made more sense to me than the Medusa Head's code at first, but cracking what some of the variables actually referred to helped it make more sense.

The first thing I had to learn about reading enemy movement code was to stop thinking in terms of hspeed and vspeed, since the NES games strictly modified the x and y values directly. However, CV3 did actually use hspeed and vspeed to an extent. Certain bytes were set to either 0 or 1 for positive hspeed, or -1 or -2 for negative hspeed. The carry bit of the status flag was added to those bytes, so at any time the hspeed was -2, -1, 0, +1 or +2. Ok, so far, so boring.

The next thing I realized was the same script was used for every skeleton -- from the normal, slow-plodding skeleton to the spry whip skeleton. Recognizing this script was the key to breaking the enemy movement code. Of course, like my Password Generator, I didn't actually take the time to translate the script into attractive GML, deciding instead to simply transliterate everything into compatible GML. This script followed this format:

Code: [Select]
A+=B;
carry=A>255;
X+=hspeed+carry;

That's the gist of the horizontal movement script of the skeletons. What's the big deal? Well, when I tried to crack the code for Medusa Heads, this was the first script I saw:

Code: [Select]
C+=D;
carry=C>255;
Y+=vspeed+carry;

And right below that in the debugger was the horizontal code above.What this told me was, as I suspected after cracking the skeletons' horizontal movement codes, that the Medusa Head's vertical movement code was at its most basic level the same (or at least very similar) function as the acceleration/deceleration horizontal movement in sword skeletons. The question left in my mind was, how did Konami tell the Medusa Head to change direction regardless of where Trevor was in relation to the Medusa Head?

For the skeletons, it was a simple case of set an alarm (yes, CV3 had the equivalent of alarms) then adjust the movement when the alarm is executed. I knew the general address which would hold any alarm used by the Medusa Head, but when I ran the game there were no such bytes to be found. I was perplexed, so I delved farther into the code. It didn't make much sense at first because there was a glaring issue I had overlooked -- Medusa Heads' y-origins are 5 pixels below their sprites! I kept staring at this byte set to C4, but Trevor was standing at C0 and the Medusa Head was knee-high. When the Medusa Head went up, the byte decreased, and vice-versa. Once I got that sorted out, I noticed in the code another byte also set to C4. It was in the same address as where an alarm byte would be, but as I ran the game I noticed it never increased or decreased. It occurred to me what I was looking at is the GM equivalent ystart. So now the code was staring me right in the face.

Code: [Select]
B-=(y-ystart);
carry=B<0 || B>255;
vspeed-=1-carry;

Er... I think that's what the code loosely translates to. Unfortunately the Ethernet port on my laptop is bent to hell, so I can't just copy-paste the ASM up to here.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on June 13, 2012, 05:11:15 PM
Sounds intriguing. So these basic calculations cover all enemy movement in the game? I'm not so good at ASM, so I'm glad you're studying CV3's code. Please take lots of notes! :D
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on June 13, 2012, 11:55:19 PM
So far I've only noticed two (basically) styles of movement codes. I'm guessing that falling is handled similarly whereby two bytes are summed and then the vspeed has the carry added to it, but whereas Medusa Heads (vertically) and Sword Skeletons (horizontally) will alter the bytes at some point, the falling code, I hypothesize, will just let the bytes keep summing up. As for why some objects fall at different rates than others, I have no clue. Things like Bone Skeletons (yeah, I probably could have cracked its jumping code when I was working on it) apparently have a vspeed lock hard-coded in. As for Trevor, though, I theorize he uses the same style of code as the Medusa Heads.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on June 15, 2012, 01:56:16 AM
Hmmm... very interesting. Dude, if I wasn't neck deep in a full-time job and starting up my game company I would totally be helping you with this as much as possible. Just the technical achievement of a near perfect replica of CV3 for people to use for their own projects will be amazing. Not to mention, I still want to use this engine to complete my remake of CV1.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on June 23, 2012, 11:49:19 PM
In case anyone is interested, I think (although I haven't tested this) the limit on instances allowed active (note there is a difference between being active and being on-screen) at any time in CV3 (note this may be different in the other games) is 13. Like I said, I haven't tested this. The best way to test it may be to put in a couple Fire Men and use the duplicate spawn trick (walk away from the enemy's start location without losing sight of the enemy -- a lot harder than it sounds -- and then walk back to the spawn point, causing another enemy to spawn), then once you get three Fire Men on the screen they shouldn't be able to create fire if there are also candles/torches on the screen. Or maybe candles and torches are handled separately. All I know is I saw the branch conditional CMP X #$13 and I know that when X was 0 it handled Trevor and when X was 1 it handled the instance whose code I'm studying. So that leads me to believe Konami set the instance limit to 13.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on July 01, 2012, 06:12:02 PM
For the life of me I cannot get the floating platforms to bob correctly! Either a bad loop is causing them to prematurely cycle or that same loop is causing them to completely ignore a variable. So right now it bobs as if the range (refer to reVamp) is always set at 0. That might suffice but you won't be able to recreate CV3 without that added function.

ARGH! Been working on this problem for almost a month now I think. Or maybe it's been a couple weeks, but I think it's really been getting near a month. The ADD ain't helping, the whiny cat in my kitchen ain't helping, and sleep ain't helping! ... At least it's back to bobbing. As of Friday I had ruined it so it wouldn't even bob and had to recode from scratch twice over just to get back to where I am.

....

Durrr.... I think it was a rookie mistake. Still learning ASM after all.


Edit: Also, when I said 13 enemies, I goofed. It's $13. So you can have 19 or so objects or enemies/moving-platforms active at a time.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Jorge D. Fuentes on July 02, 2012, 07:48:29 PM
When can we actually play this?
'cuz that's really the only update I care about. :P :P :P
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on July 02, 2012, 11:36:19 PM
What part of ADD/ADHD don't you understand? You'll never get to play it!

J/K.

... Or am i?

Notice Or am i looks like a mutilated Orz guy?

I already have interactive elements in place. But every month I overhault he coding. For example, the previous versions used collision_line and collision_rectangle. Now they use hard-coded pixel-by-pixel collision check loops to speed things up a bit. So the whole system has to be rewritten for that. So the game should be faster but the coding's taking longer. ... Yeah, something like that.

Also, learning ASM through decryption isn't very fun. Movement will be nearly identical to CV3's in sooo many aspects. I haven't even really bothered verifying if I've set image_index=image_speed for all the objects yet (which is how it works in CV3 because of the order of processes).

I'm cutting out a lot of stuff from my planned schedule to try to hurry things up a bit, I tell ya. I swear!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Jorge D. Fuentes on July 02, 2012, 11:46:13 PM
Oh man, you're that type of programmer. :( :P

Spongebob Time Cards (http://www.youtube.com/watch?v=MgxK5vm6lvk#)
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on July 03, 2012, 01:21:39 AM
Did you really forget all those times I said I'd upload something in the morning or after work and then it never got uploaded until the next month?
Yeesh. Nice to know you follow my status so closely.  :P
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Jorge D. Fuentes on July 03, 2012, 02:53:32 AM
Don't mind me I'm just being facetious.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on July 03, 2012, 06:48:01 PM
I'm mostly just interested in the basic Trevor & platform engine. I don't need the enemies as much, or the NES style graphics engine since I'm gonna change all that anyway. I still find them interesting, though.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on July 04, 2012, 02:18:08 AM
The graphics engine is dropped for the time being. It suffers the fatal flaw of sprites needing their origins centered, which renders currently Sword Skeletons buggy.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on July 27, 2012, 02:29:10 PM
(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F31KTJWTn48L._SL500_AA300_.jpg&hash=16c25aef24edbb0bf35d89d8694a76eb84592c46)

I've been hard at work lately... playing League of Legends. But before I go to bed I spend an hour watching ASM in CV3. So continuing on with my analysis of Konami's programming...


Image Speed
Image speed is simply hadled by an alarm that counts down every step. When it hits 0, the sprite changes.

Horizontal and Vertical Movement
Each direction uses four variables: coordinate, integral speed, and two variables for fractional speed. The integral speed is set once and in some cases is changed when certain conditions are met, but toherwise it's a static value which is added to the coordinate with the carry bit of the status byte added. The first fractional speed variable is initialized to 0. The second one is set in such a way that the fraction is determined by how many times that variable is added to the first variable and when that variable exceeds 255 the carry bit is set (hence the fractional part). So if the second byte is set to 128 and the integral speed byte is set to 1, the instance will have a speed of 1.5. If the integral speed is set to 255, the instance will ahve a speed of -.5.

Sine Waves
The starting coordinate is saved to a specific byte. The current coordinate is compared to the starting coordinate and the difference is subtracted from another byte. If that byte doesn't drop below 0, the carry bit is set and added modifies the integral speed. The fraction speed is negated at that time as well.

Reversing Direction
An alarm is set. When the alarm reaches 0, the integral speed and fractional speed are negated.

Winged Demons
These guys use a sine al crescendo. When the image speed's alarm reaches 0, it adds 1 to a counter. That counter is applied to the Y address (not to be confused with the y coordinate), which forces the game to set the integral speed to s specific value. (I haven't tested in a horizontal stage, but I'm guessing if you could lead a Wing Demon far enough along, based on the values I saw it would go back to a low amplitude and then just drop off the map.)

Sprite Size
Sprites in CV are either 8x24, 16x24, or 16x32. A sprite that has a graphic height of less than 24 will have a true height of 24.

Sprite Origins
Belmonts have a sprite y-origin below their feet, which in most cases is at y:32. All other instances have y-origins 1 pixel above their feet. So a 16x32 sprite would have it at y:31 and a 16x24 sprite would have it at y:23. This means Belmonts stand above ground and enemies stand in the ground.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on August 02, 2012, 02:09:50 AM
HAHA! Horizontal Hit Detection is soooo simple in Castlevania!

abs(Trevor.x - Enemy.x) < 14

That's all there is to it! There are no hit boxes! Haven't checked vertical collisions yet, though.

Still not sure how block collisions are handled. I know it ANDs $F0 to snap to the grid, but not sure how it determines when to do that.There are just so many variables to watch. If it's as Nocturne at GMC said, they used a tile map but I don't know what address that'd use if in fact that's what's going on.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on August 02, 2012, 03:26:34 PM
Wow. That's ... really wierd, in modern terms anyway. I'd thing they'd do something similar for vertical collisions with enemies.
I really wish I had more time to learn more 6502 asm so I could do the same thing with megaman and smb3.
Keep it up! I for one find all this fascinating.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on August 04, 2012, 10:29:49 AM
Found an error/flub on Konami's part in the actual coding for CV3. Well, it wasn't so much an error but dirty programming, which is kinda surprising when you consider how well thought out the rest of the coding appears to be.

First off, the Winged Demon is bugged like I suspected. It was never meant to be used outside of vertical stages. What happens in horizontal stages is the Winged Demon will increase the amplitude of its waveform then reduce it back down again. After it has returned to its normal amplitude it kicks in to crazy mode and starts spazzing out, jumping to the top of the screen then the bottom of the screen. The reason for this, as I predicted in its programming, is the vertical speed changes from +/-1 to +/-64. I had predicted it would drop off the map and be auto-deleted because I interpreted the +/-64 as +/-208 originally (it was written as $C0 in the code, but was handled as -$C0, which is 64).

Now, Trevor's code shows Konami worked on him first. The code was probably recycled from other games. Either that or they had a different programmer coding him. I haven't delved very far into Trevor's code yet, but just from the jumping code alone I've noticed two things:

1) Trevor uses the same horizontal and vertical movement code structures as enemies, but his code is hard-coded just for him. Enemies and platforms all function in arrays (basically), such that you have code like LDA $041D,X ADC $0538,X STA $041D,X. Since people like Inccubus don't know ASM yet, in GM terms that's basically var1[a]+=var2[a]. In Trevor's case, the code is sliiiiiightly different: LDA $041D CLC (clear the carry bit) ADC $0538 STA $041D. When the game adjusts (in this example) $0538, it does so with soft code just like with enemies, but the actual movement code was hard coded with its own extra address.

2) Trevor's jumping code wastes a lot of memory. It is by far the dirtiest code I've seen in the game yet. Trevor's integral vertical speed (see previous posts) is ultra-hardcoded. Not only does the game actually store Trevor's vertical speeds in the ROM itself (as opposed to enemies and platforms who have their vertical speeds calculated), each step is stored in the ROM. It's the equivalent of a Switch statement in GM:
Code: [Select]
switch step_counter
{
  case 0:
  case 1:
  case 2:
  case 3: vspeed=-5; break;
  case 4:
  case 5:
  case 6:
  case 7: vspeed=-3; break;
}
Each case has a corresponding address in the ROM (in case you ever wondered why a Switch statement is slightly faster than a bunch of IF statements, that's why). There's something like 26 bytes dedicated just to storing Trevor's actual vertical speed in the ROM.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on August 04, 2012, 03:39:13 PM
Interesting. I'm guessing here, but I'd say that dirty-ass code was inherited from CV1 & 2. The enemy code is probably newer and more efficient since they seemed to be basically re-coding all of them presumably as a way to make it easier to create lots of variant enemies that use similar movement which CV1 & 2 didn't have.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on August 05, 2012, 05:02:33 AM
Obviously right now I'm working on Trevor's code. I still don't know how collisions with tiles are handled. I found the TSA map in the ROM, but have no idea how any of that ties in with the RAM. I'm working on the stairs right now. Discovered my current stairs were a tad off by about a pixel. Since there are no physical bounding boxes, just deviations from x/y, my collisions can get a little more accurate. What I really want are the measurements for Trevor's base (what interacts with the floors) and for his face (what interacts with the walls), as these are clearly not the same.

By the way, stairs are

abs(stair.x - belmont.x)<13


UPDATE: Found the hitbox dimensions for enemies. I haven't checked for all enemies yet (assuming bosses have a larger hitbox, projectiles have a smaller hitbox), but at least for Skeletons and similarly sized enemies, hit detection is calculated as follows:

collide_horz = abs(belmont.x - enemy.x)<$0E
collide_vert = abs(enemy.y-belmont.y)<$1A
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on August 06, 2012, 03:29:49 AM
Sweet.
It just occurred to me that the ROM hacking community would probably be very appreciative of your notes on this. In particular I and many others would love some insight on hoe levels are structured. The biggest problem with hacking CV games on NES is that no one has really cracked the level structure so everyone is stuck making levels that have the same basic shapes with little or no variation at all.

The hit detection for the enemies is uber simple. I'd even call it eloquent.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on August 06, 2012, 02:45:33 PM
Whip detection seems to be

abs(belmont.x - enemy.x)<$18 for whip levels 1 and 2
abs(belmont.x - enemy.x)<$28 for whip level 3

Not sure what the y detection is for whipping. It's slightly different. I'll find it tonight. I was working on other Belmont mechanics and got sidetracked by candle drops.

Speaking of drops, collision is kinda small (naturally).

collide_horz = abs(belmont.x - drop.x)<12
collide_vert = abs(belmont.y - drop.y)<10

I think those were the values. Did it off the top of my head. Not sure if small hearts are the same. I got those numbers off a coin purse (which 90% of share the code for).

Drops are destroyed if

x-view_xview & $FF < 4 or x-view_xview & $FF > $FC
y-view_yview & $FF < 8 or y-view_yview & $FF > $E8

Again, citing figures off the top of my head and my memory isn't THAT good, so I could be off by a few pixels.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on August 08, 2012, 02:50:47 AM
Hey. All this talk of CV3's code got me started. Think I might just do a small project.
Title: Palette Swap code for Game Maker
Post by: TheouAegis on September 18, 2012, 12:16:53 AM
Simple palette swap code I wrote up tonight. GIF file needs to be 4-color, preferable 87a format, or at least that's what works for me. This kind of script has been done before, but I'll share my version to you, my Wallachian brethren. What you do with it is up to you. As for me, I have no flippin' idea where to go from here. Damn attribute tables.

Edit/Update: My GIF files were created in Paintshop Pro, saved in 4-bit color with GIF format 87a. Figured I should throw that out there since some programs save GIF files differently.

Code: [Select]
/*
This script simply modifies the higher three palette entries of a 4-color GIF.
The script looks for the specified file in the Temp directory and rewrites it.

argument0: GIF file (string, sans extension)
argument1: Color 1 (real)
argument2: Color 2 (real)
argument3: Color3 (real)
*/

var i,chr,col,pal;
chr =   file_bin_open(temp_directory+'\'+argument0+".gif",1);
for(i=$10;i<$19;i+=3)
{
    col =   (i-$10) mod 3;
    switch (i-$10)div 3
    {
        case 0:
                pal =   argument1;
                break;
        case 1:
                pal =   argument2;
                break;
        case 3:
                pal =   argument3;
                break;
    }
    file_bin_seek(chr,i);
    switch col
    {
        case 0:
                file_bin_write_byte(chr,color_get_red(pal));
                break;
        case 1:
                file_bin_write_byte(chr,color_get_green(pal));
                break;
        case 2:
                file_bin_write_byte(chr,color_get_blue(pal));
                break;
    }
}
file_bin_close(chr);

Edit/Update #2: Here's a sample of the code modifying a GIF. Top half is the original file, bottom half is the file after using this code:
pal_swap("chr73",make_color_rgb(24,88,88),make_color_rgb(32,120,120),make_color_rgb(64,192,192));
(https://castlevaniadungeon.net/forums/proxy.php?request=http%3A%2F%2Fimageshack.us%2Fa%2Fimg715%2F7531%2Fpalswapdemo.gif&hash=b9f3f43e985aa0da018ca9f4f08ddae121522d01)

Q&A
Q: How does it work?
A: GIF files are very simple image formats. The palette is stored near the beginning of the file starting at byte $0D. The first color in the file is $0D-$0F, each subsequent palette entry takes up three bytes in typical RGB order. This code simply opens a GIF file and rewrites those bytes.

Q: Is it only for NES-style quadrachromatic images?
A: No. Although this script was written with quadrachromatic images in mind, the beauty of my script is it should be able to handle 16-bit graphics. The switch statement that sets pal can easily be expanded to allow fifteen editable colors, more than enough.

Q: What makes your code different from the others?
A: For starters, you don't need to specify the color to change, which most of the scripts I've seen require. With a simple edit, I could make this code usable with a specific palette index whereby you'd just use 0 for all the other corresponding arguments. That's a simple enough edit that anyone could do it.

Q: Why use the temporary directory?
A: You wouldn't want the player to easily mess with those files now, would you? If they know anything about GM, they'll know where to find your graphics, but at least the newbs won't know.

Q: How fast is this code?
A: I haven't tested. Sorry.

Q: How do I use this in my game?
A: That's up to you to figure out. I'm still trying to figure out how I'll incorporate it into my tile maps.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on September 18, 2012, 05:28:13 AM
Neat. This will make short work of NES, GBC, etc graphic simulations. Thanks for this.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on September 21, 2012, 12:22:06 AM
I just found out GM will only allow multi-frame sprites from a GIF file if the GIF file is multi-frame as well. Since I haven't tested the above code with such a GIF yet (although maybe there's no difference), I decided to rewrite the code for use with a PNG file.

Here's a modified code for a PNG (again, byte locations may vary from program to program), allowing for 4 colors changed. One of the colors should never need to be changed -- the transparent one, but I added a 5th argument anyway. I recommend using the following neutral grayscale palette:

00 00 00 Solid Black
7C 7C 7C Dark Grey
F8 F8 F8 Light Grey
BC BC BC Whitish

When you save to a PNG or GIF file, it should (... I have no idea if this is true or not) organize the palette from lowest to highest. Or it might organize in a radial pattern, kinda like how GM reads the pixel in the bottom-left before writing. It seemed like with a GIF file it wrote in order of the palette shown in Paintshop Pro for me, but when I saved a PNG the colors were in different places in the file.

Code: [Select]
var i,chr,col,pal;
chr =   file_bin_open(temp_directory+"\"+argument0+".png",1);
if chr show_message("File Open!");
for(i=$61;i<$6D;i+=3)
{
    col =   (i-$61) mod 3;
    switch (i-$61)div 3
    {
        case 0:
                pal =   argument1;
                break;
        case 1:
                pal =   argument2;
                break;
        case 3:
                pal =   argument3;
                break;
        case 4:
                pal =   argument4;
                break;
    }
    file_bin_seek(chr,i);
    switch col
    {
        case 0:
                file_bin_write_byte(chr,color_get_red(pal));
                break;
        case 1:
                file_bin_write_byte(chr,color_get_green(pal));
                break;
        case 2:
                file_bin_write_byte(chr,color_get_blue(pal));
                break;
    }
}
file_bin_close(chr);
Title: What...the... ffff------ ... Weird glitch in CV3!
Post by: TheouAegis on October 29, 2012, 04:58:02 AM
Ok, so I discovered the glitch in the coding for Winged Demons that made them spaz out in horizontal stages, but that wasn't really a glitch because it was never supposed to be in horizontal stages. But now I found a glitch that not only doesn't matter what kind of stage it's in, it seems to have actually been programmed in!

First, here is what is supposed to happen: When a bone skeleton leaps over a cliff or block and bumps into a wall, it drops straight down. THIS WORKS.

Here's where things get wonky: When a whip skeleton leaps over a cliff or block and bumps into a wall, it not only drops straight down, it changes palette, changes CHR (sprite), and alternates between two or three single-tile sprites even though it's flagged to not animate at all.

The error starts at 0Bx938F, which loads an indexed value into byte $0606,X to be used to jump to the phase index for dropping straight down. For a bone skeleton, this is $0B (11), which makes sense since at $0A (10) the code loops back to phase 0. However a whip skeleton will loop back to phase 0 at $0C (12), but $606,X gets set to $12 (18).

I haven't been able to find any way of loading phases 13 through 17, and phase 18 onward doesn't even seem like the correct indexing. For starters, it lets the whip skeleton pass below the ground then POOF! reappear above the ground. Bone skeletons check for collisions with the ground while dropping, but is for whip skeletons it's just an image cycling code.


If any of you have time, especially if you have reVamp, try to recreate the glitch (preferably without using reVamp).


UPDATE: Changing the $12 to $0D (the logical alternative) seemed to fix the bug, as it mapped to the same code used by the bone skeleton. But I would expect $13 if it was a typo, as $0D=13.

Man, am I really debugging more thoroughly than Konami's employees?
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on October 29, 2012, 05:50:35 AM
Nice catch there. I should add this to the title hack I'm making.
Title: Sometimes the simplest things aren't so simple
Post by: TheouAegis on November 06, 2012, 03:28:06 AM
I wasn't planning on including bone dragons in my game because I knew coding them would be a bitch, but it didn't seem right to code all the enemies from CV3 except the bone dragons, since people would want to use them in their own games, y'know. Oh god, it was even worse than I expected.

Three arrays needed so far (mild compared to owls, which I think I created 4 or 5 arrays for). There's an array for x, an array for y, and an array for the image_index. I think my x and y arrays are too big, since it looks like the same values were used and extended for the Bone Dragon King. Anyway, the x and y arrays are the offsets from the adjoined rib's x and y. So you have rib[i+1]=rib[ i ].x+bonedrac_x[rib[ i ].current_offset]. Although in my code, it basically looks like x=other.x+bonedrac_x[other.current_offset]. Much cleaner, huh?

But it's how it calculates the current offset. The step's code is so short but my mind is boggled. :( So much math to just lead to a boolean check to lead to more math to lead to a boolean check. Fucking boolean checks.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on November 07, 2012, 03:03:01 AM
God that sound like a nightmare, but yeah, it would almost be blasphemy not to have the white dragons.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: kayttaja12 on November 21, 2012, 08:16:00 AM
I really would like to make NES style Castlevania game with game maker, since I'm huge fan of the series, but I really cant manage to make movement like in the original series. I only have game maker 7 and I dont really like game maker 8, so could you make this for GM7 too? GM7 and GM8 codes are pretty similiar so I dont think it could be too hard.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on November 21, 2012, 07:38:16 PM
What's not to line in GM8? They fixed a huge ton of bugs. It's far more fully featured too.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on November 22, 2012, 12:57:41 AM
Most of what I'm rescripting will be useable in GM7 I think, but that's a ways off, seeing as how I'm rescripting as I hack and learn to read the code. As I've been telling Inccubus through messages, you pretty much need to focus all your effort on hacking ONE GAME because every game is coded differently and it's hard enough reading CV's code since it had numerous programmers with their own styles. Consequently, it's taking me a while. Right now I'm working on hacking the giant bat in CV3 which is troubling because the programmer for the bat uses multiple objects and each object has a different set of codes, so I have to track multiple objects just to track a single enemy. The other programmers for enemies used strictly one object per enemy in a majority of cases. Spawners typically were the only things that had more than one object each.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Las on November 24, 2012, 05:54:46 AM
That's ironic you are mention the big bat boss. I was going to try taking what knowledge of coding i have and try and code him in. I"m not their yet clearly. I know i coudl make him fight in his normal big bat boss form. I can even add multiple instances when he dies for the other bats.

The biggest problem i'm having atm with him and the skeleton dragon(WIP) is that the health bars have to somewhat part of the whole for each bat getting hit(and yes i'm using game maker 8pro). I actually got the skelton dragons' second form to go from halflife to none. So he starts with a half a bar of health. The thing that is their lifebar is called Mr.Dbosshealth. I set it too Mr.Dbosshealth-=160. And it's at half. 320 is full life.

Now that's a little differnt and i still have to get the first version of the skeleton dragon to start at full and end at half(not sure how to write that yet). But the smaller bats seem to pose a problem. I have no idea how to go about making them A) connect to one bar and B) drain to only a couple hits each on the bar. That seems to be a little bit past me. If you have any ideas Theo on yours, please do let me know if you could. It would be a major help.

Also i figured i'd throw it out their if their are any takers we are very much in need of skilled code help on the SCV3 project. I've recenetly did a revamp on Mad forest and already it seems 10 times better than that hack of  level i made in the day.Well cool discusssion here guys, i'll stop back on soon!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on November 24, 2012, 10:08:52 PM
This morning I started tracing that HP-connectivity. I rolled over and went back to sleep.

Good luck with bone dragons. The bats are a lot easier than dragons. THe main bat only has 3 phases and I think with each smaller bat it still has the same phases, since I didn't notice any difference between its code for full-sized bat and hit-once bat. The bat has two objects for the main bat as far as I can see: When it's hanging upside down, that's one object; when it flies around the room, that's another object. Now when it splits off into two, the new bat appears to be a different object, hence different code. I haven't looked through it.

Note that a "phase" is simply a set of code executed every step. If you change the phase, you change which code is executed that step. Phase 0 for the bat's second object (the main object) sets some variables. Phase 1 sets a timer and the movement speeds (vertical and horizontal) for the bat. Phase 2 counts down the timer to 0 before moving to Phase 3, which resets the Phase counter back to 0.

The health isn't a problem at all: Castlevania uses a global health variable for the bosses. In GM, you can use the variable "health" for Trevor's health. For the boss, just make a new global variable "boss_health". When a baby bat gets hit, you subtract from boss_health. That's all there is to it. And yes, that's based on Konami's coding.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Las on November 25, 2012, 03:47:31 PM
Oh wow that's cool on the bats. Yeah i'll have to try to just subtract like i did on the MrDbosshealth-=160 or soemthing. I'll play around with it. One thing i was going to do when coding them is put them on paths. I know how to do that at least. And i figure if all i ahve to do is make it so they subtract a certain amount then split off again then i should be ok. I mean they will continously loop on their paths anyways. Thanfkully the bat is a very easy boss to code in, nothing too complex like drac or some of the others.

Cool and thanks. I'll letcha know if i make progress. As for the bone dragon, i've already got him fully working, it's just a matter of figureing out how to turn his head one way while he moves that way on the path like image_xscale=-1 or something. I dunno i think it's with tranformign the sprite. It turns upside down and the otehr way and i dont have it mirrored or vertically flipped. As for the body pieces, they are all in play working just fine as they should be. And of course theirs the getting the other version to start at full health and go down to half health.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on November 25, 2012, 09:23:00 PM
Well, you can go the way of using paths, but the bats were semi-random and didn't actually use paths. They just flew in one direction for a few steps then flew in another for a few steps then flew in another and so on and so on. Testing in-game, they obviously base this on Trevor's coordinates but I didn't see it in my code, so either I just overlooked it in my code or I missed something my first few times looking over it.

Bosses are a pain in the ass to code. Their movement's not only set in the Step event (well, CV3's equivalent of the Step event), but also the Begin Step and End Step. I have a llllloooootttt of code to read through with multiple branches, so it's taking me a long time just to get through the bats.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on November 26, 2012, 11:52:03 PM
I have a suggestion for the use of paths for bosses, Las. In order to make things less 'mechanical' and repetitive, use about 6-12 different path variations that are chosen at random by each bat object. Also, upon the completion of a single path loop have the bat object select another path at random excluding the one it just finished. That will make it less obvious that they are flying in set paths.

My personal opinion, however, is that you should a simple random direction choice as it would be much closer to the original and would probably be a lot less work. Plus having paths for a flying enemy even if it is a lot of variants to try to mask it, kinda implies a more mechanical nature to the enemy.

Having said all that. What would be a cool upgrade to this boss would be to have all the sizes of bat have a more realistic behavior. For example as soon as they are created they all fly to the ceiling where they enter a hanging state where they are in the back ground and can't be hit. Then after a random interval they drop down and dive-bomb Trevor. This would make more sense than slowly flapping about waiting to die. Plus it could make for some nice and brutal situations during the fight if say 8 bats decide to attack at about the same time.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on November 27, 2012, 12:42:51 AM
That's semi-doable in the original code. You'd just have to alter a few lines. I think you could do it in the ROM without altering the ROM's size.
...
Don't ask me how. The main bat already has a code to make it hang upside down if certain conditions are set. You'd just have to change those conditions. It's handled during the Begin Step event, essentially.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Las on November 27, 2012, 12:52:04 AM
I like the idea Incubbus, it all depends on what i can code in. With paths i kinda figured out what to do. I also can now make intros for bosses. But for some reason i tried to put one to death which didn't work. I'm thinking because he was on a path. But the idea of the bats clinging back to the ceilign does seem like more intelleigent AI. Dunno that i can code that in yet thouhg. As for teh multiple paths, i wonder woudlt i set that too random? I'm really not super effecient with code. I always try things first to see if i get them working and ask questions later if not. I do like that idea to so it is far more random and the AI is much tougher to beat. The bosses shoudlnt' be super easy to beat.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on November 27, 2012, 04:15:42 AM
@Theou: I hadn't thought of that. But you're right most of the needed code is pretty much  already there.

@Las: You can make the paths random by using a switch statement. Very easy actually. Make it into a script. For the bat's creation code make it fly to the origin point you want it to start the path from; +/- a few pixels in x & y for variety. Then call the script and feed it a random number in the correct range. Then in the "End of Path" event make the exact same call to the script. That's pretty much all there is to it. Wouldn't even need any additional variables.
Title: Revised my room transition code
Post by: TheouAegis on February 09, 2013, 05:27:18 PM
So all this time I thought my code was bad (well, it was pretty messy) because it ran super slow on both my computers. You guys said it was fine and ran ok on your computers. I couldn't figure out what the hell was going on. I spent 6 hours last night rewriting it and trying to debug it (there's another bug in it now), only to find out it was running slow because I had vsync turned on and my computers don't like vsync.  >:(

So here's my script for a door going to the right. Right now there is a bug that may or may not have to do with the fact that I didn't optimize my tile sheet, or it may be related only to my computer. I don't know what's causing the bug, but it's a freaking pixel offset and it's annoying me. So for that reason, this code contains extraneous 1s. Once I figure out why it's doing it, I may update the code because all those 1s slow the transition down a couple cycles.

Here's a link (http://"http://205.196.123.7/mveeh7w38jkg/ucdigrjr3uq9oos/Transivania.gmk") to the new demo. WITH SOUND! (kinda) It still uses my old CV3 engine (Inccubus knows what I'm talking about), so it really is just a demo. The transition itself can be used with any engine because it doesn't involve collisions at all, really.

...Yes, in case any of you missed it, this script will play a sound when the door slams open and again when the door slams shut! Bet you didn't know you could execute sounds during a room transition! (Neither did I...)

//Set scale to window_get_region_width()/256 before transition.
//Set py to obj_Belmont.y*scale before transition.
//Set px to (obj_Belmont.x-view_xview)*scale before transition.

argument15  =   argument4 * transition_steps >> 0;

/* OPTIONAL code if your door doesn't have the black "wall" already
if argument15 >= $8C
{
    draw_set_color(c_black);
    draw_rectangle($70*scale,py-$32*scale,$80*scale,py,0);
}
*/

if argument15 < $0C
{
    draw_surface(argument0,0,1);
    draw_sprite_ext(spr_Belm_walk, 0, px, py, scale, scale, 0, c_white, 1);
}
else
if argument15 < $8C
{
    px          -=  scale;
    draw_surface(argument0, -(argument15-$0C)*scale,1);
    draw_surface(argument1, argument2-(argument15-$0C)*scale,1);
    draw_sprite_ext(spr_Belm_walk, 0, px, py, scale, scale, 0, c_white, 1);
}
else
if argument15 == $8C
{
    draw_surface(argument1, 1+(argument2>>1),1);
    draw_surface(argument0,1-(argument2>>1),1);
    draw_sprite_ext(spr_door_rt, 0, $70*scale, py-$30*scale, scale, scale, 0, c_white, 1);
    draw_sprite_ext(spr_Belm_walk, 0, px, py, scale, scale, 0, c_white, 1);
}
else
if argument15 < $96
{
    draw_surface(argument1, 1+(argument2>>1),1);
    draw_surface(argument0,1-(argument2>>1),1);
    draw_sprite_ext(spr_door_rt, 1, $70*scale, py-$30*scale, scale, scale, 0, c_white, 1);
    draw_sprite_ext(spr_Belm_walk, 0, px, py, scale, scale, 0, c_white, 1);
}
else
if argument15 < $C8
{
    if argument15 == $96
        sound_play(snd_DoorSlam);
    draw_surface(argument1, 1+(argument2>>1),1);
    draw_surface(argument0,1-(argument2>>1),1);
    draw_sprite_ext(spr_door_rt, 2, $70*scale, py-$30*scale, scale, scale, 0, c_white, 1);
    draw_sprite_ext(spr_Belm_walk, 0, px, py, scale, scale, 0, c_white, 1);
}
else
if argument15 < $F8
{
    px          +=  scale;
    draw_surface(argument1, 1+(argument2>>1),1);
    draw_surface(argument0,1-(argument2>>1),1);
    draw_sprite_ext(spr_door_rt, 2, $70*scale, py-$30*scale, scale, scale, 0, c_white, 1);;
    draw_sprite_ext(spr_Belm_walk, (argument15-$C7-1)>>3, px, py, scale, scale, 0, c_white, 1);
}
else
if argument15 < $102
{
    draw_surface(argument1, 1+(argument2>>1),1);
    draw_surface(argument0,1-(argument2>>1),1);
    draw_sprite_ext(spr_door_rt, 2, $70*scale, py-$30*scale, scale, scale, 0, c_white, 1);
    draw_sprite_ext(spr_Belm_walk, 1, px, py, scale, scale, 0, c_white, 1);
}
else
if argument15 < $10C
{
    draw_surface(argument1, 1+(argument2>>1),1);
    draw_surface(argument0,1-(argument2>>1),1);
    draw_sprite_ext(spr_door_rt, 1, $70*scale, py-$30*scale, scale, scale, 0, c_white, 1);   
    draw_sprite_ext(spr_Belm_walk, 1, px, py, scale, scale, 0, c_white, 1);
    if argument15 == $10B
        sound_play(snd_DoorSlam);
}
else
{
    px          -=  scale;
    draw_surface(argument0, scale*-(argument15-$10B)-argument2/2,1);
    draw_surface(argument1, argument2 - argument2/2 - scale*(argument15-$10B),1);
    draw_sprite_ext(spr_Belm_walk, 1, px, py, scale, scale, 0, c_white, 1);
}

draw_status(scale);
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: FireSeraphim on February 10, 2013, 08:55:29 PM
@TheoAegis: I wonder if you couldn't somehow compress the door transition code to be more "multiple protagonist friendly"? Also I believe I sent you a PM ages ago and find it amusing that you have not replied yet.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on February 10, 2013, 09:45:30 PM
Too busy to work on other people's games.

And define "multiple protagonist". If you mean 2 or more characters will be on the screen at the same time, .... that would be doable...  :-\ If you simply mean the player can be playing as one of 3 or 4 different characters, you need to just put in a conditional that checks which character the player currently is. If the game was optimized, you could even just turn it into an arithmetic function, which would be a bit faster I think.

if obj_Belmont.object_index == obj_Belmont
draw_sprite_ext(spr_Belm_walk, 0, px, py, scale, scale, 0, c_white, 1);
else
if obj_Belmont.object_index == obj_Grant
draw_sprite_ext(spr_Grant_walk, 0, px, py, scale, scale, 0, c_white, 1);
else
if obj_Belmont.object_index == obj_Sypha
draw_sprite_ext(spr_Sypha_walk, 0, px, py, scale, scale, 0, c_white, 1);
else
if obj_Belmont.object_index == obj_Alucard
draw_sprite_ext(spr_Alucard_walk, 0, px, py, scale, scale, 0, c_white, 1);


An example of the arithmetic method would be:

draw_sprite_ext(spr_Belm_walk+12*character, 0, px, py, scale, scale, 0, c_white, 1);

Title: Forget Trig: The Easiest Sine Wave script ever!
Post by: TheouAegis on March 02, 2013, 05:32:28 PM
I also posted this on my blog. I'll keep this post shorter though, as I'm long-winded on my blog.

Ask a Game Maker programmer how to put wave motion in a game and they'll almost always tell you to use sin() or cos(). There is an easier method. Although probably not technically a sine wave, it's still a wave motion.

For those unfamiliar with Game Maker's terminology, vspeed is the variable used for vertical speed and ystart is the variable used for the starting y-coordinate of an instance in the room. Pretty straight-forward.

vspeed += (ystart - y) / length

The value of length is inversely proportional to the wavelength -- the higher the value of length, the narrower the wave. The initial value of vspeed affects the amplitude of the wave directly.


Yes, it took me this long to figure out what the Medusa Head code actually did. I'm old and fat -- leave me alone!
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Corpsecrank on May 13, 2013, 08:07:00 PM
Lol you started talking about waves and I was like wtf would you need a wave motion for in an 8bit cv game then you said medusa head and I almost spit my drink out.

But aside from that are you still messing around with this? I am thinking about using this to demonstrate how the tile sets I am working on can be used. I wasn't sure how complete this was or what the deal was with it. Game maker isn't really my thing but if this is fairly solid it could make a great base to put my tiles to use once.
Title: Re: Forget Trig: The Easiest Sine Wave script ever!
Post by: Esco on May 14, 2013, 02:37:14 PM
<DELETED>
Title: Re: Forget Trig: The Easiest Sine Wave script ever!
Post by: Corpsecrank on May 15, 2013, 05:49:00 AM
<DELETED>

Stop being so mysterious geez...
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on May 16, 2013, 02:34:15 AM
I'm curious what Esco's post was too.

The original project up to v0.3 is pretty much scrapped. It's a workbench. I use it every so often for some things, but the current version is just a rewrite of the actual NES code, some things scrapped. For example, I was including Sypha, Grant and Alucard at first, but have since decided to only focus on Trevor's Code for the time being to simplify things a little. When I'm not working or watching Ultraman episodes, I'm usually looking over NES code. So in a sense, the project is on indefinite hiatus. However, every so often I do release "new code". I don't use the tiles method anymore, opting for collision maps now, but I still stand by most of what I have come up with over the months (or has it been a year since I scrapped it)? The password and name entry screens I have no intention of changing, except maybe someday trying to simplify the code, although I doubt that will ever happen. The Medusa Head/Bat/Winged Demon code I posted here took me a long ass time to come up with.

My problem was I kept using a literal movement script (discussed in the latter pages of this thread), but when I finally consolidated the three variables (vert_1,vert_2,vert_3) into a single variable, the entire sine wave code Konami used made perfect sense and I was able to come up with that formula. Most code I still suck at interpreting. I'm sure if I showed Esco the White Dragon script, he might be able to make sense of it, but I only barely understood it the last time I looked at it and in my rewrite of my code (it's like my fourth rewrite that i'm on right now), I haven't gone back to tackle the White Dragon yet. Right now I've put enemies on hold to try to break down the mechanics of the Step Event (so to speak) and that's taking me a long time to get through. There are lots of little things going on behind the scenes that affect the mechanics of the game that I haven't worked out just yet. And I'm sure they have some code that they ripped off other games that have no use either, so some of the code might be dummy code. Some variables might pertain to Grant or Alucard, but since I'm not coding them I'd have no idea.

But I've already adopted quite a few coding styles based on CV3, so I don't care anymore if people are waiting for a release -- I'm taking my time just learning from Konami. It's also fun seeing code and thinking, "WHy the hell did they do that? It'd take up less cart space and possibly even less CPU if they just did this instead." Or "Wow, Konami made a typo here!" It's kinda like the episode/volume of Hikaru No Go where Hikaru points out a flaw in Sai's match against Toyo-meijin and Sai was like, "Oh snap, Hikaru's progressed so far already!" I'm not a fast learner, though. If I was, I'd know what the fuck I'm looking at half the time.


....

Wait were you the guy that had that ROM hack that everyone was like, "Sick tiles mate!"? If I ever got my code taken care of, I was gonna recruit that guy for custom tiles. My current pet project is to implement attribute tables, but I think that's actually too simple so I put it on hold. I know it's ticking Inccubus off cuz he doesn't want to use tile assemblies or palette-swapped backgrounds (although I have serious doubts that a palette swapped background is all that worthwhile in Game Maker). But the palette swap demo that didn't have enough comments for Esco is already being incorporated into my project. Hence another reason I had to do a rewrite. Also, once I figured out what the subroutine for playing sounds was in CV3, I had to go back and locate all the sound_play subroutines so I rewrote the code while I was at it. I've isolated a couple more variables since then too. I wish I could get the ROM offset notes from the guy that made reVamp, in case there's something "obvious" I missed.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Inccubus on May 16, 2013, 03:31:52 AM
I essentially only care about Trevor, really. And I have tons of stuff to do in the mean time. So no worries.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: Corpsecrank on May 16, 2013, 08:31:53 AM
I'm curious what Esco's post was too.

The original project up to v0.3 is pretty much scrapped. It's a workbench. I use it every so often for some things, but the current version is just a rewrite of the actual NES code, some things scrapped. For example, I was including Sypha, Grant and Alucard at first, but have since decided to only focus on Trevor's Code for the time being to simplify things a little. When I'm not working or watching Ultraman episodes, I'm usually looking over NES code. So in a sense, the project is on indefinite hiatus. However, every so often I do release "new code". I don't use the tiles method anymore, opting for collision maps now, but I still stand by most of what I have come up with over the months (or has it been a year since I scrapped it)? The password and name entry screens I have no intention of changing, except maybe someday trying to simplify the code, although I doubt that will ever happen. The Medusa Head/Bat/Winged Demon code I posted here took me a long ass time to come up with.

My problem was I kept using a literal movement script (discussed in the latter pages of this thread), but when I finally consolidated the three variables (vert_1,vert_2,vert_3) into a single variable, the entire sine wave code Konami used made perfect sense and I was able to come up with that formula. Most code I still suck at interpreting. I'm sure if I showed Esco the White Dragon script, he might be able to make sense of it, but I only barely understood it the last time I looked at it and in my rewrite of my code (it's like my fourth rewrite that i'm on right now), I haven't gone back to tackle the White Dragon yet. Right now I've put enemies on hold to try to break down the mechanics of the Step Event (so to speak) and that's taking me a long time to get through. There are lots of little things going on behind the scenes that affect the mechanics of the game that I haven't worked out just yet. And I'm sure they have some code that they ripped off other games that have no use either, so some of the code might be dummy code. Some variables might pertain to Grant or Alucard, but since I'm not coding them I'd have no idea.

But I've already adopted quite a few coding styles based on CV3, so I don't care anymore if people are waiting for a release -- I'm taking my time just learning from Konami. It's also fun seeing code and thinking, "WHy the hell did they do that? It'd take up less cart space and possibly even less CPU if they just did this instead." Or "Wow, Konami made a typo here!" It's kinda like the episode/volume of Hikaru No Go where Hikaru points out a flaw in Sai's match against Toyo-meijin and Sai was like, "Oh snap, Hikaru's progressed so far already!" I'm not a fast learner, though. If I was, I'd know what the fuck I'm looking at half the time.


....

Wait were you the guy that had that ROM hack that everyone was like, "Sick tiles mate!"? If I ever got my code taken care of, I was gonna recruit that guy for custom tiles. My current pet project is to implement attribute tables, but I think that's actually too simple so I put it on hold. I know it's ticking Inccubus off cuz he doesn't want to use tile assemblies or palette-swapped backgrounds (although I have serious doubts that a palette swapped background is all that worthwhile in Game Maker). But the palette swap demo that didn't have enough comments for Esco is already being incorporated into my project. Hence another reason I had to do a rewrite. Also, once I figured out what the subroutine for playing sounds was in CV3, I had to go back and locate all the sound_play subroutines so I rewrote the code while I was at it. I've isolated a couple more variables since then too. I wish I could get the ROM offset notes from the guy that made reVamp, in case there's something "obvious" I missed.

I wasn't the one with the tiles. I never did a rom hack of any kind personally. I am currently also learning from konami only I am learning in the graphics department. I am kind of amazed at just how simple the graphics for the games were. The actual "tiles" are freaking huge. I mean seriously I thought the tiles were like 1/4 of the actual tile size. For instance the floor blocks are 1/4 the size of a full tile but looking at those blocks you would assume the block is a single tile. Stairs are weird because of this and they managed to cram tiles into places they shouldn't be and stuff.

Anyhow I am trying to pull as many tiles from the 3 nes games at the moment. I have that other thread called Tile Sheets where I am going to be releasing and updating that as I go. Once I do have all the tiles I can grab from those games I am going to build out a lot of custom stuff since the games had pretty heavy limitations.

My overall vision here though is to put a package of stuff together tiles sprites etc and then pair it off with an engine almost anyone can use. If your engine was solid enough it could be used for this. Essentially it would allow anyone who wanted to make a classic style fan game do so in as little time and with as little effort as possible. Stages could be built fast using the tiles I am working on and I as well as others have done a lot of enemies and characters which could just be dropped in. I can whip up a page of items and anything else needed.

I still want to make a non linear game with these tiles and stuff that plays similar to sotn and has a fairly similar map to that game only with this material. It wouldn't be quite as complex as sotn I would want to scrap the spells since they used lame fighter style input that I am not fond of just to give an example. I suppose simplifying the game play much like richter mode. I still think it would be amazing and fun.
Title: Re: NES-Style Castlevania Belmont Engine for GameMaker! (Version 0.3 UPDATE!)
Post by: TheouAegis on May 26, 2013, 03:34:50 AM
That awkward moment when you look back over your code and not only can't make sense of it, but also don't even remember typing it up in the first place.Those are my comments; that's my movement code; but why the hell did I put it in that particular timeline position and why can't I find it in the NES code?