• 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

112 Neutral

About freddyscoming4you

  • Rank
  1. Conceptually speaking I see exceptions as something that needs to halt execution of your application and NEEDS your application's attention if you're looking for specific exceptions to handle. Return codes on the other hand are simply ways to do small talk, so to speak, in your code. I find it to be generally useful to use state enums to let your code know where it is since exception throwing in most cases is a very slow event. So... [code] enum ProcessingStatus { Pass, InputIsIncorrectFormat } void DoProcess(string input) { switch(ProcessWork(input)) { case ProcessingStatus.Pass: // proceed, return, do nothing, call NextStep() or w/e break; case ProcessingStatus.InputIsIncorrectFormat: // either report back and ask for new input or try to auto correct and try again break; } } ProcessingStatus ProcessWork(string input) { /// validate code if fail return ProcessingStatus.InputIsIncorrectFormat else carry on and return ProcessingStatus.Pass on success // however on something critical like a memory you may want to throw MemoryLeakException("ProcessWork created a memory leak with the following state at the time of the leak") } [/code] To me that is pretty easy to read, understand and is generally friendly. Granted, that is coming from a C# background but it's generally very clean.
  2. [quote name='VReality' timestamp='1315469061' post='4858950'] Anyway, the only mention of the video game industry (that I heard during the part of the discussion I sat through) was that it's one of the reasons that C++ is still so relevant. I don't think there's any reason to infer a trend in the industry of not living up to her expectations of C++ programers. And if anyone doesn't, I don't think it would be fair to say that it's because an antiquated style is preferred in the industry. [/quote] I wasn't trying to say that antiquated style is preferred or not. I was simply curious if some of the older features are "better" for highly performant systems like a game engine. Regardless, excellent commentary!
  3. So it's like calculus... excellent. LOL
  4. Listening to the dotnetwrocks pod cast here: [url="http://dotnetrocks.com/default.aspx?showNum=695"]http://dotnetrocks.c...spx?showNum=695[/url] Kate talks briefly how people are actually using C rather than C++ with things like using malloc rather than just newing an object or using smart pointers. Is using the older methods for these things preferred for game development or are people just being newbs and not realizing what tools they have at their disposal?
  5. Javascript is inherently insecure. That said you can implement some schemes to mitigate its insecurities such as having your script make a call for a decryption key that expires very soon (like 5 seconds) or even is only good for one use but that could take some more algorithmic math than you may have. The only way to be able to "secure" your app is to use a browser plug in that incorporates encrypted communication like Java. I'm not sure about Flash but I would think they'd have something like that built in. No matter what though, you should NEVER take input received by the server from the client and pass it directly to your database. The best way to secure your database is to thoroughly scrub and verify the data you pass into your database. I would argue that this single task will take about as long to develop the game mechanics themselves. Best of luck to you.
  6. [quote name='kunos' timestamp='1315041473' post='4857070'] if you dont know about generics... why would you put that into your code? you can easily code it without. if you really want to learn about generics.. buy a C# book, study it.. implement some single examples and, when you feel confident enough with it you'll have your big chance to use it in your producion code. [/quote] I started coding that around 12:30 and I was trying to think of a generic way to use interfaces and generics to create a singular method that I could use to execute API calls since they all follow the same pattern and my mind shouted "GENERICS!" And, so it was, or wasn't. Haha. [quote name='Zipster' timestamp='1315042836' post='4857077'] [font="Arial"] I'm not sure I see the purpose of [/font][font="Arial"][font="Courier New"]ParseResponse[/font] as a factory-like instance method. If you already have an instance of the concrete type you want (i.e. [/font][font="Arial"][font="Courier New"]ServerStatusResponse[/font]), why would you create a clone? As it stands right now, your generic method creates a default-initialized instance of a particular response, and then promptly throws it away by having it return a new instance of that response. I also don't believe the generic method is necessary here since your code doesn't require concrete type information -- it can just use regular inheritence by having the user pass in their own response object: [/font][/quote] Thanks for the suggestion. I stripped out all the generics stuff and simply passed in a IApiResponse object and return it's parse method from that. Subsequently I removed the parsing code out of the constructor and put it in the parse method which returns void. A few hours of sleep and a thought out suggestion will do wonders.
  7. I have implemented an interface to be used by all certain types of a class which represents a response to a WebRequest. I have the interface implement a method whose return type is also the interface so I can get a return value to be the parsed response. The parsing of the response is handled in the interface implementation in each class, naturally. However, I'm having difficulty in implementing this as I don't have hardly any experience writing generic methods and I'm not having much help using Google. Below is my class implementation, or what I have managed to cobble together so far. Can you see what's off? Thanks. First, the interface declarations: [code] using System.Xml; namespace EVE_API.Interfaces { public interface IAPIResponse { IAPIResponse ParseResponse(XmlDocument response); } } [/code] [code] using System.Collections.Generic; using System.Xml; namespace EVE_API.Interfaces { public interface IEveAPI { string ApiName { get; } Dictionary<string,string> Arguments { get; set; } } } [/code] Now, the response class: [code] using System; using System.Xml; using EVE_API.Interfaces; namespace EVE_API.APIs.Miscelleneous { public class ServerStatusResponse : IAPIResponse { private string _version; private DateTime _currentTime; private bool _open; private int _onlinePlayers; private DateTime _cachedUntil; public string Version { get { return _version; } } public DateTime CurrentTime { get { return _currentTime; } } public bool Open { get { return _open; } } public int OnlinePlayers { get { return _onlinePlayers; } } public DateTime CachedUntil { get { return _cachedUntil; } } private ServerStatusResponse(XmlDocument responseDocument) { _version = responseDocument.SelectSingleNode("/eveapi").Attributes["version"].Value; DateTime dtTry = DateTime.MinValue; DateTime.TryParse(responseDocument.SelectSingleNode("/eveapi/currentTime").Value, out dtTry); if (dtTry != DateTime.MinValue) { _currentTime = dtTry; } else { throw new MalformedResponseException("Could not find currentTime in response from SeverStatus API."); } bool boolTry; bool.TryParse(responseDocument.SelectSingleNode("/eveapi/result/open").Value, out boolTry); _open = boolTry; int intTry; int.TryParse(responseDocument.SelectSingleNode("/eveapie/result/onlinePlayers").Value, out intTry); if (intTry > int.MinValue) { _onlinePlayers = intTry; } else { throw new MalformedResponseException("Could not find onlinePlayers in response from SeverStatus API."); } dtTry = DateTime.MinValue; DateTime.TryParse(responseDocument.SelectSingleNode("/eveapi/result/cachedUntil").Value, out dtTry); if (dtTry != DateTime.MinValue) { _cachedUntil = dtTry; } else { throw new MalformedResponseException("Could not find cachedUntil in response from SeverStatus API."); } } public IAPIResponse ParseResponse(XmlDocument response) { return new ServerStatusResponse(response); } } } [/code] And now the class trying to wrap all the above together [code] using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Xml; using EVE_API.Interfaces; namespace EVE_API { public class APICaller<T> where T : IAPIResponse { public APICaller() { } public T ExecuteAPICall<T>(IEveAPI api) { List<string> urlParts = new List<string>(); urlParts.Add(api.ApiName); if (api.Arguments != null) { urlParts.Add("?"); var keys = api.Arguments.Keys; foreach (string key in keys) { urlParts.Add(key); urlParts.Add("="); urlParts.Add(api.Arguments[key]); urlParts.Add("&"); } urlParts.RemoveAt(urlParts.Count - 1); } string completeUrl = urlParts.ToString(); WebRequest request = WebRequest.Create(completeUrl); WebResponse response = request.GetResponse(); XmlDocument document = new XmlDocument(); document.Load(response.GetResponseStream()); IAPIResponse apiResponse = new (IAPIResponse)T(); return apiResponse.ParseResponse(document); } } } [/code]
  8. Unity

    [quote name='Serapth' timestamp='1314899384' post='4856389'] Actually, this is exactly my point. Everything you just said is basically no longer true since 4.0. With the inclusion of dynamic, "dynamic" is now a type, but the actual type is determined at runtime. So you can now have a "var of type dynamic" where the type is determined at runtime by inference if possible, or it pukes if not possible. I have no fault with var, its handy and can make code more ( or less) readable, its when you throw dynamic into the mix you present an opportunity for truly typeless code and clueless coders. [/quote] I wasn't aware of the dynamic type. After the reading I've done I don't see why anyone would use it with a purely .NET application. From what I can see the dynamic type itself is for interop purposes only. While you can use it and abuse it I'm guessing if you're on a project where such horrible code can be used then I'd suggest you upgrade to a better place to work.
  9. Unity

    The point of var is so you can focus on coding. C# isn't nearly as dynamic as you might think. Once the type is set from the instantiation line then that's the type and it can't be changed later on. You will actually get a compiler error. Also, the "right" way to instantiate a var is to either set it right away or do "default(type)". So if you have a var you want to use as an int you would say "var a = default(int);." To me that's very clear. You would be dumb to declare a var way up in your code and initialize it much later where there could be ambiguity issues. Furthermore, once you set a var Visual Studio will examine the type that you're setting the var to and after the instantiation line if you hover over the variable intellisense will report the correct type in the flyout box that appears.
  10. You should be able to use the same types from VB to C#. It sounds like one of those "if it aint broke don't fix it" situations. One of the reasons the VB code is the way it is may be because that array structures may be different and the DLL you're using parses the incoming and outgoing values in a custom way. I would just use the C# equivalent types that the VB code used.
  11. Unity

    Using var is ingenious for LINQ. Whether you're using LINQ to SQL or LINQ to objects it removes a lot of guess work in which type you need to cast to/from. I've never had an issue either supporting or writing new code where var messed me up with LINQ. Granted, that's about the only places I've seen it used heavily but it's treated me pretty swell.
  12. I seriously got negged for that? Wow... someone needs to lighten up. *preps for another neg on this post. weeeee*
  13. [quote name='Lewis_1986' timestamp='1314782344' post='4855801'] @ApochPiQ, seriously the old addage "if you cannot say anything helpful, be silent!" springs to mind because mocking someone and then telling them what they want to do is trivial helps no-one [/quote] Who pissed in your cheerios? I thought the same thing when I read the OPs question. It sounds very much like an image with text boxes set on top of it.
  14. [quote name='TTT_Dutch' timestamp='1314762109' post='4855734'] [quote name='Tom Sloper' timestamp='1314761902' post='4855731'] [quote name='TTT_Dutch' timestamp='1314755728' post='4855709']if I can get them to sign a contract that says that the whole game belongs to me and they will recieve a royalty from the sales does that mean its not too late to go back? Because I do believe that they will sign that.[/quote] If they sign it, then you can forget I said it might be too late to expect them to sign it, because, well, because they signed it. [/quote] Alright cool. Now what is the best template contract you think I should use? [/quote] I prefer contracts that use verbiage similar to "I'm in your codes stealin' your rights."
  15. Pretty much. Your only other option besides using a 3rd party library is going the unsafe route and copying frame data directly to memory. Which, you could get some speed boosts using native pointers while getting to switch to and from the managed environment of .Net. It could work.