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

SeiryuEnder

Members
  • Content count

    81
  • Joined

  • Last visited

Community Reputation

199 Neutral

About SeiryuEnder

  • Rank
    Member
  1. [quote name='Hodgman' timestamp='1351067118' post='4993359'] what are you using exceptions for, what are you using threads for? [/quote] Sorry, didn't have much time last night. Our server is using a thread pool, when we receive a network request we assign a thread to handle it. This can include sql queries, movement updates, game objectives, etc. Ideally our exception handling will be as comprehensive as possible so as to quietly handle any soft hardware or database failures. At the very least it will be used to resolve external problems. It'd be nice to use asserts to fix any programming errors and EH to handle any external problems, however due to the nature of servers we prize stability over all else. An offline is 0% efficient, so we're willing to sacrifice some performance while we fix the broken things.
  2. Hi, I'm currently researching exception handling, and will be implementing it on a heavily threaded game server in the near future. Here is what I will need:[list] [*]Safely unwind stack, high server stability [*]Low overhead [*]Works well in a highly threaded architecture [/list] While I am researching and have used EH before, I haven't gotten very in-depth with it and am not yet very familiar with what happens under the hood. Are there any red flags I should know about, any good book references for this sort of thing, or any ideas about how I can more effectively implement EH rather than just toggling some /EH_ flags? I realize this thread is a bit open ended, the problem I suppose is that I don't yet know what questions I should be asking and hope to pick the brains of those more experienced with this sort of thing. Thanks~!
  3. [quote name='FLeBlanc' timestamp='1338839719' post='4946205'] I personally use tolua++. In C++, I will implement a factory class, something like this: [/quote] I started out trying ToLua++ and Luabind until I found out they both use the Boost libs. Because of the bulkiness I've tried to stay away from Boost but unfortunately I may have to bite the bullet on that one... I much prefer Boost+Type Safety to no Boost+Bad Design. Your implementation looks exactly like what I wanted to do in the first place, I guess I'll back up/revert my Luna code and start working on ToLua++
  4. Right now I'm using Luna to expose my C++ classes to Lua. The problem I'm having is that I want to allocated and manage my objects in C++, only using Lua to potentially create or manipulate them. I'm not particularly familiar with Lua. My (rather naive) first attempt was to set up a class as per some Luna tutorials, create that class using a factory, pass that class to Lua using lua_pushlightuserdata, and create an object reference in lua to the pointer in the stack. As it turns out, Lua doesn't know how to interpret that pointer as it defines 'objects' by metatables which a raw memory address won't have. After giving it some thought, I'm currently considering creating an interface class which contains all of my Lua functions. The constructor will accept a parameter to its target class. Because it is only an interface and doesn't contain any actual data, it doesn't cost much to instantiate it whenever a script is run and let the GC clean it up. However, not only does this seem inefficient but I completely lose type-safety. The script could theoretically pass anything into the lua interface which can crash the program (or worse). Does anyone more experienced with C++-Lua binding know how I can achieve my original goal of handing a C++ object to lua, or have any more elegant solutions? I'll add some pseudo-code below to make my problem a bit more clear. Current Attempt: [CODE] std::vector<GameObject*> objList; class GameObject { public: void DoThing() {} int Do( lua_State* _state ) { DoThing(); } ... insert Luna binding code } int CreateObject( lua_State* _state ) { GameObject* obj = new GameObject(); objList.push_back( obj ); lua_pushlightuserdata( _state, (void*)obj ); return 1; } int main() { lua_State* state = luaL_newstate(); lua_register( state, "CreateObject", CreateObject ); luaL_loadfile( m_State, "DoSomething.lua" ); lua_pcall( state, 0, LUA_MULTRET, 0 ); lua_close( state ); return 0; } DoSomething.lua: local obj = CreateObject( "LuaScript" ) obj.Do() [/CODE] ...This won't work because Lua doesn't know how to interpret that (void*), I incorrectly thought that it would maintain some sort of VFT-esque behavior. The method I talked about as a potential solution would be something akin to: [CODE] class GameObject { public: void DoThing() {} }; class LIGameObject { public: LIGameObject( GameObject* _target ) : m_Target(_target) {} int Do( lua_State* _state ) { m_Target->DoThing(); } ... insert Luna binding code private: GameObject* m_Target; }; int CreateObject( lua_State* _state )... int main()... DoSomething.lua: obj = LIGameObject( CreateObject( "LuaScript" ) ) obj.Do() [/CODE]
  5. Just to piggyback on mikeman's code a bit, to add multiple items you could do something like this: [CODE] public struct GameItem { public static string Name; public int Energy; public int Damage; public int Value; }; ... lvi.Tag = new List<GameItem>(); lvi.Text = GameItem.Name; lv.Items.Add(lvi); ... List<GameItem> itemList = (List<GameItem>)lvi.Tag; int quantity = itemList.Count; foreach( GameItem item in itemList ) { // Do thing with individual item } ... [/CODE]
  6. You can always make the game in flash and [url="http://www.kirupa.com/flash/calling_javascript_flash_using_as3.htm"]call JavaScript externally[/url] to drive your logic. Flash is attractive because of how rapidly you can set up and develop an application (very in-depth GUI), JavaScript is attractive because of the lower level control. I don't think there's a good reason not to have the best of both worlds. It obviously won't be as efficient as everything being done in JS (interop never is), but you're not normally too worried about optimization in Facebook apps. It's more about production efficiency.
  7. [quote name='nsc92' timestamp='1338764313' post='4945946'][list] [*]what would you have HandleInput() do within an individual Object::Update? [/list] [/quote] That depends on the object.. Generally you have an ObjectManager that contains a list of Object*. Then you have other objects that derive from the parent object and do different things. Something like this (untested code): [CODE] class Animal { public: virtual void Talk() = 0; }; class Cat : public Animal { public: void Talk() { say( "Meow" ); } }; class Dog : public Animal { public: void Talk() { say( "Woof" ); } }; class Bird : public Animal { public: void Talk() { say( "Chirp" ); } }; class AnimalManager { public: Add( Animal* _animal ) { m_Animals.push_back( _animal ); } AllTalk() { for( int i = 0; i < m_Animals.size(); ++i ) m_Animals[i]->Talk(); } private: std::vector<Animal*> m_Animals; }; int main() { Cat cat; Dog dog; Bird bird; AnimalManager mgr; mgr.Add(&cat); mgr.Add(&dog); mgr.Add(&bird); mgr.AllTalk(); return 0; } [/CODE] [quote name='nsc92' timestamp='1338764313' post='4945946'][list] [*]what are some examples of what m_Events.Update() might include? [/list] [/quote] [url="http://www.gamedev.net/page/resources/_/technical/game-programming/simple-event-handling-r2141"]Simple Event System[/url] [quote name='nsc92' timestamp='1338764313' post='4945946'][list] [*]If opjects are being moved one at a time, where would collisions be handled? Would that be within m_ObjectManager.Update after all the individual Object::Update methods have been called? [/list] [/quote] Different people handle it different ways. Some people move the collision check out of the object and make it part of the object manager. Some people do it through events, and keep track of objects they've collided with that frame so that they don't multiply collide. There are other solutions as well. Do a little Googling and find a solution that works for you.
  8. That's a highly procedural approach. Generally my update loop will go something like (this is complete pseudocode mind you...): [CODE] void Game::Update( float _delta ) { m_Input.Update(); m_ObjectManager.Update( _delta ); m_Sound.Update(); m_Render.Update(); // <== Does the actual rendering m_Events.Update(); } void Object::Update( float _delta ) { HandleInput(); UpdateAI( _delta ); UpdatePhysics( _delta ); UpdateRenderInfo(); // <== Update render information, doesn't actually render the object } [/CODE] Bear in mind there's a really good chance I'm missing something, but the logic behind this ordering is as follows: Update Input first, as Input may raise events and needs to be readily accessible to other systems. Update Objects second, they may create/play/stop audio assets and have to tell the renderer what to do. Update Events last so that any events raised by other systems can be handled. If I could offer some advice though... Don't worry about throttling yet. Worry about optimization once you get things working.
  9. I couldn't agree more with JTippetts. Game programming is going to really challenge your self discipline; there's an uncountable number of projects scrapped because of lost interest. If you're not constrained by milestones and deadlines, do whatever motivates you at the time. Don't leave unfinished code - wrap up whatever you're working on - but generally it's a bad idea to keep working on something if you're deadlocked or just really disinterested. The biggest thing to keep in mind about the UI is that it is purely about FEEDBACK. It is 100% INFORMATIVE. I typically open a console (will add some code for that below) and make that last until many of the core systems are in place/functional. As for the UI, the most critical thing you can do is sit down and DRAW OUT YOUR UI ON PAPER!! Seriously, don't skip this step. Draw it a few times. Make changes on paper. It will save you so much time. You will almost certainly go through several revisions, but you want to be as prepared as possible. Generally speaking, for every hour you spend designing you will spend 10 fewer hours implementing. -edit Almost forgot to add the console code. There's a couple ways of doing this. The easiest (if you're using visual studio) is to go to: Project Properties -> Linker -> System and set your subsystem to console. In the older version of MSVC that would allow you to open a console window while running an application. If you have trouble with that or it's not an option for you, you can also add this code to your WinMain: [CODE] #if defined(_DEBUG) // Open a debug console window HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE); int hCrt = _open_osfhandle((long) handle_out, _O_TEXT); FILE* hf_out = _fdopen(hCrt, "w"); setvbuf(hf_out, NULL, _IONBF, 1); *stdout = *hf_out; HANDLE handle_in = GetStdHandle(STD_INPUT_HANDLE); hCrt = _open_osfhandle((long) handle_in, _O_TEXT); FILE* hf_in = _fdopen(hCrt, "r"); setvbuf(hf_in, NULL, _IONBF, 128); *stdin = *hf_in; #endif [/CODE] From there, you should be able to use std::cout to print to the console
  10. Yeah it's a bit of a complex problem to describe without coding examples. The only real reason for using XML right now is that at some point I intend to support other scripting languages such as Python. XML acts as a simple layer of abstraction between the game and the scripting language. The problem was twofold - my lack of understanding how to properly use Lua and how to initialize my components. For instance, until now I've done something like this (just to get things running): [CODE] Entity* ent = new Entity; Cmp_Transform* cmpTransform = new Cmp_Transform( ent ); Cmp_Mesh* cmpMesh = new Cmp_Mesh( ent, "SomeMesh.gmx" ); ent->AttachComponent( cmpMesh ); ent->AttachComponent( cmpTransform ); ent->Initialize(); [/CODE] I moved the constructor args to an Init function so that I could use the default constructor. Now, I can register components to an object factory and create them like this: [CODE] Factory<IComponent*> factory; factory.Register<Cmp_Transform>("Transform"); IComponent* cmp = factory.Create("Transform"); Entity entity; entity.AttachComponent( cmp ); [/CODE] With a simple glue function I can create any registered component by knowing its name, which gives me a lot of flexibility from the scripting end. The problem was, I couldn't call an Init(...) function from the C++ end because it is a member function of an unknown derived class. I think I've finally figured this one out. I've set up Luna to bind component member functions to Lua, and I'm going to push the component pointer onto the stack. From there I should be able to call the Initialize function. I haven't gotten that far in code yet, but theoretically it should pipe to the proper function where I can at least check the number of arguments and hopefully later enforce better type safety.
  11. I'm not familiar with CoronaSDK, but usually my dev cycle is something like:[list=1] [*]Barebones world (just some land) [*]Console output, relevant debug text [*]Simple collision/Input [*]More complex UI [*]Refine World [*]Refine UI [*]Repeat 5-6 until gold [/list] 'World' refers to general features like rendering or audio. In a production environment normally you have a set of features you're responsible for, so knowing what to work on is rarely an issue (esp. with publishers [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]) The advantage of working indie is that once things are working on a very basic level, you can decide what you want to do when you want to do it. If I could offer some advice though, try not to be too jumpy between systems. Lots of bugs happen that way.
  12. I've been developing a data-driven Entity/Component system in C++ using Lua. There's been a lot of good documentation out there, but I've hit a bit of a snag with Lua. -edit 1: [indent=1]My problem is likely to do with the need to bind classes to Lua rather than using a factory to create components... Still doing research on that[/indent] -edit 2: [indent=1]After some thought and playing with Luna, I'm going to try registering components with my factory and feeding the base pointer address back to Lua.[/indent] [indent=1]From there I should be able to call the expected mapped function. I don't know what kind of error handling this will have (if any), but at least it's moving in a direction.[/indent] [b]Summarized Question[/b] How do I create objects with a C++ factory using Lua and define necessary parameters while maintaining type-safety? My goal is to be able to determine at runtime if there is a parameter mismatch when defining a component. [b]More Information[/b] The system works like this: Open OnLoad.lua -OnLoad.lua loads _Level_.lua --_Level_.lua loads and posititions Entities in the world ---Game parses XML file for (each) Entity definition [One of two ways to handle this] [i]A[/i] ----Entity tag references _Entity_.lua -----_Entity_.lua loads components OR [i]B[/i] ----Entity tag body contains a list of components along with component property definitions [b]Problem 1:[/b] Not a huge problem, but a mild design question. Method A is more expandable (Lua can perform other actions when loading different types of entities, may be useful), but Method B is simpler and centralized. Right now I'm leaning towards defining entities in Lua to err on the side of caution, as I may need the extra functionality later. Which do you think is the preferable method? [b]Problem 2:[/b] I'm stuck on how to actually construct the components. I'm sure there's a simple solution, but for some reason it eludes me. Different components may need different parameters. For instance, I may need no parameters at all for a Timer component but will need a name/ID for a Mesh component. I'd like to figure out a way to register the component with my object factory but that would mean having to have a default constructor and defining a different Init(...) function for each type of component. When I create the object with the factory I will get a base class pointer back, so I have no (type-safe) way of knowing what parameters the init function will need. I'm just not making the connection on how to define properties of a component in XML/Lua then pass that information to its appropriate place in C++. I've considered more elaborate methods of defining property tables in my components, but that seems inefficient and overcomplicated. As always, thanks in advance for any help!
  13. I didn't realize this was such a tumultuous legal issue... I knew generalized patent laws were out of hand but this is just absurd. I'm surprised someone hasn't patented breathing. We can only hope that big-business money mongers will eventually realize that inhibiting progress like this is just shooting themselves in the feet. FYI: Bink is really easy to implement, I recommend it if you've got the $8,500 in your budget.
  14. There's also full-screen effects to consider. The world can grey out, you can do a 'spotlight' effect, etc etc.
  15. [quote name='Ashaman73' timestamp='1338442089' post='4944884'] When you want to code a multiplayer game, I would consider using a network interface. It would be a language independent solution and a superb preparation. [/quote] I hadn't considered a networked solution for communication... I rather like this. If I recall correctly, the PS3 devkit uses a similar method. This actually opens up some pretty neat possibilities. Theoretically, two or more people could work in tandem creating and/or playtesting on the fly. I still haven't gotten around to making a networking component for my engine yet, but a barebones Berkely sockets system shouldn't be too hard to drum up just to get things moving. I still have to figure out a way to get a C++ engine to render to a C# surface -- but that's another creature entirely.