2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: video memory and d3d_texfree
[Re: Garrettwademan]
#474877
11/10/18 12:43
11/10/18 12:43
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
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: sitrep]
#474951
11/14/18 17:00
11/14/18 17:00
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
@Garrettwademan: My "tool" is the following 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: 245 PA
Garrettwademan
Member
|
Member
Joined: Jan 2006
Posts: 245
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.
|
|
|
Re: video memory and d3d_texfree
[Re: Garrettwademan]
#474991
11/16/18 10:01
11/16/18 10:01
|
Joined: Aug 2003
Posts: 118 Deutschland
Ezzett
Member
|
Member
Joined: Aug 2003
Posts: 118
Deutschland
|
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. 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: Superku]
#475141
11/25/18 00:28
11/25/18 00:28
|
Joined: Apr 2002
Posts: 1,246 ny
jumpman
Serious User
|
Serious User
Joined: Apr 2002
Posts: 1,246
ny
|
im getting out of memory and d3d unamed errors as well 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.
|
|
|
|