View previous topic - View next topic |
Author |
Message |
Ninkazu Demon Hunter
Joined: 08 Aug 2002 Posts: 945 Location: Location:
|
Posted: Mon Dec 02, 2002 9:41 pm Post subject: Programming an RPG |
[quote] |
|
Yup, the article I advertised for quite a while on RPGDX is finally under way. I made the necessary corrections to the article info on the site, and more will be soon to come.
For those of you who are lazy, here is the url:
http://venosoft.com/articles/preface.html
|
|
Back to top |
|
|
God_Cells Milk Maid
Joined: 29 May 2002 Posts: 40 Location: Canada[Quebec]->Saguenay;
|
Posted: Tue Dec 03, 2002 9:50 pm Post subject: |
[quote] |
|
It's a good beginning for a tutorial!
Quote: | Because I've had such an incredibly hard time finding any good tutorial on programming, specifically in C++, |
I'd like to notice that *good* C++ tutorials are very rare, so, you should instead speak about C. C++ versus C, ^_^ C++ is less powerfull for programming games, the code is quickly made, but the chances to make a slower code are greater.
If you want to use a great language try C that is easier to understand... There's always great books about it at library! Believe me, your engine will be more effective.
Quote: | Engines can't do anything by themselves |
Well... this particulary true, I should add this sentence in my tutorial ^_^. Reformuled as "Engines souldn't do anything by themselves". This is a common error to write a specific game feature in an engine. But, more the engine is customizable, more it's slow and long to code... And, it's less stable... So, you must limit yourself, or never finish your game!
Good chance with this tutorial, keep working! _________________ Be vigilant, uncle Sam is looking at you...
Take a look to my project at : L'odyssée de Zed
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Wed Dec 04, 2002 5:47 am Post subject: |
[quote] |
|
- I find C++ easier to understand than C. I know C++ is slower than C. But as far as power, it depends on what you're referring to. The "future" is Object-Oriented Programming. That's what I'm interested in. C++ is what I'd suggest for them large, detailed games. Use C blitters and Drivers, but write your game primarily in C++ to take advantage of objects.
- That's my 3 yen. _________________ - Jaeda
|
|
Back to top |
|
|
Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Wed Dec 04, 2002 3:53 pm Post subject: |
[quote] |
|
C++ is not intrinsically slower than C. A well-written C++ program can easily match or beat a well-written C program in performance. Some C++ techniques can lead to slow code, but others are blazingly fast. You just have to know what you're doing.
|
|
Back to top |
|
|
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Wed Dec 04, 2002 9:25 pm Post subject: |
[quote] |
|
Yeah, one thing to note as slow are virtual functions. Testing the performance of an early tile engine of mine I noticed a big difference whether my tile drawing routine was defined as virtual or as a normal method. I'm not sure if it was already actually drawing the tiles at that time because I think if it was, then the time it takes to copy the tile bitmap to another bitmap would make the virtual or non virtual difference very insignificant.
|
|
Back to top |
|
|
white_door Icemonkey
Joined: 30 May 2002 Posts: 243 Location: New Zealand
|
Posted: Thu Dec 05, 2002 12:03 am Post subject: c++ vs C |
[quote] |
|
yeah... its not the compiler that is any slower.. and since C++ is a superset of C, you can code fast code if you want. its only a few of the features of C++ have hidden costs.. where as if you do the same thing with C you have to do it all manualy so you can see if it will be optimal or not.. straight way.
I mean if we really wanted pure speed, we would code everything in asm. and some people do. Sure a few asm routines can go a long way to boosting your programs speed, but the whole thing? Who has the time for that?
Of course OOP != C++. A lot of the features in C++ were designed to aid with object oriented programming, however OOP is a style of programming you can still use in C. And conversely just becuase you use C++ doesn't automatically mean you are coding with OO.
Personally I like some of features that C++ has to offer, and I agree it would be helpful to have some good tuts on them.
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Thu Dec 05, 2002 5:53 am Post subject: |
[quote] |
|
Well if you really want OO, use Java... everything is an object.. but it's hella slow on some things. But Java's sexy. =)... _________________ - Jaeda
|
|
Back to top |
|
|
Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Thu Dec 05, 2002 2:45 pm Post subject: |
[quote] |
|
Personally I can't stand Java. It's not just slow, it's horribly verbose, and it doen't let me structure my code the way I want to structure it.
|
|
Back to top |
|
|
God_Cells Milk Maid
Joined: 29 May 2002 Posts: 40 Location: Canada[Quebec]->Saguenay;
|
Posted: Thu Dec 05, 2002 8:48 pm Post subject: |
[quote] |
|
I donot agree with you guys/girls ;)...
C++ will be always slower, new/delete vs malloc/free is a clear example. C is harder to learn/understand, class heritage, template are examples. Learning the syntaxe of a language is one, but to master it is another, and C++ needs more time to master, i count mastering into learning/understanding... this language tend to simplify at cost of speed by hiding complex memory manipulations like pointer on functions.
If you dont use OOP why do you use C++? C++ was created for that... use C instead.
ASM :), is great, I agree with WhiteDoor :)
Quote: | The "future" is Object-Oriented Programming. |
We could speak alot about this ;), but i'm sure that OO isnt the future :p. _________________ Be vigilant, uncle Sam is looking at you...
Take a look to my project at : L'odyssée de Zed
|
|
Back to top |
|
|
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Thu Dec 05, 2002 8:57 pm Post subject: |
[quote] |
|
Nah, the future is in multithreaded parrallel programming for high performance computers using the message passing interface!
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Thu Dec 05, 2002 10:31 pm Post subject: |
[quote] |
|
- Correct me if I'm wrong, but oftentimes, aren't threads objects?
I know in Java they are.
- Unix generally uses fork() so... _________________ - Jaeda
|
|
Back to top |
|
|
God_Cells Milk Maid
Joined: 29 May 2002 Posts: 40 Location: Canada[Quebec]->Saguenay;
|
Posted: Fri Dec 06, 2002 7:24 am Post subject: |
[quote] |
|
Yeah, who knows :) _________________ Be vigilant, uncle Sam is looking at you...
Take a look to my project at : L'odyssée de Zed
|
|
Back to top |
|
|
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Sat Dec 07, 2002 10:34 pm Post subject: |
[quote] |
|
In Java, threads are explicit objects but in a language like C you are just free to look at them that way. OOP and threaded programming are mostly discussed as totally seperate subjects. But anyway, I was just kidding of course.
|
|
Back to top |
|
|
Nodtveidt Demon Hunter
Joined: 11 Nov 2002 Posts: 786 Location: Camuy, PR
|
Posted: Sun Dec 08, 2002 11:56 am Post subject: none :P |
[quote] |
|
Rainer Deyke is right...C++ is not slower by nature, but here's a good reason why it can be slower...
Think of BASIC versus C. BASIC is designed to be easy to use. It seems that the easier the language, the more work the compiler has to do, and thus more generalized output instruction, which means more CPU time to execute command sets, etc etc etc. C++ is easier than C, most anyone will tell you that. And likewise, a C++ compiler will end up doing far more work than a classic C compiler. Thusly you've got the more generalized output code which eats more CPU time per instruction block, etc etc etc. So although it's true that C++ by nature isn't slower than C, it can be. Modern C++ is designed to take a lot of the work away from the programmer, and that comes at a cost. Why do you think all these games that come out a dozen per week need such power-hungry computers? I swear to god they're written over the weekend in vanilla C++.
-nek
|
|
Back to top |
|
|
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Sun Dec 08, 2002 10:29 pm Post subject: |
[quote] |
|
C is closer to machine language and thus would be more efficient and easier to optimize, I agree. But new games don't need big processors because they are written in C++ instead of C. That is because they are loaded with graphical content and polygons, requiring both a good graphics card and a fast processor. Also, most of the actual game functionality gets scripted, these scripts execute about 20 times slower than native C/C++ code. Of course, the scripted part is supposed to be non-speed critical but they implement complicated stuff like AI. Also, games get an increasingly higher amount of detail on the physics part (ex. Karma Physics in Unreal Engine), which takes a lot of processor power.
|
|
Back to top |
|
|