Language…
11 users online: anonimzwx,  BeeKaay, codfish1002, DanMario24YT, koffe190, lean4, ModernKiwi, Pizzagamer9791,  Ringo, SysDataSoft,  yoshi3706 - Guests: 304 - Bots: 310
Users: 64,795 (2,375 active)
Latest user: mathew

Posts by inkydom

inkydom's Profile → Posts

  • Pages:
  • 1
edit (2020-11-20):

Note I will submit the sprites and open source the code after I've released my hack. Until then if you want to re-create this here are the general steps:

1. I built a set of custom sprites for the arrows and A/B (non-interacting, act-like 25).
2. I based the movement off the 'Angry Sun' sprite to keep x/y positions on the screen constant while mario moves.
3. I chose the speed to be 0 in the x, and some value in the y corresponding to how frequently I am spawning the arrows (this is dependent on your BPM, so it will change depending on what song you sync it to).
4.I made my own level uberASM based on the shell shooter uberASM to dynamically spawn the sprites (status 08 instead of 09). It reads in a byte sequence to determine which sprite to spawn, and does so every x frames (where x is dependent on your BPM, for 90BPM I think I used 36.75 frames average).
5. I am checking if the user holds down the corresponding button when the sprite is in the y-range to determine if they hit the step early/on-time/late
6. I increment the score counter when the detection in 5 succeeds.


Note I have everything working except step 5 (detecting when the sprite is in a specific pixel range has proven difficult for me). When I solve it I will update this post again.

---

original post:

I am working on a proof of concept mario hack centered around music and controlling mario with a dance pad (think ddr-like). I am in the early stages but am looking for ideas on how to approach creating moving arrows that go from the bottom of the screen to the top. Even just a few nudges/hints in the right direction is helpful. I will also admit this is my first hack, so I am sorry if there is an obvious answer I have missed.

The requirements I think I need:

1. the arrows don't interact with mario or other sprites (display only)
2. can somehow represent button holds by either repeating the arrows (sprite limit?) or elongate them for the duration of the button press.
3. have the timings consistent so I can script them in time with the song (I assume if I set spawns to an absolute position on the screen and always spawn at the same y-position that this should be relatively easy to keep consistent).

I have a background in embedded software engineering (but admittedly haven't done any actual embedded software for a few years now) so even an idea in pure asm no matter how 'advanced' would be incredibly helpful.

See the image at the bottom for a reference to the types of arrows I am talking about.


My ideas so far:
1. Create an ExAnimation in layer 3 for each arrow and the jump buttons, and somehow control when they play and make multiple play at the same time.
2. Use the skull platform and somehow make it non-interactive, but I don't know how to make it variable length like in smm2.

Some more background on the project if anyone is interested:

I wanted to create something fun that would keep me active during winter. I am aware level design will be a challenge since 'hold right' doesn't exactly work well with ddr style games but that's part of the fun for me. I've been toying with procedural level generation for a while now, and the thing I am thinking of doing is choosing the song, getting the required choreography/inputs and timings, then generating a level around those inputs.

Wow thank-you for the detailed response. I will attempt to reach out to the vhack team for some hints. I would have never known about that level in the hack had you not mentioned it.

That customizable sprite killer block is perfect, this is a very good idea for how to destroy sprites and check button presses for the scoring system. Thanks also for pointing me to SA-1, this makes me think I should read through as many patches as possible to see what else I may be missing. Your points on 3) are well noted and I appreciate you mentioning some of those to me before I fall in the rabbit hole.

I'm really glad you mentioned that about AddmusicK, having the music interrupt or pass data gives me a better-than-I-expected option.

Thanks again, I have a lot to go through and test out.
I am working on a multiworld usb2snes application. I am having trouble reliably getting a few different values. I've had mixed success so far. The things I'm remaining stumped on are:

1. Determine if the player is on the overworld or in a level (I feel as if this should be easy)
2. Get the current level number if the player is in a level

What I've been doing:

1. I cannot find a flag in the RAM map that is "player is in overworld" I'm beginning to think that doesn't exist, and there might be a more clever way to detect it. Any suggestions would be appreciated.

2. I was using the first two bytes of $7E010B to get the current level number, but found it doesn't work with vanilla smw or older hacks such as Dram World. For those it always returns 0. It does work for some hacks like Akogare and Baby Kaizo. Is there a better RAM value to use for all hacks or just the older hacks? Does anyone know the specifics of what causes a hack to have 0 for the first two bytes of the $7E010B stack?

Any help is greatly appreciated!
Originally posted by Kevin
1. Check for the value in $7E0100 (current game mode). If it's 0x14, Mario is in a level, if it's 0x0E he's in the overworld.
2. Yeah $7E010B only works because of the "LevelNum" patch that most hacks nowadays use (because it's included in tools like Pixi, UberASMTool and recently also Lunar Magic), but it won't work in older hacks. There's no real way in vanilla to know in which sublevel you are, only the level you entered from the overworld (so the main sublevel), which is found at $7E13BF (although it uses a weird format so it's not as straightforward as $7E010B). I guess to work around this you could apply the LevelNum patch yourself to the hacks, if it's possible for you (you can find it for example here).


Thank you so much for the fast reply! I see why I missed the info in $7E0100 it's not searchable behind that link in the description. Also thank you so much for the LevelNum patch information, I think I can work with that.
Hello,

I am attempting to use ChangeMap16.asm in uberasm. My objective is to dynamically place one block on level init. I will eventually expand this further, but just to start I want to place one block. If it's relevant, I am using the Flux Baserom. I apologize in advance if I am missing something more fundamental, I am new to making hacks.

I followed the advice here: https://www.smwcentral.net/?p=viewthread&t=124140&page=1&pid=1619829#p1619829 and have the routine inserting without errors now.

My attempt is to place tile 116 (note block from 16x16 tile map editor) at (05,05). I just get a black screen when I go into the level though. I've been trying a this for a while, any advice is appreciated.

My level105.asm file has the following contents:

Code
!block_number = $116

init:
	STZ $1933
	LDA #$0
	STA $98 ; y_1
	LDA #$05
	STA $99 ; y_2
	LDA #$0
	STA $9A ; x_1
	LDA #$05
	STA $9B ; x_2
	LDA #$01
	STA $1933 
	REP #$20
	LDA #!block_number
	%call_library(ChangeMap16_main)
	SEP #$20 
	RTL
Originally posted by Thomas
It's because you're using the "call_library" thing the FAQ mentions. Assuming you're using the form of the macro that the FAQ has, that macro is also loading a value into A, but assumes A is 8-bit and not 16-bit. So since you're calling the macro while A is 16-bit, you get a crash from the code ending up misaligned.

You don't need to use the call_library thing for UberASM Tool's included library files, it's only meant for when you're combining two existing UberASM codes to use them together in the same level. For safe routines like the change map16 routine, you just call it via a JSL (i.e. JSL ChangeMap16).


Also, this doesn't actually cause any problems here, but I would strongly recommend making sure your constants are written with even number of digits (e.g. $xx, $xxyy, $xxyyzz).


Thanks! It worked - just had to sort out the high/low byte in relation to screen coordinates, but I got that too now. I really appreciate your help #tb{:)}.
Originally posted by Gulaschko
Hey inkydom, would it be possible for you to share your final UberASM code in here? Because I do not quite know how to mess with those high and low bytes of the position and it would be really helpful to see what you have done! #tb{^V^}


Sure thing. I'm going to provide an explanation that fits my use case, bear in mind I'm not an expert. I'll include the code after.

The x and y positions are stored using two bytes each. let's call the locations in memory of the position values:

xAddress and xAddress+1 and yAddress and yAddress+1.

For the sake of my use case and this example lets also assume its a horizontal level (but I *think* a vertical level would just swap x and y).

xAddress is the position on the screen. I.e. 0 to 256 (in decimal) or 0x00 to 0x100 in hex
xAddress+1 is the screen number it is on, which at the leftmost will be 00

While I'm sure you can do 16-bit math to make this work as one number, I'm thinking of it as two separate ones:

Let's say
xAddress=0x02
xAddress+1=0x10

This would be one screen in from the left, and one tile/8 pixels from the screen edge

yAddress similarly is the position on the screen, but 0 is at the top of the screen.

yAddress=0x00
yAddress+1=0x00

This is a tile at the topmost row of the screen scrolled to the top.

So here is some code that dynamically generates 3 screens of tiles, modifying the x value and keeping the y value constant:

Code
!block_number = $0115

!currentX = $7F9CFE
!currentY = $7F9D00

!x1 = $9A
!x2 = $9B

!y1 = $98
!y2 = $99

;screenposition,screen#

init:
	LDY #$03
	-
	LDX #$16
	--
	JSL .setUpXLow
	JSL .setupY
	;spawn block
	JSL .spawnBlock
	DEX
	BNE --
	JSL .setUpXHigh
	DEY
	BNE -
	RTL

.setUpXLow
	;set up x low
	LDA !currentX
	CLC
	ADC #$10
	STA !currentX
	RTL

.setUpXHigh
	;set up x high
	LDA !currentX+1
	CLC
	ADC #$01
	STA !currentX+1
	RTL
.setupY
	;setup y low
	LDA !currentY
	STA !currentY
		
	;setup y high
	LDA !currentY+1
	STA !currentY+1
	RTL
.spawnBlock
	STZ $1933
	LDA !currentY
	STA !y1
	LDA !currentY+1
	STA !y2
	LDA !currentX
	STA !x1
	LDA !currentX+1
	STA !x2
	REP #$20
	LDA #!block_number
	JSL ChangeMap16_main
	SEP #$20 
	RTL


Here is a screenshot of my running game with the tiles I'm generating at the top of the screen:

  • Pages:
  • 1