BomberMan / Dynablaster style game

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

Post Reply
sdm
Posts: 293
Joined: Tue Apr 11, 2006 4:08 am
Location: Poland

BomberMan / Dynablaster style game

Post by sdm » Thu Nov 09, 2017 1:09 pm

Some time ago I tried to do a game similar to Bomber Man. The main reason was the curiosity I could do with my low programming capabilities ... I had some problems, but I could almost copy the basics of this game. Of course, still a long way to go and I have some things I can not solve.

The first thing to do is to calculate / extract ATTRIBUTE TABLE so that it accurately matches the location of the bomb. The bomberman bomb has a different palette than its explosion (changing the palette in the attribute table). In my demo of the game, the place of the bomb is also copied to RAM variables BombY_Temp and BombX_Temp. Maybe their position would be good to calculate the position of this place on the screen in the Attribute Table? The problem is that one byte (two bits per single 16x16 field) in this array corresponds to four 16x16 pix fields on the screen, I do not know how to calculate it.

I would like some tips on how to make randomly moving opponents. The one I did in this demo came out pretty weak.

Another thing is the best way of animating a background in UNROM (it is not possible to animate the background using CHR bank switching). Originally the code I have under UNROM, but the demo I have now moved to the CNROM where animating the bomb is by switching CHR banks. However, I would prefer UNROM.

Link to an earlier topic where I asked for help with the bomb code.
https://forums.nesdev.com/viewtopic.php?f=10&t=16256

Sample code I used to animate the bomb and its explosion in UNROM:
Unfortunately it overloads the NMI (VBLANK), which crashes in NTSC (in the PAL barely). I have no idea how to do this as efficiently as possible.

Code: Select all

Bomb_Anim_no:
	RTS
Bomb_Anim:		;in NMI loop

	INC Bomb_Anim_Timer	;timer
	INC Bomb_Anim_Timer
	INC Bomb_Anim_Timer
	INC Bomb_Anim_Timer

	LDA Bomb_Anim_Timer
	CMP #$00
	BCC BA_no1

	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE1_AddrLO
	STA $2006
	lda #$10			;pattern table bgr tile1 nr.
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE2_AddrLO
	STA $2006
	lda #$11			;pattern table bgr tile2 nr.
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE3_AddrLO
	STA $2006
	lda #$20			;pattern table bgr tile3 nr.
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE4_AddrLO
	STA $2006
	lda #$21			;pattern table bgr tile4 nr.
	sta $2007
;	LDA #$00	;reset screen (Not needed, there is one at the end of the NMI loop.)
;	STA $2006
;	LDA #$00
;	STA $2006

BA_no1:

	LDA Bomb_Anim_Timer
	CMP #$40
	BCC BA_no2

	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE1_AddrLO
	STA $2006
	lda #$12
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE2_AddrLO
	STA $2006
	lda #$13
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE3_AddrLO
	STA $2006
	lda #$22
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE4_AddrLO
	STA $2006
	lda #$23
	sta $2007
;	LDA #$00
;	STA $2006
;	LDA #$00
;	STA $2006

BA_no2:

	LDA Bomb_Anim_Timer
	CMP #$80
	BCC BA_no3

	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE1_AddrLO
	STA $2006
	lda #$14
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE2_AddrLO
	STA $2006
	lda #$15
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE3_AddrLO
	STA $2006
	lda #$24
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE4_AddrLO
	STA $2006
	lda #$25
	sta $2007
;	LDA #$00
;	STA $2006
;	LDA #$00
;	STA $2006

BA_no3:

	LDA Bomb_Anim_Timer
	CMP #$C0
	BCC BA_no4

	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE1_AddrLO
	STA $2006
	lda #$12
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE2_AddrLO
	STA $2006
	lda #$13
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE3_AddrLO
	STA $2006
	lda #$22
	sta $2007
	LDA BOMB_PPU_TILE1_AddrHI
	STA $2006
	LDA BOMB_PPU_TILE4_AddrLO
	STA $2006
	lda #$23
	sta $2007
;	LDA #$00
;	STA $2006
;	LDA #$00
;	STA $2006

BA_no4:
	RTS

Attachments
demo4_001.jpg
demo4_001.jpg (166.65 KiB) Viewed 3984 times
demo4.nes
(64.02 KiB) Downloaded 163 times
Last edited by sdm on Fri Nov 10, 2017 2:28 am, edited 1 time in total.

User avatar
Broke Studio
Formerly glutock
Posts: 164
Joined: Sat Aug 15, 2015 3:42 pm
Location: France
Contact:

Re: BomberMan / Dynablaster style game

Post by Broke Studio » Thu Nov 09, 2017 2:01 pm

Hi, I think I answered you over Nintendo age.

Edit : well at least about the code you posted
My first game : Twin Dragons available at Broke Studio.

User avatar
Ryoga
Posts: 47
Joined: Wed Mar 16, 2016 2:08 pm
Location: World 9 - Warp Zone

Re: BomberMan / Dynablaster style game

Post by Ryoga » Fri Nov 10, 2017 12:32 am

I think the beginning is very promising. Do you plan to continue with the development of this dynablaster clone?

sdm
Posts: 293
Joined: Tue Apr 11, 2006 4:08 am
Location: Poland

Re: BomberMan / Dynablaster style game

Post by sdm » Fri Nov 10, 2017 2:35 am

Thanks. I noticed post on nintendoage. However, moving the BOMB_PPU_TILEx_Addrxx variables to the PPUs is a lot of code, and it takes NMI time - I do not know if this can be simplified with UNROM. However, in Bomberman there are no CHR banks switching, and there are many bombs and each has its own animated explorations (which had to be in VBLANK time).
Last edited by sdm on Tue Mar 27, 2018 2:01 pm, edited 1 time in total.

User avatar
Broke Studio
Formerly glutock
Posts: 164
Joined: Sat Aug 15, 2015 3:42 pm
Location: France
Contact:

Re: BomberMan / Dynablaster style game

Post by Broke Studio » Fri Nov 10, 2017 3:44 am

When updating the NT you don't need to update the address if the next tile you update is right after the previous one.

Code: Select all

;|---|---|
;| A | B |
;|---|---|
;| C | D |
;|---|---|


lda BOMB_PPU_TILE1_AddrHI
sta $2006
lda BOMB_PPU_TILE1_AddrLO
sta $2006

lda #$10 ; tile A index
sta $2007
lda #$11 ; tile B index
sta $2007

lda BOMB_PPU_TILE3_AddrHI
sta $2006
lda BOMB_PPU_TILE3_AddrLO
sta $2006

lda #$20 ; tile C index
sta $2007
lda #$21 ; tile D index
sta $2007

Updating 4 tiles in a frame shouldn't be a problem.

Also, in your code, you should use BEQ instead of BCC to avoid updating the NT on each NMI.

You can read this topic about attributes : viewtopic.php?f=10&t=7253.
My first game : Twin Dragons available at Broke Studio.

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2032
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: BomberMan / Dynablaster style game

Post by FrankenGraphics » Fri Nov 10, 2017 4:02 am

The fact that you can walk freely in all directions where you're free to do so sets it apart from Bomberman/Dynablaster, which could be a nice change - especially if enemies could take advantage of it too!

I'd probably speed them up a bit.

One way to make them more "clever" without adding constantly running where-is-the-player-checks is have them decide on moving randomly or targeting the player every tile, ie move 16 pixels, done? check for a new target, move 16 pixels, done? repeat.

You can also read up on how the ghosts in pacman have different "personalites" which adds up to a sensation of them using tactics together.

If you keep it that way, i'd recommend that the game helps out the player a bit rounding corners as it is easy "getting stuck" on edges if your aim/timing isn't 100% accurate.
http://www.frankengraphics.com - personal NES blog

sdm
Posts: 293
Joined: Tue Apr 11, 2006 4:08 am
Location: Poland

Re: BomberMan / Dynablaster style game

Post by sdm » Fri Nov 10, 2017 4:48 am

glutock wrote:When updating the NT you don't need to update the address if the next tile you update is right after the previous one.
You're right, I did not think about it ... it changed a lot, thanks! :)
I totally forgot that every write to 2007 registry increases the PPU's address by one... :oops:

And actually the BCC change on BEQ / BNE has changed quite a bit. I forgot that using BCC, writing to PPU was done in every frame unnecessarily many times with the same value. Now the code works fine in UNROM.

I also had a problem with the method of collecting items on the screen, which are also elements of the background. But I did it and it works just fine. The most important code itself checks the BGR tile number on the screen and resets its place to the empty background.
Attachments
demo11.nes
some update
(256.02 KiB) Downloaded 122 times
demo10d6_.nes
Fixed latest UNROM code, now works properly without CHR bank switching + hidden items & door inside walls after explosion (test code)
(256.02 KiB) Downloaded 121 times
demo6b.nes
added wall explosion animation (old - CNROM)
(64.02 KiB) Downloaded 129 times
demo5c.nes
+ improved the random movement of one enemy (test). (old - CNROM)
(64.02 KiB) Downloaded 137 times

sdm
Posts: 293
Joined: Tue Apr 11, 2006 4:08 am
Location: Poland

Re: BomberMan / Dynablaster style game

Post by sdm » Sat Dec 09, 2017 12:48 pm

Some changes in the code. There are hidden things and doors in the walls. Not tested on the hardware - I am curious if everything works ok on NTSC consoles.


EDIT: (Ryoga question)

The size / length of the fire will not be increased (at least for now, because I have a problem with this in UNROM - in the mapper with switching CHR banks it will be easy). Things to collect will have some functions, but for now I do not know what.
One person wrote to me that the code hangs on Everdrive running on the NTSC console - is that true? : /
Graphics / Music are temporary. I have no idea for them.

I tested the code that "helped" in entering the side passages (as in BomberMan). Unfortunately, it is problematic. Even in the original game as you go and want to turn sideways, for example by holding DOWN + RIGHT, the character is blocked. So, probably leave it as it is.

EDIT 2018.05.24 - new controls
Attachments
demo12_2018-05-24.nes
improved hero control (now you do not have to be perfectly in the side passage - the code "helps" to go sideways)
(256.02 KiB) Downloaded 84 times
demo11b_test_3.nes
(256.02 KiB) Downloaded 131 times
demo11_test_001.jpg
demo11_test.nes
(256.02 KiB) Downloaded 143 times
Last edited by sdm on Thu May 24, 2018 12:32 pm, edited 10 times in total.

User avatar
Ryoga
Posts: 47
Joined: Wed Mar 16, 2016 2:08 pm
Location: World 9 - Warp Zone

Re: BomberMan / Dynablaster style game

Post by Ryoga » Sun Dec 10, 2017 6:18 am

I have tried the new demo, including the two test levels after the main level. I like the sprite of the protagonist although it is difficult to overcome the design of the character in the original game.

Playing the demo I have seen that an item appears with a monger wrapped in flames or something similar. Is that item supposed to increase the power of the bomb? If so, after taking it the power of the bomb remains the same.

User avatar
bazza
Posts: 89
Joined: Fri Nov 24, 2017 1:36 pm
Location: Argentina
Contact:

Re: BomberMan / Dynablaster style game

Post by bazza » Sun Dec 10, 2017 6:39 am

beautiful game.
bomberman moves sprite by sprite, not to remain in the middle of corridor.

Post Reply