need help much.. help me please!!!! *argh*

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

usaar33

Un1337
Mar 25, 2000
808
0
0
Unknown
www.UsAaR33.com
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:
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:
Code:
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):
Code:
class UDEMO_API UuDemoDriver : public UDemoRecDriver
{

DECLARE_CLASS(UuDemoDriver,UDemoRecDriver,CLASS_Transient|CLASS_Config,udemo
)
 void TickDispatch( FLOAT DeltaTime );
};
(source file):
Code:
#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

Shiit
Dec 19, 2000
168
0
0
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

Un1337
Mar 25, 2000
808
0
0
Unknown
www.UsAaR33.com
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

New Member
Mar 17, 2001
505
0
0
37
dot NL
2cool.free.fr
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

New Member
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

Un1337
Mar 25, 2000
808
0
0
Unknown
www.UsAaR33.com
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?
 

2COOL4-U

New Member
Mar 17, 2001
505
0
0
37
dot NL
2cool.free.fr
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

Un1337
Mar 25, 2000
808
0
0
Unknown
www.UsAaR33.com
...

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 of
Code:
IMPLEMENT_PACKAGE(udemoprivate)
(See also Tim Sweeney's Unreal Packages 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.