• 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.


  • Content count

  • Joined

  • Last visited

Community Reputation

151 Neutral

About Davaris1

  • Rank
  1. I made a modification to the start of the CallPlugIn function         //PyObject* pluginModule = PyImport_Import(name);     PyObject* pluginModule = PyImport_ImportModule(PLUGIN_NAME);     It got me further into the function, but the result string is null.     const char* resultStr = PyBytes_AsString(resultObj);       Edit: I tried this code and it got the right result.     char *cstrret;     PyArg_Parse(resultObj, "s", &cstrret);     I used this tutorial:   https://www6.software.ibm.com/developerworks/education/l-pythonscript/l-pythonscript-ltr.pdf   Its the only one I've found that works.  
  2. I am following this turorial and am not getting anywhere, with the code that was provided. I am running Python 3.3.2.   It returns null on   PyObject* pluginModule = PyImport_Import(name);     static const char* PLUGIN_NAME = "shout_filter"; String<> CallPlugIn(const String<>& ln) {     PyObject* name = PyBytes_FromString(PLUGIN_NAME);     PyObject* pluginModule = PyImport_Import(name);     Py_DECREF(name);     if (!pluginModule)     {         PyErr_Print();         return "Error importing module";     }     PyObject* filterFunc = PyObject_GetAttrString(pluginModule, "filterFunc");     Py_DECREF(pluginModule);     if (!filterFunc)     {         PyErr_Print();         return "Error retrieving 'filterFunc'";     }     PyObject* args = Py_BuildValue("(s)", ln);     if (!args)     {         PyErr_Print();         Py_DECREF(filterFunc);         return "Error building args tuple";     }     PyObject* resultObj = PyObject_CallObject(filterFunc, args);     Py_DECREF(filterFunc);     Py_DECREF(args);     if (!resultObj)     {         PyErr_Print();         return "Error invoking 'filterFunc'";     }     const char* resultStr = PyBytes_AsString(resultObj);     if (!resultStr)     {         PyErr_Print();         Py_DECREF(resultObj);         return "Error converting result to C string";     }     String<> result = resultStr;     Py_DECREF(resultObj);     return result; } int RunThatPythonScript() {     Py_Initialize();     PyObject* sysPath = PySys_GetObject((char*)"path");     PyObject* curDir = PyBytes_FromString(".");     PyList_Append(sysPath, curDir);     Py_DECREF(curDir);     String<> input = "Do Something With This Text";     CallPlugIn(input);     Py_Finalize();     return 0; }     I was getting the same issue with the official version demo:   http://docs.python.org/3/extending/embedding.html#embedding-python-in-c   Any suggestions?
  3. [quote name='flodihn' timestamp='1333317755' post='4927297'] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3]I think it is pretty clear I am referring to the green arrows as an sort of abstraction thing, and not the grey boxes that is the lists and maps etc.[/size][/font][/color] [/quote] Okay, I see you don't understand the diagram at all. If it is a library like Utility Library, or Math Library, that can be used anywhere and don't rely on anything else, the arrows don't point anywhere, they end just outside their yellow box. Arrows that extend from one yellow box to another, mean those boxes rely on them. For instance Job Manager needs System Utilities. If you don't understand something, its better to ask how it works, than to say there is something wrong with it. Edit: I see Eric L. explained it above, better than I did.
  4. [quote name='flodihn' timestamp='1333314926' post='4927276'] I was not talking about the lists, arrays, strings etc. I was talking about the three arrows that point from the Utility Class and points to the System Managers. So my point is still valid. [/quote] From your block comment, you started out by demonstrating, you don't know what Lists, Arrays, Maps, Strings, Hash Tables, Smart Links, Reference Tables, Graphs and Trees are, or how and where they are used. I am not going to explain them to you, you need to take a basic programming class for that. This is stuff [u]everyone[/u] knows. I don't mean to be rude, but its pretty its obvious you haven't the faintest clue, what you are talking about. I am not suprised you don't understand this diagram.
  5. [quote name='flodihn' timestamp='1333300720' post='4927215'][list] [*]Looking at top left corner, the "Utility Library", it has 3 green arrows to something called "System Managers", what this means is not as I said not defined, so I have to "guess" it means some sort of abstraction, that[u] things in the "Utility Library" access "stuff" in "System Managers"[/u], probably in a very nested way that they could not draw it. [/list] [/quote] You really don't know what Lists, Arrays, Maps, Strings, Hash Tables, Smart Links, Reference Tables, Graphs and Trees are??? This is basic 101 stuff, all programmers know.
  6. Just curious WitchLord, as you are going to add exceptions, what is your opinion of design by contract in AngelScript? For some reason C++ never introduced it, only Digital Mars has it for C++ as far as I know. [url="http://www.digitalmars.com/ctg/contract.html"]http://www.digitalma...g/contract.html[/url]
  7. I want an object to behave like this in AngelScript, but am unable to get it to work. [code] // AngelScript Code: ZedScriptW p(ptrToZedEntityID1); ZedScriptW s(ptrToZedEntityID2); [/code] This part seems to work. [code] // C++ r = engine->RegisterObjectType("ZedScriptW", sizeof(ZedScriptW), asOBJ_VALUE|asOBJ_APP_CLASS|asOBJ_APP_CLASS_CONSTRUCTOR|asOBJ_APP_CLASS_DESTRUCTOR); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("ZedScriptW", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ZedScriptW_Constructor), asCALL_CDECL_OBJLAST); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("ZedScriptW", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(ZedScriptW_Destructor), asCALL_CDECL_OBJLAST); assert( r >= 0 ); [/code] However I can't figure out how to create a constructor that accepts multiple parameters. This is my attempt [code] // C++ r = engine->RegisterObjectBehaviour("ZedScriptW", asBEHAVE_CONSTRUCT, "void f(ZedEntityID @)", asFUNCTIONPR(ZedScriptW_Constructor_ZedEntityID, (ZedScriptW*, ZedEntityID*), void), asCALL_CDECL_OBJLAST); assert( r >= 0 ); [/code] This is the code for the constructor that takes a parameter. The function is called when I run it, but ownerID points to garbage. [code] // C++ void ZedScriptW_Constructor_ZedEntityID(ZedScriptW *memory, ZedEntityID *ownerID) { new(memory) ZedScriptW(); if (ownerID) memory->SetComponent(ownerID->GetOwner()); } [/code] Can anyone help? Edit: I think I have figured it out while writing this post. asCALL_CDECL_OBJLAST is the hint. So I have swapped the params around. [code]r = engine->RegisterObjectBehaviour("ZedScriptW", asBEHAVE_CONSTRUCT, "void f(ZedEntityID @)", asFUNCTIONPR(ZedScriptW_Constructor_ZedEntityID, ( ZedEntityID*, ZedScriptW*), void), asCALL_CDECL_OBJLAST); assert( r >= 0 void ZedScriptW_Constructor_ZedEntityID(ZedEntityID *ownerID, ZedScriptW *memory)[/code] Hopefully all of the above is correct. If not please let me know.
  8. Thank you.
  9. I got AngelScript working with the C4 Engine, even when using the standard string class. I found these instructions in the C4 forums. [quote]If you use any standard headers, then you need to disable the C4FASTBUILD option. #define C4FASTBUILD 0[/quote] [quote] When new/delete are interfering with compilation: The only way that this would happen is if that external library is using the new operator in its header files. That being the case, you need to include any headers associated with that library before any C4 headers for each translation unit.[/quote] Just to be safe, I include all standard header files before the C4 files and it compiles.
  10. Hi WitchLord, I was just testing your demo game and got an assertion of r = -10 at line 59 and line 87, in scriptmgr.cpp. I downloaded the tarball from here: [url="http://angelscript.svn.sourceforge.net/viewvc/angelscript/trunk/"]http://angelscript.s...elscript/trunk/[/url] It works fine when I use scriptstdstring.h, but when I use my version of it, those functions do not register. Edit: I have found my mistake. In my version of scriptstdstring.cpp I used "String" instead of "string".
  11. Thanks for your answers. They were very helpful.
  12. What the best way to go about this? I have some code from an old tutorial and they are loading all the files into one module and then calling function names from that module. [quote] // Load weapons script file if (LoadScript( pScriptEngine, "common.as", MAIN_MODULE ) < 0) { pScriptEngine->Release(); cout << "Failed to load script file." << endl; Pause(); return -1; } // Load weapons script file if (LoadScript( pScriptEngine, "weapons.as", MAIN_MODULE ) < 0) { pScriptEngine->Release(); cout << "Failed to load script file." << endl; Pause(); return -1; } // Load main script file that runs in synch with the game loop if (LoadScript( pScriptEngine, "main.as", MAIN_MODULE ) < 0) { pScriptEngine->Release(); cout << "Failed to load script file." << endl; Pause(); return -1; }[/quote] So is it better to create an additional module for each creature in a game, or should I have only 1 module and have unique "main functions", based on each creature's name? Creature1Main() { } Creature2Main() { } etc.
  13. Thanks for replying so quickly. I just did what you said and it works. This is a very nice system!
  14. I'm trying to get my first script working using the C4 String class. Unfortunately it is hitting an assert and is returning asINVALID_NAME here: r = engine->RegisterObjectType("String<>", sizeof(String<>), asOBJ_VALUE | asOBJ_APP_CLASS_CDAK); Assert( r >= 0 ); I have replaced string with String<> all through scriptstdstring.cpp, so I am not sure what I should do. Any suggestions?
  15. [quote name='WitchLord' timestamp='1315537023' post='4859330'] If C4 is using its own string class and you plan to expose C4's functionality to the script then it is probably better to rewrite the desired add-ons to use this class instead of std::string. This is exactly why angelscript doesn't have a built-in string type, so the application can pick and choose the best implementation. [/quote] Thanks for your help.