Shop OBEX P1 Docs P2 Docs Learn Events
90's style 3D (Now with Music!!) - Page 7 — Parallax Forums

90's style 3D (Now with Music!!)

123457»

Comments

  • evanhevanh Posts: 17,032
    edited 2025-11-08 01:33

    Make it foraging rats and you won't get any complaints.

    And give them big fangy teeth too.

  • Or wind-up toys have escaped, and you (one of the elves) has to run around and collect them so they can be delivered.

  • RaymanRayman Posts: 15,923

    Maybe giant angry snowman throwing something...

    640 x 480 - 195K
  • evanhevanh Posts: 17,032

    That could give kids bad dreams!

  • RaymanRayman Posts: 15,923
    edited 2025-11-16 20:48

    Added a new snowman and a gumball & candy cane fence.
    Like how can now make the boundary walls partially transparent and see the background behind them. Think can only use this on the outer walls..

    AI is a big help with making the artwork. That's the part that is hard for me...
    Found that the keywords "pixel art" and "sprite sheet" helps make the low res stuff needed here.

    Wanting to get an actual playable thing going by Xmas. Think will start with stationary snowmen that through snowballs and player throws snowballs back.
    Just something simple to get points on the board...

    On the technical side, thinking that could easily have double resolution art for walls and sprites that is used when they are close. This increases demand on PSRAM a bit, but think that'd be OK. Right now, these things are drawn double pixelled when close. So, the size and P2 cycles need is basically the same for the close things in low res or high res.
    But, going to save that for another day. Sometimes simplicity might be better than visuals...

    640 x 480 - 206K
  • RaymanRayman Posts: 15,923

    Getting good walls in the theme from Midjourney...

    1223 x 742 - 1M
  • roglohrogloh Posts: 6,211

    Neat, nice quick way to generate artwork for games. Do you need different mipmap levels for these graphics textures as well in your 3D engine and if so is that easy to generate yourself from an original higher resolution texture?

  • RaymanRayman Posts: 15,923

    The graphics are currently all 64x64. Could improve maybe in the future, but also nice to keep things simple...

  • RaymanRayman Posts: 15,923

    Thinking want to add music and sound effects soon... Just tried AI to make music for the game (Suno). Think it's not bad...

    https://suno.com/s/a1tQCbosN7sLPjeU

  • I must reiterate, incredibly cringe.

  • RaymanRayman Posts: 15,923

    Here's a puzzle...

    In order to shoot, need to be able to add a sprite to the sprite list.
    I'm trying to use the LUT as a buffer for this, but it's not working...

    Here's what the sprite list looks like:

    CON 'Sprite List cons
    
        SpriteListLongs  = 9  '#longs for each element in Sprite List
        'NOTE:  If the above is increased, be sure to add an sX and nX long at end of assembly
    
        SpriteDrawListLongs = 5
    
        SpriteListSize = 25 'Max length of sprite list
    
    DAT 'Sprite list
    SpriteList '    index, x  ,  y   ,dist, angle, count, hp, dx, dy
            long      6, 256,  256 , 200,   200, 0, 0, 0, 0
            long      6, 64+64,  300 , 350,   210, 0, 0, 0, 0
            long      2, 64+64,  600 , 350,   210, 0, 0, 0, 0
    
            long      5, 100,  100 , 100,   210, 0, 0, 0, 0
            long      4, 100,  200 , 100,   210, 0, 0, 0, 0
            long      5, 100,  300 , 100,   210, 0, 0, 0, 0
            long      4, 100,  400 , 100,   210, 0, 0, 0, 0
            long      5, 100,  500 , 100,   210, 0, 0, 0, 0
            long      4, 100,  600 , 100,   210, 0, 0, 0, 0
    
            long      4, 200,  100 , 100,   210, 0, 0, 0, 0
            long      5, 200,  200 , 100,   210, 0, 0, 0, 0
            long      4, 200,  300 , 100,   210, 0, 0, 0, 0
            long      5, 200,  400 , 100,   210, 0, 0, 0, 0
            long      4, 200,  500 , 100,   210, 0, 0, 0, 0
            long      5, 200,  600 , 100,   210, 0, 0, 0, 0
    
            long      3, 300,  100 , 100,   210, 0, 0, 0, 0
            long      4, 300,  200 , 100,   210, 0, 0, 0, 0
            long      3, 300,  300 , 100,   210, 0, 0, 0, 0
            long      4, 300,  400 , 100,   210, 0, 0, 0, 0
            long      3, 300,  500 , 100,   210, 0, 0, 0, 0
            long      4, 300,  600 , 100,   210, 0, 0, 0, 0
    
            long      4, 400,  100 , 100,   210, 0, 0, 0, 0
            long      3, 400,  200 , 100,   210, 0, 0, 0, 0
            long      4, 400,  300 , 100,   210, 0, 0, 0, 0
            long      3, 400,  400 , 100,   210, 0, 0, 0, 0
            long      4, 400,  500 , 100,   210, 0, 0, 0, 0
            long      3, 400,  600 , 100,   210, 0, 0, 0, 0
    
            long        0,   0,    0 ,   0,     0,0, 0, 0, 0 'index =0 signals end of list
    
            long 0[SpriteListSize*SpriteListLongs]
    

    Maybe it's bigger than needs to be, but fine for now.

    Here's the code where I try to copy the list down one sprite.
    Doesn't seem to be working...

                    'Insert snowball into top of sprite list
                    'Need to move whole list down one
                    'Maybe can use LUT as buffer for this?
                    setq2   #SpriteListSize*SpriteListLongs
                    rdlong  0,pSprites 
                    mov     ptra,pSprites
                    add     ptra,#SpriteListLongs
                    setq2   #SpriteListSize*SpriteListLongs
                    wrlong  0,ptra
                    'Create new sprite
                    'mov     ptra,pSprites
                    'wrlong  6,ptra 'snowball
                    'wrlong  fplayerx,ptra[1]
                    'wrlong  fplayery,ptra[2]
                    'wrlong  0,ptra[3]
    

    Anybody spot the problem?

  • roglohrogloh Posts: 6,211

    You are adding 9 to ptra, but it should be 9*4.

  • RaymanRayman Posts: 15,923

    That sounds like it! Thanks @rogloh

  • RaymanRayman Posts: 15,923

    Ok, player can shoot snowballs now. Guess that's a step forward.
    But, they don't interact with anything and basically fly forever...

    This breaks the sprite engine for some reason.
    Could investigate that, but think just having them disappear when hitting a wall will fix it...

  • RaymanRayman Posts: 15,923
    edited 2025-12-08 19:49

    Think need to dig up info on how to do a jump table in PASM2...
    Need to have different sprites do different things when hit, so think need a subroutine for each one...

    Knew this well at one time, but that was a while ago...

  • RaymanRayman Posts: 15,923

    Found JMPREL. Think that's the ticket:
    https://forums.parallax.com/discussion/176101/jmprel

  • RaymanRayman Posts: 15,923

    It's close to being a playable game now.

    The snowmen can shoot snowballs.
    The player can also shoot.

    Have life and ammo status bars.

    640 x 480 - 218K
  • RaymanRayman Posts: 15,923

    How's this for Game Over screen?

    320 x 240 - 123K
  • RaymanRayman Posts: 15,923

    It's getting close now... Added custom splash screen and an intro screen...

    320 x 240 - 125K
    320 x 240 - 112K
  • RaymanRayman Posts: 15,923

    It's a Christmas Miracle! Game is now playable!

    It's rigged for rayslogic.com hardware right now, but can be fairly easily changed to work with P2 Edge 32MB (will try that tomorrow).

    The .bmp files in the attached .zip need to go onto a uSD attached to P2. Pin settings may need to be adjusted...

    The main file is raycast7a_SpinMain1i.spin2
    It's been tested just now with SpinTools IDE.
    It should also work with FlexProp, but haven't checked that in a while...

  • ke4pjwke4pjw Posts: 1,262

    I am going to give this a go tomorrow! Looks like fun!

    Just today I learned about the X := X / Z and Y := Y / Z formula for quick and dirty 3D perspective.

  • RaymanRayman Posts: 15,923

    Uh oh, just tried with Edge 32MB and something is wrong... It's sorta right, but screen is flickering with wrong colors...

    This used to work, have to do some forensics...

  • RaymanRayman Posts: 15,923
    edited 2025-12-27 19:00

    Ok, found main problem... There's a pin being toggled to measure frame rate, but that is now on a pin needed by Edge's PSRAM... Moved to P38 and good now.

    Also, found some major bug looking things when trying to compile with FlexProp. Have that sorted out, but uSD does't work with FlexProp. Have to investigate that.

    Anyway, this should work with Edge 32MB with VGA on P16 and USB on P24. <--- Ooops, that is USB on P24

  • RaymanRayman Posts: 15,923

    Updated FlexProp to latest release, 7.6.1, and now it runs with FlexProp too.

    Think I remember the issue with the uSD now.
    FlexProp didn't handle the backslash abort, the same way as Spin Tools IDE in this line:
    if \FS.FATEngineStart(uSD_MISO, uSD_CLK, uSD_MOSI, uSD_CS, 0)

    Seems this was fixed in newer versions, thanks @ersmith !

    There is something strange with the "BRK debug".
    This breaks the sprites for some reason, so don't enable that... "Print Debug" seems to work...

  • RaymanRayman Posts: 15,923
    edited 2025-12-27 19:00

    This version is rigged for the P2 Eval Board with Parallax HyperRam module on basepin 0.

    VGA on P16 and USB on P24

  • RaymanRayman Posts: 15,923

    Next point of order is to add music (and then effects). SimpleSound looks good for this. Haven't used it in a long while.

    Have to decide now whether to find an embedded mod music file or try to twist it into playing a wave file from uSD..

    Found a mod that is small enough (I think) and might make some sense. This might be easy way...
    https://modarchive.org/index.php?request=view_by_moduleid&query=125525

  • RaymanRayman Posts: 15,923

    Now has music! That was almost too easy...

    Had to remove some floor tiles to make room for SimpleSound and a .mod music file, but all good. There are still two floor tiles, only really need one...
    Still might look ways to recover some memory later...

    This version is rigged for the P2 Eval Board with Parallax HyperRam module on basepin 0.
    VGA on P16 and USB on P24

Sign In or Register to comment.