• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

m4ttbush

Members
  • Content count

    19
  • Joined

  • Last visited

Community Reputation

125 Neutral

About m4ttbush

  • Rank
    Member

Personal Information

  1. Thanks Andreas, I was having the same issue with revision 1373, but I made the same changes in asCWriter::CalculateAdjustmentByPos() and asCReader::CalculateAdjustmentByPos() And everything seems to be working now! Does that sound right? Thanks!
  2. Thanks for the prompt fix Andreas! The bytecode saves out ok from 64 bit now. Unfortunately I'm still having issues with loading bytecode on 64 bit. The bytecode seems to load ok and it runs, but when it executes a function with an enum parameter, the other parameters get mangled. For example, I have a script function: [CODE]void change_state(state_types new_state, int new_face)[/CODE] When the scripts are compiled on x64 it works fine, but when the bytecode is loaded again, the second parameter becomes the same value as the enum. Replacing state_types with int then casting it back to an enum to assign it fixes the problem. There was another case with a few enums and a string that caused a crash in the string assignment operator when the function was called. This was also fixed by replacing the enums with ints. The function I was originally having problems with also causes problems, so I'm assuming this is the same problem but manifesting itself in a different way. I'll see if I can isolate the problem again, I suspect it will just be a matter of reloading the bytecode in the test I posted earlier. [b]Edit:[/b] Yep, using the same script as before but saving then loading the bytecode before executing it causes a crash, but it works if the enum is swapped for an int. Thanks for your help!
  3. Hey Andreas, I've managed to isolate the problem! Happens on both Windows and Linux 64 bit with 2.24.0a Looks like it's caused by an enum followed by a non-primitive type in a script function...: [CODE] enum TestEnum { TestEnum_A } class NonPrimitive { } // Problem function void Foo( TestEnum e, NonPrimitive o ) { } void main() { NonPrimitive o; Foo( TestEnum_A, o ); // Crashes saving bytecode for where it's called } [/CODE] "NonPrimitive" can be value or reference, script or application class and it will crash, but primitive types work fine. Looks like it breaks in as_restore.cpp around line 3369 when it gets to the enum parameter. Maybe some kind of discrepancy in how enum parameters are treated? [CODE]for( asUINT p = 0; p < calledFunc->parameterTypes.GetLength(); p++ ) { if( offset <= currOffset ) break; if( calledFunc->parameterTypes[p].GetObjectType() || calledFunc->parameterTypes[p].IsReference() ) { numPtrs++; currOffset += AS_PTR_SIZE; // offset is 1 on 32 bit and 64 bit, but this causes currOffset to be 2 on 64 bit } else { asASSERT( calledFunc->parameterTypes[p].IsPrimitive() ); currOffset += calledFunc->parameterTypes[p].GetSizeOnStackDWords(); } } [/CODE]
  4. [quote][b]All of the tests passed with success.[/b][/quote] Awesome. Thanks so much for your help with that, and I'm really glad you got it sorted without having to shell out for a new mac.
  5. This is what I'm getting if I run just the native calling convention tests: Same in debug/release apple/gcc compiler [quote] [b]AngelScript version: 2.23.1 WIP[/b] [b]AngelScript options: AS_MAC AS_X86 [/b] [b]-- TestExecute passed[/b] [b]--- Assert failed ---[/b] [b]func: void ExecuteString()[/b] [b]mdle: ExecuteString[/b] [b]sect: ExecuteString[/b] [b]line: 1[/b] [b]---------------------[/b] [b]Failed on line 76 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp[/b] [b]TestReturn: cfunction didn't return properly[/b] [b]Failed on line 84 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp[/b] [b]--- Assert failed ---[/b] [b]func: void ExecuteString()[/b] [b]mdle: ExecuteString[/b] [b]sect: ExecuteString[/b] [b]line: 1[/b] [b]---------------------[/b] [b]Failed on line 88 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp[/b] [b]--- Assert failed ---[/b] [b]func: void ExecuteString()[/b] [b]mdle: ExecuteString[/b] [b]sect: ExecuteString[/b] [b]line: 1[/b] [b]---------------------[/b] [b]Failed on line 100 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp[/b] [b]Failed on line 248 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp[/b] [b]--------------------------------------------[/b] [b]One of the tests failed, see details above.[/b] [/quote] I'll see if I can get a better idea of what's going wrong, let me know if there's any other information I can give you. I don't know if you have any interest in upgrading your mac, and please don't feel obligated to do so. But I just made a small donation on behalf of Hitbox for your contribution to Dustforce, which might help out if you did want to upgrade. Thanks, Matt
  6. Ah, you're right. If I put the function parameters in an array on the stack in the correct order, and pass that array in to the assembly code it works, in debug at least.
  7. Unfortunately removing the UNUSED_VAR macros doesn't help. Are you sure it's not passing the address of the parameter? It looks correct here: http://snag.gy/q98dS.jpg Down the bottom of the image you can see that [font=courier new,courier,monospace]&args[/font] is [font=courier new,courier,monospace]0xbffff294[/font] [font=courier new,courier,monospace]&paramSize[/font] is [font=courier new,courier,monospace]0xbffff290 (-4)[/font] and [font=courier new,courier,monospace]&func[/font] is [font=courier new,courier,monospace]0xbffff28c (-8)[/font] And [font=courier new,courier,monospace]edx[/font] seems to be set to [font=courier new,courier,monospace]0xbffff294[/font]. Thanks for your help, and no rush, 1.22.1 is still working. And the mac build of Dustforce isn't out for another 3 weeks
  8. Yep, this is in [font=courier new,courier,monospace]TestExecute()[/font] I tried that code, it still crashes. This is what it looks like when it crashes with call stack and disassembly: [url="http://snag.gy/jDB74.jpg"]http://snag.gy/jDB74.jpg[/url]
  9. I think I was on 10.7.2 and I updated to 10.7.3 when I updated Xcode. Can't remember if I tried 2.23.0 before updating or not, sorry. Here's the assembly for CallCDeclFunction, I think [url="http://pastebin.com/VpMwk3HF"]http://pastebin.com/VpMwk3HF[/url] Thanks Edit: Btw, it's crashing on line 47 of that paste, 2 lines after "[font=courier new,courier,monospace]copyloop:"[/font] at "[font=courier new,courier,monospace][color=#000000]pushl [/color][color=#009900][b]([/b][/color][color=#339933]%[/color][color=#00007F]eax[/color][color=#009900][b])[/b][/color][color=#000000]"[/color][/font]
  10. Every one of the tests crashes inside [font=courier new,courier,monospace]CallSystemFunctionNative[/font] when it gets to "[font=courier new,courier,monospace]asm __volatile__[/font]" [font=courier new,courier,monospace]TestExecute [/font]crashes calling "[font=courier new,courier,monospace]cfunction[/font]" from "[font=courier new,courier,monospace]ExecuteString[/font]" [font=courier new,courier,monospace]TestCDeclReturn::Test[/font] crashes calling "[font=courier new,courier,monospace]reti64[/font]" from "[font=courier new,courier,monospace]ExecuteString[/font]" [font=courier new,courier,monospace]TestExecute1Arg [/font]crashes calling "[font=courier new,courier,monospace]cfunction[/font]" ...etc Only one that didn't crash was [font=courier new,courier,monospace]TestVirtualInheritance[/font], but I think it got skipped because virtual inheritance wasn't detected. Let me know if there's anything more I can do. Edit: I'm on [left]OS 10.7.3 and Xcode 4.3.2[/left] [left]Edit 2: If I compile for 64 bit, all tests pass (Except TextVirtualInheritance which is skipped).[/left]
  11. Hey Andreas, I'm having the same issue, I couldn't get the disassembly to work, but here's the assembly from what I think is the StringFactory function [url="http://pastebin.com/UZagTvCa"]http://pastebin.com/UZagTvCa[/url] Let me know if there's anything else I can do.
  12. Thanks Andreas, I'll see if I can get a better idea of what's happening, my solution does feel like it's just hiding some underlying issue (which may well be in the compiler) I've come across some other strange behaviour, I'm not certain yet if it's related to AngelScript or not, but it also only occurs with optimisations enabled.. Will look in to it more tomorrow. Thanks
  13. Thanks Andreas, I'm using 32 bit Intel (i386), I haven't tried 64 bit, will do that today. I've only been using Xcode for a couple of days, so I'm not very proficient at using the debugger, but I'll try to narrow down where it's going wrong. Edit: Yep 64 bit works fine. Edit2: After some more digging around, it appears that the constructor is not returning a NULL pointer, and the value of retQW immediately after calling [CODE]retQW = CallCDeclFunctionQWord(args, paramSize<<2, (size_t)func);[/CODE] is not 0, but if I print the value just outside the switch statement, it is 0. This might be due to some code being optimised away, but this seems to be where the pointer becomes null. [b]Edit3: Kinda got it working[/b], if I make retQW volatile it seems to prevent optimisations enough for it to work. This is using the GCC 4.2 compiler.
  14. Hey, I've started porting our game Dustforce to OS X, and it's going pretty well so far, the debug build is actually up and running. But as soon as I try to run the game with a release build of AngelScript I get a null pointer access on the first reference the code comes across which has been returned from the application (i.e. script classes being instantiated seem to work fine). And if I comment that code out, the next reference it tries to access is null, and so on. It seems to be when I enable optimisations, even the first level, if I disable optimisations in the release build it works, or enable them in the debug build it fails. To isolate the problem, I added the array add-on to the "tutorial" sample, and put this code in the script: [CODE] array<uint> arr; arr.resize(5);[/CODE] And I get a null pointer access on arr.resize(5); I stepped in to the factory function and confirmed that it's not returning null... I'm using Xcode 4.2.1 and I've tried AngelScript 2.22.1 and 2.22.2 I've tried building from the included Xcode project file, and also just adding the AngelScript cpp files to the Dustforce project. I'll keep trying, but much of the internals of AngelScript are a bit over my head. Any help would be greatly appreciated. Thanks.
  15. Thanks Andreas! Your [font="Courier New"]IsKeyWord[/font] optimization is faster than mine, it's down to ~5 seconds with revision 1055 (: According to CodeAnalyst, about 30% of the remaining time is spent in [font="Courier New"]asCBuilder::GetFunctionDescriptions()[/font] And another 20% is spent in [font="Courier New"]asCompareStrings()[/font] [font="'Courier New"] [/font] Looks like speeding up those linear searches might help a bit, but don't worry about it too much if you have other things to do. Thanks for taking the time to help with this, I really appreciate it! -Matt