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

BlazeCell

Members
  • Content count

    13
  • Joined

  • Last visited

Community Reputation

452 Neutral

About BlazeCell

  • Rank
    Member
  1. Thanks guys. Those are some good tips on creating a realtime fire effect.
  2. So I just got done playing Little Inferno by Tomorrow Corporation, and I absolutely loved it. The algorithm they used for the fire combined with the physics of the smoldering debris matched the visual feel of fire so well, I couldn't distinguish what I was seeing from real fire. The pyromaniac within me is doing cartwheels.   So I was wondering, what algorithm were they using for the fire? There are definitely particles being used, but I'm not sure the fire is entirely comprised of just particles. It's very fluid and whole looking.   So, any thoughts on what they might be doing under the hood?
  3. Sigh, the editor messed up on my last code snippet, it should look like this:     def menu_func(self, context): # Operators triggered by menus have their operator context by default set to #   EXEC_REGION_WIN. We need it set to INVOKE_DEFAULT to call invoke() instead of # execute(). self.layout.operator_context = 'INVOKE_DEFAULT' # Create the menu button self.layout.operator(AlignVerts.bl_idname, text="Align Verts") def register(): bpy.utils.register_class(AlignVerts) # Add "Align Verts" menu to the "Mesh->Vertices" menu.    bpy.types.VIEW3D_MT_edit_mesh_vertices.append(menu_func) def unregister():    bpy.utils.unregister_class(AlignVerts)    # Remove "Align Verts" menu from the "Mesh->Vertices" menu.    bpy.types.VIEW3D_MT_edit_mesh_vertices.remove(menu_func)
  4.   Largely, I just googled around. I think I started with the query "Blender scripting", found a basic tutorial, and went from there.   I didn't even know Python before starting this, tho it wasn't hard to figure out the syntax. It's basically the same as javascript except: You use indentation instead of curly braces to indicate scope. Colons are put at the end of anything that has an inner scope, such as classes, if statements, or for loops. You use 'not' instead of '!'. You use 'and' instead of '&&'. You use 'or' instead of '||'. You can access the documentation for Blender scripting by going to: http://www.blender.org/documentation/blender_python_api_2_66a_release/ or by going to Help -> Python API References from within Blender itself (which is better if you want to ensure that the documentation you're looking at matches the version you're using).   Blender has a view for a Text Editor that allows you to edit scripts from within Blender itself. I prefer to use Sublime Text 2 myself as it has more options regarding coding, but the Text Editor within Blender has a menu for templates which will allow you to load up boiler plate scripts that you can examine, test, and modify to help you learn the ropes around Blender scripting.   As far as gotchas that I ran into while trying to make this Align Vert operator: There are 3 key functions for a operator: a) execute(self, context): This method is what is called when you run your script via the console or a batch process or when your operator isn't setup to be modal. It's a one-shot function that performs an operation based on the current settings and that's it. b) invoke(self, context, event): This method is an initializer function that allows you to set your settings to default values and whatever preprocessing you need. c) modal(self, context, event): This method is what gets called when a modal event happens. Modal events happen when execute(), invoke(), or modal() return: {'RUNNING_MODAL'} This starts a modal event loop that allows the modal() method to handle user input (key presses and mouse input). This is the setup that I needed to allow X, Y, or Z to be pressed to toggle modes.   You must register your operator class as a handler for modal events if you want your modal() function to be called after invoke() or execute() return {'RUNNING_MODAL'}. The event registration command is: context.window_manager.modal_handler_add(self) It is recommended that you add this line of code to your invoke() function.   When your operator is triggered via SPACEBAR operator menu, it is by default run with the 'INVOKE_DEFAULT' operator context, which tries to call invoke() before execute() if invoke() exists. When you register your operator to a menu via code like: def menu_func(self, context):     # Create the menu button     self.layout.operator(AlignVerts.bl_idname, text="Align Verts") def register():     bpy.utils.register_class(AlignVerts)     # Add "Align Verts" menu to the "Mesh->Vertices" menu.     bpy.types.VIEW3D_MT_edit_mesh_vertices.append(menu_func) def unregister():     bpy.utils.unregister_class(AlignVerts)     # Remove "Align Verts" menu from the "Mesh->Vertices" menu.     bpy.types.VIEW3D_MT_edit_mesh_vertices.remove(menu_func)   The menu will button created will by default run your operator with the operator context of 'EXEC_REGION_WIN', which will cause it to ignore your invoke() function and jump straight to the execute() function. To fix this add a line of code that changes the menu operator context before triggering your operator: def menu_func(self, context): # Operators triggered by menus have their operator context by default set to #   EXEC_REGION_WIN. We need it set to INVOKE_DEFAULT to call invoke() instead of # execute(). self.layout.operator_context = 'INVOKE_DEFAULT'     # Create the menu button     self.layout.operator(AlignVerts.bl_idname, text="Align Verts") def register():     bpy.utils.register_class(AlignVerts)     # Add "Align Verts" menu to the "Mesh->Vertices" menu.     bpy.types.VIEW3D_MT_edit_mesh_vertices.append(menu_func) def unregister():     bpy.utils.unregister_class(AlignVerts)     # Remove "Align Verts" menu from the "Mesh->Vertices" menu.     bpy.types.VIEW3D_MT_edit_mesh_vertices.remove(menu_func)   I spent many hours learning these nuances. I hope these tips help. =D
  5. Ok, I finally got the script working. You can find the full code here: http://www.blender.org/forum/viewtopic.php?p=104692#104692   Thanks for the recommendations guys. =)
  6. Wow! After a couple of days, REPLIES! =D     Yeah, that's actually exactly what I've been doing the last couple of days. I already have the operation part of the code figured out and working. The part I'm stuck at is getting the python script to be processed in a modal manner so that I can toggle which axis coordinates to preserve. The Blender Python API describes using a modal() function in the custom operator class that gets called after execute() or invoke() return {'RUNNING_MODAL'}. Only problem is that my modal() function is never getting called. I've posted on the Blender forums regarding this issue: http://www.blender.org/forum/viewtopic.php?t=27384                 Thanks for the alternative. I'm not sure if that will get the precision that I'm looking for, but constraints seem to be the best alternative that I've run across so far. I'll keep those tools in mind in the future.
  7. I'm new to Blender and I have a question that you modeling veterans can probably answer:   I've been searching all over as to how to align a selection of vertices in Blender along an arbitrary axis but haven't found anything that points to a ready solution.   Ideally, I'd be able to just: Select a series of vertices in Edit Mode. Bring up the vertex actions menu. Select something like "Align" from the menu. The selected vertices would then be automatically aligned along the line formed by the first and last vertex in the selection. Then I could just left click or press Enter to commit. Additionally, it would be awesome if I could press X, Y, or Z before committing the alignment action to preserve the corresponding coordinate value when aligning the vertices. Does anything like this already exist in blender?   Also, I'm aware of the technique where you scale your selection to zero along a single coordinate axis to align the selection along that axis, but that doesn't solve the issue where the desired result is alignment along an arbitrary line between two vertices.   Thanks in advance for any insight you can provide.
  8. [quote]how will "color picking" work for layered element?[/quote] There are two ways to handle layered elements, depending on whether you wish to pick only one element at a time or multiple:[list=1] [*]The easier case is picking a single element. When you go to render out the elements as colors, only render out the elements you care to to pick. For instance, if you have a button element with a label element inside, chances are you don't care to pick the label element, only the button. So just render the button as a solid color based on its picking index and skip the label element. If you render out the colors using depth testing, then the topmost elements will take precedence when picking any point that has elements overlapping. [*]The harder case is picking multiple elements, like if you want to implement rubberband selection. In that case, I've implemented a technique where I cycle thru the elements separately performing three operations for each of them. [/list][list] [*]Render out the element as a solid color based on its picking index. [*]Query the pixel(s) I care to pick at for color (picking index) and depth. [*]Clear the color and depth buffers before rendering the next element. [/list] [indent=1]The query will tell me if I picked anything. Usually, I choose the color white (pickingIndex == int32.max) to represent nothing was picked, but black (pickingIndex == 0) could work too if you want to start your picking indices at 1 instead of 0. If I get a hit, I can then use the queried depth value to order the elements if that matters at all.[/indent] In both scenarios, you can limit your rendering to the a viewport that only encompasses the area you care to pick to lower the overhead of rendering (typically a 1x1 pixel area unless you're rubberband selecting or you want to buffer your picking precision). I do recommend however, to save the viewport optimization portion for after you've perfected your picking code, I've historically had to tweak things several times before picking was working properly, and it's hard to debug my picking logic when I'm only rendering out a single pixel =P.
  9. [b]bwhitling [/b]is right on the money. I've implemented this technique in OpenGL. In the sources that I've read, this technique is called "[b]color picking[/b]" if that helps your google searches. What's great about this technique is that you can assign a picking index to each element you wish to be pickable (clickable). This index can be an unsigned 32bit integer that you generate by incrementing a counter every time you create a pickable object. When you go to draw the pickable object as a solid color, all you need to do is convert the 32bit integer into four 8bit color components (RGBA) to get the color you should draw. Then when you read back the color, just convert the four 8bit color components back into a 32bit integer and you have the picking index of the object that got picked (clicked).
  10. If you're performing boolean operations on 2D polygons, the Clipper library has served my needs quite well in the past: [url="http://www.angusj.com/delphi/clipper.php"]http://www.angusj.com/delphi/clipper.php[/url]