Noxid's Modding/Hacking Resources

Nov 7, 2009 at 12:35 AM
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
Pronouns: he/him
Noxid's Modding/Hacking Resources

So, I've been doing a bit of work here and there with Assembly, just sort of reading all the various threads and tidbits left behind by others. Sometimes, it was a little frustrating having to search all over the place to find any information unless you knew where it was already (Dooey's Index of useful threads was Awesome :D). So's anyway, I decided to collect all the stuff I could find for Assembly and put it into one word document which I could have stored on my own computer for easy referral. Of course, I'd like to share it too, so here it is:

View it like a page of internet: Here

What this contains:

~45 pages of Assembly offsets, tutorials, examples and general comments

A table of contents system by which you can ctrl-f a keyword to jump easily to your desired area of interest




If anyone has anything they think I missed, I'd be glad to add it and update the file.

~~~~Other Resources~~~~
An Excel file with listings of all entities with entity # and offset, as well as songs with Name and Resource Name. Also an empty sheet for SFX.
::Mediafire::
::Tile44 Direct Link::

My Modding Beginner's Guide. It's a 20+ page word doc written by me in a whimsical yet informative style, intended to teach the basics of modding and using CE to new modders. It's not 100% done yet but there's still alot of information there. I have it as a word doc because it's easy enough to find something that opens these and I don't want to be bothered adding all the line breaks to make it look nice in a text file.
::Wordpress Direct Link::
::Tile44 Direct Link::

A listing of every function in Cave Story and a short description of (basically) what they do. It's not complete either, but there's a lot of stuff in there as it is. Started by S. P. Gardebiter, and then I kind of took over.
::Mediafire::
::Dropbox Direct Link::

~~~~Programs~~~~
A Java TSC Editor
It has some features that you can read about on its thread. I am pretty satisfied with how it works.

~~~~Videos~~~~
These videos are intended to be a sort of introduction to the basics of using Cave Editor and modding in general.

 
Nov 7, 2009 at 1:21 AM
Vanished.
Bobomb says: "I need a hug!"
Join Date: Apr 5, 2008
Location:
Posts: 776
Re: Noxid's Assembly Compendium

I love you *downloads*

It's only 39 Pages.


Also:
Make it PDF.
DOC makes me cry :(
 
Nov 7, 2009 at 1:43 AM
Hax on....Hax off....
"Keep on rollin'!"
Join Date: Jan 5, 2009
Location: Easter Island
Posts: 474
Re: Noxid's Assembly Compendium

Cool!
I think you can find a lot of this stuff around the Forums but this is much more convenient. This will prove to be quite useful, I think.
 
Nov 7, 2009 at 2:01 AM
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
Pronouns: he/him
Re: Noxid's Assembly Compendium

Yes, it's all either from around the forums or on SP's web thingy, but with this you don't have to have multiple threads and stuff open, and you can search the entire document at once.

39 pages eh? Comes up 45 on Word 2000. Perhaps my fancy formatting got lost along the way.

see? in the bottom left?

p88939-0-compendium.png

But that is neither here nor there.

I would like to point out that those values I've labelled "ROM" and "RAM" are probably most definitely incorrectly annotated and categorized. I dunno what I'd call em though.
 
Nov 7, 2009 at 2:14 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
Eww, sticky..

I do believe this is sticky worthy, yes?
If anymore new members ask questions over Assembly, we can just send them here, now.
Cheers to Noxid for letting us be lazy :(
 
Nov 8, 2009 at 6:40 AM
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
Re: Noxid's Assembly Compendium

Schokobecher said:
I love you *downloads*

It's only 39 Pages.

And here is a PDF Version:
[link]

Also:
Online Version:
[link]

Could you remove these please? I don't really like having multiple copies of everything I made all over the place, because if the thing needs updating, only the versions I can change will be updated. I would actually prefer it if Noxid's original document linked to the relevant threads rather than copying the text directly, but a single copy floating around is acceptable.

If you want to edit these copies to link to the relevant threads, while leaving Noxid's copy with the full text, thats fine too.
 
Nov 8, 2009 at 11:19 AM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 33
Pronouns: No homie
Re: Noxid's Assembly Compendium

Please write my Name correctly. It's "S. P. Gardebiter", not "S.P. Gardebiter" :/

Edit: You mixed ROM and RAM offsets.
 
Nov 8, 2009 at 5:21 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
Pronouns: he/him
dooey100 said:
I would actually prefer it if Noxid's original document linked to the relevant threads rather than copying the text directly, but a single copy floating around is acceptable.
Is it alright if I put the links in alongside the full text, and then have them in a list at the bottom saying "For most up-to-date and complete info..."

EDIT: - cuz that's what I did...
S. P. Gardebiter said:
Please write my Name correctly. It's "S. P. Gardebiter", not "S.P. Gardebiter" :/

Edit: You mixed ROM and RAM offsets.

Fixed your name, Wasn't sure about ROM and RAM but I think it should be straight now. If not, tell me and I can fix it again.
 
Nov 8, 2009 at 8:12 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3052
Re: Noxid's Assembly Compendium

wow, a whole bunch of stuff happened over the weekend.
can't believe I was gone...

I'll look over this presumably sometime within the next week, ie, when I have time. (also, next ten minutes, assume that I shall super edit)


anything that's ram starts with 4blablabla, anything that's rom, lacks it.*
so 0x4047b0 as opposed to 0x0047b0.**

eek, consistency, mister. consistency.
0x4047b0, 004047b0, and $04047b0 are all different ways of writing the same thing, and it would be easiest if you used the same one consistently, although witha a 40 page document, this might be hard.

I think there are four more registers.

ah, shoot, I can tell which of those notes are mine, shinings, runes and dooeys.
the shame, the shame.

I need more of a life, but at least I can't tell which are other peoples. (ie, gir, cookie, sshigsi, etc)
lace out now.

*or the other way around, I forget.
**note that this does not mean that offsets you have with 4blablabla are all ram offsets, some are mistakenly lahbehlayd
 
Jan 2, 2010 at 4:30 AM
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
Pronouns: he/him
Thanks to a generous contribution from Lace, I've updated the compendium with some new and some revised information, notably the section on TSC hacking and functions, and certain offsets for bullets, collisions, entities, etc. There are also probably a few changes that I've made as I've used it, but nothing major, just the odd correction here and there. Also contains an offset for the Camera code stuck at the end, courtesy of GIR.

Oh, also, the file is a .txt, which takes it down to roughly 40% the size and also it should load faster, but the downside is (at least in my eyes) that it's a tad harder to look at. Best viewed fullscreen with word wrap off.
 
Jan 2, 2010 at 8:22 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3052
Re: Noxid's Assembly Compendium

sweet, some miscelanious errors are that this:

Kill quote (drown?)

PUSH constant
CALL 421990

isn't true, it actually calls a tsc event, in that case, the drowning one.

this is a tad off:
0x0001 - ?
0x0002 - Ceiling
0x0004 - Wall (lr?)
0x0008 - Floor
0x0010 - Wall (lr?)
0x0020 - ?
0x0040 - ?
0x0080 - ?
0x0100 - Water
for player, 1 is inspecting, for an npc, 200 is water, not 100, and other weird things like that. ew.

you have this data:
+0x00: Event.InUse (N)
+0x08: Event.X (N)
+0x0C: Event.Y (N)
+0x10: Event.MoveX
+0x14: Event.MoveY
+0x28: Event.NPCID (N)
+0x4C: Event.Direction (N)
+0x54: Event.Display_L (N)
+0x58: Event.Display_U (N)
+0x5C: Event.Display_R (N)
+0x60: Event.Display_D (N)
+0x64: Event.FrameNum
+0x68: Event.FrameID
+0x6C: Event.ObjectTimer
+0x74: Event.ScriptState
+0x78: Event.ScriptTimer

(N): NOT conventions - Don't turn them into temporary storage locations.
four times. de one I gave you is the most recent, and presumably the most correct.

my funfuns no thar D:
LOADING:
Sound Loader:
push soundid ; what is going to be the sound id
push channels
push offset ; offset of the sound
call 004207E0
add esp,0C

Music Loader:

Graphics Loader:
push graphicid ; what is going to be the graphics id
push offset ; this offset holds the name of the graphic, not the graphic itself
call 0040B800
add esp,08

EFFECTS:
Play Sound:
push channelnum
push soundid
call 00420640
add esp,8

Play Music:
push musicid
call 00420EE0
add esp,4

Render Graphics:
push graphicsid
push rects ; lea [ebp-xx]
push y
push x
push ? ; some offset or another ... ?
call 0040C3C0
add esp,14

WEAPONS:
Weapon Ammo Add:
push weaponid
call 401FA0
add esp,4

Weapon Ammo Subtract:
push weaponid
call 401FA0
add esp,4

Weapon Bullet Counter:
push weaponid
call 00403C40 ; returns into eax
add esp,4

EXP Add:
push xptogain
call 4196f0
add esp,4

OTHER:
RAM Reserve A:
push amount
push ? (0 works)
push offset to reserve
call 00480D30
add esp,0C

RAM Reserve B:
push amount
call 004813A3 ; Not sure about what this does. Used in conjunction with above
add esp,4 for tsc reserves, and is used by itself other places.

Call TSC Event:
push eventnum
call 421990 ; note that with an unhacked parser, this will destroy invincibility
add esp,4

ASCII To Number:
push ascii
call 00421900 ; returns into eax
add esp,4

Random Num Generator:
push min
push max
call 40f350 ; returns into eax
add esp,8

Take Damage:
push damage
call 00419910 ; this will also hurt your exp, not seprate functions.
add esp,4

NPC Create:
push ? (0 should work)
push ? (0 should work)
push ? (0 should work)
push yvel
push xvel
push y
push x
push num
call 46efd0
add esp,20

Underwater Timer:
push y
push x
call 41a350
add esp,8

bullet tuff should be as such
+0x0C: Event.inuse (N) ; 0 kills
+0x10: Event.x (N)
+0x14: Event.y (N)
+0x18: Event.xvel
+0x1C: Event.yvel
+0x28: Event.collision
+0x2C: Event.timer

and it's worth noting that all those weapon offsets are for the bullet only, not the gun, which can be found in an array that starts near 41ff0a.

meh!
also, no credit needed for stuff I post. It's generally based off of someone elses work, and I don't really need/like to be credited excessively (except for idea, I'm all for thought credit).

yeah, good luck.
 
Jan 2, 2010 at 10:18 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
Pronouns: he/him
Lace said:
sweet, some miscelanious errors are that this:

isn't true, it actually calls a tsc event, in that case, the drowning one.
Removed
this is a tad off:
for player, 1 is inspecting, for an npc, 200 is water, not 100, and other weird things like that. ew.
removed. The flag data for players and entities should be findable elsewhere in the document (Maybe?)
you have this data:
four times. de one I gave you is the most recent, and presumably the most correct.
#1 - was yours
#2 - Replaced with yours
#3 - Removed
#4 - Couldn't find :/
my funfuns no thar D:
Huh, I coulda swore I pasted that. Maybe I accidentaly Ctrl-z.
bullet tuff should be as such

and it's worth noting that all those weapon offsets are for the bullet only, not the gun, which can be found in an array that starts near 41ff0a.
done, and noted.


meh!
also, no credit needed for stuff I post. It's generally based off of someone elses work, and I don't really need/like to be credited excessively (except for idea, I'm all for thought credit).
Mkay, I tried to fixes it. It's a big thing to look through...
 
Jan 2, 2010 at 10:46 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3052
Re: Noxid's Assembly Compendium

#4 - Couldn't find :/
erm, accidentally scrolled up when reading, and because of it, thought you had copypastad a large portion of the document.
:cool:

only the char one, and that just has the inspecting flag.
mebbe three lists would do best, in which case...
Char said:
0x0001 - Inspecting
0x0002 - Ceiling
0x0004 - Wall (lr?)
0x0008 - Floor
0x0010 - Wall (lr?)
0x0100 - Water
NPC said:
0x0002 - Ceiling
0x0004 - Wall (lr?)
0x0008 - Floor
0x0010 - Wall (lr?)
0x0200 - Water
Bullet said:
0x0002 - Ceiling
0x0004 - Wall (lr?)
0x0008 - Floor
0x0010 - Wall (lr?)

thanks for all the work you've put into this thingy.
it's dang useful.
 
Feb 2, 2010 at 1:54 AM
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
Pronouns: he/him
I have been doing a bit of playing, and have found a few little things that may prove interesting. You can just copypaste this into your file so you're all up to date and such.

Code:
 # NPC Stuff [MISCNPC]

004A5F98 ???, x 0x0280
+0x00: Event.InUse (N)		; is the event active? 0 kills.
[U]+0x04: Event.Collision		; flag to show what it's colliding w/[/U]
+0x08: Event.X (N)		
+0x0C: Event.Y (N)		
+0x10: Event.MoveX		; xvel, added to event.x each step
+0x14: Event.MoveY		; yvel
+0x1C: ?			; also yvel, but only used for some
+0x20: Event.Unknown1
+0x24: Event.Unknown2
+0x28: Event.NPCID (N)		; sprite #, as in H/V trigger is sprite # 46
[U][B]+0x2C: Event.EntityID (N)	; Entity ID, as seen in the editor
+0x30: Event.EventNum (N)	; Event #, as seen in the editor[/B][/U]
[U]+0x34: Event.Tileset (N)	; The tileset # as seen in a NPC.tbl editor[/U]
+0x40: ?			; health/damagetaken
+0x44: Event.EXP (?)
+0x4C: Event.Direction (N)
[U]+0x50: Event.Flags	(N)	; Entity flags, such as 2000 (down to run script)[/U]
+0x54: Event.Display_L (N)	; left side of the display rect
+0x58: Event.Display_U (N)	; top side of the display rect
+0x5C: Event.Display_R (N)	; right side of the display rect (NOT width)
+0x60: Event.Display_D (N)	; bottom side of the display rect (NOT height)
+0x64: Event.FrameTimer
+0x68: Event.FrameNum
+0x6C: Event.ObjectTimer
+0x74: Event.ScriptState	
+0x78: Event.ScriptTimer
+0x9c: Event.HitTrue		; Has the entity been Hit?
+0xA4: Event.Damage

These in particular might be useful for more advanced TSC-ASM integration.
There's also something at +34 that probably follows the line of the previous three, but I'm not sure what it is yet.

EDIT: Figure'd it out! It's what tileset the NPC is using (ex. 14 (hex) = 20 (dec) = tileset NPCSym)
 
Feb 2, 2010 at 2:42 AM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3052
Re: Noxid's Assembly Compendium

sweetzies. thanky very mucho.

actually, along those lines we were lacking the hitrects for npcs, so fwah. (not discovered by me)
Code:
+0x00: Event.InUse (N)		; is the event active? 0 kills.
+0x04: Event.Collision		; flag to show what it's colliding w/
+0x08: Event.X (N)		
+0x0C: Event.Y (N)		
+0x10: Event.MoveX		; xvel, added to event.x each step
+0x14: Event.MoveY		; yvel
+0x1C: Event.MoveY2		; also yvel, but only used in some entities
+0x20: Event.Unknown1
+0x24: Event.Unknown2
+0x28: Event.NPCID (N)		; sprite #, as in H/V trigger is sprite # 46
+0x2C: Event.EntityID (N)	; Entity ID, as seen in the editor
+0x30: Event.EventNum (N)	; Event #, as seen in the editor
+0x34: Event.Tileset (N)	; The tileset # as seen in a NPC.tbl editor
+0x40: Event.HP			; health/damagetaken
+0x44: Event.EXP (?)
+0x4C: Event.Direction (N)
+0x50: Event.Flags (N)		; Entity flags, such as 2000 (down to run script)
+0x54: Event.Display_L (N)	; Left side of the display rect
+0x58: Event.Display_U (N)	; Top side of the display rect
+0x5C: Event.Display_R (N)	; Right side of the display rect (NOT width)
+0x60: Event.Display_D (N)	; Bottom side of the display rect (NOT height)
+0x64: Event.FrameTimer
+0x68: Event.FrameNum
+0x6C: Event.ObjectTimer
+0x74: Event.ScriptState	
+0x78: Event.ScriptTimer
[COLOR="Red"][B]+0x7c: Event.Hitbox_L (N)	; Hitrects
+0x80: Event.Hitbox_U (N)
+0x84: Event.Hitbox_R (N)
+0x88: Event.Hitbox_D (N)[/B][/COLOR]
+0x9c: Event.HitTrue		; Has the entity been Hit?
+0xA4: Event.Damage

edit:
what the hell?
I just dropped 20 posts overnight ( I know bc I was happy for getting a palindromic post number).
D:
 
Feb 2, 2010 at 3:57 AM
Bonds that separate us
Forum Administrator
"Life begins and ends with Nu."
Join Date: Aug 20, 2006
Location:
Posts: 2858
Age: 34
Pronouns: he/him
Re: Noxid's Assembly Compendium

Lace said:
edit:
what the hell?
I just dropped 20 posts overnight ( I know bc I was happy for getting a palindromic post number).
D:
Tale of the Broxxus thread was baleeted.
 
May 10, 2010 at 5:21 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
Pronouns: he/him
Another quick update, the list is very nearly done now. Any help with the last few unknown or guessed values would be cool.

Code:
+0x00: Event.InUse (N)		; is the event active? 0 kills.
+0x04: Event.Collision		; flag to show what it's colliding w/
+0x08: Event.X (N)		; Position [x]
+0x0C: Event.Y (N)		; Poxition [y]
+0x10: Event.MoveX		; xvel, added to event.x each step
+0x14: Event.MoveY		; yvel[COLOR="Red"]
+0x18: Event.AltVel		; Sometimes Velocity
+0x1C: Event.AltVel		; Sometimes nothing.
+0x20: Event.TargetX          ; For entities such as Curly that use the targeting macro.
+0x24: Event.TargetY           ; [/COLOR]
+0x28: Event.NPCID (N)		; sprite #
+0x2C: Event.EntityID		; Entity ID, as seen in CE
+0x30: Event.EventNum		; Event #, as seen in CE
+0x34: Event.Tileset (N)	; The tileset # as seen in a NPC.tbl editor[COLOR="Red"]
+0x38: Event.HurtSound (N)	;
+0x3C: Event.DeathSound (N)	;[/COLOR]
+0x40: Event.Health (?)		; health/damagetaken
+0x44: Event.EXP (?)		; EXP dropped[COLOR="Red"]
+0x48: Event.DeathGraphic	;[/COLOR]
+0x4C: Event.Direction (N)	;
+0x50: Event.Flags		; Entity flags
+0x54: Event.Display_L (N)	; left side of the display rect
+0x58: Event.Display_U (N)	; top side of the display rect
+0x5C: Event.Display_R (N)	; right side of the display rect 
+0x60: Event.Display_D (N)	; bottom side of the display rect 
+0x64: Event.FrameTimer		;
+0x68: Event.FrameNum		;
+0x6C: Event.ObjectTimer	;
+0x70: Event.Directive		; Usually something from the parent.
+0x74: Event.ScriptState	;	
+0x78: Event.ScriptTimer	;
+0x7C: Event.HitRect_L		;
+0x80: Event.HitRect_U		;
+0x84: Event.HitRect_R		;	
+0x88: Event.HitRect_D		;[COLOR="Cyan"]
+0x8C: ???			; nonzero 1000
+0x90: ???			; nonzero 1000
+0x94: ???			; nonzero 1000
+0x98: ???			; nonzero 3000[/COLOR]
+0x9c: Event.HitTrue		; Has the entity been Hit?[COLOR="Cyan"]
+0xA0: ?			;[/COLOR]
+0xA4: Event.Damage		; Damage done to Player
+0xA8: Event.Parent		; It's like the ebp+8 of the parent entity.

Also does anybody know what the first and third values PUSH'd for 46EFD0 do? They're used in the exploding cloud when it makes its countdown bubbles but I'm not sure what they do.
 
May 10, 2010 at 10:46 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3052
Re: Noxid's Assembly Compendium

Code:
+0x20: Event.Unknown1		; Jerk [x]?
+0x24: Event.Unknown2		; Jerk [y]?
Wat. No.
At least not for curly, where these are the target x/ys.

18 and 1c are the same as 10 and 14, but only used sometimes.



Don't make entities enough to know what the first and third values are.

Of course, the only ones of these that matter when making your own NPC are the ones with (N) after them, but you know that.


Oh, velocity -> acceleration -> jerk?
Derivatives? Really?

The game has pretty much no reason to get that in depth w/ physics. For most things w/ grav/accel, it just adds a normal number, instead of fetching from a register.
 
May 10, 2010 at 10:52 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
Pronouns: he/him
Eh, I was grasping at straws. I still kinda want to believe that there's some more important purpose for them than just "sometimes velocity" but I guess maybe that's just it. Also those ones at the bottom confound me but I didn't even have an imaginary name for them. The values are what one entity had there when I checked it but it does't mean much out of context :/

Editing to amend.
 
Back
Top