Jump to content
  • Advertisement


GDNet Emeritus
  • Content Count

  • Joined

  • Last visited

Community Reputation

1682 Excellent

About Zahlman

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Zahlman

    Creating Stepmania gameplay

    What have you tried? What part are you having trouble with? What you're asking is overly broad and can't feasibly be answered as asked.
  2. Zahlman

    Create a 4x game

    I have no idea what you mean by "4x".
  3. I think I fixed it. My suggestion: go to "My Settings" and uncheck "Enable visual (RTE) editor?", and kick it old-school.
  4. This is a golden rule: whenever you are debugging your saving and loading routines, verify the actual contents of the actual files. Use a hex editor to be sure.
  5. Zahlman

    overhead of wrapper struct

    I'm moving this because it's clearly not a beginner topic and most beginners are probably better served by being kept away from thinking about this kind of micro-optimization...
  6. The way your logic is written right now, you only actually perform logic on the first note in each sub-vector, and then use the result to decide to clear out the entire vector. That's messy and misleading; do the single check outside the loop. As for the actual looping... you're messing things up by iterating over the vector as you modify it. Elements get shifted down each time through the loop, and the index also increments, with the net effect that you skip every other item. You wouldn't need any of that if you just stored Notes by value in the sub-vector - then you could just .clear() it. Why are you storing pointers? ... Actually, wait, I see what you're trying to do with the 'i-1' bit... you want to get rid of all the elements at the beginning of the vector that match the condition, until the first one that doesn't, yeah? Still way overcomplicating it, and yes, potentially slowing things down (although it honestly shouldn't cause a problem with the number of objects you're talking about). Iterate to find the first element that doesn't match the condition, using an iterator. Then use the vector's erase method to erase an iterator range from the beginning until that point. That way, the elements get shifted down in the vector all at once. Simplify your code. Simple code is easier to debug and easier to optimize (and often implicitly optimized anyway).
  7. Zahlman

    Dynamic memory in game

    Well, not quite: // 1: Simple 2d array. not contiguous, simple access vector<vector<bool>> vec( size, vector<bool>(size,false) ); vec[2][3] = true; // 2: 2D array as contiguous 1D array, slightly more complex access vector<bool> vec( size*size, false ); vec[size*2 + 3] = true; [/quote] ... Or you could really stop reinventing the wheel, and just use boost::multi_array.
  8. "global" is relative. What is meant here seems to be more like "nonlocal", or at least "less local than we might be able to get away with".
  9. Zahlman

    too much collision check

    Hold on, here. How many asteroids and bullets are we talking about? Let's make sure we have a good idea what the real problem is before we try to solve it
  10. Zahlman

    What online game services are there?

    OP: the people whose "nonsense" you want out of the thread are well-respected, established forum members (including a moderator) who know whereof they speak. Thus far, you have not demonstrated yourself to be any of those things. They have answered your question to the extent that it can meaningfully be answered and explained to you how to ask more useful questions. Your response is to shower them with abuse simply because they do not provide a comprehensive list of what you have in mind so as to supplement the Google search results that you find unsatisfactory for a reason you won't even explain. Oh, and then you submit a report because "the QQers are QQing" explicitly. Guess what? You earned that QQ, and you've earned formal disciplinary action as well. Locked and warned.
  11. Zahlman

    Structure functions?

    It's obviously C++, as many of the features illustrated are not available in C.
  12. Zahlman

    Is Unity3D spoiling me?

    There is no such thing as "being spoiled" in this context. Professionals determine and then use the best tool for the job, as measured in minimum expected time to create something that's up to standard. Full stop. You can always go back and learn how to do things at a lower level. This is useful not so much because "you won't always have Unity to fall back on" (going forward, engines are only going to get more powerful, so this would only happen if you got into less powerful platforms such as mobile), but because it exercises your problem-solving skills and your ability to see the "big picture". To that extent, get the most varied education you have time for. Dabble in stuff. Talk to artists (and writers and sound engineers and game designers and producers and even publishers, if you can). The primary use for lower-level stuff is to create more new higher-level stuff. Everything is built in layers in this industry - just like basically any other industry. Nobody on this planet can make a pencil "from scratch", and you're worried about being "spoiled" by getting a "head start" on an MMOWTFOMG?
  13. The techniques you have been describing, to the extent that I can make any sense out of them... are perfectly compatible with OO. OO is not about having a lot of classes and following rules out of a textbook for how to hide data members (that isn't even what "encapsulation" really means in the first place). If you want to pick on things like, for example, needless use of accessors and mutators, then do that. Point out the part that's actually complicated; don't just say "it looks like what I think of as "OO" so it must be too complicated". OOP does not require "inheritance" by many definitions, and while it is normal for OOP languages to include the concept of a constructor, the concept of a destructor is actually pretty specific to C++ (where you don't have automatic garbage collection) and other languages that have to interface with C++ APIs. A finalizer is something different again, and also very, very rarely needed. In C++, structs are classes. They can have member functions, and the only thing the differs is the default for access protection, which can be overridden. In C#, the picture is similar, except that structs are value types and classes are reference types. Instances of either are still objects, however. You pick the object-type with the semantics that make sense for your problem. Comments cannot solve the problem of fundamentally flawed design, and aren't really relevant to the discussion anyway. Although honestly, this entire mess is irrelevant to the discussion. What you seem not to have understood is that the OP is having trouble understanding the actual algorithms.
  14. Zahlman

    ffMPEG VS C++ example

    Closed per OP request.
  15. Zahlman

    Question about Managers

    The fact that this question can meaningfully be asked is exactly the problem.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!