Jump to content
IGNORED

Diablo-look a like possible on A8?


Recommended Posts

i discovered another "nice" feature... on real hardware (PAL 130XE) the random values seem to be completly different than to atari800win... f.e. on my real machines its far more unlikely that a weapon is dropped compared to the emulated one... (i checked diablo8.atr)

 

can somebody compare this?

Link to comment
Share on other sites

ok. do you found it strange that in the inventory the sorting is changing when you pick up different items? i mean each item has an ID and if you have picked up f.e. item #1 and item #3 then in your inventory list you get #1,#3 listed. but when now picking up #2 you get in the inventory #1,#2,#3 as the inventory code is going through the item list and shows only the ones which are marked with "in the inventory" but skipps the ones who are marked with "still on the floor".

Link to comment
Share on other sites

i just went through the latest printout of the source code and i found the error with the pickup... i am quiting the pick up routine after the 1st item. so i just need to change the routine that it does quit after the 4th cell checked even if there are 4 items to pick up... should be no problem at the moment.

Link to comment
Share on other sites

the picking up routine is cleared up so it works now. you can pick up max. 4 items per frame and the clear routine which whipes the items from the background buffer is now clearing only the item which you have picked up and not all 4 "possible" items you are covering with your sprite...

 

but i am hunting one nasty bug in the inventory code as at the moment you can switch back into the inventory screen but when you are not changing the weapon than it switches back to the first item (the dagger) which i don't know why to be honest...

Link to comment
Share on other sites

it seems that i have found the bug... it was not the inventory routine but the "pick weapon routine" which let you wear your selected weapon...

 

so... it took 2 weeks to found this... if i had a trace function i guess it would be quicker....

 

now i can start to write a first prototype of a dungeon routine... so you get something "new" to see... ;)

Link to comment
Share on other sites

It's really great to see that this game is making so much progress. I'm really looking forward to see the final version of the game. Unfortunately I don't own a 800XL myself, but maybe that fact changes in a few months when I get the opportunity :)

 

Keep up the good work!

Link to comment
Share on other sites

small interim update:

 

- attachted the new build. now you should be able to collect weapons and switch to them correctly. if you leave the inventory screen by hitting ESC the weapons are not switched (as it should be...). now i have to implement "drop marked item" which will be same like destroying item so i will not place the item on the floor by design... ;)

 

- the improving of DEX will not slow down the character but now he should getting faster and having a better chance to hit the enemy

- now you can pickup up to 4 items by once. the background cells of the player sprite are now checked correctly.

 

but first i start to code a maze routine... i am getting bored with the inventory stuff now for nearly 4 weeks... ;) appologise...

 

in the archive you find 2 version... one is the cheat version which drops weapons & gold only and the other one is the "normal" one...

 

have fun... any strange things happening just let me know...

diablo9.zip

Link to comment
Share on other sites

  • 2 weeks later...

small update.

 

attachted turbo basic xl+mapper9.tub

 

please boot the disc and type LOAD "D:MAPPER9.TUB".

 

the basic file draws rooms like i would implement in the first version for Beyond Evil. after one room is drew press a key. there are no boundary checks so its likely that you got an error message. then just rerun the stuff.

 

why i am showing you this? any idea how i can avoid that a room is overlapping an existing room? i mean a simple way just by some simple formulars? i dont want to keep a "bitfield" in memory with the existing rooms (like a z-buffer).

 

just let me know what you think about it... its kind of inspired by Telengard and temple of apshai...

 

10 GRAPHICS 8
20 DIM SXTAB(8),SYTAB(8)
30 FOR I=0 TO 7
40   READ A:SXTAB(I)=A
50 NEXT I
60 FOR I=0 TO 7
70   READ A:SYTAB(I)=A
80 NEXT I
90 DATA 10,20,30,40,10,20,15,20
100 DATA 10,20,15,20,40,20,30,40
110 XP=RAND(256):YP=RAND(128)
120 N=RAND(4)
130 SX=SXTAB(N):SY=SYTAB(N)
140 EXEC DRAW_ROOM
150 DO 
160   GET K
170   OLDX=XP:OLDY=YP:OLDSX=SX:OLDSY=SY
180   REM WHICH DOOR
190   D=RAND(4)
200   N=RAND(8):SX=SXTAB(N):SY=SYTAB(N)
210   IF D=0
220	 XP=OLDX-(SX DIV 2)+(OLDSX DIV 2):YP=OLDY-SY
230   ENDIF 
240   IF D=1
250	 XP=OLDX-(SX DIV 2)+(OLDSX DIV 2):YP=OLDY+OLDSY
260   ENDIF 
270   IF D=2
280	 XP=OLDX+OLDSX:YP=OLDY-(SY DIV 2)+(OLDSY DIV 2)
290   ENDIF 
300   IF D=3
310	 XP=OLDX-SX:YP=OLDY-(SY DIV 2)+(OLDSY DIV 2)
320   ENDIF 
800   EXEC DRAW_ROOM
890   OLDX=XP:OLDY=YP:OLDSX=SX:OLDSY=SY
895   PRINT D
900 LOOP 
999 END 
1000 PROC DRAW_ROOM
1010   COLOR 1
1020   PLOT XP,YP:DRAWTO XP+SX,YP:DRAWTO XP+SX,YP+SY:DRAWTO XP,YP+SY:DRAWTO XP,YP
1025   REM PAINT XP+1,YP+1
1030 ENDPROC 

beyondevil.zip

Link to comment
Share on other sites

Well, you could render the screen, and then use screen memory as your map. Assuming you have things laid out in a big square array...which you probably don't.

 

If you are using a list with x,y,x1,y1 type coordinates you would have to iterate through the list and check to see if the bounds of the box you are considering intersects any that exist in the list. There is an easy and fast way to do these checks, it is similar to clipping or bounding box intersection type calcs in games.

 

*edit* duh I just noticed you included the source, so this line :

 

1020 PLOT XP,YP:DRAWTO XP+SX,YP:DRAWTO XP+SX,YP+SY:DRAWTO XP,YP+SY:DRAWTO XP,YP

 

is your bounding box. You should record and save the coords and use them to check for intersection.

Edited by danwinslow
Link to comment
Share on other sites

i was kicking around ideas for pro/cons regarding the "background buffer" approach and the list intersection approach. the buffer method would need a lot of memory imho. pro for that would be that you could easily have a map for the player... ;)

 

the list approach seems quite smaller in ram usage but i am not sure if its fast enough at the end of the day...

Link to comment
Share on other sites

Well, in games I have done with this kind of restraint, one way is to go ahead and use a mapped 2 dimensional buffer, but keep it small by only loading the 'active' areas..ie., rather than loading an entire dungeon map, only the current room and all of the immediately adjacent rooms would be mapped in memory...the rest would be stored on disk, or perhaps represented as a list and the 'built' as needed into the mapped arrays. Likewise, only the critters that are in these rooms would be present in the animation list, the rest would be frozen. This limits some of the things you can do but its a good compromise between speed and space.

 

Anyways, zipping through a list of 20-30 rooms and doing bounding box intersection calcs would be pretty fast. I dont recall the algorithm exactly but if I recall its just some subtractions and a compare or two. Its a very common operation and you could easily find example source. Any sprite engine will have some version of intersection checking going on.

Edited by danwinslow
Link to comment
Share on other sites

btw. the idea behind this new approach is that the map is build by entering new room. so the player only see one room but he can walk around between the room. as i am using a pseudo random generator the mapper can recreate the level easily (as i mentioned it some time ago).

 

this simple mapper could be used for "indoor" levels and seems quite easy to implement in my game. the other dungeon creators are quite complicated at the moment so i will implement this simple one first to see how it works.

 

thanks, dan.

Link to comment
Share on other sites

  • 5 weeks later...

but it seems still some bugs there... here is the listing

10 GRAPHICS 8
20 DIM SXTAB(8),SYTAB(8)
25 DIM XTAB(32),XXTAB(32)
26 DIM YTAB(32),YYTAB(32)
29 ROOM=0
30 FOR I=0 TO 7
40   READ A:SXTAB(I)=A
50 NEXT I
60 FOR I=0 TO 7
70   READ A:SYTAB(I)=A
80 NEXT I
90 DATA 10,20,30,40,10,20,15,20
100 DATA 10,20,15,20,40,20,30,40
110 XP=160:YP=95
120 N=RAND(4)
130 SX=SXTAB(N):SY=SYTAB(N)
140 EXEC DRAW_ROOM
145 XTAB(ROOM)=XP:YTAB(ROOM)=YP:XXTAB(ROOM)=SX:YYTAB(ROOM)=SY
146 ROOM=ROOM+1
150 DO 
160   GET K
170   OLDX=XP:OLDY=YP:OLDSX=SX:OLDSY=SY
180   REM WHICH DOOR
190   N=RAND(8):SX=SXTAB(N):SY=SYTAB(N)
200   D=RAND(4)
210   IF D=0
220	 XP=OLDX-(SX DIV 2)+(OLDSX DIV 2):YP=OLDY-SY
230   ENDIF 
240   IF D=1
250	 XP=OLDX-(SX DIV 2)+(OLDSX DIV 2):YP=OLDY+OLDSY
260   ENDIF 
270   IF D=2
280	 XP=OLDX+OLDSX:YP=OLDY-(SY DIV 2)+(OLDSY DIV 2)
290   ENDIF 
300   IF D=3
310	 XP=OLDX-SX:YP=OLDY-(SY DIV 2)+(OLDSY DIV 2)
320   ENDIF 
400   EXEC TEST_ROOM
410   IF FLAG<0 THEN 200
800   EXEC DRAW_ROOM
805   XTAB(ROOM)=XP:YTAB(ROOM)=YP:XXTAB(ROOM)=SX:YYTAB(ROOM)=SY
810   ROOM=ROOM+1
890   OLDX=XP:OLDY=YP:OLDSX=SX:OLDSY=SY
895   PRINT D
900 LOOP 
999 END 
1000 PROC DRAW_ROOM
1010   COLOR 1
1020   PLOT XP,YP:DRAWTO XP+SX,YP:DRAWTO XP+SX,YP+SY:DRAWTO XP,YP+SY:DRAWTO XP,YP
1025   REM PAINT XP+1,YP+1
1030 ENDPROC 
2000 PROC TEST_ROOM
2010   C=0:FLAG=0
2020   REPEAT 
2030	 IF ABS(XP-XTAB(C))<XXTAB(C) AND ABS(YP-YTAB(C))<YYTAB(C) THEN EXIT 
2060	 C=C+1
2070   UNTIL C=ROOM
2080   IF C<ROOM THEN FLAG=-1
2085   PRINT "++";FLAG,ROOM
2090 ENDPROC 

Link to comment
Share on other sites

this one works better...

 

it checks for overlapping and if there is no new fit for the existing new room it tries several others until max iterations is reached... if so it exits... now assume that all this rooms are build later in the game when walk off the screen....

 

next will be to place some doors as right now we are walking straight through the rooms... so a room has 2 doors (entry/exit). i have to think how i can place doors between rooms... hmmm... as all rooms are stored in an array should be no problem to run hallways from the middle of each room to others...

beyondevil.zip

Link to comment
Share on other sites

small update...

 

boot disk and type RUN "D:MAPPER9.TUB"

 

enter level number for the random generator so you can recreate levels... after quiting the map drawing (in general with an error message never mind) please type GOTO 5010.

 

now each room is going to be rendered in Gr.12 and centered on screen... hope you get the idea what i try to do... when you leave a room later in the game i am going to switch the screen... no scrolling etc... i am afraid... why? simply because of the background item buffer and RAM... but who knows where it leads... ;)

post-528-1167248009_thumb.png

post-528-1167248016_thumb.png

beyondevil.zip

Link to comment
Share on other sites

here is a straight forward converted asm code right out of my head converting the turbo basic logic:

 

 

 

sxtab dta 5,10,15,20,5,10,7,10

sytab dta 5,10,7,10,20,10,15,20

 

lda #0

sta room

tax

 

lda #160

sta xp

lda #95

sta yp

 

jsr get_random

and #7

tay

 

lda sxtab,y

sta sx

sta xxtab,x

lda sytab,y

sta sy

sta ytab,x

sta yytab,x

 

lda xp

sta xtab,x

lda yp

sta ytab,x

 

inx ;room+1

 

;do

loop lda #0

sta it

 

jsr get_random

and #7

tay

lda sxtab,y

sta sx

lda sytab,y

sta sy

 

lda sx

lsr

sta sx2

 

lda oldsx

lsr

sta oldsx2

 

lda sy

lsr

sta sy2

 

lda oldsy

lsr

sta oldsy2

 

 

jsr get_random

and #3

 

bne next1

sec

lda oldx

sbc sx2

clc

adc oldsx2

sta xp

 

sec

lda oldy

sbc sy

sta yp

jmp exit

 

next1 cmp #1

bne next2

sec

lda oldx

sbc sx2

clc

adc oldsx2

sta xp

 

clc

lda oldy

adc oldsy

sta yp

 

next2 cmp #2

clc

lda oldx

adc oldsx

sta xp

 

sec

lda oldy

sbc sy2

clc

adc oldsy2

sta yp

jmp exit

 

next3 sec

lda oldx

sbc sx

sta xp

 

sec

lda oldy

sbc sy2

clc

adc oldsy2

sta yp

 

exit inc it

jsr test_room

 

 

lda xp

sta oldx

sta xtab,x

lda yp

sta oldy

sta ytabx

lda sx

sta oldsx

sta xxtab,x

lda sy

sta oldsy

sta yytab,y

inc room

bne loop

 

 

test_room ldy #0

sty c

sty flag

 

loop clc

lda xp

adc sx

cmp xtab,y

bcs exit

 

clc

lda xtab,y

adc xxtab,y

cmp xp

bcc exit

 

clc

lda yp

adc sy

cmp ytab,y

bcc exit

 

clc

lda ytab,y

adc yytab,y

cmp yp

bcc exit

 

iny

 

cpy room

bne loop

exit cpy room

bcs exit2

lda #-1

sta flag

 

exit2 rts

 

 

 

 

 

 

 

[/code]

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...