Results 1 to 24 of 24

Thread: C++ or VB ?? What is better for 3D Graphics?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2002
    Location
    Toronto, Canada
    Posts
    50

    C++ or VB ?? What is better for 3D Graphics?

    Hi,
    I am looking for advice. I use VB now. I like it. But from now I am going to start learning 3D graphics (DirectX 8). I think C++ is much faster and give more opportunities. What do you think is there a need to make 3d Games in C++, or I can do it in VB just as good as in C++?

    Thanks,
    Andrew
    Best regards, Andrew

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    C++ is faster and you can do everything in it.

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    In VB the graphics will be almost the same speed, but the other routines will slow you down.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Addicted Member Janus's Avatar
    Join Date
    Aug 2001
    Location
    California
    Posts
    221
    Nah, VB is actually much slower and less good at 3D. Definitely use C++, though it might be worth writing a high-level COM library in C++, and then using VB to wrap it in a game engine. All the vertex/matrix/etc. manipulation is still much slower in VB than in C++.
    "1 4m 4 1337 #4xz0r!'
    Janus

  5. #5
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280

    Unhappy Traitors!

    My friend and I have built several 3D games in VB, all that work VERY fast (mind you we used OpenGL, not DX8).

    As long as you don't use bulky intrinsic controls (i.e. timer[less?] control) the program will go pretty fast. Replace repetitive calculations with look-up tables, etc. If you really need some complex calculation that is just too slow, then VB is more than supportive of mult-language programming (e.g. write an assembler macro to do the job, MASM is free with Visual Studio!)

    If I were you, I would stay with VB since it is SOOOO much easier! And besides, there must be a 20% difference in speed for a user to notice a difference, so I wouldn't worry.

  6. #6
    Zaei
    Guest
    DX8 (and probably all of the other DirectX versions) ARE built on COM. As Sas said, the Graphics will be nearly the (or the same) speed as C++, since both use the same code. On the other hand, Logic and AI are starting to take up more and more CPU time, which will REALLY make a difference in VB, since it is so much slower. Since you are just starting out, you can safely stick with VB, since your logic code wont be taking most of you CPU time. If you later move onto something more heavy duty, C++ is a much better bet.

    Z.

  7. #7
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    I still don't see why everyone is obsessed with VC++! Obviously it has some inherit speed increases, but then again you could easily incorporate them into VB6 (e.g. DLL, Macro). However, when in VB, smarter programming is of the essence; repeat code does not equal repeat players!

  8. #8
    Zaei
    Guest
    Actually, in some cases, it is FASTER to repeat segments of code...

    C++ offers MANY advantages over VB, only one of which is speed. You also get true OOP, with inheritance, which VB only partially supports. Classes are also easier to use, and objects take up less room then VB objects. You get low level access, including inline assembly.

    VB is great for tools and tests, but beyond that, I wouldnt really consider it anymore for writing an actual engine (I am pretty obsessed with modularity, which VB isnt so good at).

    Z.

  9. #9
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    You need C++...

    Yeh, VB is a great language, but if you want to become a game programmer you have to know C++, I have never seen commercial companies like Sierra or Novalogic make games with VB - please correct me if I'm wrong

  10. #10
    Addicted Member
    Join Date
    Feb 2002
    Posts
    242
    C++, OOP is the way to go when dealing with graphics.

  11. #11
    Lively Member jimmymou's Avatar
    Join Date
    May 2001
    Location
    Luxembourg
    Posts
    74
    My own experience, that has nothing to herit from true graphics programming, comes from finite element system resolutions (to resolve thermodynamics systems).

    Most mathematical functions are available in C++, this is not always the case with VB, and the resolution (or calculation) of big math equation is faster with C++.

    Nevertheless, today I develop more under VB than under C++, but as soon as this requires a faster math procedure, either I build an entire C++ App, either I build a DLL to do this from VB.

    JiMmY

  12. #12
    Zaei
    Guest
    In games, there are many different sub systems that need to interact together. C++ allows so much ease in this area, through OOP, that I would hardly consider another language. C++'s main strength is not its speed, but the ease of creating a large interconnected system, through OOP.

    Z.

  13. #13
    Addicted Member Bazza81's Avatar
    Join Date
    Apr 2001
    Location
    Nottingham, UK
    Posts
    203
    My views on C++ and VB. If any of these views seem strange or irrelivant then I must appoligise for they are just my views.

    C++ has been a round for a while now and it has become the standard in industrial application devlopment. Large complex, industrial programs such as games and high end server database programs benefit much more from an OOP C++ approach. VB could never rival thees things. C++ is made for the professionals and is in my opinion a very friendly language considering it was made decades ago. I think the C language as a hwole will stay with us for a very long time and it should becuase of all the advantages it offers. ASM and other such low level languages will definatly become used less and less as the C compilers become more advanced and efficient. The specs of PC's are increasing so much that ASM will hardly ever be used anymore where speed is a factor. We owe a lot to C++ due to all the great things it has brought us, like Windows for instance. I do not want to start a debate about Windows here becuase in my view it is a programming masterpiece. All these people who say Windows is crap ect, probably don't appreciate or even know the ammount of work that went into it for us to play games and do out usual stuff that we take for granted. I just wish I had the knowledge to build my own OS, so I am thankful for Windows. Anyway, back to my point. C++ is here to stay and it will always be faster and more efficient than any other language.

    Onto VB. VB was made for VERY fast application development. I don't think anyone will disagree that if you just want to create a simple application for say, keeping track of employees in a company, then VB will beat any competition with its eyes closed. A novice VB programmer could build a simple application 10 times quicker than an experience C++ coder could. But, this is why VB was developed. To let the coding kiddies make little 2D shoot em ups in the middle of the night and the assistant programmer in a company quickly develop a hit counting system for the companies web site. These are the things that no other language in the world can offer. Sure you can make the same things in C++ but they will take 5 times as long.

    For novice programmers trying to learn the basics of programming as a whole, then VB is definatly the way to go. VB will beat anything in simple application developemtn, C++ will always beat anything in complex application development!

    Any comments?
    Who needs rhetorical questions anyway?


    Bazza NET - The place you want to be!

  14. #14
    Zaei
    Guest
    Windows was mainly programmed in C, with some assembly.

    Z.

  15. #15
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    C++ has been a round for a while now and it has become the standard in industrial application devlopment. Large complex, industrial programs such as games and high end server database programs benefit much more from an OOP C++ approach. VB could never rival thees things. C++ is made for the professionals and is in my opinion a very friendly language considering it was made decades ago. I think the C language as a hwole will stay with us for a very long time and it should becuase of all the advantages it offers. ASM and other such low level languages will definatly become used less and less as the C compilers become more advanced and efficient. The specs of PC's are increasing so much that ASM will hardly ever be used anymore where speed is a factor. We owe a lot to C++ due to all the great things it has brought us, like Windows for instance. I do not want to start a debate about Windows here becuase in my view it is a programming masterpiece. All these people who say Windows is crap ect, probably don't appreciate or even know the ammount of work that went into it for us to play games and do out usual stuff that we take for granted. I just wish I had the knowledge to build my own OS, so I am thankful for Windows. Anyway, back to my point. C++ is here to stay and it will always be faster and more efficient than any other language
    I agree, Windows is great. If you think about it, we might be using DOS still, of Mac OS or some other crappy thing.
    Don't Rate my posts.

  16. #16
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Well hmm I'm currently developing a MMORPG (like everyone else ) and since I recently learned C++, I was considering making the game in C++ instead of VB... the only thing that bothers me is that sometimes I forget that C++ doesn't automatically take care of pointers everything else is ok I guess. Anyway... do you think it would be best to start the engine from scratch in C++, or continue the one I have in VB?

    Btw no matter what those weenies say, Windows is a lot better than most of the other crap. Oh maybe it's not so good as Linux when it comes to security. And of course DOS is always cool, I grew up with it But it's still better for most stuff.

    Hmm... something else... the way I make my games, I NEVER use OOP. It's like, an array of enemies and then you loop trough every one of them and based on their type and all move them or make them fire in some way etc. In OOP it's a bit different. Well, it seems that I can't "think" OOP when I'm programming that's bad right? Where can I learn this?
    Sorry, I know, it's a kind of a very abstract question but what the hell. I need to know

    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  17. #17
    Addicted Member
    Join Date
    Feb 2002
    Posts
    242
    Hmm... something else... the way I make my games, I NEVER use OOP. It's like, an array of enemies and then you loop trough every one of them and based on their type and all move them or make them fire in some way etc. In OOP it's a bit different. Well, it seems that I can't "think" OOP when I'm programming that's bad right? Where can I learn this?
    Sorry, I know, it's a kind of a very abstract question but what the hell. I need to know


    If you know C++ how could you never use OOP? C++ IS an OOP language. You have to be using OOP if you're programming in C++

  18. #18
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Can someone point me in the right direction in making some sort of 2D game in VB?? Like if I made a little space fighter game or something, how would I tell if its been shot?? And manage moving 3-4 bad guys across the screen.

    Thanks in advance
    Don't Rate my posts.

  19. #19
    Addicted Member Janus's Avatar
    Join Date
    Aug 2001
    Location
    California
    Posts
    221
    Jim Davis: Read the previous post. He was asking for help with TWO-DIMENSIONAL games. not 3d ones.
    "1 4m 4 1337 #4xz0r!'
    Janus

  20. #20
    Zaei
    Guest
    Originally posted by Javan

    If you know C++ how could you never use OOP? C++ IS an OOP language. You have to be using OOP if you're programming in C++
    You do NOT have to program with OOP in C++:
    Code:
    #include <stdio.h>
    inline int x(int y) {
      return y*y;
    }
    
    int main() {
       printf("%i", x(10));
       return 0;
    }
    The above is perfectly legal C++ code, that could not compile under C.

    Jotaf: The only way to learn to program the OOP way is practice thinking that way. Often times, I walk around my house, and reduce it to code (sick, huh?). My door is an object, with members Open(), Close(), Lock(), Unlock(), etc. My Light is an object, IsOn(), On(), Off(), my power outlet is an object, Object* ConnectedTo(), etc. Its then really easy to see how the objects interact (the Zaei Object can call Light::On(), or Door::Close()). Once you grasp the concept that everything in a complex system is represented as an object that other objects can act upon, its pretty easy stuff. In the case of an MMORPG, you have player objects running around, and item objects being traded, dropped, spawaned, and monster objects being killed, etc. You also have Map Objects, tree Objects, etc, etc.

    Z.

  21. #21
    Addicted Member Bazza81's Avatar
    Join Date
    Apr 2001
    Location
    Nottingham, UK
    Posts
    203
    If you want to know about very simple 2D gaming then check out my space invaders program. I hope it helps!
    Attached Files Attached Files
    Who needs rhetorical questions anyway?


    Bazza NET - The place you want to be!

  22. #22
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Hmm... yeah I know that... but it's hard because I got used to think non-OOP (no classes, not many functions...) because that's how it has to be if you want your games in VB to run at a decent speed
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  23. #23
    Zaei
    Guest
    Well, dont anymore =). The way you are currently programming is pretty close to OOP anyway. You just need to change the format of your code. Your UDTs become classes, and the Functions that act on your UDTs become members. So this:
    Code:
    Type PlayerType
      ...
    End Type
    
    DoSomething(Player)
    becomes
    Code:
    Call Player.DoSomething()
    Z.

  24. #24
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Heh yeah thanks
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width