Planetside Software Forums

Support => Terragen Support => Topic started by: narvik on October 22, 2007, 09:10:31 am

Title: c0000005 crashes
Post by: narvik on October 22, 2007, 09:10:31 am
***** UPDATE *****
If you are new to this thread, PLEASE either read the whole thread, or know that there was a relatively SIMPLE workaround to render
this animation, using a BATCH file and the command prompt. Read further to get all details....
***** END UPDATE *****


I'm trying to render an animation split into 6 projects, and all but one crash constantly, mostly immediately after writing the first frame.
Only project that doesn't crash is one with hardly any objects.

Error seems to be the c0000005 (access violation).
Haven't seen this error since Cinestream/EditDV days.

Computer is AMD Athlon 5600+ 2X, 2 GB, Win2000

Would upgrade to 4 GB, although: 1) not sure Win2000 will make use of that, and 2) TG2 might still crash as maybe the quantity of RAM might not be the issue.

What's the story on TG2 and memory leaks?

What's the "safest" way (read, set-up) for TG2 to handle larger projects.

Cheers,

Title: Re: c0000005 crashes
Post by: Oshyan on October 22, 2007, 02:05:13 pm
If you're trying to render sequentially from the UI and are including objects, particularly populations, then you may be in for a lot of difficulty. There are some currently unresolved issues regarding sequential animation and object use that often cause crashes. One possible workaround is to use batch files and the commandline to render out your frames. Other than that you may just have to wait for an update that addresses these issues.

In terms of your specific problem and error, there really isn't nearly enough info to know what is happening. You would need to either provide the scene itself, including objects, or a lot more information on its specifics, including number of objects/populations, size of objects used (in polygons and MB), number of textures in use and their size, detail settings, etc.

- Oshyan
Title: Re: c0000005 crashes
Post by: narvik on October 23, 2007, 01:00:38 pm
Thanks Oshyan,
dang, this already tuned into something that is far more complicated than it ought to be; but nevertheless, I will continue with it.


I'd much appreciate if someone could help me with writing a simple batch file to render the animiation. I am so lost on this, it is becoming rather frustrating.

Total of 1550 frames.


Title: Re: c0000005 crashes
Post by: narvik on October 23, 2007, 01:56:16 pm
Tried using the command line, and that dfoesn't work. I get two small BMP files; it appears no terrain/heightfield is loaded, and no objects.

Is there a way to render an animation with TG2 using objects and populations?
Title: Re: c0000005 crashes
Post by: Oshyan on October 23, 2007, 02:07:08 pm
The commandline should certainly work. It's possible you're just not passing the right arguments, or the paths are an issue. BigBen might have some good input here.

- Oshyan
Title: Re: c0000005 crashes
Post by: narvik on October 24, 2007, 04:32:00 pm
Thanks again Oshyan.
Your help much appreciated as always.

Not sure what I could possibly change in the command line, as I tried many variations; and just to be sure, I even dumped all files into thew same folder, just to make sure TG2 would find them, but still no go.
Upgraded to 4GB RAM, still crashes using normal GUI.

I guess I might try Bryce after all this....sad really...

Title: Re: c0000005 crashes
Post by: Oshyan on October 24, 2007, 05:47:22 pm
Narvik, a thought occurs - what version are you using?

- Oshyan
Title: Re: c0000005 crashes
Post by: narvik on October 24, 2007, 07:29:08 pm
I'm using version 1.9.04.1

Title: Re: c0000005 crashes
Post by: narvik on October 24, 2007, 07:40:07 pm
If there are any newer versions out there, I'll be glad to give them a try....
Title: Re: c0000005 crashes
Post by: bigben on October 24, 2007, 10:27:39 pm
It may be related to this post, particularly if frame 1 renders correctly - http://forums.planetside.co.uk/index.php?topic=954.0 (http://forums.planetside.co.uk/index.php?topic=954.0).

1: Definintely render frame by frame, not in the GUI.
2: Common problems people have with commandline include


The commandline is a little sensitive to syntax so it pays to use nerdishly correct syntax. I also recommend moving all project files to the same directory and stripping out the path names from the TGD... (I also remove all spaces from directory names but that's just me  ;) ).

Here's a sample commandline from one of my animations.

%TERRAGEN_PATH%\tgdcli.exe -p C:\TGD\GrandCanyon\Project1\bb_grand_canyon.tgd -r -f 6973
now 6973 >> c:\render\frames\renderlog.txt


The secondline isn't necessary. I use it to log the render progress which is handy when you split the rendering among several computers. The now command is included in the Windows Administration Pack http://www.microsoft.com/downloads/details.aspx?FamilyID=C16AE515-C8F4-47EF-A1E4-A8DCBACFF8E3&displaylang=en (http://www.microsoft.com/downloads/details.aspx?FamilyID=C16AE515-C8F4-47EF-A1E4-A8DCBACFF8E3&displaylang=en)

[edit]Forgot the memory aspect of the question...

In my experience rendering frame by frame via tgdcli is pretty solid once you sort out the other issues. Increasing RAM beyond 2Gb won't help too much. There is a physical limit at which Windows will spit the dummy. The total memory usage (RAM and VM) is the critical number here, so even with less RAM you can still successfully render relatively complex stuff... it's just slower because you use more VM.  My high res panorama test ran non stop for 3 weeks without any memory problems (running in the background at work without getting in the way!)  [/edit]
Title: Re: c0000005 crashes
Post by: narvik on October 24, 2007, 11:09:27 pm
Thanks bigben,
I now added the -p switch (not done previously), and moved some more stuff around, and it seems to be rendering something, so that's positive.

Just a question about automation: is there a way to write a simple batch-file, that would allow the rendering of, say, 100 consecutive frames?

Many thanks...
Title: Re: c0000005 crashes
Post by: narvik on October 24, 2007, 11:12:39 pm
Just saw your added RAM edit:

I have three identical computers for this animation, one of them with 4GB RAM, the other two with 2GB.

If this is successful in rendering a batch of frames, I am wondering if it is worth tring to run two instances of the commandline render on each computer....
Well, fist thing is first, and I need to see if this works....

Still rendering, so lets hope...
Title: Re: c0000005 crashes
Post by: bigben on October 25, 2007, 12:28:19 am
Quote from: narvik on October 24, 2007, 11:09:27 pm
Thanks bigben,
I now added the -p switch (not done previously), and moved some more stuff around, and it seems to be rendering something, so that's positive.

Just a question about automation: is there a way to write a simple batch-file, that would allow the rendering of, say, 100 consecutive frames?

Many thanks...


I use this: http://forums.planetside.co.uk/index.php?topic=1841.0 (http://forums.planetside.co.uk/index.php?topic=1841.0)

Not sure if the latest release includes the batch file exporting as there was an issue with ascii encoding (easily fixed by opening and saving with WordPad). It can split a sequence into separate batch files, with a progressive frame order (every 1/1024, 1/512, 1/256 frame etc...)

Documentation sucks... I should do some more on that....  ;)

Quote from: narvik on October 24, 2007, 11:12:39 pm
Just saw your added RAM edit:

I have three identical computers for this animation, one of them with 4GB RAM, the other two with 2GB.

If this is successful in rendering a batch of frames, I am wondering if it is worth tring to run two instances of the commandline render on each computer....
Well, fist thing is first, and I need to see if this works....

Still rendering, so lets hope...


If you have enough RAM to run consecutive renders (and they're dual core) then yes, this is a good idea. I do this for animation previews where there is just basic surfacing so memory isn't an issue.
Title: Re: c0000005 crashes
Post by: narvik on October 25, 2007, 12:36:32 am
Great, thanks, I'll try those.

Well, the test render went fine....
EXCEPT: it didn't render the terrain/heightfield. Objects are there, except the land and plants....hmmm...

EDIT:
How do I modify the script to make tgdcli generate the heightfield before rendering, as I would using the GUI?
Title: Re: c0000005 crashes
Post by: bigben on October 25, 2007, 12:56:37 am
Pass ... I use TERs.  I did try auto generate once... it got stuck in a loop generating the heightfield. Someone else will have to answer this one.
Title: Re: c0000005 crashes
Post by: narvik on October 25, 2007, 07:46:28 am
Okay, thanks bigben.

Is there a way to convert the heightfield to a TER then?
Title: Re: c0000005 crashes
Post by: narvik on October 25, 2007, 08:00:09 am
By the way, there is something strange going on when executing the command line:
I do see several lines that contain the word "cannot"....it may or may not have to do with the heighfield - unfortunately I can't
read what it says as the command prompt only displays maybe a 100 lines and the "cannot whatever" lines get pushed up so far they get deleted...

Anyway to capture the full text of the command promt?
Title: Re: c0000005 crashes
Post by: Oshyan on October 25, 2007, 01:31:31 pm
Heightfield auto-generate is currently buggy and is not recommended. However once you generate your heightfield manually in the GUI you can just right-click the Heightfield Generate node and choose Save File As and give it a name and location (be sure to put .ter on the end). Then you can replace the Generate with a Heightfield Load node and it should work in commandline setups.

- Oshyan
Title: Re: c0000005 crashes
Post by: narvik on October 25, 2007, 02:09:37 pm
Thanks Oshyan,
another questions though; how do you call a Heightfield Load node in the command line?

EDIT: oh, sorry, I know what you mean now.....will try that.
Title: Re: c0000005 crashes
Post by: narvik on October 25, 2007, 07:13:13 pm
SUCCESS!  ;D ;D ;D

I was able to render a complete frame using the command line!

Many thanks to all who helped; Oshyan, bigben, and you-know-who.

Now final step would be to write a batch file that keeps on executing the command line, with a new frame number.
If anyone knows how to do that, I'd appreciate some help there.

Maybe split the batch process up into 12 batches or so?

This frame took about 4hrs+ to render, and there's about 1400 frames left.
Title: Re: c0000005 crashes
Post by: bigben on October 25, 2007, 10:10:28 pm
You could try my script tool (linked in previous reply) or use a spread sheet and text editor.
1: In the spreadsheet you need 3 columns...
  column 1, text before the frame number (copy to first row and fill down)
  column 2, sequential frame number

2: save as text
3: open in text editor and remove tabs (don't forget to include a space at the end of the text in column 1).
Title: Re: c0000005 crashes
Post by: narvik on October 26, 2007, 09:07:06 am
bigben,
thanks for the reply.

I'm still not quite understanding that though.


If I have a text file that looks like this:

=========================================
Set TERRAGEN_PATH=C:\T            
            
%TERRAGEN_PATH%\tgdcli.exe -p C:\T\P.tgd -r -f 266
%TERRAGEN_PATH%\tgdcli.exe -p C:\T\P.tgd -r -f 267
%TERRAGEN_PATH%\tgdcli.exe -p C:\T\P.tgd -r -f 268
%TERRAGEN_PATH%\tgdcli.exe -p C:\T\P.tgd -r -f 269
%TERRAGEN_PATH%\tgdcli.exe -p C:\T\P.tgd -r -f 270
%TERRAGEN_PATH%\tgdcli.exe -p C:\T\P.tgd -r -f 271
%TERRAGEN_PATH%\tgdcli.exe -p C:\T\P.tgd -r -f 272
%TERRAGEN_PATH%\tgdcli.exe -p C:\T\P.tgd -r -f 273
etc
==========================================

How do I run that in the command line so that the computer renders all the frames?



Title: Re: c0000005 crashes
Post by: bigben on October 26, 2007, 09:19:06 pm
Change the file extension from .txt to .bat and double click  ;)
Title: Re: c0000005 crashes
Post by: narvik on October 26, 2007, 09:33:16 pm
Quote from: bigben on October 26, 2007, 09:19:06 pm
Change the file extension from .txt to .bat and double click  ;)


Oh, hahaha! That I can manage...   :D :D

Thanks bigben...
Title: Re: c0000005 crashes
Post by: narvik on November 08, 2007, 08:32:57 am
Okay, this is now [almnost] working perfectly.

Now I am getting my brain wrapped around TG2, I'm starting to like it a lot.


Two things though:

1)
When is next update coming out approximately, and what will be added/fixed?

2)
I am getting a few errors when executing the BAT file; namely:
ERROR: DeclareParam: Cannot declare more than 256 parameters!

These are assumably after 256 of them? I get quite a few of these errors; they are called something like:
AddClass: added class square_root_colour (numbers....)
AddClass: added class perlin 3D scaler (numbers....)
AddClass: added class square_colour (numbers....)
etc

The pic looks to be fine (except for some lingering WHITE SPOTS still...); but I was wonderiong what effect these errors have on the animation?


Title: Re: c0000005 crashes
Post by: Oshyan on November 08, 2007, 01:22:05 pm
The next update will probably be the final release and there will be some significant improvements in rendering, UI, etc.

I haven't seen that error before. Since you're rendering from the commandline in a batch file and this is a fairly unusual circumstance I would tend to assume that is the source of the problem. Perhaps your batch execution lines are not being properly parsed as individual, sequential commands, but rather as continuous lines, causing an overflow of the command stack?

- Oshyan
Title: Re: c0000005 crashes
Post by: bigben on November 08, 2007, 11:21:38 pm
Possibly long filenames creating a very long command string?

Only guessing though.  For rendering animations I move the files to a folder almost directly off the root directory so that the path+filename is very short. I get pretty pedantic when it comes to setting up commandline stuff, but it seems to pay off. About the only "luxury" I allow myself is long filenames, apart from that I stick to old-school DOS file naming rules.

If it's and encoding issue as Oshyan suggested, this is easily fixed by opening the batch file in WordPad and saving it. This fixes incorrectly encoded EOL characters. I have had encoding issues but haven't seen this error yet myself, but as it's a simple check/fix it's worth a try.
Title: Re: c0000005 crashes
Post by: narvik on November 09, 2007, 08:21:38 am
***** UPDATE *****
These ERRORS are now eliminated. There was an issue with FOLDER locations, that made something go wonky.
Not sure exactly what, but it seemed the Terragen program didn't like being in the same folder as the all the object and TGD files,
or something like that anyway....
***** END UPDATE *****



Thanks once more for the help...

I am not sure if this is really generated from the command line or not.
The good news is, that it DOES NOT CRASH AT ALL now. Totally rock solid, and it can render consecutive frames with VERY complicated populations.

For your viewing pleasure I've [screen]captured the command prompt several times and stitched them together as a GIF file.

If anyone can take a look at it and see what might be going on, that would be cool...

I'm not too tech savy, but I look for words like:
ERROR, and CANNOT, and FALSE, and my gut tells me that can't be too good!  ;)
...and there's plenty of those words here....   :-\

For instance, what is "False UCbool"?

Here's the pic....
(http://fjordland.com/batch_script_screen_capture.gif)
Not sure how to make the image a clickable link, so here's the link to the image:
http://fjordland.com/batch_script_screen_capture.gif



***** UPDATE *****
These ERRORS are now eliminated. There was an issue with FOLDER locations, that made something go wonky.
Not sure exactly what, but it seemed the Terragen program didn't like being in the same folder as the all the object and TGD files,
or something like that anyway....
***** END UPDATE *****

Title: Re: c0000005 crashes
Post by: jo on November 09, 2007, 08:34:29 pm
Hi,

Quote from: narvik on November 09, 2007, 08:21:38 am
For instance, what is "False UCbool"?


Nothing to worry about :-). It's something to do with parsing the preferences file and is just to let me know things were working correctly. I've taken this out now, it's been working correctly for ages.

I'm not sure what might have been causing the DeclareParam errors. I did actually have something like this the other day, but it was only because some code had changed and I hadn't completely rebuilt everything. Nothing to do with what was causing your problems.

Regards,

Jo
Title: Re: c0000005 crashes
Post by: narvik on November 11, 2007, 11:21:44 am
Sweet, thanks Jo.

---

Unfortunately still having white-spot issues....opened new thread for that.