CaveEditor Background Behaviour Issue Solved!!

May 14, 2009 at 7:23 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
Well, after some extensive playing around with the executable (lol not really), I found out how to overcome the dreaded problem with CaveEditor: that's right, I figured out how to edit background behaviour.

Things you will need to know:

-how to use a hex-editor
-how to convert from decimal to hex
Code:
BG effects values
00 - fixed in place
01 - move slow
02 - follow foreground
03 - hide
04 - hide
05 - core/up and down water style
06 - scroll left (layered), w/ items falling left
07 - scroll left (layered)
08 - hide

What seems to have initially caused the problem is somewhat complex. CaveEditor modifies the .exe so that it loads it's map data (ex sprite sheets and bk and name and stuff) from a new location, one that is created once CaveEditor edits Cavestory (this is probably one of the reasons why SW HATES cave editor). This in theory should have allowed us to edit all the values with ease, but it seems the creator (name forgotten sorry) has forgotten about the bg effect value. Even though this value is stored in a new location when edited, it is loaded from it's old location, which is not edited with CE (and thus why CE is unable to edit the bg-effect value). Once I had discovered this, it was simply a matter of finding where this value was stored in the .exe .

The workaround I have developed can only be assured to work on the original 94 maps of cavestory, so don't try this on added maps please. It might work with maps past 95, so someone try it so I can say yes or no here. It has been tested, I've looked over the hex dump, it only works for the original maps(0-94).

I have developed an offset formula, to make this easier on people. It is tricky however. First is:

200x (where x is the map number [ for ex Pens1 is map 1])

First calculate this out. Let's say we want to edit the bg effect for the start point. This is map 13. So 13 * 200 = 2600.

Now this is where a hex calculator comes in handy. I recommend using the calculator that comes with windows, so first enter the value found with the first formula into the calculator (make sure your calculator is in decimal mode when you do this.). So now 2600 should be on your windows calculator. Then change the mode to hex mode. This will change the number, and if it was 2600 it should now be A28.

Now that that's done, press "+" on the number pad, then 937F0, then "=". If you are using map 13, 2600, A28, the result should be 94218.
(Note: in this step you will ALWAYS add 937F0, it is a constant)


If you've done everything correctly, congratulations. Now all you need to do is open your hex editor, open cavestory, then go to the address you found (ex 94218). Then just change this address to one of the following values listed at the top of this post (00 - 08 in hexadecimal only).

This should solve the problem. If anyone has any difficulties, please post here.
 
May 14, 2009 at 7:55 AM
Hax on....Hax off....
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Jan 5, 2009
Location: Easter Island
Posts: 476
Interesting. I might try this when I replace all the orgs in my sue's workshop edited mod cause I was told that you could fix the exe with cave editor but doing so would screw up all the background movement. On behalf of everyone who uses cave editor, thank you.
 
May 14, 2009 at 9:30 PM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
Oh JEEZE!

Holy crap!!
I've gotta try this, right freakin' now!!
Good thing you found it out just now, too. Almost released my demo without backgrounds, ^.^;
If this works, I think it'll make CE completely superior to SW!

And once again, I recommend Translhextion for any hex editing >=D

I'll go try that on one of the new maps...

EDIT:
D-darn...
Doesn't work on maps above 94, but I guess we should have expected that...
Not like Pixel purposely left those spots open for new maps.
But, CE adds them somewhere, and if we can figure that out...

Still, awesome find, GIR!!!!
 
May 15, 2009 at 12:24 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
VoidMage_Lowell said:
Holy crap!!
I've gotta try this, right freakin' now!!
Good thing you found it out just now, too. Almost released my demo without backgrounds, ^.^;
If this works, I think it'll make CE completely superior to SW!

And once again, I recommend Translhextion for any hex editing >=D

I'll go try that on one of the new maps...

EDIT:
D-darn...
Doesn't work on maps above 94, but I guess we should have expected that...
Not like Pixel purposely left those spots open for new maps.
But, CE adds them somewhere, and if we can figure that out...

Still, awesome find, GIR!!!!

The thing is, the data that caveeditor lays out is all there a lil' later on, but the game tries to read the bg-camera-setting from the original location. Since there is no original location for maps greater than 94, it can't read the values/reads it as 0-hide.

Also lowell, you do know how to change a map's number right? Like how to take the tsc, map, entity (pretty much the whole map) data and change it to an existing number? It's quite simple.

(yyz will be refering to the name of the pretend map we're changing the number of. Ex. pens1 is the name of the arthur's house map.)
A) go into your data/stage folder.
B) First look for the following files that will be copied:
-yyz.tsc (The SCript file)
-yyz.pxm (PiXel Map file)
-yyz.pxe (PiXel Entity file)
C) Then find the map that you're going to replace. (for example, we will use pens1.)
D) Then delete those map's files:
-pens1.tsc
-pens1.pxm
-pens1.pxe
E) Then rename the yyz files to pens1 files.
F) Change the map settings for pens1 to what you had for yyz.
G) Change any script that refers/transports to map yyz, and make it so that it goes to map pens1.


That should let you change the map number, or more correctly, replace one map with another.
 
May 15, 2009 at 3:27 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
Hmm..

GIRakaCHEEZER said:
The thing is, the data that caveeditor lays out is all there a lil' later on, but the game tries to read the bg-camera-setting from the original location. Since there is no original location for maps greater than 94, it can't read the values/reads it as 0-hide.

Also lowell, you do know how to change a map's number right? Like how to take the tsc, map, entity (pretty much the whole map) data and change it to an existing number? It's quite simple.

(yyz will be refering to the name of the pretend map we're changing the number of. Ex. pens1 is the name of the arthur's house map.)
A) go into your data/stage folder.
B) First look for the following files that will be copied:
-yyz.tsc (The SCript file)
-yyz.pxm (PiXel Map file)
-yyz.pxe (PiXel Entity file)
C) Then find the map that you're going to replace. (for example, we will use pens1.)
D) Then delete those map's files:
-pens1.tsc
-pens1.pxm
-pens1.pxe
E) Then rename the yyz files to pens1 files.
F) Change the map settings for pens1 to what you had for yyz.
G) Change any script that refers/transports to map yyz, and make it so that it goes to map pens1.


That should let you change the map number, or more correctly, replace one map with another.
But I'm too lazy to do all of that =D
Actually, I'm afraid of losing any data from getting rid of the originals...
Probably wait until the mods a lot further along before doing that.
But thanks for the information! ...And shouldn't this be sticky-ed or something? =D

Also, does Hide-0 always make the background dark blue? {Instead of completely black}
Because that's all the backgrounds usually end up as...


EDIT:
I just realized something...
Remember how I told you that some of my backgrounds with CE randomly work...?
How the hell does that happen, if what you said's true? {Or did I not understand it? XD}
{It was room 96 that work, by the way}
 
May 16, 2009 at 5:13 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
VoidMage_Lowell said:


EDIT:
I just realized something...
Remember how I told you that some of my backgrounds with CE randomly work...?
How the hell does that happen, if what you said's true? {Or did I not understand it? XD}
{It was room 96 that work, by the way}


Well, does room 96 still work? That'd be the question I'd ask.

And yes, dark blue is the fade out color so that's what the bg will be if it's at 0-hide.
 
May 16, 2009 at 5:16 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
Affirmative

GIRakaCHEEZER said:
Well, does room 96 still work? That'd be the question I'd ask.

And yes, dark blue is the fade out color so that's what the bg will be if it's at 0-hide.
Yeap!
It alone shows up as pitch black, whilst the others show off their dark blue-ness...
{Unless I'm blind and one of the others is full black, too...}
But it still works!
 
May 16, 2009 at 5:23 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
VoidMage_Lowell said:
Yeap!
It alone shows up as pitch black, whilst the others show off their dark blue-ness...
{Unless I'm blind and one of the others is full black, too...}
But it still works!

If you want to get rid of that dark blue color in all rooms, just edit offset $DE78 to the color you want, that's the offset for the fadeout/hide color. And just asking, can you say change room 96 to have the sky bg-effect working? If so then we might find out something. If not then I have a theory.
 
May 16, 2009 at 5:31 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
Hmm..

GIRakaCHEEZER said:
If you want to get rid of that dark blue color in all rooms, just edit offset $DE78 to the color you want, that's the offset for the fadeout/hide color. And just asking, can you say change room 96 to have the sky bg-effect working? If so then we might find out something. If not then I have a theory.
Eh, I'll change it if everyone else thinks it looks funny....
Pure blackness might seem a bit boring...

And, last time I tried, the moving effect didn't work, but I'll try again anyways...

EDIT:
Well, I can get any of the backgrounds to work with number 96, but no motions for Fog or Moon...
 
May 16, 2009 at 11:15 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
GIRakaCHEEZER said:
I figured out how to edit background behaviour.

Well, I figured it already out a year ago:

http://spgardebiter.sp.funpic.de/CaveStory/FAQ/OptionTB.txt

You're very slow :D

GIRakaCHEEZER said:
CaveEditor modifies the .exe so that it loads it's map data (ex sprite sheets and bk and name and stuff) from a new location, one that is created once CaveEditor edits Cavestory (this is probably one of the reasons why SW HATES cave editor). This in theory should have allowed us to edit all the values with ease, but it seems the creator (name forgotten sorry) has forgotten about the bg effect value.

The creator of CE is called Wistil.
In fact this is what SW also do, it moves the map headers e.t.c. to a new location, in fact it moves it to a total new section in the exe file.
That's what I figured out years ago, so I told Wistil to do the same, because it's a rather smart way to let the user edit the map headers.
In fact SW can edit the background behaviour.
 
May 17, 2009 at 4:04 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
S. P. Gardebiter said:
Well, I figured it already out a year ago:

http://spgardebiter.sp.funpic.de/CaveStory/FAQ/OptionTB.txt

You're very slow :D

Now I understand this means that you knew how to edit background behaviour without an editor, but ARE you also telling me that you discovered WHY CaveEditor failed to edit such data and that the .exe referred to the original values? Because if not, then this is still a new discovery. OF COURSE people knew where the values were originally, or else how would the editors change these values. Don't call me slow when I discovered why the issue with CaveEditor was apparent and that the game still refered to the old bg behaviour data (and nothing else, the rest stays the same while caveeditor changes the name, tile set, npc sheets... etc somewhere else).

S. P. Gardebiter said:
The creator of CE is called Wistil.

Yeah, I think I did know that at one point, but I'm a bit forgetful with people's names, especially if they haven't been on the forums for forever. So oops on that one.

S. P. Gardebiter said:
In fact this is what SW also do, it moves the map headers e.t.c. to a new location, in fact it moves it to a total new section in the exe file.
That's what I figured out years ago, so I told Wistil to do the same, because it's a rather smart way to let the user edit the map headers.
In fact SW can edit the background behaviour.

Yea I found that out when I was looking at the SW code, good job telling Wistil to do that too, I wish his method didn't have the background behaviour flaw however.

And yes, who doesn't know that SW can edit the BG behaviour? Oh wait, just the people who have never touched SW ever =D. And besides, there are plenty of reasons to choose CE over SW, it's still just a matter of personaly preference.
 
May 19, 2009 at 8:26 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
GIRakaCHEEZER said:
Now I understand this means that you knew how to edit background behaviour without an editor

SW can edit it? oo'
I just tested out the values. :D

GIRakaCHEEZER said:
Because if not, then this is still a new discovery.

Sure, though your list is outdated :p

GIRakaCHEEZER said:
And yes, who doesn't know that SW can edit the BG behaviour? Oh wait, just the people who have never touched SW ever =D. And besides, there are plenty of reasons to choose CE over SW, it's still just a matter of personaly preference.

There are also a plenty of reasons to choose SW over CE :) (Hacked Version can edit more NPC Flags, can work with bitmaps, better GUI etc.)
 
May 20, 2009 at 12:05 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
CE SW

S. P. Gardebiter said:
There are also a plenty of reasons to choose SW over CE :) (Hacked Version can edit more NPC Flags, can work with bitmaps, better GUI etc.)
And there are several reasons to choose CE over SW: :D
Easier-to-read script writing {With the TSC list right there!! Though, I've ended up memorizing it.....XD}
And, I think CE's GUI's easier to use than SW, of course, we've both probably started with the different editors first, and thus that's altered our views drastically... {I find editing flags and such for an NPC harder in SW, XD}
Does not bite when other 3rd party programs come into play {I've heard all sorts of problems when people try to add ORGs when they mainly use SW...}
Adds the (C)Pixel part to altered files, so you can use any program to change sprites =D, as CE will fix all the files for you afterwords...
etc. :p

But this is all probably back down to opinion...
The only complaint I've ever had with CE is the Backgrounds, which is apparently fixable, now =D
 
May 20, 2009 at 12:20 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
FOR THE LOVE OF GAWD S.P., quit quoting fragments of my sentences. You did this the first time you posted on my thread (although the second post doesn't abuse this as much, it is acceptable). I know you knew how to edit BackGround information, but I just found a workaround to solve AN ISSUE PEOPLE WERE HAVING WITH CaveEditor. I don't see why you called me slow.

To show why I am upset with your fragment quoting, here's a rather extreme example:

A: I can speak japanese!

B:
I can speak
Lol you're slow, I knew how to do that ages ago.


Please SP, be sure to take not only the part you're addressing, but the context that comes with it as well. Otherwise you're just twisting my words around and using them to your advantage.

Also, I understand that you know alot about CaveStory, but that doesn't mean you have to be so condescending when you're telling people that their list isn't updated and such. There's no reason to call me slow, it just makes you come off as rude.


Be nice SP.
 
Jun 28, 2009 at 5:07 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
Major thread rez

I know I disappeared for a very long time but I am still alive. Actually it was an email from Andwhyisit to rehost CE that I received resparked my drive to work on CaveEditor.

I saw this post and was very surprised and thought "hey, that should be an easy fix." It turns out it was an easy fix but not quite the fix that Void mentioned. When I moved the map data inside the exe there were several places that point to the map data that now need to point to the new map data location. It turns out I missed the one related to the background behavior which is why those changes were not being shown in game.

I don't have a location to upload CE to anymore as my college webspace was finally removed. Instead I'll post a quick hex edit that can be done to fix the problem.
Jump to location 0x020D9E and change the data there from F0 37 49 00 to 40 F0 4B 00.
This will fix the pointer to the background behavior type and allow CE's changes to be seen in game.
 
Jun 28, 2009 at 11:14 PM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
Sweet! Great to see you back, even though I don't think I was here when you left. Also, thanks for putting up the CE source, I've been slowly trying to make sense of it, but I have a hard enough time trying to make sense of my own code, it will be a long time before I can make sense of other peoples. CE is an awesome program, and and if it weren't for a couple features of SW that I really like, I'd probably use it exclusively.
 
Jul 7, 2009 at 4:12 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Wistil said:
I don't have a location to upload CE to anymore as my college webspace was finally removed.
Can't you upload it to the forum as an attachment?
 
Jul 25, 2009 at 5:07 PM
Senior Member
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Jul 14, 2009
Location:
Posts: 155
Celtic Minstrel said:
Can't you upload it to the forum as an attachment?

Non-members can't download, and we don't want spam accounts do we?

Meh, I don't care actually :D.
 
Jan 21, 2011 at 3:07 PM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 21, 2011
Location:
Posts: 249
Re: Major thread rez

Wistil said:
I know I disappeared for a very long time but I am still alive. Actually it was an email from Andwhyisit to rehost CE that I received resparked my drive to work on CaveEditor.

I saw this post and was very surprised and thought "hey, that should be an easy fix." It turns out it was an easy fix but not quite the fix that Void mentioned. When I moved the map data inside the exe there were several places that point to the map data that now need to point to the new map data location. It turns out I missed the one related to the background behavior which is why those changes were not being shown in game.

I don't have a location to upload CE to anymore as my college webspace was finally removed. Instead I'll post a quick hex edit that can be done to fix the problem.
Jump to location 0x020D9E and change the data there from F0 37 49 00 to 40 F0 4B 00.
This will fix the pointer to the background behavior type and allow CE's changes to be seen in game.

I am unsure which version of your editor you're referring the change to, as I cannot locate either data ranges in v.99c or v.99, and the source for v.98 does not apparently download. While I can adjust backgrounds for any map up to 94, maps past that value have no background at all.

Help? Anyone? 94 maps is much too little for what I'm working on. :)
 
Jan 21, 2011 at 3:26 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
I was under the impression that this issue was fixed in the 99 builds, but the traditional workaround is to not use the "New Map" feature and instead to use Copy Map, and then change the background and all other attributes.
 
Top