Jump to content
IGNORED

MK update running on real Hardware!


walter_J64bit

Recommended Posts

Bit convoluted and confusing.  Anyone who has read the RAPTOR/JS manuals would be completely lost listening to that.

 

Nothing in the "new camera system" section explains why the object processor bandwidth is lower, as everything mentioned results in a net0 difference in display. Not sure what "and then I only redraw the screen here" was about either, its a simple GDIWTH/BWIDTH window into the whole backdrop, can very easily do the same with Y-axis.

 

Anyway, as I've said many times before, if the end result is fun and playable, who gives a f**k how it got there? :D

 

Hopefully plays well at the end! 

  • Like 6
Link to comment
Share on other sites

1 hour ago, grips03 said:

Yes smaller sprites are way better.  I think the sprites are still a little too thick.

He is aiming for "arcade perfect", which translates into "as close as he could get".

 

Jag res is a little lower than the Arcade game, but not that much. Sprite size seems adequate now, I would be disappointed if he would lower them to SNES level. SNES has lower res than Jag btw. 

 

I still believe he could push the colors to 32 indeces per sprite. Would give the Jag version a slight edge over the others. 

 

Edited by agradeneu
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, grips03 said:

Yes smaller sprites are way better.  I think the sprites are still a little too thick.

SNES has an 256x224 res, so images/sprites are stretched slightly for the 4:3 format. That is why it looks a bit thinner in the source image.

  • Like 1
Link to comment
Share on other sites

19 hours ago, CyranoJ said:

Nothing in the "new camera system" section explains why the object processor bandwidth is lower, as everything mentioned results in a net0 difference in display. Not sure what "and then I only redraw the screen here" was about either, its a simple GDIWTH/BWIDTH window into the whole backdrop, can very easily do the same with Y-axis.

Yeah, I'd be very concerned if scanning out a window into a large 'sprite' took more bandwidth than a full small 'sprite.' Maybe there were page misalignment issues before or something? I don't question that changing things fixed... something, but it doesn't seem to be adequately explained. FWIW, I run into this all the time, where I find a fix, work backwards to convince myself it is the right fix, and then upon getting it reviewed or talking about it with someone else, realize my reverse engineered explanation is completely bogus. Usually the fix is still right, but I just misunderstood the nature of the problem and need to reevaluate why the fix worked if I want to feel good about its robustness or be able to apply the knowledge gained from working on the fix to other issues in the future.

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

@trufun101 or @trufungames great to see you are still cracking away at this!  But I do have to agree with CJ that your explanation was a bit confusing in terms of how you've managed to optimize the level rendering.  I take it, you were previously drawing all sprites ( in their entirety ) every frame?  But now ( based on the developer thread post and watching your video ), you are drawing them to the "framebuffer" using the font / particle layer, but only when the scene moves? 

 

I'm not entirely sure that is the best approach here, and I want to point out a few optimization techniques that make a huge difference, if you aren't already aware.

  1. Clipping.  This is the processing of "slicing" up an image ( or polygon ) that is only partially within the view window before sending it to the rasterizer.  This means we only send data that is within screen space to be rasterized to save on bandwidth.  This should be done on large sprites in Jagstudio by making the sprite no larger than the screen plus a bit of padding for offsets ( regardless of how large the texture data is ), and then adjusting the gfxbase in order to scroll that texture as the scene moves.
  2. Culling.  This is the processing of completely preventing sprites ( or polygons ) completely outside the view window from being sent to the rasterizer.  This means if an object is not within screen space, do not send it to the OP for processing.  This is done in Jagstudio by setting the "active" flag on the sprite.

As an example of Clipping, I have a background sprite that is 1296x256 pixels.
image.thumb.png.ff025ff38568860bb57987a980387ddc.png

 

But I only define the sprite width and height as 368x240, as this covers the entire screen plus ~16 pixels on either side.  The important part is to set the gwidth to the actual texture width.  Example Sprite definition ( irrelevant attributes omitted for this discussion 😞


; Background1
    dc.l    1                                                                ; (REPEAT COUNTER)     ; Create this many objects of this type (or 1 for a single object)
    dc.l    is_active                                                        ; sprite_active        ; sprite active flag
    dc.l    368                                    ; sprite_width        ; width of sprite (in pixels)
    dc.l    240                                    ; sprite_height        ; height of sprite (in pixels)

    dc.l    is_normal                                                        ; sprite_flip        ; flag for mirroring data left<>right
    dc.l    BACKGROUND1                                                ; sprite_gfxbase    ; start of bitmap data
    dc.l    4                                                                ; (BIT DEPTH)        ; bitmap depth (1/2/4/8/16/24)
    dc.l    is_RGB                                                            ; (CRY/RGB)            ; bitmap GFX type
    dc.l    is_trans                                                        ; (TRANSPARENCY)    ; bitmap TRANS flag
    dc.l    368*240/2    ; sprite_framesz    ; size per frame in bytes of sprite data
    dc.l    368/2                                    ; sprite_bytewid    ; width in bytes of one line of sprite data

    dc.l    3                                                                ; sprite_CLUT        ; no_CLUT (8/16/24 bit) or CLUT (1/2/4 bit)
    dc.l    1296/2                                    ; sprite_gwidth        ; GFX width (of data)


Then every frame, I check to see if we need to move the texture within the sprite based on "camera" movement:
 

void backgroundHandler(int *backgroundScrollX, int backgroundGfx, short scrollAmount, unsigned int *level_offset) {
    sprite[BGND_INDEX].x_ += scrollAmount;
    if(sprite[BGND_INDEX].x_ < -31){
        *backgroundScrollX += 8;        
        sprite[BGND_INDEX].gfxbase = backgroundGfx +*backgroundScrollX;
        sprite[BGND_INDEX].x_ = -16;
       
    }  
    else if(sprite[BGND_INDEX].x_ > 0)  {
        *backgroundScrollX -= 8;        
        sprite[BGND_INDEX].gfxbase = backgroundGfx +*backgroundScrollX;
        sprite[BGND_INDEX].x_ = -16;        
    }
    *level_offset += scrollAmount;
}

 

No for Culling, simply need to check the position of the sprite and make sure it is within screen space, and either make it active or inactive based on that.

 

image.thumb.png.041cc5e8ae221b2d27d92099788fe818.png


Here are some shots of this demo in action:
image.thumb.png.a54f947f3d9c1fc0169d580648e789db.png
image.thumb.png.f717b4fac07ee0caf26b81fc6deb70a5.png

image.thumb.png.9ff562e56c4d0a5d2dcdcb5437f360d6.png

Full disclaimer - this is nowhere near a playable demo, just intended to play with the idea of using texture atlas with Jagstudio.  There are issues with the sprite alignment that I don't have time to adjust my hand for Jagstudio - to this extent if the MS-DOS sprites are already aligned for you, 100% go with that man.

 

All that said, here is the full demo code, assets and binary for anyone morbidly curious to check it out. I am just providing it to show you the concepts mentioned above in action.
fighter.zip

 

  • Like 8
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...