Subtle changes in 1.1 from 1.0
by Jason McIntosh · in Torque Game Builder · 12/29/2005 (11:48 pm) · 6 replies
I converted my current project from 1.0.2 to 1.1.0 alpha 2. Here are a couple subtle things that are worth mentioning to others.
- t2dVectorDistance() now returns a scalar, whereas it used to return a vector (the function was VectorDistance2D()).
- Blend colors are in the range 0..1 instead of 0..255.
- Is .safeDelete() more strict or something? Some crappy, bad, ugly code of mine that worked fine before caused crashes with the new version. I view this as a good thing, actually. Hopefully this means the internal memory management was improved. And it forces me to redo what was a big pile of dinosaur poop.
Otherwise the game was pretty easy to change over. My game is a complex bunch of code that touches many of T2D's systems, so it bodes well that there are no major problems so far. The alpha must be pretty bug free. Easy to take that for granted, but it really highlights Melv's huge talent and tons of careful effort.
Looking forward to more updates when TGE 1.4 integration is done! And special big thanks to the guy(s) that fixed the Mac project files (and another thanks for continued support of XCode 1.5). It compiled perfectly the first time.
- t2dVectorDistance() now returns a scalar, whereas it used to return a vector (the function was VectorDistance2D()).
- Blend colors are in the range 0..1 instead of 0..255.
- Is .safeDelete() more strict or something? Some crappy, bad, ugly code of mine that worked fine before caused crashes with the new version. I view this as a good thing, actually. Hopefully this means the internal memory management was improved. And it forces me to redo what was a big pile of dinosaur poop.
Otherwise the game was pretty easy to change over. My game is a complex bunch of code that touches many of T2D's systems, so it bodes well that there are no major problems so far. The alpha must be pretty bug free. Easy to take that for granted, but it really highlights Melv's huge talent and tons of careful effort.
Looking forward to more updates when TGE 1.4 integration is done! And special big thanks to the guy(s) that fixed the Mac project files (and another thanks for continued support of XCode 1.5). It compiled perfectly the first time.
About the author
#2
Thanks for the compliments, and good luck with your project! :)
12/30/2005 (9:20 am)
Actually this is a new game with 95% new code. I'm not sure that I'll convert Little Gods at all, since that would also include redoing about 40 particle effects from scratch. Plus it's not as cleanly structured as this new game, so there's no telling what horrors would await me.Thanks for the compliments, and good luck with your project! :)
#3
It crashes in platformMemory.cc. I get assert errors (line 909) that something is "Not an allocated block". I assume this means it's attempting to free memory that isn't allocated? Then it crashes (sometimes) in treeRemove(), platformMemory.cc, line 466.
I forgot about the ability to trace the script code, so I'll try that and see what happens.
Any other ideas?
12/30/2005 (1:27 pm)
Hmm, this crashing has persisted. It's very possible (even likely) that it's my code, but none of this happened before I converted to 1.1, and my code hasn't been modified significantly other than renaming things and a few patches to fix the above mentioned changes.It crashes in platformMemory.cc. I get assert errors (line 909) that something is "Not an allocated block". I assume this means it's attempting to free memory that isn't allocated? Then it crashes (sometimes) in treeRemove(), platformMemory.cc, line 466.
I forgot about the ability to trace the script code, so I'll try that and see what happens.
Any other ideas?
#4
If you look at the call-stack, you should be able to see where it originated. I'd be very interested to help you here whether it's T2Ds fault or not.
- Melv.
12/31/2005 (6:34 am)
Jason,If you look at the call-stack, you should be able to see where it originated. I'd be very interested to help you here whether it's T2Ds fault or not.
- Melv.
#5
12/31/2005 (3:39 pm)
Thanks for the help, Melv. Here's the crash report from the Mac version (I am not able to run it from a debugger on my low-end PC), but of course the TGE calls are the same, so it might still be helpful.Thread 0 Crashed: 0 ??? 0x000401a8 SimObject::unregisterObject() + 0x38 (simManager.cc:356) 1 ??? 0x00040320 SimObject::deleteObject() + 0xd0 (simManager.cc:389) 2 ??? 0x0003965c cSimObjectdelete(SimObject*, int, char const**) + 0x28 (simBase.cc:575) 3 ??? 0x00039620 cSimObjectdeletecaster(SimObject*, int, char const**) + 0x58 (simBase.cc:571) 4 ??? 0x0001859c CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*) + 0x33d4 (compiledEval.cc:1156) 5 ??? 0x0002ddd8 Namespace::Entry::execute(int, char const**, ExprEvalState*) + 0x7c (consoleInternal.cc:836) 6 ??? 0x00025600 Con::execute(SimObject*, int, char const**) + 0x134 (console.cc:829) 7 ??? 0x00025730 Con::executef(SimObject*, int, ...) + 0xb8 (console.cc:850) 8 ??? 0x00036da4 ScriptObject::onRemove() + 0x48 (scriptObject.cc:91) 9 ??? 0x000401bc SimObject::unregisterObject() + 0x4c (simManager.cc:361) 10 ??? 0x00040320 SimObject::deleteObject() + 0xd0 (simManager.cc:389) 11 ??? 0x0003965c cSimObjectdelete(SimObject*, int, char const**) + 0x28 (simBase.cc:575) 12 ??? 0x00039620 cSimObjectdeletecaster(SimObject*, int, char const**) + 0x58 (simBase.cc:571) 13 ??? 0x0001859c CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*) + 0x33d4 (compiledEval.cc:1156) 14 ??? 0x0002ddd8 Namespace::Entry::execute(int, char const**, ExprEvalState*) + 0x7c (consoleInternal.cc:836) 15 ??? 0x00025600 Con::execute(SimObject*, int, char const**) + 0x134 (console.cc:829) 16 ??? 0x00025730 Con::executef(SimObject*, int, ...) + 0xb8 (console.cc:850) 17 ??? 0x00036da4 ScriptObject::onRemove() + 0x48 (scriptObject.cc:91) 18 ??? 0x000401bc SimObject::unregisterObject() + 0x4c (simManager.cc:361) 19 ??? 0x00040320 SimObject::deleteObject() + 0xd0 (simManager.cc:389) 20 ??? 0x0003965c cSimObjectdelete(SimObject*, int, char const**) + 0x28 (simBase.cc:575) 21 ??? 0x00039620 cSimObjectdeletecaster(SimObject*, int, char const**) + 0x58 (simBase.cc:571) 22 ??? 0x0001859c CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*) + 0x33d4 (compiledEval.cc:1156) 23 ??? 0x00018068 CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*) + 0x2ea0 (compiledEval.cc:1087) 24 ??? 0x00018068 CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*) + 0x2ea0 (compiledEval.cc:1087) 25 ??? 0x00018068 CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*) + 0x2ea0 (compiledEval.cc:1087) 26 ??? 0x0001a618 CodeBlock::compileExec(char const*, char const*, bool) + 0x318 (compiler.cc:522) 27 ??? 0x0002533c Con::evaluate(char const*, bool, char const*) + 0xb4 (console.cc:778) 28 ??? 0x000d5f80 GuiControl::onAction() + 0x8c (guiControl.cc:1140) 29 ??? 0x0008a244 GuiButtonBaseCtrl::onAction() + 0xe0 (guiButtonBaseCtrl.cc:268) 30 ??? 0x00089e1c GuiButtonBaseCtrl::onMouseUp(GuiEvent const&) + 0x70 (guiButtonBaseCtrl.cc:183) 31 ??? 0x000cf750 GuiCanvas::rootMouseUp(GuiEvent const&) + 0x84 (guiCanvas.cc:654) 32 ??? 0x000cf178 GuiCanvas::processInputEvent(InputEvent const*) + 0xac8 (guiCanvas.cc:521) 33 ??? 0x0006e8a4 DemoGame::processInputEvent(InputEvent*) + 0xc0 (main.cc:545) 34 ??? 0x000e8d30 GameInterface::processEvent(Event*) + 0x170 (gameInterface.cc:66) 35 ??? 0x000e900c GameInterface::postEvent(Event&) + 0xa4 (gameInterface.cc:154) 36 ??? 0x001015e0 DoWinCarbonEventHandling(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 0x3a4 (macCarbWindow.cc:651) 37 com.apple.HIToolbox 0x92881fa0 DispatchEventToHandlers + 0x150 38 com.apple.HIToolbox 0x92882214 SendEventToEventTargetInternal + 0x174 39 com.apple.HIToolbox 0x928946bc SendEventToEventTarget + 0x28 40 com.apple.HIToolbox 0x928a2d3c HandleMouseEventForWindow(OpaqueWindowPtr*, OpaqueEventRef*, unsigned short) + 0x144 41 com.apple.HIToolbox 0x929c3524 HandleMouseEvent(OpaqueEventRef*) + 0x170 42 com.apple.HIToolbox 0x92892c5c ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 0x1e8 43 com.apple.HIToolbox 0x9288205c DispatchEventToHandlers + 0x20c 44 com.apple.HIToolbox 0x92882214 SendEventToEventTargetInternal + 0x174 45 com.apple.HIToolbox 0x928946bc SendEventToEventTarget + 0x28 46 ??? 0x00102350 ProcessMessages() + 0xec (macCarbWindow.cc:1109) 47 ??? 0x001023e0 Platform::process() + 0x54 (macCarbWindow.cc:1140) 48 ??? 0x0006e2c4 DemoGame::main(int, char const**) + 0x19c (main.cc:416) 49 ??? 0x00102e70 run() + 0x84 (macCarbWindow.cc:1654) 50 ??? 0x00102f64 DoRAELLoop(__EventLoopTimer*, void*) + 0x20 (macCarbWindow.cc:1704) 51 com.apple.CoreFoundation 0x901c45f8 __CFRunLoopDoTimer + 0xf4 52 com.apple.CoreFoundation 0x901c1958 __CFRunLoopRun + 0x5c8 53 com.apple.CoreFoundation 0x901c5e6c CFRunLoopRunSpecific + 0x148 54 com.apple.HIToolbox 0x92885f60 RunCurrentEventLoopInMode + 0xac 55 com.apple.HIToolbox 0x9288c640 ReceiveNextEventCommon + 0xf4 56 com.apple.HIToolbox 0x928ae1a0 AcquireNextEventInMode + 0x48 57 com.apple.HIToolbox 0x928ab670 RunApplicationEventLoop + 0x88 58 ??? 0x00103500 main + 0x574 (macCarbWindow.cc:1849) 59 ??? 0x00002458 _start + 0x188 (crt.c:267) 60 dyld 0x8fe1a278 _dyld_start + 0x64
#6
12/31/2005 (3:40 pm)
There's another crash that happens and it appears to have something to do with safeDeleting a static sprite. I'll try to reproduce that and post the crash report.
Torque 3D Owner Luke D
Default Studio Name
At the very least I'll probably soft-launch with 1.0.2 soon and wait to integrate when the 1.4 core is in.
By the way, congrats on the Game Tunnel review and award!