Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ACagliano

Pages: 1 2 3 [4] 5 6 ... 62
46
TI Z80 / Re: ACags Project Reveal
« on: March 12, 2015, 04:11:49 pm »
Well, viewing the gif in Chrome shows it nicely. Apparently its a Safari thing. Also, does anyone know... on a website, i know that onclick does not trigger when an element is "touched" on a touch screen, but can the jQuery .click function work?

47
TI Z80 / Re: ACags Project Reveal
« on: March 11, 2015, 08:55:40 pm »
That is a broken link, as there is no official release yet. It's a placeholder for now.

Also, here is an animated screenshot of the title screen. This works, but pressing [2nd] to start the game immediately crashes. The screenshot may be glitchy, bc i know my version of WabbitEmu tends to botch them. Can anyone suggest a better Mac/Unix emulator?

48
Art / Re: Sprite Fine-Tuning: Slender
« on: February 26, 2015, 08:07:16 pm »
bump. I'm not satisfied with my tree at all. Anyone, ideas to make it look better?

49
Art / Re: Sprite Fine-Tuning: Slender
« on: February 11, 2015, 09:50:43 am »
Update:
Sprites are now 4-level masked.

Posted are the slender image, the tree image, and the page image. Below is the bitmap for each. The data is formatted with one byte of the mask, followed by one byte of layer 1, then one byte of layer 2, then rinse and repeat for the whole sprite.

Slender:
Code: [Select]
.db %11111100,%00000001,%00000000 \ .db %00111111,%10000000,%00000000
.db %11111000,%00000010,%00000110 \ .db %00011111,%01000000,%00000000
.db %11111000,%00000100,%00000000 \ .db %00011111,%01000000,%01100000
.db %11111000,%00000110,%00000000 \ .db %00011111,%00000000,%00100000
.db %11111000,%00000011,%00000010 \ .db %00011111,%10100000,%00100000
.db %11111100,%00000011,%00000000 \ .db %00011111,%10000000,%01000000
.db %11110000,%00001110,%00000010 \ .db %00001111,%10010000,%01000000
.db %11100000,%00111101,%00000110 \ .db %00000111,%10011000,%01110000
.db %11000000,%00111111,%00011111 \ .db %00000111,%11111100,%01111000
.db %11000000,%00111111,%00011111 \ .db %00000111,%11111000,%11111000
.db %11000000,%00111111,%00111111 \ .db %00000011,%11101100,%11111100
.db %11000000,%00110011,%00111111 \ .db %00000011,%11111110,%11111100
.db %10000000,%00110011,%00110111 \ .db %00000001,%11110110,%11111100
.db %10000000,%01100011,%00110111 \ .db %00000001,%11100110,%11101100
.db %10000000,%01100111,%00110111 \ .db %00000001,%11100110,%11100110
.db %10000000,%01110111,%00110111 \ .db %00000001,%11100010,%11100110
.db %10000000,%01110111,%00110111 \ .db %00000001,%11100010,%11100110
.db %10000000,%00100111,%00100111 \ .db %00000001,%11100010,%11100110
.db %10000000,%00100111,%00100111 \ .db %00000001,%11100010,%11100110
.db %10000000,%00101111,%01100111 \ .db %00000001,%11100010,%11100110
.db %10000000,%00101111,%01100111 \ .db %00000001,%11100010,%11100110
.db %10000000,%01101110,%01100111 \ .db %00000001,%01110010,%11100110
.db %10000000,%01100110,%01100111 \ .db %00000001,%01110010,%11100110
.db %10000001,%01100110,%01100110 \ .db %10000001,%01110110,%01100110
.db %10000011,%01100100,%01101110 \ .db %11000001,%00110110,%01100110
.db %10000011,%11100100,%01101110 \ .db %11000001,%00100110,%01100110
.db %10000011,%11001100,%01101110 \ .db %11000001,%01100000,%01100010
.db %10000011,%00001110,%01101110 \ .db %11000001,%01100000,%01110010
.db %11110011,%00001110,%01101110 \ .db %11001111,%00110000,%00110010
.db %11110011,%00001100,%00001100 \ .db %11001111,%00110000,%00110000
.db %11110011,%00001100,%00001100 \ .db %11001111,%00110000,%00110000
.db %11110011,%00001100,%00001100 \ .db %11001111,%00010000,%00110000
.db %11110011,%00001100,%00001100 \ .db %11001111,%00010000,%00110000
.db %11110011,%00001100,%00001100 \ .db %11001111,%00010000,%00110000
.db %11111111,%00000100,%00000000 \ .db %11111111,%00010000,%00000000

Tree:
Code: [Select]
.db %11110000,%00000111,%00001000 \ .db %00011111,%11100000,%00100000
.db %11110000,%00000111,%00001000 \ .db %00011111,%11100000,%00100000
.db %11110000,%00000111,%00001000 \ .db %00011111,%11100000,%00100000
.db %11110000,%00000111,%00001000 \ .db %00011111,%11100000,%00100000
.db %11110000,%00000111,%00001000 \ .db %00001111,%11010000,%00110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%11010000,%00110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%11010000,%00110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%11010000,%01110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%10010000,%01110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%10010000,%01110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%10010000,%01110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%10010000,%01110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%10010000,%01110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%10010000,%01110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%10010000,%01110000
.db %11100000,%00001111,%00010000 \ .db %00001111,%00010000,%11110000
.db %11100000,%00001110,%00010001 \ .db %00001111,%00010000,%11110000
.db %11100000,%00001110,%00010001 \ .db %00001111,%00010000,%11110000
.db %11100000,%00001100,%00010011 \ .db %00001111,%00010000,%11110000
.db %11100000,%00001100,%00010011 \ .db %00001111,%00010000,%11110000
.db %11100000,%00001101,%00010011 \ .db %00001111,%00010000,%11110000
.db %11100000,%00001101,%00010011 \ .db %00001111,%00010000,%11110000
.db %11100000,%00001000,%00010111 \ .db %00001111,%00010000,%11110000
.db %11100000,%00001000,%00010111 \ .db %00001111,%00010000,%11110000
.db %11000000,%00011000,%00100111 \ .db %00000111,%00111000,%11111000
.db %11000000,%00011000,%00110111 \ .db %00000111,%00111000,%11111000
.db %11000000,%00000010,%00111111 \ .db %00000111,%01111000,%11111000
.db %11000000,%00000010,%00111111 \ .db %00000111,%01111000,%11111000
.db %11000000,%00000000,%00111111 \ .db %00000111,%11111000,%11111000
.db %11000000,%00000000,%00111111 \ .db %00000111,%11111000,%11111000
.db %11000000,%00000001,%00111111 \ .db %00000111,%11011000,%11111000
.db %11000000,%00000001,%00111111 \ .db %00000111,%11111000,%11011000
.db %11000000,%00000011,%00111111 \ .db %00000111,%11111000,%11111000
.db %11000000,%00000011,%00111111 \ .db %00000111,%11111000,%11111000
.db %11000000,%00000111,%00111111 \ .db %00000111,%11111000,%11111000
.db %11000000,%00011111,%00111111 \ .db %00000111,%11111000,%11111000
.db %11000000,%00111111,%00111111 \ .db %00000111,%11111000,%11111000
.db %11000000,%00111111,%00111111 \ .db %00000111,%11111000,%11111000
.db %11000000,%00111111,%00111111 \ .db %00000111,%11111000,%11101000
.db %11000000,%00111111,%00111111 \ .db %00000111,%11111000,%11111000

Page:
Code: [Select]
.db %11111111,%00000000,%00000000
.db %11000011,%00000000,%00000000
.db %10000001,%00001000,%00001000
.db %10000001,%00110000,%00110000
.db %10000001,%00001100,%00001100
.db %10000001,%00110000,%00110000
.db %10000001,%00000100,%00000100
.db %10000001,%00011000,%00011000
.db %10000001,%00000000,%00000000
.db %11111111,%00000000,%00000000

50
Art / Sprite Fine-Tuning: Slender
« on: February 04, 2015, 02:35:10 pm »
Here are some of the sprites that I'm gonna be using for Slender the Eight Pages. I am asking anyone with a prowess at pixel art to please make them look nicer. I will upload the image and the bitmap for observation. Thanks.

Also anyone who has or wants to make a sprite of a tall tree, a piece of paper, a shack, a car, and an oil tanker can do so and upload. Remember, 4-level grey, and as though viewed at night.

4-level greyscale:

Slender:
Code: [Select]
; layer 0
.db %11111111,%11111111
.db %11111110,%10111111
.db %11111111,%11111111
.db %11111111,%10111111
.db %11111110,%10111111
.db %11111110,%00111111
.db %11111110,%10111111
.db %11111110,%10111111
.db %11111110,%00011111
.db %11111110,%00111111
.db %11111110,%01111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
; layer 1
.db %11111111,%11111111
.db %11111111,%01111111
.db %11111110,%00111111
.db %11111110,%01111111
.db %11111111,%01111111
.db %11111111,%11111111
.db %11111111,%01111111
.db %11111111,%01111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111
.db %11111111,%11111111

A page:
Code: [Select]
; layer 0
.db %11111111
.db %11000011
.db %10001001
.db %10110001
.db %10001101
.db %10110001
.db %10000101
.db %10011001
.db %11000011
.db %11111111
; layer 1
.db %11111111
.db %11000011
.db %10001001
.db %10110001
.db %10001101
.db %10110001
.db %10000101
.db %10011001
.db %11000011
.db %11111111

51
TI Z80 / TI-Slender: The Eight Pages
« on: February 03, 2015, 12:43:49 pm »
A few days later than promised, I'm revealing the topic of my almost-complete game.

This game will be a clone of Slender: The Eight Pages, featuring 4-level interrupt-based greyscale, and all the static effects you know and love. The game will be rendered in 3D. Granted I won't be able to emulate the creepy music, but I'm sure the game will be fun, if not scary.

Project Page: http://clrhome.org/slender

If this game is well-received, I will clone the rest of the Slender series as well.

52
TI Z80 / Re: Figuring out what's in front of you (RayCaster)
« on: January 31, 2015, 09:35:00 am »
bump

53
TI Z80 / Re: Figuring out what's in front of you (RayCaster)
« on: January 28, 2015, 09:17:40 am »
That does what your code does (and will actually assemble). But i'm not sure if you really wanted to be using playerDirection to add those values to or priorAngle. Probably priorAngle. Shouldn't you at least try to assemble your code first?

I can't comment on the code as a whole because i don't really understand raycasting or what you're trying to do, sorry...

I know there are certain technicalities within it like the ld b,** stuff. However, I want to get the routine conceptually working, then i fix that.
To answer your question about priorAngle, that is actually just a check if whether the current angle and the last angle we calculated are the same. If they are, then we skip the part where we figure out angleStop and the starting angle (which I just found a mistake... angle current needs to be manually set if we do that, or angleStart and angleCurrent need to be separate).

***Edit*** fixed all instances of that, and amended my code to above to reflect

***Edit 2 *** found another mistake. As of now, the raycaster, when calculating the vectors for the present angle, only saves the .8 part of the 8.8FP number. However, in the routine, i add hl (where h= x origin integer and l= y origin integer) to bc (where b is the .8 part of the x vector and c is the .8 part of the y vector). Clearly, that's a mistake, but short of adding more RAM and using the full 8.8 location, i don't see a workaround.

54
TI Z80 / Re: Figuring out what's in front of you (RayCaster)
« on: January 27, 2015, 03:43:28 pm »
Update: Got a routine. Let me know if I goofed up anywhere:

The routine should create an 11-entry stack for the rendering-routine to process. Each "entry" corresponds to a section of the "screen". Entry 1 is far left, 2 is next to that, and so on. If the renderer hits a $ff, it skips that section of screen. Otherwise, it renders the masked greyscale sprite (which is based through a scale-down routine, based on distance) for that section and moves on.

Feel free to correct/optimize, but let me know what I did wrong so I learn from it :p

Code: [Select]
#define distance tempSwapArea ; 1 byte
#define rayCurrent distance+1 ; 2 bytes
#define angleCurrent rayEnd+2 ; 1 byte
#define angleStart angleCurrent+1 ; 1 byte
#define angleStop angleStart+1 ; 1 byte
#define iterVector angleStop+1  ; 2 bytes
#define rcStack iterVector+2 ; 2 bytes, a pointer to the start of the raycaster object stack
#define renderDistance 10 ; adjust this to change the render distance
#define priorAngle rcStack+2 ; 1 byte


engine_raycaster_Init:
ld hl,smallEditCol
ld (rcStack),hl ; reset pointer to start of raycaster stack
ld a,(playerDirection)
ld hl,priorAngle
cp (hl)
jr z,{1@}
ld a,b
ld b,5
add a,b
ld (angleStop),a
ld b,-10
add a,b
ld (angleStart),a
@: ld a,(angleStart) ; sorry about this bit, but needs to be here for the jump to work
ld (angleCurrent),a ; shouldnt be too time-consuming to do that
rc_loop_angle:
call _getTempVector
ld a,(playerPosX)
ld h,a
ld a,(playerPosY)
ld l,a
ld bc,(iterVector)
rc_loop_ray:
add hl,bc
call rc_getDistance
ld (distance),a
ld a,l
multAbyWidth
ld c,h
ld b,0
add hl,bc
call rc_getMap
ld a,(hl)
or a
jr z,rc_tilepush_skip
; rc_tilepush: if tile is something, push this object onto rcStack, renderer will handle it
ld de,(rcStack)
ld (de),a ; object type Id
inc de
ld a,(distance)
ld (de),a
inc de
ld (rcStack),de
jr rc_skip_writeempty
rc_tiletest_skip:
ld a,(distance)
cp renderDistance
jr z,rc_loop_angle_next
jr c,rc_loop_angle_next
jr rc_loop_ray
rc_loop_angle_next:
ld de,(rcStack)
ld a,$ff
ld (de),a
inc de
ld (rcStack),de
rc_skip_writeempty:
ld a,(angleCurrent)
inc a
ld (angleCurrent),a
jr rc_loop_angle








rc_getTempVector:
; using current angle, gets vectors. each vector is in 8.8 FP format, so we only save the .8 part
; input: a = angle
; output: new vectors loaded into (iterVector) word
push af
call calcSin ; a = angle
ld (iterVector),l ; hl = 8.8 FP
pop af
call calcCos
ld (iterVector+1),l
ret

rc_getMap:
; input: hl = offset in map
; output: hl points to tile
ld bc,(SlendMapPtr)
add hl,bc
ret

rc_getDistance:
; input: hl = current testing location
; output: a = distance from origin
ret

55
TI Z80 / Re: Figuring out what's in front of you (RayCaster)
« on: January 27, 2015, 02:22:50 pm »
Ok sounds good. Now to convert that pseudo-code into assembly... LET THE 200 PAGES OF CODE COMMENCE!!!!!!

56
TI Z80 / Re: Figuring out what's in front of you (RayCaster)
« on: January 27, 2015, 02:18:27 pm »
My angle is +/- 5 byte degrees. So in pseudo-code:

Code: [Select]
for (a,  from angle-5 to angle+5, 1 ) {
     calc (x,y) vectors of a
     figure out all points on line from player (x,y), in increments of above (x,y), till render distance
     push any objects found onto a stack
     }
render stack

57
TI Z80 / Re: Figuring out what's in front of you (RayCaster)
« on: January 27, 2015, 11:54:57 am »
Edit: so with a little nudge, and a helpful resource, I am trying to develop my own raycasting engine, portable, and with configurable render distance (bc I'm not entirely sure what my render distance will be yet until I test). What I've have gathered so far is:

- RayStart becomes the X and Y position of the player, the "camera". Render distance is the camera plane, the farthest the routine will render to.
- You are basically following the direct line from you to the camera plane, incrementing by 1 "unit" per iteration and testing for an object.
- continue this until you hit the camera plane.

Which is great. I get that. But where does it come in where I'm going from POV-left to POV-right, not just directly in front of you? Unless I'm missing part of the explanation that talks about that.

Here's the start of what I have:

Code: [Select]
#define rayStart Op8
#define rayEnd Op8+2
#define renderDistance 10 ; change this to tweak render distance
#define rcStack Op8+4


engine_rayCaster_Init:
ld hl,smallEditCol
ld (raycastStack),hl ; reset pointer to start of raycaster stack
ld e,(playerPosY)
ld (rayStart),e
ld (rayEnd),e ; initialize player position as start and current end of ray
ld d,(playerPosX)
ld (rayStart+1),d
ld (rayEnd+1),d ; initialize player position as start and current end of ray
ld e,l
ld d,h ; ray End temp (may delete ram if i can)  de = ray start, hl = ray end
ld bc,(playerVectorX)
push bc
_rc_loop:
add hl,bc
ld a,l
push hl
multAbyWidth ; out hl
ld c,b
ld b,0
add hl,bc ; offset in map to get
jr _rc_loop_test
_rc_test_exit:
pop hl
call _rc_push



_rc_loop_test:
; yes, i know i didnt actually put in the pointer to the map data. pretend, i did that.
ld a,(hl)
or a
jr nz,{1@}
pop bc
jr _rc_loop
@:
jr _rc_test_exit


_rc_push:
ld de,(rcStack)
ld (de),a ; map object pushed to stack
inc de
ld (de),hl ; object position push to stack
ld hl,(rayStart)
inc de
inc de
ld (de),hl ; your position pushed to stack (i will throw in a distance calc here, bc this is multiple data entries)
inc de
inc de
ld (rcStack),de
ret

58
TI Z80 / Re: Figuring out what's in front of you.
« on: January 21, 2015, 11:44:11 am »
I hate when someone says "make a hash" lmao jk.

I really do need to get to work on this now that the static is out of the way.

I was considering looping the angle you are standing at and scanning the distance for objects, but that might be harder than some of the proposed solutions, that I don't entirely get. I may also be able to use trig functions to figure out the area that is viewable, and then check nearby objects to see if points fall in range. If this is indeed ray-casting, I have zero experience. What is the quickest way to do it?

59
TI Z80 / Re: Figuring out what's in front of you.
« on: January 18, 2015, 07:29:50 pm »
So do you have the coordinates of the objects?

Yes, the coordinates of the objects are in a tilemap

60
TI Z80 / Figuring out what's in front of you (RayCaster)
« on: January 18, 2015, 03:17:03 pm »
So, for my game, I'm trying to come up with a quick way to take a player's current location, and check a set distance, like say 20 units, away from them, and maybe like 10 units either direction at that distance (kind of like the field of vision), and determine what objects are in viewing range. I have a scaled sprite routine that I've figured out how to work, so now I just have to draw a tree, a house, a car, a few oil tanks, and a note. Once this bit is done, I'm ready to compile and test!

That being said, anyone any ideas? I have an 8.8 FP number for your current location and a 1-byte angle for your direction.

Pages: 1 2 3 [4] 5 6 ... 62