Gamestudio Links
Zorro Links
Newest Posts
Performance report in trade mode
by jcl. 01/18/20 09:25
oldschool fps project
by 3run. 01/14/20 19:15
Question about Clipping
by Dooley. 01/13/20 04:16
Simple backtest for SPX intra weeklies
by interzonez. 01/13/20 03:42
Trojan Agent
by jcl. 01/12/20 08:36
Multiplayer c-script example
by Truth. 01/10/20 19:45
Virtual hedging @OANDA
by jcl. 01/10/20 12:53
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
6 registered members (Quad, alibaba, kvm, 3run, txesmi, 1 invisible), 935 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Leohermoso, matchristrading, pablomfz, tenrally, TradeOperator
18357 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 9 of 10 1 2 7 8 9 10
Re: video memory and d3d_texfree [Re: Garrettwademan] #474877
11/10/18 12:43
11/10/18 12:43
Joined: Sep 2003
Posts: 6,848
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,848
Kiel (Germany)
Not that I'm aware of, sorry. I've signed said contract and dug through the compiler source code (and looked at test interim code) for a bunch of days. I think I roughly know how it works but actually changing anything in there is something completely else, the memory management code might as well be Chinese.
You'd probably need some wise guy and compiler enthusiast like JustSid to have a look at this. *wink wink*

Btw. as a workaround I wrote a small tool in lite-C which checks the alteration dates of code files, compiles a new exe version like this:
exec_wait("C:\GStudio8\WED.EXE","-r superku.c -nx 128 -ns");
and then starts the exe.
If I only do changes on levels, models or something like that it heavily cuts down on the compile times, otherwise (changing code) it's only slightly slower. I don't have any memory issues then and the game is running faster as well, but... you don't have any debugging features (like sys_marker) or informative error messages then. Not an optimal solution.


"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: video memory and d3d_texfree [Re: Superku] #474927
11/13/18 20:30
11/13/18 20:30
Joined: Jan 2006
Posts: 244
PA
Garrettwademan Offline
Member
Garrettwademan  Offline
Member

Joined: Jan 2006
Posts: 244
PA
Interesting about your tool, is this something that you would share? I have .WDL (using C-SCRIPT) with A8 latest version and willing to do anything to get over this issue.

So my error only happens when I open a certain panel (the panel image is rendering white only), and when I face the model that is causing me an issue. I seem to only see this on my laptop, but my desktop doesn't have the problem.

My plan of action is to...

-remove all unused files in the game folder (I understand PATH will load all items in that folder regardless if it is used or not)
-Shrink audio / video / graphic files (assuming JPG is better than BMP for sizing, keeping BMP and TGA for special transparency)
-Remove unnecessary code or shrink it down (I have maybe 20Mb of code)
-use LoS and remove entity when player isn't close, maybe using .visible options
-Test with a smaller level (I have about 300 items in the level for objects such as walls and tables, maybe I can shrink this down)
-Test the .EXE compared to using SED in development
-Look at options to use .DLL files for code
-Test making custom EXE file that have resolution locked down instead of changing it every time to see if it crashes.
-I do not use any special engine functions to clear memory as I understand that they don't work perfectly, maybe I am wrong?
-Any other suggestions?

Luckily I made my game very modular, so a Visual Studio app moves the ACKNEX to the root folder before loading the game, I have a ton of .EXE files which are loaded on demand.

I really hope we get a surprise message from the developers that they figured out the Chinese code.


Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
Re: video memory and d3d_texfree [Re: Garrettwademan] #474933
11/14/18 06:41
11/14/18 06:41
Joined: Jan 2014
Posts: 77
USA
sitrep Offline
Junior Member
sitrep  Offline
Junior Member

Joined: Jan 2014
Posts: 77
USA
Where is that “feb update”?

Where is link to download latest A8 PRO update?

Thanks!

Re: video memory and d3d_texfree [Re: sitrep] #474951
11/14/18 17:00
11/14/18 17:00
Joined: Sep 2003
Posts: 6,848
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,848
Kiel (Germany)
@Garrettwademan: My "tool" is the following code:
Click to reveal..
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <windows.h>
///////////////////////////////

STRING* str_tmp = "";

TEXT* tDir = { pos_y = 40; strings = 200; flags = SHOW;}

void main()
{
	fps_max = 60;
	video_screen = 0;
	video_window(NULL,NULL,0,"Superku Launcher");

	var fhandle = file_open_write("launchLog.txt");

	file_str_write(fhandle,str_printf(NULL,"Superku Launcher Logn%02d:%02d:%04d - %02d:%02d:%02d...",(int)sys_day,(int)sys_month,(int)sys_year,(int)sys_hours,(int)sys_minutes,(int)sys_seconds));
	file_str_write(fhandle,str_printf(NULL,"nCurrent work_dir: %s",_chr(work_dir)));
	str_cpy(work_dir,"C:\GStudio8\Superku\");
	str_cpy(save_dir,work_dir);
	SetCurrentDirectory(_chr(work_dir));
	char cbuffer[256];
	GetCurrentDirectory(256,cbuffer);
	file_str_write(fhandle,str_printf(NULL,"
	nGetCurrentDir: %s",cbuffer));

	int doCompile = 0;
	int numFiles = txt_for_dir(tDir,"*.c"); 
	int i;
	for(i = 0; i < numFiles; i++)
	{
		file_str_write(fhandle,str_printf(NULL,"n
		Is file (%s) newer than superku.exe? ",_chr((tDir.pstring)[i])));
		if(file_date((tDir.pstring)[i]) > file_date("superku.exe"))
		{
			file_str_write(fhandle,"Yes!");
			doCompile = 1;
			break;
		}
		else file_str_write(fhandle,"No...");
	}
	if(!doCompile)
	{
		int numFiles = txt_for_dir(tDir,"*.h"); 
		int i;
		for(i = 0; i < numFiles; i++)
		{
			file_str_write(fhandle,str_printf(NULL,"n
			Is file (%s) newer than superku.exe? ",_chr((tDir.pstring)[i])));
			if(file_date((tDir.pstring)[i]) > file_date("superku.exe"))
			{
				file_str_write(fhandle,"Yes!");
				doCompile = 1;
				break;
			}
			else file_str_write(fhandle,"No...");
		}
	}

	printf("nndoCompile : %d",doCompile);
	file_str_write(fhandle,str_printf(NULL,"n
	ndoCompile: %d",doCompile));

	if(doCompile)
	{
		printf("nSet Build options: %s...",_chr("options_skbuild.scr"));	
		file_cpy("C:\GStudio8\data\options.scr","C:\GStudio8\data\options_skbuild.scr");	
		printf(" Done.");
		printf("nCompile exe and dll...");	
		exec_wait("C:\GStudio8\WED.EXE","-r superku.c -nx 128 -ns");
		printf(" Done.");
		wait(1);
		if(key_esc) sys_exit(""); // in case of compile errors
		file_cpy("C:\GStudio8\Superku\acknex.dll","C:\GStudio8\Superku\superku.cd\acknex.dll");
	}
	file_close(fhandle);
	if(key_esc) sys_exit("");
	wait(1);
	if(key_esc)
	{
		sys_exit("");
		return;
	}
	exec("C:\GStudio8\Superku\superku.exe","-nx 128 -ns -diag");
	sys_exit("");
}


I have no clue about C-Script, forgot everything about it, but it should work still.
Go to the "data" subfolder in your Gamestudio installation folder, duplicate (and backup) the options.scr file and create one for your script compilation. I've pretty much excluded all files there (like images, MDL, WMB) so it only compiles the code. I think there's a command line option for the publish process to do that normally but it did not work for me for some reason, which I forgot.

Btw. have you checked the amount of memory your game uses when it crashes using VMMap?


"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: video memory and d3d_texfree [Re: Superku] #474986
11/15/18 23:58
11/15/18 23:58
Joined: Jan 2006
Posts: 244
PA
Garrettwademan Offline
Member
Garrettwademan  Offline
Member

Joined: Jan 2006
Posts: 244
PA
Thanks for sharing, will review and try it! I just found the command d3d_texlimit and was about to do a cartwheel after reading the description, but when I actually implemented it, the game crashes every time for certain models on several different machines.

I have used VMmap, so I clocked 1.984Gb RAM on my Desktop machine, and about 1.8Gb something on my laptop. My Desktop DOES NOT CRASH or throw any texture memory errors (it runs perfectly), but my laptop always has the issue. I cleaned up my code so I am seeing about 1.7Gb but my laptop still says NOPE and craps itself! Now I use built in checks for vid_memory and nexus, and I am only using 78/600Mb nexus, and about 250Mb of video memory. Its like these are not logging properly or related to the bug. At game launch it says it found 750Mb of video memory.

Now I did some testing, the same texture file that kept crashing on my laptop didn't crash when I didn't load the world models (walls, floors, tables, etc) with the culprit model, and it only crashes when I look at the item in the game. There may be things I can potentially do to work around this (but not coming to me right now).

All in all Windows OS only really supports up to 2GB of RAM per software instance unless you do some crazy stuff.

BTW Superku, your game on Steam looks awesome. The specialFX and detail is amazing! 7 years too. I am a little worried about posting my game on steam even though I paid the fee and working on the page layout. I wanted to finish this last detail before going live, but worried this issue may severely delay my project now. I have been dragging playing other games now, thinking, researching, and performing little tests here and there. I don't want to be bummed because I have been able to get around and even abuse the bugs from A8 to my advantage lol, but this one is scary. This is my first 1 million+ lines of code project, so I plan on grinding until its done! Thank you for your input and experience too! It has been very helpful to me over the years.

Last edited by Garrettwademan; 11/16/18 00:02.

Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
Re: video memory and d3d_texfree [Re: Garrettwademan] #474991
11/16/18 10:01
11/16/18 10:01
Joined: Aug 2003
Posts: 114
Deutschland
E
Ezzett Offline
Member
Ezzett  Offline
Member
E

Joined: Aug 2003
Posts: 114
Deutschland
Quote:
I have used VMmap, so I clocked 1.984Gb RAM on my Desktop machine, and about 1.8Gb something on my laptop. . My Desktop DOES NOT CRASH or throw any texture memory errors (it runs perfectly), but my laptop always has the issue.

Depending on the system even 1.4Gb could be too much for a 32 Bit application. You should stay way below that. I wouldn't risk to make a Gamestudio game that needs more than 1 Gb at a time.

Today's HD textures and high poly models fill up RAM very quickly. Because Gamestudio is a 32 Bit software you would need to work around that limit by a clever resource management in the game.

Quote:
Now I use built in checks for vid_memory and nexus, and I am only using 78/600Mb nexus, and about 250Mb of video memory.

If I remember correctly some things like textures are saved twice in memory to recreate them if you ALT+TAB out and back into the game. This is not shown correctly when you use these helper variables. You basically need to multiply some of the allocated memory by two.

Re: video memory and d3d_texfree [Re: Ezzett] #474997
11/16/18 16:40
11/16/18 16:40
Joined: Jan 2006
Posts: 244
PA
Garrettwademan Offline
Member
Garrettwademan  Offline
Member

Joined: Jan 2006
Posts: 244
PA
Thanks for the info Ezzett. I read that 1.4Gb is the max GS can support safely. I luckily bloated my textures / models / code so I knew I could go back later to shrink / optimize them.

My levels are pretty massive, so I may shrink them down. I luckily built a world editor that can add models / properties, doors, lighting systems, etc. so this should be fairly quickly.


Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
Re: video memory and d3d_texfree [Re: Garrettwademan] #475012
11/18/18 10:17
11/18/18 10:17
Joined: Sep 2003
Posts: 6,848
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,848
Kiel (Germany)
Keep in mind that the culprit most likely is the size of your code or rather the interim code created by the compiler (in development mode at least), not bitmaps or other files. Re-read the last 15 posts or so in this thread for clarification.

Publish your game, run it, then check memory usage with VMMap. It might even be a GB less than what you're currently seeing.


"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: video memory and d3d_texfree [Re: Superku] #475141
11/25/18 00:28
11/25/18 00:28
Joined: Apr 2002
Posts: 1,227
ny
jumpman Offline
Serious User
jumpman  Offline
Serious User

Joined: Apr 2002
Posts: 1,227
ny
im getting out of memory and d3d unamed errors as well frown

its been happening when recreating render chains, but also when I add in objects with huge textures. However I did not optimize my levels nor the texures, but its a little concerning nonetheless.



what Im worried about is optimizign all these textures and models and levels and still hit that out of error when creating new objects in realtime.

Last edited by jumpman; 11/25/18 00:29.
Re: video memory and d3d_texfree [Re: jumpman] #475146
11/25/18 17:59
11/25/18 17:59
Joined: Sep 2003
Posts: 6,848
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,848
Kiel (Germany)
That's just for your testscene, right? The script shouldn't be the issue then. However, try the following:
Download VMMap if you haven't already.
Put bad syntax at the very end of your script. Compile it, wait for the compiler to throw an error message but keep the process open. Start VMMap, pick the acknex.exe process and look at the memory (total/ heap).
You can remove the dummy line at the end of the script and check memory usage at runtime if you want to.

If the script compiling does not consume a ton of memory it's indeed your files, probably the textures (and/ or maybe even a huge nexus?).


"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
Page 9 of 10 1 2 7 8 9 10

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