Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, Quad, VoroneTZ, 1 invisible), 623 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
bmap_process crashes #475528
12/18/18 19:04
12/18/18 19:04
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Hello!
I've been using bmap_process for quite some time now as a means of an animated loading screen/ level transition.
Most of the time it's working fine. However, every now and then it's crashing sadly (sometimes weeks apart).

I'm calling bmap_process in the on_level event (and for another bitmap + material in some other menu code) where it may crash although having worked fine before during the same game session. Pointers are all valid it seems.
The crash only seems to happen during level loading.

Do you see anything in the source code where that could be an issue? Or do you have any other idea what do do?

Thanks.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: bmap_process crashes [Re: Superku] #475530
12/19/18 12:10
12/19/18 12:10
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Not at first glance. It doesn't crash here. Are you sure that it is bmap_process that crashes, not something else?

Re: bmap_process crashes [Re: jcl] #475531
12/19/18 12:43
12/19/18 12:43
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Thanks for looking into it. I'm rather certain that the crash happens in bmap_process though. Here's my on_level event:

Code:
void level_load_progress(var percent)
{
	cprintf1("nLLPM(%d)",(int)percent);
	if(percent < 5) pp_renderchain_debug(0);
	int hresult = material_update_float(pp_levelload_mat, "loadpercent", percent);
	cprintf1(" MUF(%d) ",hresult);

	cprintf4("m(ll %p, rc %p, mat %p, effect %p)",levelload_bmap,renderchain_bmap,pp_levelload_mat, pp_levelload_mat->d3deffect);
	bmap_process(levelload_bmap,renderchain_bmap,pp_levelload_mat);
	cprintf0("b");

	draw_quad(levelload_bmap,nullvector,NULL,NULL,NULL,NULL,100,0);
	cprintf0("d");
	material_update_float(emotesTransition_mat, "loadpercent", percent);
	cprintf0("f");
	draw_obj(entEmotesTransition);
	cprintf0("e");
	level_load_percent = percent;
}



Click to reveal..
Code:
// made by Rackscha, adapted by Superku

//#define DEVTRUE

#ifndef Console_h
	#define Console_h
	#include<windows.h>;

	long WINAPI WriteConsole(int Handle, char* Buffer, int CharsToWrite, int* CharsWritten, int reserved);
	long WINAPI CreateConsoleScreenBuffer(long dwDesiredAccess, long dwShareMode, long *lpSecurityAttributes, long dwFlags, long lpScreenBufferData);
	long WINAPI SetConsoleActiveScreenBuffer(long hConsoleOutput);
	long GConsoleBuffer;
	int consoleInitialized = 0;
	#ifdef DEVTRUE
		int consolePrintTrue = 1;
		#else
		int consolePrintTrue = 0;
	#endif
	int consolePrintTarget = 2; // 2

	void consoleInit()
	{
		if(consoleInitialized) return;
		consoleInitialized = 1;
		AllocConsole();
		GConsoleBuffer = CreateConsoleScreenBuffer(GENERIC_WRITE, FILE_SHARE_READ, 0, CONSOLE_TEXTMODE_BUFFER, 0);
		SetConsoleActiveScreenBuffer(GConsoleBuffer);	
		//SetWindowPos( GConsoleBuffer, 0, -800, -100, 0, 0, SWP_NOSIZE | SWP_NOZORDER );
		//MoveWindow( GConsoleBuffer, -600, -100, 0, 0, TRUE);
	}

	void cdiag(char* AText)
	{
		if(!consolePrintTrue) return;
		if(consolePrintTarget) diag(AText);
		if(consolePrintTarget == 0 || consolePrintTarget == 2)
		{
			if(!consoleInitialized) consoleInit();
			WriteConsole(GConsoleBuffer, AText, str_len(AText), NULL, 0);
		}
	}
	
	#define cprintf0(str) cdiag(_chr(str)) // time to redo this with var args...
	#define cprintf1(str,arg1) cdiag(_chr(str_printf(NULL,str,arg1)))
	#define cprintf2(str,arg1,arg2) cdiag(_chr(str_printf(NULL,str,arg1,arg2)))
	#define cprintf3(str,arg1,arg2,arg3) cdiag(_chr(str_printf(NULL,str,arg1,arg2,arg3)))
	#define cprintf4(str,arg1,arg2,arg3,arg4) cdiag(_chr(str_printf(NULL,str,arg1,arg2,arg3,arg4)))
	#define cprintf5(str,arg1,arg2,arg3,arg4,arg5) cdiag(_chr(str_printf(NULL,str,arg1,arg2,arg3,arg4,arg5)))
	#define cprintf6(str,arg1,arg2,arg3,arg4,arg5,arg6) cdiag(_chr(str_printf(NULL,str,arg1,arg2,arg3,arg4,arg5,arg6)))
	#define cprintf7(str,arg1,arg2,arg3,arg4,arg5,arg6,arg7) cdiag(_chr(str_printf(NULL,str,arg1,arg2,arg3,arg4,arg5,arg6,arg7)))
	#define cprintf8(str,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) cdiag(_chr(str_printf(NULL,str,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)))
	#define cprintf9(str,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) cdiag(_chr(str_printf(NULL,str,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)))
	#define cprintf10(str,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) cdiag(_chr(str_printf(NULL,str,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10)))
#endif



It's crashing after "[...]effect %p" and before "b". Usually the console is on point (and the acklog).

Btw. bmap_process crashes when you call it each (/ the same) frame, have the material's AUTORELOAD flag set and save the *.fx file. I never really questioned it as I've thought some d3d pointer got invalid that frame at least but maybe... it actually shouldn't and there's something else going on?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: bmap_process crashes [Re: Superku] #475658
01/01/19 17:00
01/01/19 17:00
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Still getting crashes (that is one today, another one week(s) ago). Fixed a small memory (local array) issue and hoped the bmap_process crash was a subsequent issue of overwriting memory somewhere beforehand but no luck.

I've written my own bmap_process for now and that seems to be working. We'll see if that one crashes as well, if so I should be able to pinpoint the issue in there.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: bmap_process crashes [Re: Superku] #476487
03/04/19 16:12
03/04/19 16:12
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I've released my game on February 28th and sadly bmap_process causes issues on a bunch of machines, either just crashing the game or spewing file not found messages (regarding fxo files) - game installed in regular full ASCII paths.
It was showing the 255 WRS control byte in file names on some machines:
https://i.imgur.com/STsNIQ4.png
So I thought maybe it would go away when I put shaders not into the WRS, no difference though:
https://cdn.discordapp.com/attachments/430428194517155861/552159630982119424/unknown.png
https://i.imgur.com/mU4u3uu.png

My custom bmap_process had some issues as well, which I forgot sadly. I will have to look into it.
As I expected that that function may cause some trouble I had included a menu settings variable with which you can disable all bmap_process calls. That affects the main menu, in-level leaderboard and name display though. And people have to contact me first or find that info somewhere. Saw a bunch of refunds because of those issues.

Can you please look into bmap_process again? Something is not right about it. Maybe the fact that it crashes when you edit an fx file live could be a good starting point.
Thank you!!


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: bmap_process crashes [Re: Superku] #476488
03/04/19 16:57
03/04/19 16:57
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I'll do that, but to be sure: the crashes happened when loading fxo files from the wrs? Or does it also happen with external fxo files?

Re: bmap_process crashes [Re: jcl] #476489
03/05/19 00:01
03/05/19 00:01
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Thank you already!
I've looked through everything for the 10th time after my post and only then realized there's 2 implicit effect_load calls (which I constantly overlooked) when I open the menu. Those were resulting in the file not found messages.
I loaded them via "effect_load(mat,mat->effect)", maybe that's the issue (why only on some machines though?). Happens to files read from a sub-folder or from the WRS.
The subsequent crash then probably came from an invalid effect.


The only remaining/ actual issues with bmap_process then are some crashes during level_load (which I circumvented using draw_obj and SetTexture/ ... calls) and editing FX files live. Which only is a bit annoying but not a big deal.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: bmap_process crashes [Re: Superku] #476495
03/05/19 11:25
03/05/19 11:25
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I did not find a bug in bmap_process, but I found one in effect_load. This command:

effect_load(mat,name)

should not get a pointer to mat->effect as second parameter. So if you want to reload the effect, store the name in a string or copy it to a char array and pass the copy. This is probably the reason of the errors in your screenshots.


Re: bmap_process crashes [Re: jcl] #476523
03/06/19 16:18
03/06/19 16:18
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Yes okay, thank you!

Unrelated, but the game does not launch on some machines (only a few though as far as I can tell). Apparently, it appears as a process in the task manager and that's it ("not responding").
Any idea what could be the issue there? I told them to try and install the DirectX 2010 runtime, currently waiting for results.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: bmap_process crashes [Re: Superku] #476524
03/07/19 09:47
03/07/19 09:47
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
The DX 2010 runtime is normally not needed, since the DLLs are included in the distribution. At which point does it hang? Did the engine window already open?

Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1