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

MahanGM

Members
  • Content count

    16
  • Joined

  • Last visited

Community Reputation

148 Neutral

About MahanGM

  • Rank
    Member
  1. I figured I had a problem with vertex declaration. It's fixed now. Thanks for your time
  2. I'm trying to draw 2d planes with textures. Previously, I was doing this with fixed functions which was fine, but now I'm moving into shaders and I'm stuck.   I have written below shader: /**  * Parameters  */ const float4x4     WorldViewProjMatrix; const int         MaxAnisotropy; const texture     MainTexture; const float4     MainColor; const bool        IsMainTextureSet = true; /**  * Samplers  */ sampler2D MainSampler = sampler_state {     Texture = <MainTexture>;     AddressU = Clamp;     AddressV = Clamp;     MipFilter = Point;     MinFilter = Point;     MagFilter = Point;     MaxAnisotropy = <MaxAnisotropy>;     MipMapLodBias = 0; }; /**  * Structs  */ struct VertexShaderInput {     float4 Position : POSITION0;     float2 TextureUV : TEXCOORD0; }; struct VertexShaderOutput {     float4 Position : POSITION0;     float2 TextureUV : TEXCOORD0; }; struct PixelShaderOutput {     float4 Color : COLOR0; }; /**  * Functions  */ VertexShaderOutput VertexShaderMain(VertexShaderInput input) {     VertexShaderOutput output;     output.Position = mul(input.Position, WorldViewProjMatrix);     output.TextureUV = input.TextureUV;     return output; } PixelShaderOutput PixelShaderMain(VertexShaderOutput input) {     PixelShaderOutput output;     float4 textureColor = (IsMainTextureSet) ? tex2D(MainSampler, input.TextureUV) : float4(1.0f, 1.0f, 1.0f, 1.0f);     output.Color = saturate(textureColor * MainColor);     return output; }   /**  * Techniques  */ technique Diffuse {     pass Pass0     {         VertexShader = compile vs_2_0 VertexShaderMain();         PixelShader = compile ps_2_0 PixelShaderMain();     } } The problem is, only first row and column of the texture is drawn. This seems to be a uv coordination problem, but if it was the problem it shouldn't have worked with fixed functions too.   I have attached two files. One is the shot from my application and second is my 128x128 test texture. If you look at the first picture you can see there is a red 2d plane with only the first row and column part of the second picture applied to it. In second picture first row and column is a red line.   I'm sure there is something I'm missing.
  3. Hey I didn't try that at all. Thanks for the reply. It's solved.
  4. I faced a problem when I wanted to change the content of a member variable in my script class.   This is my class: class Foo {   int baz1;   Bar@ baz2; } I can easily change value types in C++ by: int* value = (int*)addressOfbaz1; (*value) = 456; But this doesn't work with object handles and I know why, but I don't know how I can alter the address that object handles are pointing to.
  5. @Andreas Jonsson   That's a good solution. And by the way, I completely forgot about meta data.   Thanks for the assist.
  6. Generally speaking you're right, but my case is not general. I'm using a base class to provide some behind the scene benefits to script classes at runtime but don't want to involve them in my host app. I'm trying to get public member variables to architect a unity3d like scripting system where you can assign values to your public members before runtime and some other stuff. That's why.   I was checking GetProperty parameters now, there is nothing for this kind of stuff.
  7. @jbadams Thanks man. I was looking for this forum.   @Juliean Thanks. I've seen GetProperty method in object type class before. I didn't test it then but I now have, but since my script classes are derived from another base class, this will give me all member variables declared in both classes. Is there a way to avoid this?
  8. I'm trying to get member variables declared in an anglescript script class from my host application. There is a function for getting the global properties, but none for getting script class properties.
  9. Oh, I'm sorry. Thanks for the response.
  10. I was using angelscript version 2.23.1 and I had this problem when I wanted to register assignment behavior for one of my value types. I downloaded the 2.29.1 version and I still have the same problem. I've checked angelscript header file and this label is just not there.
  11. I've been drawing primitives recently and I have problem with rendering order. I was expecting by setting different z values for my quads, I'd get a kind of depth system. I'm not sure what I'm doing wrong or even my theory is true.   I simply create my vertices: Vertex2D vertices[] = {     {0, 0, 0, color, 0, 0},     {rect.Width(), 0, 0, color, 1, 0},     {0, rect.Height(), 0, color, 0, 1},     {rect.Width(), rect.Height(), 0, color, 1, 1},     {rect.Width(), 0, 0, color, 1, 0}, }; Then I set translation for them: D3DXMATRIX translationMatrix; D3DXMatrixTranslation(&translationMatrix, rect.X() - 0.5f, rect.Y() - 0.5f, depth); device->SetTransform(D3DTS_WORLD, &translationMatrix); And finally draw.   Before this, I was using D3DXSprite to draw sprites and I was drawing shapes with the Direct3D device itself. There was a depth problem between primitives drawn by Direct3D device and sprites drawn by D3DXSprite so I decided to switch to textured quads for sprite drawing and eliminate D3DXSprite. D3DXSprite had a front to back depth sort flag that could manage different z values, I don't know if there is a magical way to achieve what D3DXSprite is offering or it's just a simple vector sort, I just need to know what's the solution.   Thanks.
  12. Hey thanks. I don't know why I didn't think of that in the first place. I was setting a wrong offset in SetStreamSource(). Thanks again.
  13. Hi. I've been working on a simple line draw and I can't get the colors to work. I want to draw a red line. This is my result:     I have defined two vertices with the same color (red with an alpha of 255). As you can see source color is completely black. If I disable blend mode, I'd still get this result, but if I enable it and play with D3DRS_SRCBLEND and D3DRS_DESTBLEND, I can change the result, but it never gets to the point that I want which is a full red line.   My vertex format is as follows:   D3DFVF_XYZ | D3DFVF_DIFFUSE   Someone said that it might be from vertices normal vectors, but I don't have any lighting in my scene so it's not that. However, if I change D3DFVF_XYZ to D3DFVF_XYZRHW and pass value 1 for rhw, it'll draw the line with correct color, but that's not the format I want. I want to be able to apply geometry changes to my vertices and I know RHW does not receive any of that. And, I have a totally bright material and even if I set D3DMCS_COLOR1 for D3DRS_DIFFUSEMATERIALSOURCE, I'd still get the same result in the picture above.
  14. Is this possible in lua to achieve? player.scripts["movement"].properties["stat"] = "stand" print (player.scripts["movement"].properties["stat"]) I've done the second line in c++ with this approach: luabind::object FakeScript::getProp() { luabind::object obj = luabind::newtable(L); for(auto i = this->properties.begin(); i != this->properties.end(); i++) { obj[i->first] = i->second; } return obj; } But I'm stuck with setter. The first line in lua code which I'm trying to set value "stand" for key "stat" is not going to work and it keep directing me to the getter method. Setter method only works when I drop `["stat"]` from `properties`.   I can do something like this in my script: player.scripts["movement"].properties = {stat = "stand"} But this isn't what I want because I have to go through my real keys in c++ to determine which one is placed in the setter method argument.   This is my map in class: std::map<std::string, std::string> properties;
  15. I'm not sure but link the debug library to see if it works "d3dx9d.lib". And ensure that you include the Lib and Include path of DX SDK after all of the included libraries such as Windows SDK.