Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

BLiNX: the time sweeper [MS-019] [1.05] #184

Open
PatrickvL opened this issue Aug 21, 2017 · 38 comments
Open

BLiNX: the time sweeper [MS-019] [1.05] #184

PatrickvL opened this issue Aug 21, 2017 · 38 comments
Labels
issue-audio issue-video region-other Region 4/PAL state-partially-working Has serious issues that prevent progression/use of important features. type-retail xdk-4831

Comments

@PatrickvL
Copy link
Member

PatrickvL commented Aug 21, 2017

Wikipedia

Description

Previously the game displayed intro screens, but on the current build that is not the case and instead the loading screen will flash briefly before crashing.

Also if you have no controllers plugged in you can hear the menu music
(needs confirmation? see this video)

---------------------------
Cxbx-Reloaded
---------------------------
Received Exception Code 0xC0000005 @ EIP := 0x58149F6A

  Press "OK" to terminate emulation.
  Press "Cancel" to debug.
---------------------------
OK   Cancel   
---------------------------

Dumps

KrnlDebug.txt
CxbxDebug.txt
BlinxXbe.txt

Status

Previous behavior:
Showed intro videos, albeit laggy and with incorrect sound.

Current behavior:
Flashes loading screen briefly before crashing

Screenshots

Current Behavior:
vlc_2017-10-09_11-12-19
firefox_2017-10-09_11-12-50
Video

Previous Behavior:
screenshot_5
screenshot_6

Additional Information

Tested on version 6a798ad5 (Oct 8 2017)

Copied from original issue: Cxbx-Reloaded/Cxbx-Reloaded#235
Xbe.txt

@PatrickvL
Copy link
Member Author

From @furrya on March 17, 2017 6:47

Now the game has regression - black screen with an exception code

screenshot_1

And here two KrnlDebug files
First with graphic progress, from earlier build and 2 - from a latest build
1)
KrnlDebug — graphics.txt
2)
KrnlDebug - no graphics.txt

@PatrickvL
Copy link
Member Author

PatrickvL commented Aug 21, 2017

The first real difference between those two logs is that EmuD3DDevice_SetRenderState_YuvEnable is present in build Cxbx-Reloaded/Cxbx-Reloaded@a7ad4921 and absent in Cxbx-Reloaded/Cxbx-Reloaded@64aac86d.

Alas, the older log doesn't contain the HLE log, so it can't be compared, but the newer log mentions HLE: 0x00134BB0 -> D3DDevice_SetRenderState_YuvEnable_4134. It's possible this is the wrong location.

@PatrickvL
Copy link
Member Author

PatrickvL commented Aug 21, 2017

From @furrya on March 30, 2017 13:41

It's fixed with Cxbx-Reloaded/Cxbx-Reloaded@3eb9b7d5, intro videos returned ^^
screenshot_2

@PatrickvL
Copy link
Member Author

PatrickvL commented Aug 21, 2017

From @furrya on April 18, 2017 11:50

Cxbx-Reloaded/Cxbx-Reloaded@77933ad8


Video in the game is broken now in Cxbx-Reloaded/Cxbx-Reloaded@77933ad8. Just black screen with laggy sounds in the background.
screenshot_1
KrnlDebug.txt

Updated - Cxbx-Reloaded/Cxbx-Reloaded@42e87e7b


The video has appeared, but not stretched normally. Controller emulation does not seem to work now, I am not able to skip the intros.
screenshot_1
screenshot_2

@PatrickvL
Copy link
Member Author

PatrickvL commented Aug 21, 2017

From @furrya on May 4, 2017 7:46

Blinx - the time sweeper doesn't show videos anymore, instead the game shows a loading screen and crashes. Cxbx-Reloaded/Cxbx-Reloaded@9173d4ab

screenshot_1
screenshot_2
screenshot_3


KrnlDebug.txt

@CakeLancelot CakeLancelot added issue-audio issue-video region-other Region 4/PAL state-booting Shows splash screens, logos, intros, etc and/or has audible effects, but doesn't progress further. xdk-4831 labels Aug 22, 2017
@CakeLancelot CakeLancelot changed the title Blinx - The Time Sweeper - laggy and slow intros and it stucked on third BLiNX: the time sweeper [4D530013] Aug 22, 2017
@BelleNottelling
Copy link
Contributor

Latest logs, taken from #266
CxbxDebug.txt
KrnlDebug.txt

@Casuallynoted
Copy link

Update on this one, just tested it out! Looks like it's back to flashing the loading screen for a second and then crashing. The log says that it couldn't assemble a recompiled pixel shader.

@PatrickvL
Copy link
Member Author

PatrickvL commented Sep 29, 2017

For all regressions, we're most interested in hearing about which commit broke it (using a git bisect), so we can quickly zoom into the issue

Oh, also make sure to clean the HLE cache when switching to another build, because function detection was and is still very much in flux.

@Casuallynoted
Copy link

Whoops, just saw this! Did a clean of the HLE cache, posted logs over in the main blinx issue, but I'll also pop them over here for ease of access. Not sure which build broke it as I'm pretty new to the CXBX project but if there's any way I could help to figure out which commit it was I'd love to help with that. :)

KrnlDebug.txt
CxbxDebug.txt

@CakeLancelot
Copy link
Member

Whoops, just saw this! Did a clean of the HLE cache, posted logs over in the main blinx issue, but I'll also pop them over here for ease of access. Not sure which build broke it as I'm pretty new to the CXBX project but if there's any way I could help to figure out which commit it was I'd love to help with that. :)

KrnlDebug.txt
CxbxDebug.txt

I've done a test with this title and get a flashing loading screen before it crashing, did you get the same results with these logs? Also an xbe dump (Edit>Dump Xbe Info To...) would be helpful in verifying that we have the same version of the game.

@Casuallynoted
Copy link

Casuallynoted commented Oct 9, 2017

Yes, that's correct, currently getting a flashing loading screen. Attached is the dump!
1.05: BlinxXbe.txt

@CakeLancelot
Copy link
Member

CakeLancelot commented Oct 9, 2017

Yes, that's correct, currently getting a flashing loading screen. Attached is the dump!

Updated, and to be clear this issue originally was for the PAL version while the attached dump appears to be NTSC - though I don't know if it warrants separation into two issues because as far as I know the end result is the same on either version.
This and one other issue regarding menu music will need to be confirmed. I added some info about the latter in the issue.

@Casuallynoted
Copy link

Awesome! Yeah- so far I've tested both regions and they seem to be about the same in terms of issues at the moment. If there's anything else I can do to help provide additional info, let me know^ Would be awesome to see the game get to the menus. :D

@RadWolfie
Copy link
Member

@CakeLancelot If both PAL and NTSC has the same library version. It should be acceptable to have both PAL and NTSC in same issue. Unless both have a different failure says otherwise.

In the dump of NTSC build is 4831 library version.

@sonicjam717
Copy link

sonicjam717 commented Jan 31, 2018

Crashing before video again I guess from reading this post.

CxbxDebug.txt
KrnlDebug.txt
1.05: Xbe.txt

sketch

My Specs:
CPU: AMD FX8150 3.6ghz, boost to 4.2ghz
GPU: AMD R9 290 4gb, driver Crimson 18.1.1
RAM: 8gb ddr3
Windows 10 Pro 64bit

@jeltaqq
Copy link

jeltaqq commented Feb 10, 2018

Description

Booting, but when playback FMV has crash with CreateTexture Failed!.

[1670] WARN: CreateTexture Failed!

Error: 8876086C
Format: 844715353
Dimensions: 1024x512

Dumps

KrnlDebug.txt

Status

Previous behavior:
Crashes before videos.

Current behavior:
Crash with CreateTexture Failed!

Screenshots

Additional Information

Tested with Cxbx-Reloaded/Cxbx-Reloaded@735a4bcf

@Voxel9
Copy link
Member

Voxel9 commented Mar 4, 2018

https://www.youtube.com/watch?v=SoeDh6kObz4

New video from John GodGames showing Blinx now gets in-game, though it seems you need wire-frame in order to see what you're doing. Game looks like it is extremely slow right now as well, but nice progress nontheless!

EDIT: This actually seems to be footage from a WIP branch from Luke; just thought I should make that clear.

@Shideravan
Copy link

Shideravan commented Apr 7, 2018

Cxbx-Reloaded/Cxbx-Reloaded@d784ce1f: tested using HLE mode, Windows 10, Nvidia GPU

image

@Tanxinaz
Copy link

Tanxinaz commented May 16, 2018

Cxbx-Reloaded/Cxbx-Reloaded@a59df66b

HLE mode

@ghost
Copy link

ghost commented May 27, 2018

Got the same message, but a different line
capture

@Tenrys
Copy link

Tenrys commented Oct 25, 2018

NTSC version has videos not playing for me, but menu works nicely.

When starting a game, frames take roughly 20 seconds to render what seems to be a solid color.

Cxbx-Reloaded/Cxbx-Reloaded@65a1f10a

@Insan1ty0ne
Copy link

Insan1ty0ne commented Jan 5, 2019

The game displays the first two loading screens then shows a blackscreen. Audio is working perfectly. Pressing the A button on the controller gets you to the main menu. The main menu (and all sub-menus) are fully functional but only partially load. The animated backgrounds are just a black screen. When attempting to start a new game the audio for the intro video plays perfectly, but again, it just displays a black screen. Skipping the intro video makes the game attempt to load, the FPS drops to around one and the game never actually renders anything, but again, the sound plays perfectly. Note: If you wait long enough you can see behind the loading screen, but like I said, nothing renders.

blinx_1

1.05, tampered with: Xbe.txt

If anyone wants me to log anything specific, please let me know.

@jthecodebuilder
Copy link

Getting pretty much the same here. I have a feeling it's rendering this slow in-game because it's supposed to run at 30fps, or some unoptimal code in the DirectX stuff. But what happens if I hack the game to run at 60fps...?

@Voxel9
Copy link
Member

Voxel9 commented Jan 6, 2019

It'll probably run even slower seeing as it'd have to produce more frames (and at a faster rate) than 30fps.
As you say, it's likely just unoptimal code at the moment.

@BLiNXthetimesweeperGOD
Copy link

The reason it renders so slowly is probably because the game renders the models (they aren't visible, but are still there) in around 600 chunks each due to what I'm guessing is an emulation bug. Just try using a graphics debugger or model ripper (like NinjaRipper) and you will get hundreds to thousands of meshes, each being around 3-6 tris.

@PatrickvL
Copy link
Member Author

PatrickvL commented Sep 1, 2019

There IS indeed a situation that results in that last described behaviour, I'll look it up and link it here.

EDIT : See this comment in code : https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/blob/develop/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp#L7528

// Indexed quadlist can be drawn using unpatched indexes via multiple draws of 2 'strip' triangles :
// 4 vertices are just enough for two triangles (a fan starts with 3 vertices for 1 triangle,
// and adds 1 triangle via 1 additional vertex)
// This is slower (because of call-overhead) but doesn't require any index buffer patching.
// Draw 1 quad as a 2 triangles in a fan (which both have the same winding order) :
// Test-cases : XDK samples reaching this case are : DisplacementMap, Ripple
// Test-case : XDK Samples (Billboard, BumpLens, DebugKeyboard, Gamepad, Lensflare, PerfTest?VolumeLight, PointSprites, Tiling, VolumeFog, VolumeSprites, etc)

So I guess we can add this title to the list of test cases

@PatrickvL
Copy link
Member Author

PatrickvL commented Sep 1, 2019

The reason I chose for that approach, is to avoid yet another resource conversion (in this case index buffers), which would also require a cache and a costly modification check, all requiring additional complexity and code to maintain.

However, now that I think of it, I may have a solution that will also work, but doesn't require a call per quad nor conversion of the index buffer. I'll document this in an issue Nope, I thought maybe index buffers have a stride after each primitive, so that the same index buffer could be drawn twice, first with a stride of one after each triangle, the second draw starting at one index aside the first draw, with also a stride of one after each triangle. But alas, there is no such thing as a per primitive stride when using index buffers.

So there's no other way than to keep doing it like this, or to convert index buffers.
(The conversion is quite simple though: each set of four indices, A,B,C,D must be expanded into a set of six indices A,B,C,A,C,D so that's 50% more entries to render twice the number of quads as triangles)

@LukeUsher
Copy link
Member

LukeUsher commented Sep 1, 2019

Converting is the best idea because that results in less draw calls, and the number of draw calls made is one of the largest impacts to performance in graphics programing.

The vertex caches should negate the need for multiple conversions per-draw.

@jthecodebuilder
Copy link

jthecodebuilder commented Oct 20, 2019

Regression. Cxbx-Reloaded/Cxbx-Reloaded@c0cdb011
Capturecxlb
Capturecxlb2

@PatrickvL
Copy link
Member Author

Slowness due to repeated indexed quadlist draws will be addressed in issue Cxbx-Reloaded/Cxbx-Reloaded#1749 (pending PR : Cxbx-Reloaded/Cxbx-Reloaded#1757)

@jthecodebuilder
Copy link

I would of been able to test the quad draw fix out months ago, but due to a regression problem ("Failed to create vertex buffer"), I can't. I would try and attempt to find what commit broke it, but it is not a priority to me right now.

@jthecodebuilder
Copy link

jthecodebuilder commented Jan 1, 2020

Welp, seems I (almost) have the answer, I went through my previously downloaded builds, and found that between commits Cxbx-Reloaded/Cxbx-Reloaded@1a62f5e1 and Cxbx-Reloaded/Cxbx-Reloaded@5f5e19a3 that the game somehow has been broken. I'd delve into this deeper by downloading every build between those two, but AppVeyor's 6 month build deletion policy complicates things, which means I have to download every commit and compile them manually, which I'm too lazy to do unless it could be done automatically .

@PatrickvL
Copy link
Member Author

@jthecodebuilder please try this : https://git-scm.com/docs/git-bisect

@jthecodebuilder
Copy link

jthecodebuilder commented Mar 30, 2020

Well, I think I figured it out. When the vertex cache was implemented, it broke BLiNX (and maybe a couple of others too). (I suspect that BLiNX uses an uncommon implementation of its quad rendering?) So therefore, Cxbx-Reloaded/Cxbx-Reloaded@f36cd05 broke the game. Not sure what is happening, but I will try to get the debug log.

Not sure this will be enough to debug this, but it's all I'm able to do.
KrnlDebug-blinx.zip

@Cxbx-Reloaded Cxbx-Reloaded deleted a comment from jthecodebuilder Mar 30, 2020
@Cxbx-Reloaded Cxbx-Reloaded deleted a comment from Casuallynoted Mar 30, 2020
@Cxbx-Reloaded Cxbx-Reloaded deleted a comment from PatrickvL Mar 30, 2020
@jthecodebuilder
Copy link

Just saying, but I feel like an issue should be opened to keep track of (almost) all games that have regressed due to this recent implementation of the vertex conversion (cache).

@Margen67 Margen67 changed the title BLiNX: the time sweeper [4D530013] BLiNX: the time sweeper [MS-019] [1.05] Jun 24, 2020
@ObiKKa
Copy link

ObiKKa commented Dec 13, 2020

This PR # 2048 (Optimize vertex stream cache for partial buffer access), dated November 27, 2020, was tested by an user and showed that it's helped to get this game to go in-game with some decent visuals.

User's comment:

Blinx now goes ingame:

@KBouder
Copy link

KBouder commented Jan 5, 2021

image
image
image
image

Finally in game! Also, cutscenes and audio are working flawlessly, and a locked 60 in the menus with no graphical issues that I've noticed. Not yet playable due to the low performance, but this is a massive improvement.

@Neo-Desktop
Copy link

Finally in game! Also, cutscenes and audio are working flawlessly, and a locked 60 in the menus with no graphical issues that I've noticed. Not yet playable due to the low performance, but this is a massive improvement.

Just wanted to add for the record,

aside from the low performance, there's also missing textures in-game and some extremely stretched "wonky" 3d objects, similar to SSX 3 [#1083]

I will say that this is amazing, and I can't wait to see further compatibility with this game

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue-audio issue-video region-other Region 4/PAL state-partially-working Has serious issues that prevent progression/use of important features. type-retail xdk-4831
Projects
None yet
Development

No branches or pull requests