Dimension Drive (working title)

Mugi

Member
thanks!
the recoil physic still needs tons of work, but now it does both horizontal and vertical movement, and as far as today's work, that was my goal. i will adjust it to function properly on a later date.
i still need to work on getting my attack done again, but for that I have to finish redoing the player sprites so that will take a while.
i also started creating a template for the level selection screen but that will be another can of worms (i am NOT looking forward on creating a working parallax!)

trying to get some cavern tilesets done so that i can continue the level design a little is the ultimate goal of this night. (yeah, in my dreams :p)
Im fairly satisfied that i got the physics ported over to 4.1.0 now though (and sprite HUD!!!!), so it's a good point to continue from. Aside attack and ducking, i have everything working now (ducking i could make work but i dont want to use an action state for it, so it will have to wait a bit more.)

Edit: here's one last thing from today's physics play =)

https://youtu.be/CHs7gkog4q8
 

Mugi

Member
jorotroid said:
Whoa! This is looking amazing. I am particularly loving the background so far.

ah, the sprite hud guy himself!
it's largely thanks to you that my game looks anything like i wanted it to :p

speaking of the hud, did you reimplement yours on 4.1.0 already?
how did you solve the issue with it being stuck on 0HP after dying ? I got it working but im not really that good with assembly, so would be nice to hear more from that.
 

Mugi

Member
like i said, i actually went back to graphics a little.
since my game will have similar mechanics to shatterhand, i will also need a health platform that restores HP when you crouch while standing on top of it.
here's my implementation. (just visual for now, no functionality)

a 16x16 pixel health icon, animated with 12 unique frames of animation, created using 5 8x8 pixel tiles.
I wont lie to you, creating this took an eternity and then some !

a more final form of the platform design in the screenshot, but the cross animation is the same as on the video.

https://youtu.be/GFJP3XNpDHo
game_031.png
 

jorotroid

Member
Mugi said:
ah, the sprite hud guy himself!
it's largely thanks to you that my game looks anything like i wanted it to :p

speaking of the hud, did you reimplement yours on 4.1.0 already?
how did you solve the issue with it being stuck on 0HP after dying ? I got it working but im not really that good with assembly, so would be nice to hear more from that.

I'm glad you found my spirte hud was useful to you!

I haven't reimplemented much at the moment. So far most of my time with 4.1 has been exploring and "mapping" out where stuff has moved/changed in the code. But I can make that higher on my priority list. But if ChronosV2 puts out his sprite HUD first, you might want to consider using his as I think it will be more customizable. I'll probably try his at some point and go with whichever one uses less space (I'm going to need every bit for my game).

By it being stuck on 0HP after dying, do you mean after you die and respawn, it is stuck on 0HP? I don't recall if I had that issue. I did have an issue where at 0HP, the healthbar would fill back up. That I did solve, but I am a little fuzzy on how I did it at the moment. I'll probably remember things better as I reimplement them.
 

Mugi

Member
jorotroid said:
I'm glad you found my spirte hud was useful to you!

I haven't reimplemented much at the moment. So far most of my time with 4.1 has been exploring and "mapping" out where stuff has moved/changed in the code. But I can make that higher on my priority list. But if ChronosV2 puts out his sprite HUD first, you might want to consider using his as I think it will be more customizable. I'll probably try his at some point and go with whichever one uses less space (I'm going to need every bit for my game).

By it being stuck on 0HP after dying, do you mean after you die and respawn, it is stuck on 0HP? I don't recall if I had that issue. I did have an issue where at 0HP, the healthbar would fill back up. That I did solve, but I am a little fuzzy on how I did it at the moment. I'll probably remember things better as I reimplement them.

I'll stick with my variation of yours, as it does everything i need it to, and it's really compact as far as code goes now.

as for the issue, for me it was stuck permanently at 0HP after dying and respawning, until the emulator was resetted. (the health worked, it was just the hud not updating.)
i fixed it simply by changing your "death check" (in predraw, that checks for #$FF and writes #$00 on it to not tilt the HUD) to write #$00 into Object_health,x instead of temp3, since that, it has functioned as intended.

as for setting it up, instead of handleobjectcollisions.asm, you have to set the trampoline into bank14.asm now, and just set the macro into a custom define. (i just call the macro from predraw straight now.)

as for later updates, do tell me if you write more compact code, as i will propably need all the bits i can save on my game too :) (i posted my variation of your hud code in your thread, since it only counts up to 8 HP and only half or full sprite to draw, the draw logic is much smaller than yours.)


edit: im also extremely interested on, if you start digging up how to strip of the default hud code, since that stuff eats some serious space as far as i understood.
(i was glancing over it a little but havent really dug in yet, it seems to be kinda allover the place. Like you, most of my time has been exploring the new code and redoing my physics.)
 

jorotroid

Member
Mugi said:
I'll stick with my variation of yours, as it does everything i need it to, and it's really compact as far as code goes now.

as for the issue, for me it was stuck permanently at 0HP after dying and respawning, until the emulator was resetted. (the health worked, it was just the hud not updating.)
i fixed it simply by changing your "death check" (in predraw, that checks for #$FF and writes #$00 on it to not tilt the HUD) to write #$00 into Object_health,x instead of temp3, since that, it has functioned as intended.

as for setting it up, instead of handleobjectcollisions.asm, you have to set the trampoline into bank14.asm now, and just set the macro into a custom define. (i just call the macro from predraw straight now.)

as for later updates, do tell me if you write more compact code, as i will propably need all the bits i can save on my game too :) (i posted my variation of your hud code in your thread, since it only counts up to 8 HP and only half or full sprite to draw, the draw logic is much smaller than yours.)


edit: im also extremely interested on, if you start digging up how to strip of the default hud code, since that stuff eats some serious space as far as i understood.
(i was glancing over it a little but havent really dug in yet, it seems to be kinda allover the place. Like you, most of my time has been exploring the new code and redoing my physics.)

Cool, I'll take a look at your code when I get to reimplementing the sprite HUD. Hopefully it will result in an even better Sprite HUD!

Yeah, I will probably look into stripping out the HUD code again, though if it is anything like 4.0.11 I have to be careful because some of the HUD code was also used for the text boxes.

I feel that a lot of my initial time is going to be related to understanding and tweaking how scrolling works. There are a lot of bugs related to it at the moment if I want to use it in my game.
 

Mugi

Member
I looked into it too ,but that code is some lightyears beyond my skills to fix, which left me no choice but to use screen-to-screen and/or one way scroll for my game until someone with actual skill pulls out a functioning 2-way scrolling.
from a quick glance it appears to work, but it has some issues retaining collision data, and the scrolltimings propably need some tweaking (it leaves horrible seams and/or corrupts tile data when you change direction mid-colums)
it also tends to corrupt entire rooms when you change direction and attempt to return into a place you came from.

Since i can't really do much to that with my current skillset, i just decided to move on with the development, and keep the design so that once we have a functioning 2-way scroll, i could bake it in without having to change my designs too much.



for posterity check, here's my version of the hud code i actually have in use now (the one i posted on your thread is for 4.0.11)

predraw:
Code:
	.include SCR_SPRITE_HUD

checkForSpriteHUDDraw:
	LDA gameState			; We want only want to make the HUD in the main gameState.
	BNE drawingSpriteHud
	RTS

drawingSpriteHud:
					; Draws the health symbol at the left side of the bar.
	DrawSprite #$08, #$E0, #$7C, #%00000001, spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
					; on death, player_object gets it's health set to #$FF which the HUD doesn't really appreciate,
					; so we are checking, and if HP is #$FF we set it to #$00
	LDX player1_object
	LDA Object_health,x
	CMP #$FF
	BNE thePlayerIsAlive
	LDA #$00
	STA Object_health
	JMP letsGetThisHUDStarted

thePlayerIsAlive:
	LDA Object_health,x
	STA temp3
		
letsGetThisHUDStarted:
	;; Draw the Health Bar
	DrawStatusBar #$18, #$E0, temp3, #$7F, #$11, #$7E, #$11, #$7D, #%00000001

macro:
Code:
MACRO DrawStatusBar arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8
	;; arg0 x position of bottom bar segment
	;; arg1 y position of bottom bar segment
	;; arg2 value bar is displaying
	;; arg3 location of empty graphic
	;; arg4 location of 1/4 graphic
	;; arg5 location of 1/2 graphic
	;; arg6 location of 3/4 graphic
	;; arg7 location of full graphic
	;; arg8 attribute data (bits 0 and 1 determine which palette is used)

	LDA #$00		
	STA temp2		;Number of full sprites
	STA temp1		;if there is a partial sprite and what is it
	LDA #$04		
	STA temp		;Number of empty sprites

	LDA arg2
	;see if health empty
	AND #%00001111
	BEQ readyToDrawHealthBar
	; store full sprite number
	LSR a
	STA temp2
	; no bit was left over
	BCC drawHealthBar
	; bit left over, our half sprite
	LDA arg5
	STA temp1

drawHealthBar:
	LDA temp		
	SEC
	SBC temp2		;Number of full sprites
	STA temp		;Number of empty sprites
	BEQ readyToDrawHealthBar	;If we only have full sprites, then we can go ahead and draw
	LDA temp1
	BEQ readyToDrawHealthBar	;Does an empty sprite need to be replaced with a partial sprite?
	DEC temp ;remove 1 empty sprite for partial

readyToDrawHealthBar:
	LDX temp2
	LDA arg0
	STA temp2	;Now temp2 is the x position of drawing from left to right

fullSpritesLoop:
	TXA
	BEQ partialSpriteDraw
	DrawSprite temp2, arg1, arg7, arg8, spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset

	LDA temp2
	CLC
	ADC #$08
	STA temp2

	DEX
	JMP fullSpritesLoop

partialSpriteDraw:
	LDA temp1
	BEQ readyToDrawEmptyBars
	DrawSprite temp2, arg1, temp1, arg8, spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
		
	LDA temp2
	CLC
	ADC #$08
	STA temp2

readyToDrawEmptyBars:
	LDX temp		;Loaded into X for iteration
emptySpritesLoop:
	TXA
	BEQ doneWithHealthBar
	DrawSprite temp2, arg1, arg3, arg8, spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
		
	LDA temp2
	CLC
	ADC #$08
	STA temp2

	DEX
	JMP emptySpritesLoop

doneWithHealthBar:

ENDM

i reduced the counter to 4bits here since my game uses max HP of 8, so it worked for me. (also draws horizontally now.)

the usual apply, set a trampoline in bank14, and make a define for the macro, which is then called from predraw (is there a better way to do this ?)
 

Mugi

Member
Okay this was a bit of a struggle (i fought several hours with getting the health stuff to work how i wanted it to) but allow me to present to you Animated health platforms !!

Pressing down while standing on the platform activates it to restore HP, but only if your HP is not full.
in the final version, healing will cost money, but money has not been implemented yet, so currently they just work.

https://youtu.be/-xyn0iGjA0Y
 

Mugi

Member
Yeah, im still just stuck in my physics test room.
I dont want to spend much time on the world design before i have the required mechanic elements done (i still need a wall grab tile, an ice tile, and maybe something else :p) then i will start expanding the world and levels :)
 

Mugi

Member
I got sick so complicated code is a no-no for a few days i guess, head hurts too much for that....

meanwhile i went back to the dreaded stage selection im attempting to pull off, and i got the base working a-ok for now.
graphics are totally placeholder at this point in time, and i still have to deal with the player sprite flashing on the top corner for a split second at spawn. (on that note, i might just code it so that the warp trigger sets you to hidden mode at spawn. Need to toy with that.) nayway, here's something of what it might look when more done :)

https://www.youtube.com/watch?v=QBvqFARdPws
 

Mugi

Member
starting to get the look in i guess...
im really out of ideas at the moment of how to make this look like (and what to put in the stage images :p)
only basic layout is done, i'll have to decorate it a bit more once i get my code up and running for getting the extra graphics bank to work so that i can use more than one tileset to draw stuff (the text at the top and the screen frames kinda ate tiles :p)

I will propably keep it in this state for a while as i work on the framework for the 5-way multi warp for entering all the 5 stages. Also have to draw the "stand" so that the player sprite doesn't float in air :p

https://youtu.be/vkau7AZtfYE
 

dale_coop

Moderator
Staff member
Totally awesome! Love the scrolling effect, it gives a very dramatic effect.
Great work, Mugi <3

PS: Need music on that ;)
 

Mugi

Member
i haven't started learning that yet, but i will dig into famitracker at some point :)
again though, im trying to keep up my workflow here and still working on mechanics and features. Creating the stage selection has been and still is really difficult, i've been forced to completely code my own functions for everything in it so far.
the scroll, the code to disable sprite hud, and player, variables to control the warping, and getting extra graphics for drawing enough detail everywhere..... i still have much work with it.
 

Mugi

Member
was a long night but here it is!

i finally finished writing the code up for my stage selection and the entire screen framework is finally complete and implemented.
have at it!

https://youtu.be/DyTD5JXUtJk

this is a screen with a cursor selectable warp location with unlimited multiwarps (you can input as many warp locations as you want.)
the multi-warp code is also mostly written (just needs a cleanup) but not implemented yet.

again, placeholder graphics, still out of inspiration for the graphics on this one :p
 

CutterCross

Active member
Mugi said:
was a long night but here it is!

i finally finished writing the code up for my stage selection and the entire screen framework is finally complete and implemented.
have at it!

this is a screen with a cursor selectable warp location with unlimited multiwarps (you can input as many warp locations as you want.)
the multi-warp code is also mostly written (just needs a cleanup) but not implemented yet.

again, placeholder graphics, still out of inspiration for the graphics on this one :p

...Did I mention this is the best thing I've ever seen come out of NESmaker?
 
Top Bottom