CS Engine and TSC improvement

Dec 22, 2010 at 10:59 AM
Senior Member
"Master using it, and you can have this!"
Join Date: Aug 19, 2009
Location: UK
Posts: 85
Age: 30
Right, now I've got my improved rank image, I feel it is time to post my development thread for the idea in the title.

Basically my hack will consist of the following:
- More efficient code for each NPC
- 'Debug' Save and Load menu items, enabled via the start flags
- The integral FPS counter enabled via a menu button
- A max FPS option included in DoConfig
- A mute button that works properly, for Music, General SFX and Text scroll SFX
- Various extra TSC commands:
- <SNPXXXX : Save game to XXXX.dat
- <LNPXXXX : Load XXXX.dat
- <LI-XXXX : Reduce hitpoints by X
- <CREXXXX:YYYY:ZZZZ:AAAA : Create an entity of type A and EID A at X:Y
- <AE-XXXX : Remove X ammo
- <AX+XXXX : Add X Exp to current weapon
- <AX-XXXX : Remove X Exp from current weapon
- <MAM : Max Arms, all weapons to Level 3 MAX
- <CMC:XXXX:YYYY:ZZZZ : Integration of CarrotLord's code above

Thanks for your feedback. I realise that <X- can be done with negative numbers, but I just thought there should be an easier way than referring to the ascii table all the time, and all it would take is a copy of the original command, replacing ADD with SUB.

So, I've removed everything that has been done before, which thankfully wasn't too much. Again, any ideas would be much appreciated.
 
Dec 22, 2010 at 11:40 AM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
Damn, this sure is useful.
 
Dec 22, 2010 at 3:33 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
As far as TSC goes, I wrote a more efficient parser - this gives you room for approximately 2x as many commands as already exists. It also includes a couple of the custom commands I made for myself, *and* the fixed <CAT (it previously was exactly the same as <SAT, but I made it to clear the effects of <SAT and <TUR). If you want to use the variable commands though, here's the code:
Code:
48BC00

55 8B EC 83 EC 08 8B 45 08 50 E8 F1 9A FE FF 83 C4 04 89 45 FC 8B 45 08 83 C0 05 50 E8 DF 9A FE
FF 83 C4 04 89 45 F8 8B 45 FC D1 E0 90 05 90 E0 49 00 8B 4D F8 66 89 08 8B E5 5D C3 55 8B EC 83
EC 0C 8B 45 08 50 E8 B5 9A FE FF 83 C4 04 89 45 FC 8B 45 08 83 C0 05 50 E8 A3 9A FE FF 83 C4 04
89 45 F8 8B 45 FC D1 E0 05 90 E0 49 00 89 45 F4 8B 45 08 83 C0 04 0F BE 10 83 FA 2B 74 13 83 FA
2D 74 19 83 FA 2A 74 1F 83 FA 25 74 2F 8B E5 5D C3 8B 4D F8 8B 45 F4 66 01 08 EB F1 8B 4D F8 8B
45 F4 66 29 08 EB E6 8B 45 F4 66 0F BF 00 8B 4D F8 0F AF C1 8B 4D F4 66 89 01 EB D1 8B 4D F4 66
0F BF 01 8B 4D F8 99 F7 F8 8B 4D F4 66 89 01 EB BC 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 55 8B EC 83 EC 0C 8B 45 08 50 E8 FF 99 FE
FF 83 C4 04 89 45 FC 8B 45 08 83 C0 05 50 E8 ED 99 FE FF 83 C4 04 89 45 F8 C7 45 F4 90 E0 49 00
FF 4D F8 83 7D F8 00 7C 12 8B 45 FC 03 45 F8 D1 E0 03 45 F4 33 D2 66 89 10 EB E5 8B E5 5D C3 55
8B EC 83 EC 10 8B 45 08 50 E8 B2 99 FE FF 83 C4 04 89 45 FC 8B 45 08 83 C0 05 50 E8 A0 99 FE FF
83 C4 04 89 45 F8 8B 45 08 83 C0 0A 50 E8 8E 99 FE FF 83 C4 04 89 45 F4 8B 45 08 83 C0 0F 50 E8
7C 99 FE FF 83 C4 04 89 45 F0 8B 45 F4 6B C0 0C 05 97 BD 48 00 FF E0 8B 45 FC 8B 4D F8 3B C1 74
3E EB 4F 8B 45 FC 8B 4D F8 3B C1 75 32 EB 43 8B 45 FC 8B 4D F8 3B C1 7F 26 EB 37 8B 45 FC 8B 4D
F8 3B C1 7C 1A EB 2B 8B 45 FC 8B 4D F8 3B C1 7D 0E EB 1F 8B 45 FC 8B 4D F8 3B C1 7E 02 EB 13 8B
45 F0 50 E8 08 5D F9 FF 83 C4 04 33 C0 40 8B E5 5D C3 33 C0 EB F8 55 8B EC 83 EC 0C 8B 45 08 50
E8 FB 98 FE FF 83 C4 04 89 45 FC 8B 45 08 83 C0 05 50 E8 E9 98 FE FF 83 C4 04 89 45 F8 8B 45 08
83 C0 0A 50 E8 D7 98 FE FF 83 C4 04 89 45 F4 8B 45 F8 50 8B 45 FC 50 E8 14 35 F8 FF 83 C4 08 8B
4D F4 D1 E1 81 C1 90 E0 49 00 66 89 01 8B E5 5D C3

And here's the txt ASM for use with the doukutsu assembler
I sort of tested it so it probably works.

http://www.mediafire.com/?3upm9vbe01tn6xr

More efficient code for the NPCs is a nice notion, but I don't think it's entirely necessary as the game is pretty efficient as it is. Extra space can be made by simply removing unneeded NPC or boss code because really, you're not going to use them all.

Adding functionality do DoConfig, I don't know much about that. Biggest thing I've done to that is add more font options.
Same thing with the menu options, although I imagine they wouldn't be quite so hard.
Toggling the FPS Counter via a menu option is actually probably the easiest. In fact, with the Variables hack you can do it via TSC and then just give an item or something. Unless you meant like a "main menu" sort of deal.
A better mute would be interesting, although it'd involve a bit of tweaking in the PlaySound function. Nothing major.

Let's see, TSC...
<SNP - Eh, if you think it would be useful. I like my model of start menu-initialized different profiles.
<LNP - Same as above
<LI-/<ML- - It's possible to do this already I think with negative numbers. Wel, not <LI-, but <ML+000! takes away 15 health from max.
<CMC - This is a good idea, pretty useful.
<SMK - Good for making TSC more efficient.
<AE- - Again, possibly doable with -ve numbers but I'm not 100% sure.
<AX+/- - I like the idea, although you could make them one command again by allowing -ve input.
<MAM - Another fairly simple one, don't see anything wrong.
 
Dec 22, 2010 at 8:26 PM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
Pronouns: he/him
<CMCXXXX:YYYY:ZZZZ : Change map tile X:Y to type Z _without_ smoke

I've already done the above. I promise you it's a very simple hack, and uses a flag instead of an extra command (though you could turn it into an extra command). I'll post the code shortly.

Code:
CPU Disasm
Address Hex dump Command
00413AB9 |. /E9 816D0200 JMP 0043A83F
00413ABE | |90 NOP
00413ABF |> |6A 00 PUSH 0
00413AC1 |. |6A 00 PUSH 0

CPU Disasm
Address Hex dump Command
0043A83F /> \68 7D150000 PUSH 157D ;check for flag 5501
0043A844 |. E8 E740FDFF CALL 0040E930
0043A849 |. 83C4 04 ADD ESP,4
0043A84C |. 83F8 01 CMP EAX,1
0043A84F |. 74 0B JE SHORT 0043A85C
0043A851 |. 6A 00 PUSH 0
0043A853 |. 6A 00 PUSH 0
0043A855 |. 6A 00 PUSH 0
0043A857 |.^ E9 6392FDFF JMP 00413ABF
0043A85C |> 6A 00 PUSH 0
0043A85E |. 6A 00 PUSH 0
0043A860 |. 6A 00 PUSH 0
0043A862 |. 6A 00 PUSH 0
0043A864 |. 6A 00 PUSH 0
0043A866 |. 6A 00 PUSH 0
0043A868 |. 6A 00 PUSH 0
0043A86A |. 6A 00 PUSH 0
0043A86C \.^ E9 6892FDFF JMP 00413AD9

Feel free to optimize the code (add loops or something to reduce PUSH 0's). Here's how to use it in TSC:

Code:
<FL+5501 //this flag controls the hack
<CMP0055:0045:0000 //erases tile (55,45) without smoke
<FL-5501
<CMP0060:0020:0000 //erases tile (60,20) with smoke
<END

<ML-XXXX : Reduce max life by X

I'm sure Dooey did this already. Here is the relevant thread:

http://www.cavestory.org/forums/threads/ml-hack-add-to-subtract-from-or-set-your-max-health.2047/ <--add to, subtract from, or set your max health.
 
Last edited by a moderator:
Dec 23, 2010 at 5:49 AM
I don't anymore.
"I'm sorry Mario, but your princess is in another castle."
Join Date: Aug 9, 2010
Location: Greener Pastures
Posts: 1188
Age: 30
I can't really submit much besides an idea. <STRXXXX and <GTRXXXX:YYYY:ZZZZ.
<STRXXXX sets a marker at the players current location with numberXXXX, and <GTRXXXX:YYYY:ZZZZ travels to map XXXX, to marker YYYY, and runs event ZZZZ.
I figured some one could make a type ofPaper Mario type rpg with those and other TSC commands and enemy flags. Just thinking creativley here.
 
Dec 23, 2010 at 5:52 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
With variable hack you can store player X and Y position for future use; they're part of the handful of automatically updated "reserved" variables.

V000 - Current Health
V001 - Max Health
V002 - Xpos
V003 - Ypos
V004 - Gun XP?
V005 - Gun XP till?
 
Jan 16, 2011 at 6:57 PM
I don't anymore.
"I'm sorry Mario, but your princess is in another castle."
Join Date: Aug 9, 2010
Location: Greener Pastures
Posts: 1188
Age: 30
One more idea. <SIMYYYY:ZZZZ:XXX1:XXX2:XXX3...XXXn.

The commannd does the following:
YYYY shows the amount of images written.
ZZZZ is ticks between each one.
XXXX is the image particular inmage, there has to be as many of these XXXX's as was written in YYYY.

The command will show 320x240 images over the screen for short animations or for special effects. For a small cutscenes or to display text in a certain way (EX: the way the name of a location appears in an animation in Kingdom Hearts). The images simply appear over the screen, not replacing what ever is there.

Maybe when I learn more about ASM I'll actually do this one.
 
Jan 25, 2011 at 1:55 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 21, 2011
Location:
Posts: 249
How about a command that turns an NPC into a custom-generator type, with input for the type of NPC to generate, how often, and what direction to generate in.
 
Jan 25, 2011 at 8:35 AM
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Sep 16, 2009
Location:
Posts: 519
Thats not how the generators work D:
 
Jan 25, 2011 at 8:42 AM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
<AX+XXXX : Add X Exp to current weapon

seems pretty pointless since you can just do it with TSC by spawning extra exp. chips
 
Jan 25, 2011 at 9:25 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
Vercci, you could do it.
 
Jan 26, 2011 at 6:49 AM
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Sep 16, 2009
Location:
Posts: 519
I mean aren't the enemy generators in the ironhead fight (I don't remember any other generators right now) specifically designed to spawn those fish, as opposed to being able to choose what spawns?
 
Jan 26, 2011 at 1:40 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
There are also bute generators and maybe other stuff
Anyway wouldn't making it so that you can choose the spawn be the improvement, since that's what the thread is about
 
Jan 26, 2011 at 2:59 PM
Hey.
"In Soviet Russia, graves keep YOU!"
Join Date: Oct 20, 2010
Location: Within the hearts of all
Posts: 691
Age: 104
Pronouns: he/him
There's red bat generators and cloud generators as well.
 
Jan 26, 2011 at 6:08 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
Also ones for those red drop things, and water droplets such as in Start Point.

As far as engine improvement goes, there's only like one fantasy hack that I haven't been able/been bothered to pull together for myself, and that is the ability to use translucent graphics (like 32bit bitmaps with alpha or, even better, PNG files)

Every time I think about it I have to tell myself that it's just not worth the massive overhaul of the drawing engine it would require. It would make 2x res seem as easy as a framerect edit by comparison.
 
Jan 29, 2011 at 2:34 PM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 21, 2011
Location:
Posts: 249
Request:

<UMP - Unshift Map Tile; Does the exact opposite of <SMP, moves the map tile to one tile to the right instead of the left.

Noxid said:
Anyway wouldn't making it so that you can choose the spawn be the improvement, since that's what the thread is about

I do this manually with h/v triggers. When there are many of them, anytime one of them is triggered, it moves itself off screen and sets a flag. When any other is triggered, it moves the triggers back into place. (moving the triggers stops them from cancelling the hit invulnerable on quote when he's hit)
 
Feb 4, 2011 at 11:19 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6224
Age: 39
Pronouns: he/him
My idea:
<PMLXXXX:YYYY (Move player left)
<PMRXXXX:YYYY (Move player right)

If Y is greater than 0 then the player character will jump, else the character will simply move X pixels. When jumping the jump button duration of the jump is determined by Y, and X is the left/right button duration of the jump.
 
Feb 5, 2011 at 10:15 AM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
Alright I've been posting this everywhere like a deranged 80 year old. Can you make it so that in a MSG command a small line or border appears before the last letter of the line? It would make it make it so much easier to create dialogues.
 
Feb 9, 2011 at 11:28 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 21, 2011
Location:
Posts: 249
Another two:

<LWC : 'Lock Weapon Change' - Prevents player from changing weapons until <KEY or <END. Would do this by disabling 0x493618 and 0x49361C, maybe with a flag or something.

<LMJ : 'Lock Move & Jump' - Prevents player from moving or jumping until <KEY or <END. Same as above, but disables 0x493610, 0x493628, 0x493630, 0x493634, 0x493638, and 0x49363C instead.


Or, instead perhaps just a '<LOK0000' function, where 0000 represents the key, using the IDs from the key table. That could be a little more complicated though, unless the values are stored as an integer [multiple binary flags] in the memory. Maybe also would need an '<ULK0000' function to unlock, or maybe just setup <LOK so it checks to see if the given kID is already locked, and then unlock if it so. That way, the keylock would persist past <KEY or <END.


These kind of functions would allow for some very nifty cutscenes, you know!
 
Back
Top