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

m_switch

Members
  • Content count

    58
  • Joined

  • Last visited

Community Reputation

234 Neutral

About m_switch

  • Rank
    Member
  1. [quote name='deepdene' timestamp='1295220020' post='4759840'] [quote name='m_switch' timestamp='1295206621' post='4759746'] Note that the semantics of properties and public variables that return value types are different. For public variables, you are directly accessing the variable. However, a property that returns a value type makes a copy of the variable. [/quote] [font="arial, verdana, tahoma, sans-serif"][size="2"]In both instances with value types the values are placed onto the evaluation stack and popped into the appropriate stack variable. ...[/size][/font] Also the only difference between a automatic property and providing the backing field yourself in terms of MSIL is the fact that the compiler adds an attribute to the field I believe to indicate it's compiler generated. [/quote] This is an implementation detail, I was speaking in reference to the semantics. Visual Studio will actually generate an error when you attempt to modify a copy of a property's backing store (directly). See [url="http://msdn.microsoft.com/en-us/library/wydkhw2c%28v=vs.71%29.aspx"]http://msdn.microsof...v=vs.71%29.aspx[/url]
  2. [quote name='SiCrane' timestamp='1295205247' post='4759741'] [quote name='ApochPiQ' timestamp='1295203640' post='4759727'] Consider: in C#, the syntax foo.Field will work to access Field whether Field is a public member [i]or [/i]a property. So the best course of action is to begin with public fields, and [i]if[/i] you need to refactor to add logic later, drop in a property named Field with the associated logic. No calling code needs to be changed, meaning you only have minor code site updates to make, and everything continues to work swimmingly. [/quote] The syntax is the same, but the generated MSIL is different. This means that if you change from a public field to property, you can't do a drop in binary replacement. Calling code still needs to be recompiled. [/quote] Note that the semantics of properties and public variables that return value types are different. For public variables, you are directly accessing the variable. However, a property that returns a value type makes a copy of the variable.
  3. Seconding Dark Messiah of Might and Magic (PC, the 360 port was not very good). Easily the most immersive melee combat I've ever experienced.
  4. Why not have three (or however many) separate vectors/containers instead of trying to jam everything into one?
  5. Setting the alpha multiple times in the same frame won't have a visual effect. Only the value at the end of the frame will be used to draw the clip. Either keep state between frames to determine the alpha (loop is unnecessary) or use a tween library like Greensock designed to simplify what you're trying to do.
  6. That's not always the case. Functions aren't named in Lua, but can used as a value in a table. Which is exactly how global functions work; _G is just a "special" Lua table used for globals. Consider the following: In Lua: SomeCFunction(function() print("what is my name?") end) In C: int SomeCFunction(lua_State* L) { lua_pcall(L, 0, 0, 0); return 0; } This is perfectly legal (and common), and the function is never assigned a name.
  7. Brackets are like the @ symbol in C#, they indicate that the string should be parsed as is, that is without interpreting any escape codes. I used it to avoid escaping the back slash in paths. From the Lua manual: Quote: Literal strings can also be delimited by matching double square brackets [[ ...]]. Literals in this bracketed form may run for several lines, may contain nested [[ ... ]] pairs, and do not interpret any escape sequences. For convenience, when the opening '[[' is immediately followed by a newline, the newline is not included in the string. As an example, in a system using ASCII (in which 'a' is coded as 97, newline is coded as 10, and '1' is coded as 49), the four literals below denote the same string: (1) "alo\n123\"" (2) '\97lo\10\04923"' (3) [[alo 123"]] (4) [[ alo 123"]] It's going to depend on how you bind with Lua and what exactly your cube does, but essentially the NewTemplate function would look like this: function Cube.NewTemplate(path) local cubeTemplate = {} for k, v in pairs(yourPrototypeTable) do cubeTemplate[k] = v end cubeTemplate.properties.texture = path --or whatever needs to be done return cubeTemplate end Where your prototype table is a collection of public methods/properties. Just remember that if you have any fields in the prototype that are a table they'll be shared. Like in your above post: T.properties = Cube.properties Do a deep copy if needed. Example prototype table: local yourPrototypeTable = { Load = function() ... end, CreateAt = function(x, y, z) ... end, }
  8. How about using Game.Cube as a prototype for an intermediate template/factory? Something like: local Cube = require"Game.Cube" --creates a new table that 'inherits' Game.Cube's 'public' methods local BlueCube = Cube.NewTemplate[[..\Content\Models\Blue.bmp]] ... BlueCube.Load() local c = BlueCube.CreateAt(25,0,0)
  9. That would have been good information to know. As far as I know, in the current release of Lua (5.1.4), all standard load (file/string/buffer/etc) functions eventually go through lua_load.
  10. Depending on the format of the script in your archive, you may prefer
  11. A short anecdote: I had written several (some popular) WoW addons also. However, I found them extremely difficult to market to potential employers. There are very few Lua only jobs in the industry; most list Lua as a plus but you'll primarily be working in some sort of tool or C++. I ended up dropping all the addons from my portfolio and showed that I could augment C++ with Lua. Shortly thereafter, I had several hits and ended up landing my first industry job. Depending on what exactly you wish to do in the industry, you may consider doing something similar. Consider that many potential employers don't understand WoW addons, let alone guilds, raiding, etc. The UI designs, programming logic, and techniques are more interesting. Try showcasing that instead of the number of downloads.
  12. KillQuest quest1 = new KillQuest("This is a test"); This is not valid Lua. Lua is dynamically typed. More specifically, in Lua, you don't put the type before the variable name. Additionally, "new" is not a keyword in Lua. Try: local quest1 = KillQuest("This is a test"); I'd recommend reading the free Programming in Lua or ordering the second edition.
  13. See: ObjectProperties Do note that these techniques have varying degrees of performance implications.
  14. Quote:Original post by Matthew Shockley I may be wrong, but I believe you have to settable after every time you push a value. You are wrong. settable consumes two values from the stack with each call. You should really test this or at least look at the documentation (which clearly suggests that this is not the case) before providing advice. Quote:Original post by Dummie Data[x]["Key"] = Value; I think this is the same: Data[x].Key = Value; It is, the second way is just syntactic sugar for the first. You'll find that Lua is a very sugary language. Quote: Original post by Dummie Unfortunately nothing happens when I access the created table from Lua. Define "nothing". Quote: It seems my Code is not right. What could be the problem? Where is the mistake? You're pushing strings onto the stack as values when you want to push a table. This is one way to do it, here I've commented what would be on the top of the stack at each point. lua_newtable(L); //Data lua_newtable(L); //Data, subData lua_pushinteger(L, 1); //Data, subData, 1 lua_pushvalue(L, -2); //Duplicate subData - Data, subData, 1, subData lua_settable(L, -4); //Data[1] = subData - (pops 2) Data, subData //setting a field lua_pushstring(L, "v1"); //Data, subData, "v1" lua_setfield(L, -2, "k1"); //subData["k1"] = "v1" - Data, subData //pop off the subtable lua_pop(L, 1); //Data
  15. That's not valid Lua. It should look like: function PrintMessage() io.write("...") end You need to check the return value from luaL_dofile so you can catch these sorts of errors. Likely you'd want to use lua_pcall over lua_call and check its return value also.