Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

58 Neutral

About antiHUMANDesigns

  • Rank
  1. antiHUMANDesigns

    ? about arrays

    You can access the elements of an array is a second way aswell. [source lang="cpp"]int array[10]; // create the array int *p = array; // create a pointer of the same type and assign it to the start of the array.[/source] Now, using pointer arithmetics, you can access the elements by adding a number to the pointer, such as "p+1", which is the same thing as array[1]. "p" by itself would be the same thing as array[0]. This actually what arrays do, but I think the compiler keeps a note on how many elements the array was created with, to help you with not going out of bounds. Also, you need to "delete" arrays that have been created with "new" by typing "delete[]". Pointer ariothmetics is not just an alternative way of traversing an array, but is something more or less needed, so it's good to know it. I'm a bit rusty on programming atm, so don't bash me too hard if I wrote something stupid or made some silly mistake. EDIT: oh, and using an array normally (array[0]) dereferences automatically, but if you use "p", it's not dereferenced, so you need to write "*p" to get the actual value of the element, instead of the address to it. Just wanted to point that out, even if I felt it was obvious.
  2. antiHUMANDesigns

    total noob here. Can you recommend a c++ compiler?

    Dev-C++ is at least as good as Code::Blocks, I would say. Definitely better than Eclipse in my opinion. So ye, I recommend Dev-C++ if you, like me, think Visual Studio feels too cumbersome.
  3. antiHUMANDesigns

    Textured meshes don't look as they should?

    I know why! Because when maya repeats textures, it only works in maya. To repeat textures, you should change the actual UV layout. Maya does something internally which is not exported. That is, assuming you're repeating using the attributes in the window/sidebar to the right. If you repeat the texture in the UV editor, by scaling your UV's up, it'll work, assuming there's nothing else wrong.
  4. antiHUMANDesigns

    Best 3d modelling software for beginners?

    There used to be a great little program called "Nendo", which I started with some 10 years ago. Not sure it even exists anymore, but it sure was lovely to work with. It really felt like sculpting, for some reason.
  5. antiHUMANDesigns


    Its not, they're different languages, knowing one of them makes learning the other easier since they are related but learning one in order to learn the other is counterproductive. [/quote] When looking at books and stuff, they often say you don't need to know C to learn C++, and I think that's the kind of thing he, or they, meant, because they're all-inclusive (EDIT: I mean, the book teaches everything without need for prior knowledge) . But the difference between C and C++ really is pretty small (compare C to QBasic and the difference is bigger), so if you learn C++, you know a lot (if not most) of C, for example. If you already know C, then moving to C++ is only a little more than an adjustment. (Not trying to understate the difference, because there sure is a difference, but the difference is small for beginners, I think we can agree.) So, yes it is counter-productive to learn C before you learn C++, if you think about it, but it's not useless to do so. I don't see a reson to downvote what Simon said, because technically he's right.
  6. antiHUMANDesigns


    PHP looks a lot like C, which helps. Advanced PHP even has classes and such, like C++. But still, PHP is a scripting language, and C++ is not. Just a little bit of PHP might not help you very much in C++, but at least it helps you understand how programming languages work, which mean you're past the first step. Hey, just give it a try? If you look at a few starter tutorials and think "WTF are they saying?", then... well, play around more with PHP, maybe, I don't actually know.
  7. antiHUMANDesigns


    If you have no experience at all... nah? I'd love to say yes, but only if you can handle it. If you know a little of some Basic-style language, or even C or PHP, then yes, you should be fine with starting C++. But from nothing, it'll probably overwhelm you.
  8. antiHUMANDesigns

    Few questions - collision detection

    meh? This wasn't supposed to be a new post, just an Edit. 8|
  9. antiHUMANDesigns

    Please simplify my code.

    Templates may not be perfect, but if you don't see their value, you haven't been using C++. [font=courier new,courier,monospace]std::string[/font] works because of templates, [font=courier new,courier,monospace]std::cout/cin[/font] work because of templates, <algorithm> works because of templates, [font=courier new,courier,monospace]std::vector[/font] works because of templates, etc. In your own code, templates can help a ton too (for making a generic resource cache, for example, or making a vector (mathematical vector, that is) or matrix library, rather than duplicating the code, increasing the amount of work it is to maintain everything). There is so much wrong with that statement I'm not even going to try to correct it... But we're getting side tracked now, and I think some of these discussions would be better in a new thread. Let's not hijack the OP's thread. [/quote] I obviously use std::string from time to time. If I don't see their value, that doesn't mean I'm not using C++. I don't understand your logic here. My personal disposition towards certain bits of code has no impact on what language I am writing in. None whatsoever. It's like saying I don't drive a car just because I chose to never use the cigarette lighter, which is a part of the car. But let me repeat it to make it clear: I do use std::string sometimes. I'm not bothered by it. Can we start scrutinizing your preferences now? This is starting to feel like a witch hunt. Really. EDIT: OH, btw, when I say "...then I don't think it's C++ code either", then that is obviously an opinion, seeing as I used the word "think". Now, I see why you don't want to try to "correct" my opinion. Thank you for that.
  10. antiHUMANDesigns

    Please simplify my code.

    It's not that you just over-engineered stuff. It's that it's not very good code. You wrote an empty constructor (why?), you used a C header (<time.h> (the C++ version is <ctime>)), you're using C-style casts (instead of C++ style casts), you're not including the header to use [font=courier new,courier,monospace]s/rand()[/font], you're using the [font=courier new,courier,monospace]s/rand()[/font] from C (and not the [font=courier new,courier,monospace]s/rand()[/font] from C++), etc. You're being hypocritical of the "you're using C, not C++." And as rip-off showed, you're using OOP wrong. There is no need for SlotMachine to be a class (it's got one function, and no member variables). There's no need for the Application class either, as idiomatic C++ wouldn't be using classes like that. If you want evidence that not everything needs to be in a class, take a look at the <algorithm> header. Some programming languages have done the disservice of teaching people that Everything Is An Object And Belongs In A Class, which is so far from true it's not even funny. OOP is great, but it's unfortunate that it's so misunderstood, and teaching a beginner to over engineer isn't doing him/her any favors. For what it's worth, I commend you for trying to help. The reason I'm being a bit harsher than normal though is because you're being quite stubborn and this is in For Beginners, where details matter. And for the record, you can do OOP in C. It's not just a C++ thing. C++ never meant for everything to be wrapped up in a class, and it intended for free standing functions to be used in addition to its other features that complement OOP. [/quote] Ah, man, I tried to re-write the OP's code as quickly as possible, and I made the constructor thinking I would put something there, and ended up not doing so, but leaving it like that. I didn't know it would come under scrutiny. Most people just write small snippets of code (or even pseudo-code) to show something, but I undertook to re-write it all as an example for a beginner, but it ended up being scrutinized by professionals instead. Had I known... <time.h> instead of <ctime>, once again an honest mistake from trying to rush it. Doesn't change the point I was trying to make, though. If you look back, it's about the C++ way of thinking, not which libraries you use. I disagree that SlotMachine shouldn't be a class. This is a quick prototype, or a first-version of the "game". If I wanted to add things to the slot machine, having it as a class already is a good thing. You might not like it, but to be completely frank and brutally literal, I don't give a shit, because it wasn't written for your enjoyment. It's C++, it compiles without errors, I like it, it allows for further development nicely... I'm happy with it. In OOP, the slot machine is an object. I stand by that. I don't see how it matters what the class contains. The slot machine is an object, and when I pull it's lever, that's a method for that object (or, member function). Making it a function is not OOP, making it a variable won't work, so what would you make it? I chose to make it a class, and until until you can change my mind as to why it shouldn't be (performance is not an issue in this application, for example), I stand firm. And I don't put everything in a class either. In my own projects, I have "lose" functions for getting random floating point values, for example. I never said everything needs to be a class, but I do claim that some things should be classes, because it makes logical sense if you consider how they are being handled. I can probably find some way to make a getRandomFloat() function to become an object, by looking at it like a pseudo-random number generator, but I don't see how I would make an actual slot machine into a function or a variable, and not feel silly about it.
  11. antiHUMANDesigns

    Please simplify my code.

    I'm not sure if you've programmed in c, I've used it a bit for writing libraries, and the main problems I have with it, are things that c++ has introduced shortcuts for, and of course its painfully lacking of the standard template library (So you have to implement your own lists, hashmaps etc). So not defining classes isn't really equivalent to c code. I know the feeling, I dislike mixing functional code with imperative code, but I think procedural and oop can fit together fine. I know the feeling of over obsessing with oop from when I first started programming. If you want to see programming from another perspective, to see why oop isn't so important, you should look at a functional language like scheme (racket is a good implementation) or haskell. Also if you're interested in alternate oop systems, look at clos (common lisp object system), I think it's a vast improvement over the c++/java/c# oop system. Knowing some of these things, I believe will help you put things in a better perspective. [/quote] No, I agree it's not equivalent to C code just because you don't use classes. But if you do'nt use classes, I don't think it's C++ code either. It feels more like some kind of mix...which I don't enjoy. As for procedural and OOP... you know, the term "procedural" is something I probably end up using widely and wrongly. I lack formal education and I may get the terminology wrong. I've always programmed alone, for about 19 years, so I've never needed to express these things in words, to others. I do my best to express myself, but it obviously comes out wrong at times.
  12. antiHUMANDesigns

    Please simplify my code.

    OK, see, from everything I've read, 99% of people have nothing but bad things to say about templates, and I chose not to use them myself. (Though by doing so it also means I'm not good at them either.) And I'm not exaggerating when I say 99%. I can't recall one single person, besides you, who has said anything good about templates. I just made personal choice not to use them, but I admit that I no longer remember straigh off-hand why that is. And don't get me wrong, I write things procedurally at times aswell. I just don't think it'd be a good thing to teach people to do things the easy way. Maybe I'm at fault, I'm not a licensed teacher. And, perhaps due to my aspergers, I do surely over-engineer things, because I want everything to make sense. And mixing procedural and OOP is the same application simply feels right-off stupid to me. I see no defense for it. (OR, more correcly: I see no defense for ME to do that.) [/quote] Well, I prefer to look at quality over quantity. If templates are good for Abrahams, Alexandrescu, Gurtovoy, Meyers, Stepanov, Stroustrup, and Sutter, they're good enough for me :-) // So, now you'll be hopefully able to recall a few more people besides me who said something good about them I would presume that 99% of people you've talked with / read are probably still stuck in the early 1990s "C with Classes" approach and aren't really using C++, since templates are a pretty fundamental feature thereof // Chances are they were using ancient (late 1980s/early 1990s) compilers that didn't support much beyond the pre-standard "iostream.h" and simply couldn't compile template-based code well or at all -- so, no wonder they had bad experience ;] I have to say, it takes some major intellectual laziness though to never try a feature again just because a decade or two decades ago one had a bad experience... If you want to catch up, I'd recommend: http://www.moderncpp.../book/main.html http://www.boostpro.com/mplbook/ If you're already familiar with OOP and design patterns, you can see the first book as trying to achieve the abstraction without the run-time performance overhead penalty -- for instance, what's known as "strategy pattern" in the Design Patterns book (using the OOP) way is really stemming from a common software engineering principle and (re)introduced as "policy based design" (using the GP) in the Alexandrescu's book. You shouldn't trust other people, you should pick up the book, examine it, and determine the costs/benefits yourself! That's why this part of your statement worries me: "and I chose not to use them myself. (Though by doing so it also means I'm not good at them either.)" This is exactly the WRONG approach -- you should FIRST become good at a feature in order to be able to assess whether it's good or bad for your project(s) and choose what's right, otherwise you're unable to do so (and no, reading/listening to other people, including me, is not enough -- personal experience is vital!). Only then you're able to pick and choose optimally. Take the "virtual" keyword, for example -- are you sure that when you need polymorphism in your code it *always* has to be dynamic/run-time polymorphism? If not, are you aware that C++ allows you to have static/compile-time polymorphism with absolutely zero run-time costs /* http://en.wikipedia....emplate_pattern */? Perhaps it will turn out that dynamic polymorphism is exactly what you need. Perhaps not. Similarly, it may turn out that Data-Oriented Design (DOD) will be a better fit than OOP in a particular application -- http://gamesfromwith...oriented-design -- or, in completely another application, the costs/benefits flip around. That's the beauty of multiparadigm programming -- it allows you to pick *exactly* what you need, when you need it -- no less and no more. Seriously, I recommend you to pick up GP and TMP as well -- it will make you a better programmer and a better designer. As for mixing -- again, see the links to Stroustrup's FAQ -- no offense, but I'm inclined to take the word of the C++ creator over you and "99% of people" you've encountered for what's wrong and what's right in C++ :-) [/quote] A very well written reply. +1 (Apart from your last sentence.) I understand that there are people who like templates, of course, I just haven't heard of any yet. I didn't count Stroustrup, because... well, frankly, he's biased. You misunderstand me, I didn't chose not to use them because of what others have said. They didn't make sense to me. Aren't they changing/improving templates for C++0x? As I recall, they had a pretty big flaw, which they are [finally] fixing now, so there is/was probably a reason that caused people not to like them, and likely the same reason that caused them to fix/improve it. I have no formal education in programming, so I lack a lot of the terminology, and maybe I use some of it poorly. I do my best. I also side with the creator, once I truly understand the intent and value of it. I just don't see it with templates. They're messy, first of all. I don't like using "++" in statements either, so I don't side with the creator there either, I think it's bad practice to use it in any other way that pretty much only "x++;" on it's own. and there are articles explaining why it's a bad idea, because it causes ambiguity in many cases. But C++ allows it, just like it allows many other bad practices (in different people's opinions). I just think templets fall into that category, which inherently means it's an opinion or matter of taste or style. All I'm saying is that I'm not alone in seeing it that way. And like I've said earlier, I also use C++ procedurally (mostly when testing stuff), but I would never mix 2 styles in one application if I could help it. I actually go to great lengths to avoid doing so, sometimes. Keeping one style consistenly throughout one program is deathly important to me, so that I know where to look and what to expect when I look for things in my code. But if I completely skipped classes in a program, I personally would not consider it proper C++, and I stand by this opinion, for now.
  13. antiHUMANDesigns

    Getting started with open world game development

    thank u for your advice.. i want to follow this method rather than using a game engine. but, can you please elobrate the procedure..i have no expernce with openGL...what are the tools i should use for this?? [/quote] thank u for your advice.. i want to follow this method rather than using a game engine. but, can you please elobrate the procedure..i have no expernce with openGL...what are the tools i should use for this?? [/quote] Sry for the late response. OK, no experience with openGL... well, if you're decent with C++, you may be OK, because just displaying a model isn't very hard in openGL, using the most basic way, where you just specify where the vertices are, and their texture coordinates and normal. You don't need any "tools", I would say. Just find some code that loads an .obj or .rtg (or something else, if you can find it). That'll usually give you an object where all the vertices and stored, and you just iterate through it and output the vertices using glVertex. (I would definitely make it a display list, though, but that's easy to add once you get the model showing.) If you want lighting, you need to speficy the normals, which will be in that object that loaded your model, so output those aswell. And then you need to speficy light positions and turn on lighting, and some minor stuff like that. It really isn't very hard, so don't worry, just get one thing working at a time using online tutorial. It's no problem at all finding a simple tutorial on how to just output triangles, on google. It's very, very basic. Try googling and reading some of it there, and if something doesn't make sense to you, come back here and ask more specifically what you need help with.
  14. antiHUMANDesigns

    Few questions - collision detection

    There's a good and free 2D physics library called Box2D (right?). You could check that out.
  15. antiHUMANDesigns

    Few questions - collision detection

    I did some 3D modeling for a small game that used XNA, and the collision detection/response seemed to be lacking. It acted really weird once the speeds increased. But of course, it might have been the programmer's fault, but it seemed to improve once he switched to another library for physics. ("Bullet" library, I think.)
  • 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!