Jump to content
IGNORED

Beyond Evil - now playable


Heaven/TQA

Recommended Posts

well... in MADS you would have something like this:

 

sqrtabl

:256 .byte <[#*#]

sqrtabh

:256 .byte >[#*#]

 

so in theory:

 

ldy #monster_type_id

lda mx

sec

sbc px

bpl

eor #$ff

clc

adc #1

tax

lda sqrtabl,x

sta temp+1

lda sqrtabh,x

sta temp2+1

lda my

sec

sbc py

bpl

eor #$ff

clc

adc #1

tax

lda sqrtabl,x

clc

temp adc #0

lda sqrtabh,x

temp2 adc #0

cmp monsterdistance,y

bcc yes_collision

no_collision

 

just out of my head...

Link to comment
Share on other sites

That looks pretty good. I'd like to see how well it actually works.

The only problem I see is now that monsterdistance is now pre-squared and you can't check (x2-x1) or (y2-y1) against it to bail out of the routine early to save some clock cycles. A very rough estimate puts it at 40+ clock cycles but I ddidn't use a book so that could be way off. The table of squares still take quite a bit of memory too. I don't see a shift to divide by 2 did I miss something?

I suppose you don't have to check distance every vblank or all monsters every vblank. (you aren't moving everything every frame right?)

With 50 or 60 vblanks / sec, if you check 1 monster every vblank, you end up updating 50 monsters in 1 sec or 10 monsters at least 5 times / sec.

And once a monster has seen/smelled you could update those more often if needed, it just depends on how much time you have to play with.

Edited by JamesD
Link to comment
Share on other sites

If you really need more range than 1 shift gets you, you can try shifting twice. I have my doubts about how well it would work though. That would result in 4 pixels variance.

Actually, it would vary by location since we are talking about squaring and adding two numbers. Dropping that much precision could be ugly.

Link to comment
Share on other sites

Overlapping circle observations...

2D array, 2D array, SQRT. That's three table lookups and two have a multiply involved. That's gotta cost some serious clock cycles.

It's also 2 arrays. 1 for pow and 1 for sqrt. So it's also two memory pages.

Ouch

 

 

I'm still not sure I follow the double circle idea. I guess you could wear different armor that makes you more or less detectable.

Some could be visible and others could be stink. For example... dead hide of impenetrable beast could protect well but gets you mobbed by monsters.

You could have stealth armor (ooooooooo... stealth!!!!) that makes you less visible. But then you could do that just by using a subtract factor for the final distance which would be faster.

 

<edit>

Correction, add factor. To subtract just use a negative number.

Edited by JamesD
Link to comment
Share on other sites

I don't get a double-circle concept either.

 

I suppose you might take the philosophy that if the player's circle of influence touches the monster, then that entitles him to some defensive ability against attack.

 

It seems all this is getting kinda complicated... do you think the end result will be better using all this complexity?

Link to comment
Share on other sites

I don't get a double-circle concept either.

 

I suppose you might take the philosophy that if the player's circle of influence touches the monster, then that entitles him to some defensive ability against attack.

 

It seems all this is getting kinda complicated... do you think the end result will be better using all this complexity?

I can see the player circle from the detectability (stealth, stink, shiny, noisy) standpoint but you don't need a circle, just added/subtracted distance.

There should be no circle, only distance. It just happens to form a circle around a monster or the player.

 

You might need a distance calculation from the player to calculate the effectiveness of a spell or accuracy of an arrow.

But then it's still just distance you are calculating and you could check the results outside a callable distance routine.

Link to comment
Share on other sites

From the detectability standpoint there is a lot of potential to mess with the player. :)

Some armor might be required to kill a boss... but if it put it on too soon it can tire you, make you sweat, attract too much attention too soon and get you killed. The longer you wear a heavy piece of armor the greater the distance you are detectable from.

That might be fun to throw at the player but the complexity might be a bit much for the memory.

Edited by JamesD
Link to comment
Share on other sites

well... actually i brought the 2 circle stuff in the discussion which maybe can lead to a circle with radius 1 might be the player...or circle of 4/8 pixel...

 

the only goal right now is to have a quick and good looking solution of player putting the monsters in hunting mode...

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

ok... got it run on my real setup and I have to admit that the sprite routine is quite good...better 50fps "feeling" on real machine than in any emulator... again...nothing can beat the real thing...

 

but still have to fix the damned sprite garbage sometimes appears on the screen.

Link to comment
Share on other sites

it's definitly this routine and it's logic:

 

check_background: lda nxpos
		lsr
		lsr
		sta checkb0+1
		lda nypos
		tay
		lsr
		lsr
		lsr
		tax
		lda linetab2l,x
		clc
checkb0		adc #0
		sta v0
		lda linetab2h,x
		adc #0
		sta v0+1
		ldx #1;depends on even ypos 2 or 3 lines checked
		tya
		and #7
		beq checkb1;only 2 lines
		inx
checkb1		ldy #0
		sty temp
checkb2		lda temp
		ora (v0),y
checkb4		iny
		ora (v0),y
checkb5		iny
		ora (v0),y
		sta temp
checkb6		tya
		clc 
		adc #$26;next line
		tay
checkb3		dex
		bpl checkb2
		lda temp
		rts

 

so... actually I am checking the background buffer each time a sprite moves... so as you can see I am always checking 2x3 or 3x3 cells in the backbuffer... not that this is even not necessary the ora'ing is wrong, too as it gives "wrong" results...

 

f.e. this is the backbuff on the new position

 

AAA
AAA
AAA

 

results in A

 

assume that the monster sprite is now moving 1 pixel to the right... and the backbuff would look like this:

 

.AA
.AA
.AA

 

so actually the collum is free to move but the routine would give me A as result and so that movement would be rejected...

 

or

 

..A
BBB
BBB

 

and it seems that there are cases where my set_monster routine would act wrong by this check background logic... I will make tests now with a checkup, checkleft, checkright and checkdown special routines...

post-528-1244381606_thumb.png

post-528-1244381615_thumb.png

Edited by Heaven/TQA
Link to comment
Share on other sites

i don't really get it... maybe I am really stupid...now the third time I am rewriting the sprite routines... maybe you can help here...

 

can you play around with this build and try to recreate the garbage where the sprite engine misses to erase the same sprite and moves on to next position and draws the sprite???

 

under which circumstances in your oppinion does it appear???

sprite10.zip

Link to comment
Share on other sites

i don't really get it... maybe I am really stupid...now the third time I am rewriting the sprite routines... maybe you can help here...

 

can you play around with this build and try to recreate the garbage where the sprite engine misses to erase the same sprite and moves on to next position and draws the sprite???

 

under which circumstances in your oppinion does it appear???

I can't get it to create garbage but if you go to the right edge of a dungeon and then go up or down it moves the character to the left a space and then up or down.

<edit>

Oops... spoke too soon. The garbage is a sprite image you can run over and it never moves.

It appears to happen at the spawn points. Are you sure it's not a setup issue?

Edited by JamesD
Link to comment
Share on other sites

I found some additional issues.

 

1. When trying to exit a room it drew a character outside the room. This happened once. I was above the door and walking left when it happened.

2. Monster disappeared once. It was a monster that was just spawning and I somehow managed to walk over it. Once I moved it appeared again.

3. Crashed after waling all over the place.

Link to comment
Share on other sites

Thanks James... will look into the spawn routine, too...

 

in the debug build you should only walk from room #1 to room #2 as the other rooms are drawn but I am not telling the monster engine that we are in a new room... ;) and the monsters are only walking into one direction to make it easiert to hunt the bug...

 

you can press option/select/start to show the back buffer at any time.

 

I can recreate the bug when bumping in one monster from the right side and then tease it...so move little bit away and then again back...

Link to comment
Share on other sites

Thanks James... will look into the spawn routine, too...

 

in the debug build you should only walk from room #1 to room #2 as the other rooms are drawn but I am not telling the monster engine that we are in a new room... ;) and the monsters are only walking into one direction to make it easiert to hunt the bug...

 

you can press option/select/start to show the back buffer at any time.

 

I can recreate the bug when bumping in one monster from the right side and then tease it...so move little bit away and then again back...

I downloaded the file and just clicked on it. It wasn't limited to 2 rooms whatever I ran.

 

If it's caused by interaction between the character and baddies the only thing I can think of that would do that is if the location was updated before erasing the old position.

 

After playing with it some more, it also marked a spot on the backbuffer as occupied and didn't clear it. So there is a spot on the screen you can't walk through even though nothing is there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...