PDA

View Full Version : need help much.. help me please!!!! *argh*


usaar33
20th Nov 2001, 09:25 PM
For my new demo manager, I have written a custom demo driver. Its purpose
is simply to take into account pausing and timedilation (allowing you to
pause and speed up/slow down demos).

(Note: that ut demo manager 2.0 also has file analyzing and such :)
A pic to make you feel guilty (note that speed and pause will be removed from this menu) if you dont help :p:
http://www.unreality.dk/usaar33/udemobeta.jpg
)
It works perfectly for one demo. Unfortuantely after completion, when
loading another demo (or even exiting the game), it will crash in garbage
collection with the following error:

Log: 0.0ms Unloading: Package SaveMe
Log: Closing down demo driver.
Critical: FMallocWindows::Free
Critical: FMallocWindows::Free
Critical: FMallocWindows::Realloc
Critical: 00000008 0 FArray
Critical: FArray::Realloc
Critical: 0*2
Critical: FMallocWindows::Free
Critical: ULevelBase::Destroy
Critical: ULevel::Destroy
Critical: UObject::ConditionalDestroy
Critical: (Level ctf-orbital.MyLevel)
Critical: DispatchDestroy
Critical: (29599: Level ctf-orbital.MyLevel)
Critical: DispatchDestroys
Critical: UObject::PurgeGarbage
Critical: UObject::CollectGarbage
Critical: Cleanup
Critical: UGameEngine::LoadMap
Critical: AttemptLoadPending
Critical: TickPending
Critical: UGameEngine::Tick
Critical: UpdateWorld
Critical: MainLoop
Exit: Executing UObject::StaticShutdownAfterError


The code that I use is the quite simple:

(header file):

class UDEMO_API UuDemoDriver : public UDemoRecDriver
{

DECLARE_CLASS(UuDemoDriver,UDemoRecDriver,CLASS_Transient|CLASS_Config,udemo
)
void TickDispatch( FLOAT DeltaTime );
};

(source file):

#include "udemoprivate.h" //this has an include of the header above.
void UuDemoDriver::TickDispatch( FLOAT DeltaTime ){
guard(UuDemoDriver::TickDispatch);
//note that GetLevel() returns Notify->NotifyGetLevel(), only it has an
assertion that would crash if I just checked it alone.
if
(Notify->NotifyGetLevel()&&GetLevel()->GetLevelInfo()&&GetLevel()->GetLevelI
nfo()->LevelAction==0){
if (GetLevel()->GetLevelInfo()->Pauser!=TEXT(""))
return;
DeltaTime*=GetLevel()->GetLevelInfo()->TimeDilation;
}
Super::TickDispatch(DeltaTime);
unguard;
}
IMPLEMENT_CLASS(UuDemoDriver);

Thanks in advance to any who can help me. If no one can, I will be forced
to forfeit this feature :(

Shiit
21st Nov 2001, 11:45 AM
I'm far from in the same programming league as you, so maybe what I'm saying is rubbish or obvious, but I can hardly imagine that's all the code in there. Isn't a demodriver supposed to clean up after playing a demo, or pass control back to a player or something? It seems to me that's where things go awry, since it works fine for pláying a demo...
Or is there more code, but did you post only this because you know this is the code at fault, e.g. you have a working version of this code, but without speed adjustments.

usaar33
21st Nov 2001, 09:18 PM
no, that is my complete code for the driver. It is a child of the normal UT demo driver. All cleanup should, in theory, be done by the parent. As for its parent, the net driver, I do not even have the source... so that is that.

2COOL4-U
22nd Nov 2001, 12:54 PM
Perhaps it's an error in the parent of your class(Like it doesn't know how to handle your class)?

usaar33
23rd Nov 2001, 01:56 AM
Originally posted by 2COOL4-U
Perhaps it's an error in the parent of your class(Like it doesn't know how to handle your class)?

uh, that makes little sense. I have the code. nothing class dependent. this is OOP.

*bump*

Raeled
23rd Nov 2001, 08:04 AM
it also happends if you don't pause, and use normal speed?

maybe the tick of the demo driver contains something else that is important.

2COOL4-U
23rd Nov 2001, 09:57 AM
I reall hope you'll be able to add timedilation :) If you successeed in doing this also add an option to make a screenshot every tick(Or after a few ticks).

This allows mods to make a preview movie by just placing all the BMP's after each other in a movie. Instead of using video out to record it on tape and then reimport it again. Man you'll be praised if do this :D

Mychaeel
23rd Nov 2001, 02:27 PM
I'm certain you tried that already... but: Does that problem also occur if you don't do anything other than calling Super::TickDispatch() in your TickDispatch() implementation?

Maybe the crash happens in one of the other methods you're calling; maybe calling one of them is invalid after the demo has finished (GetLevel() or GetLevelInfo(), for instance).

Just some random guesses. Sorry.

usaar33
23rd Nov 2001, 03:07 PM
Originally posted by Mychaeel
I'm certain you tried that already... but: Does that problem also occur if you don't do anything other than calling Super::TickDispatch() in your TickDispatch() implementation?

Maybe the crash happens in one of the other methods you're calling; maybe calling one of them is invalid after the demo has finished (GetLevel() or GetLevelInfo(), for instance).

Just some random guesses. Sorry.


an empty class alone will crash :( It has nothing to do with my tick stuff.


preview shots? one shot is 2 megs... at 30 FPS....

again, the tickdispatch is not it.... perhaps it is some declaration I need?

Mychaeel
23rd Nov 2001, 03:18 PM
I've stumbled over some IMPLEMENT_PACKAGE macro call in other web sources that might be missing in your code; something along the lines ofIMPLEMENT_PACKAGE(udemoprivate)(See also Tim Sweeney's Unreal Packages (http://unreal.epicgames.com/Packages.htm) document.)

Another random guess, but maybe worth a try. :)

2COOL4-U
23rd Nov 2001, 03:57 PM
Usaar33: I read about this on a Site once it was for half life, but if you did this and ppl would turn their resolution down to 320 x 200(Anything higher would result in a big avi file anyway). And use your timedilation to make the screenshots it would be really cool(I know some half life programm is able to do this stuff).

usaar33
23rd Nov 2001, 11:13 PM
Originally posted by Mychaeel
I've stumbled over some IMPLEMENT_PACKAGE macro call in other web sources that might be missing in your code; something along the lines ofIMPLEMENT_PACKAGE(udemoprivate)(See also Tim Sweeney's Unreal Packages (http://unreal.epicgames.com/Packages.htm) document.)

Another random guess, but maybe worth a try. :)

Nope, I already have that. (and the implament_class thing as well)
Besides, other classes already work.


2cool: the lowest res (at least here) is 512x384. again, if you really want it to occur simply make it in uscript (an entry level actor that calls consolecommand("screenshot") every frame when x ms have gone by.

2COOL4-U
24th Nov 2001, 03:15 AM
Yeah I could do that :D Thanks for the idea

Mr.Mitchell
24th Nov 2001, 04:38 PM
There is already a mutator that makes screenshots every renderable frame. It is the MovieCapture mutator, you can get it at http://mep.beyondunreal.com/projects.html