Sign in to follow this  

C++ not C#

This topic is 4019 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

haay,, im tired... (T_T) ive changed my mind.. before i want vb.net with directX, next C#, and now C++.. do you think c++ is better?? im aiming to be a professional game programming..(what a dream!) but seriously, i really want to... but the question is HOW????? maybe, im too young for that "DirectX and C++" stuff.. haay... so,,any suggestion,,please... i don't know what to do.. i really did my best to search for tutorials but it isn't effective.. please someone help me.. please.. by the way,,XNA didnt work on my Pc.. the "SpriteBatch" thing has an error.. and i think my video card didn't meet the requirements of XNA.. so i think i'll use c++..BUT i dont know anything.. yah!! i know something but im wondering,,why is that in c++,,almost/ALL the tutorials are teaching me but the output is in console??? what's the purpose???? AHHHH!!!! i can't understand C++.. is it just im a complete damn!!.. so please help me,.. THANKS IN ADVANCE!!! -marc

Share this post


Link to post
Share on other sites
The tutorials start you out on the console because you need to understand the language before you can begin using APIs for graphics.

If you just blunder your way through, chopping together tutorials, you won't understand the language, and you won't understand why you have certain bugs. Take your time, practice, and make sure you understand the tutorial before you move on.

Share this post


Link to post
Share on other sites
i was trying to ask if you would recommend me to study c++ with directX..

-----------------------

uhmm,so can u give me some sites that have good tutorials in C++??
what if ive finished that tutorial,,where could i find tutorials in c++ using Directx9???
in my case,, what shall i do???
i have some knowledge in programming coz i do programming in vb6 and vb.net before..

btw, thank to the two of you for your replies..

Share this post


Link to post
Share on other sites
I know game programming sounds really exciting and you want to do it right away, but as one of my professors always says, "you've got to walk before you can run." Or, don't put the cart before the horse.

In other words, take your time with the C++ beginner tutorials; they're designed for beginners. Don't be discouraged that your first program outputs text to the console; being able to do this is very helpful when you're trying to debug your games.

I'm still new to all this, but what I've found helpful is to set goals for myself. For instance, if you have the time, try to complete one tutorial a day. Maybe after a month or so try to program the game of Nim on the console. My personal goal is to do one NeHe tutorial a day, typing in the code and making sure I understand it by playing with it. I hope in a month's time I'll have a basic grasp what OpenGL can/can't do and how to implement my ideas.

So, you've got to be patient.

Share this post


Link to post
Share on other sites
XNA is a lot easier then using pure Direct X API, XNA will setup your devices, ect... You need to do this all by yourself if you use Direct X with C++, XNA only supports C# and Visual Basic.NET

Share this post


Link to post
Share on other sites
Quote:
Original post by Jettoz
XNA only supports C# and Visual Basic.NET
Not exactly. The XNA Framework can be used with any managed .NET language, but unless you use XNA with C# (and more importantly Visual C# Express Edition) then you lose out on certain parts of XNA that are only available through how Game Studio Express integrates with Visual C# Express.

Also, the Xbox 360 .NET runtime doesn't support some of the special things that are only in VB.NET, such as My.{...}

This may change in the future though.

As for the requirements of XNA, well it has no fixed-function pipeline so you have to have a graphics card capable of at least Shader Model 1.1. You also need the .NET Framework 2.0 and a small XNA Runtime.

Regards,
ViLiO

[Edited by - ViLiO on December 12, 2006 11:19:16 AM]

Share this post


Link to post
Share on other sites
YUP!!! you got it!! i think its the PIXEL SHADER 1.1 which i think i dont have in my video card.. so is there any way to have that pixel shader or i must really buy a new video card??

Share this post


Link to post
Share on other sites
Quote:
Original post by macmoy
YUP!!! you got it!! i think its the PIXEL SHADER 1.1 which i think i dont have in my video card.. so is there any way to have that pixel shader or i must really buy a new video card??


You need to start with plain vanilla programming
no graphics
no directx
no XNA
just printing text to the screen.

Graphics require _advanced_ understanding of programming. It seems like you have zero which is where we all started. =) So just buckle down, pick a language (it doesn't matter which) and just learn to program.

If you want to start with games start with a text based RPG _after_ you've spent at least 2 weeks learning the basics of whatever language you have chosen.

-me

Share this post


Link to post
Share on other sites
Quote:
Original post by macmoy
ok,,, uhmm,, what's a text-based RPG??? samples pls..

Ok here is a simple textbased(console) game in VB(would look very similar in C# and can easily be ported to C#:

Sub Main()
' ported from old basic program for apple II

Dim nbus As Integer
Dim jtotalfeet As Integer
Dim aangle As Integer
Dim a As Single
Dim s As Single ' speed
Dim t2 As Integer ' number of successful jumps
Dim t3 As Integer ' number of failed jumps

' random number generator
Dim generator As Random = New Random
Dim madeit As Integer = generator.Next(0, 8)
Dim running As Boolean = True
Dim jumpagainresponse As String
Dim bodypart() As String = {"R.ARM", "R.LEG", "L.LEG", "BACK", "NECK", "SKULL", "RIBS", "KNEE", "BUTT", "EYE GONE"}



' main game loop
Do
Console.WriteLine(vbTab & vbTab & "MOTORCYCLE JUMP")
Console.WriteLine(vbTab & vbTab & "by Jaime Moreno")
Console.WriteLine(vbTab & vbTab & "Farmersville, Ca")
' create some blank lines
Console.WriteLine()
Console.WriteLine()

Console.WriteLine("We're at the scene of the big motorcycle jump!")
Console.WriteLine("How many busses will you try to jump?")
nbus = Console.ReadLine
jtotalfeet = nbus * 15 ' each bus is 15feet

Console.WriteLine("{0} busses! That's {1} feet!", nbus, jtotalfeet)

' make sure following loop runs at least once
Do

Console.WriteLine("What ramp angle will you use?")
aangle = Console.ReadLine
If aangle < 90 And aangle > 0 Then
a = aangle * 0.01745
Else
Console.WriteLine("{0} degrees? That's impossible. Come on now.", aangle)


End If

Loop Until aangle < 90 And aangle > 0

Do
Console.WriteLine("How fast will you leave the ramp?")
s = Console.ReadLine
If s > 0 Then
'h = 6
'd = 0
'g = 6
'r2 = 0
's2 = 0
s = s * 1.5
Console.WriteLine("There he goes!!!!")
If madeit > 4 Then
Console.WriteLine("He made it! Great jump, killer!")
t2 += 1
t3 += 1
Console.WriteLine("Want to jump again?")
jumpagainresponse = Console.ReadLine
If jumpagainresponse.ToUpper = "YES" Or jumpagainresponse.ToUpper = "Y" Then
' start game again
Else
running = False

End If

Else
Console.WriteLine("He's short of the ramp...")
Console.WriteLine("He jumped too far!")
Console.WriteLine("He missed the ramp.")
Console.WriteLine("I think he's hurt........")
Console.WriteLine("Well, killer, the doctor says you broke your")
Console.WriteLine(bodypart(madeit))


t3 += 1

running = False

End If


Else
Console.WriteLine("A practice jump!")
Console.WriteLine("OK, This time ")
End If

Loop Until s > 0


Loop Until running = False

Console.WriteLine("You made it {0} out of {1} attempts.", t2, t3)
Console.WriteLine("Be careful, now.")

' create some blank lines
Console.WriteLine()
Console.WriteLine()

'ask for enter to quit
Console.Write("Please press 'enter' to exit")
Console.ReadLine()

End Sub


Make a whole bunch of similar games of your own from scratch and then you will be able to start learning directx.


Share this post


Link to post
Share on other sites
Quote:
Original post by macmoy
ok,,that code is for vb.net??
before,, i know how to program in vb.net... but why u use console??
why don't u use form??


You can use a form if you want but then it'd make the program 10x longer and harder to understand. I think that's why everyone is telling you to start learning with just console or text games first.
If you don't believe me try writing game I just posted using forms.
It'd be good experience anyways since if you don't use messagebox.show to communicate to user you will have to have to learn to use system.drawing functions to draw text on form and communicate with user which is even harder.

p.s. If you can't figure it out I will post updated versions of game I made using windows form and managed directx later.

Share this post


Link to post
Share on other sites
huh?? icant understand,,im sorry...
why is it console again??
in forms(windows application) u can communicate with the user by
msgbox"ssdfdsfsdfsdfsdf" <<< like that ryt?? and also,,
label1.text="HELLO" <<< that one ryt??
whats your point of programming first on a console?? if you can do it in forms as well?? im really very sorry if i cant understand...
THANKS!!!

Share this post


Link to post
Share on other sites
Imagine that you want to learn, say, French(assuming you don't already know french). But instead of placing you into a beginner's french class, they put you into a Math class and expected you to both learn French and math at the same time.

Using forms adds complexity to learning the language. A simple console app is probably under 10 lines of code while a windows forms class can be over a 100. With a console application you can focus on learning the keywords and operators while with a windows forms class you have to learn about keywords, events, operators, etc. You focus on fundamentals and Then learn windows forms.

You're like a five year old trying to get into fight without boxing gloves with Muhammad Ali in his prime.

Share this post


Link to post
Share on other sites
thanks for your advice but i already know how to program in windows form.. i have already made a 2d rpg although it is not finished,, using BitBlt in vb6..(gdi32)
the only problem is,what good languange to use when doing directx?
i think c# or c++ but which of the 2?? they say,,c++ is more complicated but it FAST...and c# is using managed code so they say c++ is faster than c#..honestly,, i think ill choose C# BUT,,how can learn?? here in Philippines,,there's no such books about directx,,NOTHING!!! so how?? i hope,,there will be a nice directx expert in C# which will teach me,,either give me a pdf,tutorial, or even tell me step-by-step.. (T_T) oh.. please.... HELP ME....

Share this post


Link to post
Share on other sites
First, I only skimmed the above posts so if this was already posted, my bad...

EDIT: I just read some posts above and some of the things wrote below might be useless if you arent intending to program in C++...

If you want to *eventually* become a pro game programmer I just want to make it clear that VB is not the way to go, though I'm sure you already know that lol.

Text based games in C++ are normally made by beginners to just get the "style" of game programming, not normally for any type of serious project. C++ is the way to go if you want to program video games, but some of the habits from VB programming are difficult to escape from when moving on to C++, so just be aware. After you get good at text-only console based games and want to move on to graphical games use an api like directx (which I think you mentioned above). But if you are new to graphics programming in C++ I would definately start with something simpler like SDL, or use a premade engine for a game.

For C++ tutorials, I've found the ones at www.cprogramming.com helpful. I strongly recommend finding a decent book about C++ programming though, just check at an overstock store and get them really cheap if you want (one in my area has hundreds of programming books and its an all-purpose store).

I hope this helps, and once again: if any of this was already said or is otherwise useless to the origionally question, sorry about that.

Share this post


Link to post
Share on other sites
what version of c++?? c++ 2005 or c++ 6???
for c++ 2005,,how will i start? what will i choose?? unlike vb or c#,, i choose "Windows Application"...what will i choose in C++ 2005 and in C++ 6??

Share this post


Link to post
Share on other sites
I'm assuming that you are talking about Visual C++, the Microsoft IDE for developing C++ applications. Basically, there is no change in the language (as far as I know), but the change is in the user interface of MSVC++. I suggest you read tutorials about how to use the language or IDE. For help with MSVC++ you can find information at Microsofts homepage and MSDN.
I hope this helps and I also hope that I understood your question correctly lol.

Share this post


Link to post
Share on other sites
Quote:
Original post by xtremeprog05
I'm assuming that you are talking about Visual C++, the Microsoft IDE for developing C++ applications. Basically, there is no change in the language (as far as I know), but the change is in the user interface of MSVC++. I suggest you read tutorials about how to use the language or IDE. For help with MSVC++ you can find information at Microsofts homepage and MSDN.
I hope this helps and I also hope that I understood your question correctly lol.


Actually there are changes in the language between those versions.

Microsoft Visual C++ 6.0 doesn't follow the ISO standard and is thus a very poor compiler, most other compilers from the same timeperiod doesn't either so using a new one is definitly recomended.

ofcourse it is possible to use an old IDE with a new compiler aswell, standalone compilers are generally cheaper than complete IDEs.

Share this post


Link to post
Share on other sites
I have strong feelings on learning C++ first. Yes C++ is difficult, and many people that start learning it give up when it gets hard. I love being challenged, and learning C++ provides many of them. I have been using it for 5 years and still learn things from time to time. I remember when I started college in 2001 for Computer Science. We had 18 people in my C++ Programming I class, by the end of the year there was only 5 of us left in that class. Programming in general takes dedication, and there is no easy way to learn it. You learn by doing it over and over again. When you get comfortable with C++ I think it is really important to learn Assembly, mainly because it really helps you understand what is happening behind the scenes. After taking a class on Assembly, C++ seems so simple, almost too simple. Pointers make more sense, as does how the stack works. I learned more from my Assembly class than anyother class in my life.

Start small, my first game 7 years ago was a side scrolling space ship game on the TI 85 calculator. My first real C++ game was a text based adventure game, but it still taught me a lot.

Share this post


Link to post
Share on other sites

This topic is 4019 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this