PDA

View Full Version : Best Programming Language to learn for RPG design? Best resource to learn it from?


gumbomasta
February 20th, 2011, 01:24
C#? C++? Java? Is there a book you recommend that could teach me in a sort of crash-course way?

Might as well start somewhere… :p

-g

hishadow
February 20th, 2011, 06:25
All those languages you listed are fairly complex. To be anywhere near useful with them you'd almost need 3 years worth of college degree in Computer Science. Well, even then you would have only just gotten started. Learning just the languages is only a small fraction of the skillset required for programming.

If all you're interested in is designing content, then I'd suggest using an existing game that's moddable and make a module for it instead. You don't need any programming skills beyond writing scripts in a special purpose language for that.

DArtagnan
February 20th, 2011, 09:23
Go with C#, download Visual Studio Express, find a tutorial - and just experiment until you die from exhaustion. Steal bits of code left and right, until you have something that actually works.

A ton of documentation available, and tutorials ranging from being targeted at the completely inexperienced to advanced coders.

I never cared to sit down and read much when I was itching to do something, so I just tend to work as I go. Somehow, I've managed to do most of the things I've set out to do - but it's a long road when you don't have all the theory in place. But it's about what you prefer.

If you have the patience to take a proper course and read a few huge books, that's always a good foundation.

Oh, and about the biggest mistake you can ever make is telling yourself there's something you can't do - unless you're 100% certain it's impossible.

pibbur
February 20th, 2011, 10:32
I agree with Dartagnan, C#/Visual Studio is a good choice, for several reasons, including the visual design environment. It's not as complex as C++, and the strict nature of the language/environment protects you from making a lot of errors (which C++ happily allows you to do). However, C# comes with the .net architecture and a HUUUGE amount of classes/components, which can be a bit overwhelming, but you'll start with the basics, and a good tutorial will lead you safely through the jungle.

You don't need anything near a 3 year college degree to use any of the languages, I certainly did not. I would recommend a good book, not only to learn the language, but to learn programming and programming design, which is just as important as, perhaps even more important than learning the language. You need to learn how to create a good class structure (the components you create in your programs), and in my book that requires more than you're likely to get from a turtorial and experimenting. I like the professional C# series from Wrox, the target audience of those are however people who already know a bit about programming. I would recommend that you get yourself an introduction text like "C# for dummies" and after that go for books like the Wrox'es.

Eventually you would probably also benefit for a book on game programming, there are several good books, including books on RPG programming.

After that it depends on how advanced you want to be. There are books about using 3D geometry, about the mathematics involved, about physics…. But all that lie a couple of years ahead.

And if you want to get REALLY advanced and write high performance stuff, you need to switch from C# to a language like C++, as that requires memory manipulation which C# won't allow you to do. But again, that's years ahead, and by then C++ won't be particularly difficult.

Currently there are some new trends regarding preferred programming languages, new languages like Ruby (which I no little about other than the name) are gaining increasing support. So things may change. But for the moment: C# is your best choice, IMO.

bjon045
February 20th, 2011, 10:37
Java would be your best bet. Many java libs have been ported to Android so there is a fair chance your Java games can run on Android.

i.e. http://slick.cokeandcode.com/

The best thing about Java (apart from also preparing you for Android) is that if it all goes belly up you can still find a job in Business world.

pibbur
February 20th, 2011, 10:46
Java would be your best bet. Many java libs have been ported to Android so there is a fair chance your Java games can run on Android.

i.e. http://slick.cokeandcode.com/

The best thing about Java (apart from also preparing you for Android) is that if it all goes belly up you can still find a job in Business world.

Java is a good language. Personally I don't like it, but that's entirely personal and not completely rational. I think it's ugly. 'nuff said.

I still would recommend C#/visual studio becuase that's IMO the easiest way to get into programming. You can still learn Java later if you want.

And a c#/.net background is also a way into Business programming. C# is widely used, because it integrates very well with the major databases like Oralce and Microsoft SQL Server, and software integration solutions like Biztalk.

If you want to go for Java, Bruce Eckel has written a fairly good book: Thinking Java, which he has made freely available online at http://www.mindviewinc.com/Index.php. You will also find a similar book on C++ there.

hishadow
February 20th, 2011, 10:47
My point is, learning programming is a huge distraction if your intent is to design a game. Maybe you should describe a little what you'd like to achive, gumbomasta?

pibbur
February 20th, 2011, 10:53
My point is, learning programming is a huge distraction if your intent is to design a game. Maybe you should describe a little what you'd like to achive, gumbomasta?

I can agree with the above, it really depends on what you want to do. And, starting with a mod may be a more gentle introduction to game design (it depends how well design the modding tool is, I guess).

Then, if you find yourself dedicated, go for the languages.

GothicGothicness
February 20th, 2011, 12:07
It all depends on what you want to do, and what your target is.

If you get more specific I can give you more detailed advice. As I am certainly an expert in this area.

If you want to make a game which works on many platforms with fairly modern graphics.... unity 3d is the way to go. You can either use javascript/ruby or scripting languages or C# for it.

If you want AAA quality UDK is more or less your only choice currently, in which case you'll be writing your RPG in unreal scrip and using kismet ( visual editor ).

If you want to make something completely unique, you could go with Ogre or Torque ( both C++ ).

To try to develop your own RPG from scrach... unless you are aiming at simple 2d graphics or text.. this is not an option.

pibbur
February 20th, 2011, 13:29

To try to develop your own RPG from scrach… unless you are aiming at simple 2d graphics or text.. this is not an option.

Unless you are like me who REALLY love to program using bare bones Win32 API, DirectX API and OpenGL API.

But then I'll (probably?) never finish a game in the first place. (Except for the one I created in 1985 as a present for my oldest daughter).

What GG says makes sense. Unless you are like me who REALL... Oh, sorry. Already said that.

wolfing
February 20th, 2011, 16:09
I still prefer visual basic to start :) instructions are somewhat readable (not like C) and you don't have to worry about all the micro-management (pointers and what not). When I graduated from college, if I had heard myself saying what I just said, I would have committed suicide. To me C was king and everything else was rubbish, but really, Basic is an easier language to comprehend (and does pretty much anything you need). And if you use .NET, you could learn with VB and branch to C# seamlessly, in fact, you could rewrite a module from VB to C# and your application won't even notice the difference.

gumbomasta
February 20th, 2011, 16:33
Thanks for all the suggestions.

I've narrowed down the engine I want to use: Unity3D, because it's visually appealing and can work across several different platforms. And it's free.

I was inspired by this game, Fract (http://richardeflanagan.com/lab/10-fract-beta-come-and-play). Even though it has little to do with RPG mechanics, I'm impressed by what was achieved in terms of atmosphere, elegance and ingenuity, using the Unity3D engine.

As for a language, I may delve into either C# or Javascript. We'll see. Unity seems to recognize both languages.

As for gameplay concept, I was really inspired by the discussion that went one at the "Why Can't We Have more TB RPGs" thread a few days back. It further galvanized me to want to bring a WEGO style combat system to an RPG, not unlike the game Frozen Synapse (http://www.frozensynapse.com). I would want to layer that sort of combat engine, which requires strategic use of movement, timing and spacial awareness, with RPG mechanics and character abilities.

Frozen Synapse, from what I've gleaned, happens to be powerd by the Torque Engine, and it has two or three guys working on it.

For now, though, I simply want to have that basic combat tech demo down that will use its WEGO system. The RPG Kit for Unity (http://rpg-kit.com/) seems like one person's way into getting an rpg combat system working in Unity, but I'd be open to study this and bend it to my own whims. Once that core combat mechanic is solid, i think it can be a strong foundation for any RPG universe / story / world that could be built around it. For now, though, the focus is on that core combat design.

My expectations for this game concept are truly modest, as are my abilities to pull it off, but it's still an idea that hasn't stopped nagging at me. I want to zero in on the smartest way, given my limited coding experience and time resources, to explore whether I can make it a reality.

thanks,
g

Gorath
February 25th, 2011, 20:43
edit:
Deleted. Didn't make much sense. ;)

gumbomasta
February 26th, 2011, 02:39
@gorath,

curious to see what you wrote anyway ;)

Lucky Day
February 26th, 2011, 03:59
I got back into programming with the NWN Toolset. Its not Object Oriented, but its close. Its a C like language and the 3D Object can be used like OO.

If you are looking to design RPG games everything is right there for you - powerful scripting tools, conversation editor, quest journal..etc. etc.

I wouldn't recommend the NWN2 Toolset as its just not that intuitive. I haven't tried Dragon Age. I did look at the Morrowind toolset many years ago.

Thaurin
March 2nd, 2011, 21:34
Everything pibbur and GothicGothicness said is true. That said, and I have no experience with engines, *proper* programming/design does take an unusually long time to train yourself in. The thing is, those years of experience does get your brain into a way of thinking that three months usually just does not deliver.

But of course there have been some people doing amazing things in short time (and lots more people that have thrown together truly horrible piles of ugly, unstructured, unmaintainable code that actually, for some reason, seems to work).

I deal with some of the latter at work sometimes. :(

pibbur
March 2nd, 2011, 21:46
From one of the posters at the Codeproject Lounge (yesterday):

"Just came across this comment in another programmer's code:

/* This method is a total disaster. It works, but stepping through it is a nightmare. The original
* programmer and God are probably the only ones who understand it. ENTER AT YOUR OWN RISK!!! */

Gave me a much needed chuckle this morning. Unfortunately, I now need to enter this method to perform some maintenance. Wish me luck! Big Grin | :-D "

blatantninja
March 2nd, 2011, 22:23
I think about 50% or more of the code I have written in my career should begin with that warning.

I'm 100% self-taught from a combination of books, message boards and experimentation. Which probably produces the absolute worst type of programmer. I'm slowly getting better though. I've finally trained myself to comment the vast majority of my code so I at least know what the line is supposed to be doing, but I have a long way to go before anyone will ever think my code is pretty!

hishadow
March 3rd, 2011, 08:47
I learned C++ while in school and had a great time with it while learning graphics using OpenGL. I don't use it anymore though since it was too low level. Your comments about ugly code though reminded me of the general opinion many have of the C++ language. I was a bit surprised to discover that later on. Even programming language designers loath it and regard it as a mishmash of concepts bolted to eachother by ducktape. I've come to agree that it takes considerable dicipline to create good code in that language. The upshot is that it enables you to learn languages like Java and C# much easier. Too bad though they're so tied to their respective vendors. Java seems to be over the hill. C# seems like a great choice if you want to work exclusively on the Microsoft platform.

Arhu
March 3rd, 2011, 08:47
"Just came across this comment in another programmer's code: (snip)

Hehe. In a related vein, I'm working with code that follows no coherent style whatsoever. Think random indentation, no line length limit including as much code in one line as possible, and so on. A nightmare. Caused me to make the following quote one of my favorites:

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
- John F. Woods

SirJames
March 3rd, 2011, 13:02
Try Game Maker 8

It has enough power to make the very greatest of 2D RPGs but is the easiest to learn.

It's also got multiplayer TCP/IP play so if you're good enough you can make your game co-op. Many people swear by 32dll if you're getting into multiplayer search the forums for that.

It has a scripting language, but you can get started just using drag and drop command icons and build them like a flowchart.

The community is huge and theres millions of games ppl have made and put up the source code for that you can copy and learn from.

blatantninja
March 3rd, 2011, 13:28
Hehe. In a related vein, I'm working with code that follows no coherent style whatsoever. Think random indentation, no line length limit including as much code in one line as possible, and so on. A nightmare. Caused me to make the following quote one of my favorites:Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
- John F. Woods

That is awesome.

Thaurin
March 3rd, 2011, 14:15
I'm 100% self-taught from a combination of books, message boards and experimentation. Which probably produces the absolute worst type of programmer. I'm slowly getting better though. I've finally trained myself to comment the vast majority of my code so I at least know what the line is supposed to be doing, but I have a long way to go before anyone will ever think my code is pretty!

Learning all the features of a good object-oriented programming language and using those features when it makes sense goes a long way! Knowing when to subclass, use delegates, abstraction, encapsulation, private/public/protected properties and methods, interfaces, etc. If you understand all those concepts (and possibly some of the common design patters), then you're more than half-way there! And I know *I* really should learn to do all that stuff much better than I do now!!

(Of course, re-reading that, this basically means that you design your software well, probably before even writing one line of code.)

pibbur
March 3rd, 2011, 15:45
Agreed.

Fortunately (IMO) object oriented programming makes it easier to structure your program well (as long as you know how to use the features, of course)

public Pibbur(){this.name="Pibbur";}

Thaurin
March 3rd, 2011, 19:43
One good thing about OO is that you can have a terribly implemented class, but so long as the public interface to it makes sense, that does not kill the entire software as long as the class does what it is asked. You can easily rewrite the implementation part later. Just make sure that everything that needs to be public (that other parts of the game need to know about or use) makes sense and is laid out well.

But then some people go and *STILL* lump EVERYTHING in one horrifying class as if it were a procedural language and complain that stuff is hard or does not work. :(

Anyway, I've always thought that OO programming must be a perfect fit for game development (there are *so* many objects in any game!). I want to try that out some day, see if something so complex can really be made simple through OO.

public Zombie(int hitPoints, bool feedingFrenzy) : Monster(hitPoints)
{
HitPoints = hitPoints;
Speed = feedingFrenzy ? 10 : 6;
}

:)

BillSeurer
March 3rd, 2011, 20:25
public Zombie(int hitPoints, bool feedingFrenzy) : Monster(hitPoints)
{
HitPoints = hitPoints;
Speed = feedingFrenzy ? 10 : 6;
}

Passing in boolean values to control the flow of a function is considered bad design. Tsk tsk.

DArtagnan
March 4th, 2011, 09:57
One good thing about OO is that you can have a terribly implemented class, but so long as the public interface to it makes sense, that does not kill the entire software as long as the class does what it is asked. You can easily rewrite the implementation part later. Just make sure that everything that needs to be public (that other parts of the game need to know about or use) makes sense and is laid out well.

But then some people go and *STILL* lump EVERYTHING in one horrifying class as if it were a procedural language and complain that stuff is hard or does not work. :(

Anyway, I've always thought that OO programming must be a perfect fit for game development (there are *so* many objects in any game!). I want to try that out some day, see if something so complex can really be made simple through OO.

public Zombie(int hitPoints, bool feedingFrenzy) : Monster(hitPoints)
{
HitPoints = hitPoints;
Speed = feedingFrenzy ? 10 : 6;
}

:)

You would throw quite a few cats at me, if you saw my code!

I'm still stuck way too much in the procedural mindset - and I'm having the hardest time adapting to OO - but I'm learning as I go.

Fortunately, I don't mind redoing things over and over - as that's how I've always worked :)

Thaurin
March 4th, 2011, 10:02
Passing in boolean values to control the flow of a function is considered bad design. Tsk tsk.

It's the constructor, so I can initialise the zombie with a feeding frenzy.

Zombie newZombie = new Zombie(25, true);

Not that I'm terribly good at good design. :)

P.S. Why is that considered bad design?

GothicGothicness
March 4th, 2011, 10:04
My advice is to learn about design patters, save time and creates high quality code.


P.S. Why is that considered bad design?

Imagine the zombie having lots of different modes later... and you pass a boolean for each... this would quickly become messy.

hishadow
March 4th, 2011, 10:57
I'm still stuck way too much in the procedural mindset - and I'm having the hardest time adapting to OO - but I'm learning as I go.
Javascript has some good OO characteristics. It's different from how C++/Java/C# work but is much easier to understand. A class in those languages are viewed as "meta" information, whereas in Javascript a class is just an object which can be accessed and updated like any regular object. It uses a technique called prototype inheritance which I think is pretty neat.

DArtagnan
March 4th, 2011, 11:03
Javascript has some good OO characteristics. It's different from how C++/Java/C# work but is much easier to understand. A class in those languages are viewed as "meta" information, whereas in Javascript a class is just an object which can be accessed and updated like any regular objects. It uses a technique called prototype inheritance which I think is pretty neat.

Hmm, I'm using XNA - because it's very useful and efficient for handling graphics and I'm very happy with Visual Studio Express and C#.

So, I'm quite comfortable with my solution - and I know it's more about me being stuck in ancient-land - than the language not being suited for the project.

Truth be told, I was never interested in becoming a programmer - and I'm only doing it out of having no other choice.

But, I have a relatively easy time learning and I'm good with coming up with creative solutions.

The advantage of doing a game like the one I'm doing, is that performance won't be much of an issue. It's not going to be a game with a ton of things going on at run-time - and since combat will be turn-based, it's not a problem that I don't optimise so well.

Thaurin
March 4th, 2011, 12:27
My advice is to learn about design patters, save time and creates high quality code.

Yeah, I know some obviously, but never read the book cover to cover…

Imagine the zombie having lots of different modes later… and you pass a boolean for each… this would quickly become messy.

Oh yeah, I wrote a static function once to generate and send an email, that had like twenty parameters. :P I probably should have created a class for all that or something. But it works. :P

I'm still stuck way too much in the procedural mindset - and I'm having the hardest time adapting to OO - but I'm learning as I go.

I can't imagine being stuck in procedural thinking using a object-oriented language and framework! I mean, everything the language offers in terms of features, libraries, etc. are object-oriented, how do you even abuse that procedurally? :P

Make one object and do everything from there?

Zloth
March 5th, 2011, 23:11
If you are actually wanting to break into the game industry to program, I think C++ is the end-all-be-all. A better plan may be to learn a Visual Studio.Net language, earn a good bit of money from the business community, and use that cash to pay other people to write games for you in C++.

Imagine the zombie having lots of different modes later… and you pass a boolean for each… this would quickly become messy.
Don't be silly, who would do that? You just pass a 32-bit integer and use each bit in the number as one of your flags! <grinning, ducking, running>

Though that bit about design is an important one - it's probably the most often flubbed thing out there. The biggest problem is folks who just have no clue about how to design things well but there are also folks who seem to know the design rules but have no clue why they are there. They're the ones who will make half a dozen classes to write a Hello World program and give an interface to each class.

What will REALLY drive you nuts, though, are the people who use perfectly good designs - just not the designs that fit your own tastes. Then you've got no excuse to re-write the entire program! Oh the pain....

pibbur
March 6th, 2011, 00:41
...
What will REALLY drive you nuts, though, are the people who use perfectly good designs - just not the designs that fit your own tastes. Then you've got no excuse to re-write the entire program! Oh the pain….

I feel your pain, friend! I've been there.

Why don't you come with me to a Programmers Anonymous meeting?

DArtagnan
March 6th, 2011, 10:52
I can't imagine being stuck in procedural thinking using a object-oriented language and framework! I mean, everything the language offers in terms of features, libraries, etc. are object-oriented, how do you even abuse that procedurally? :P

Make one object and do everything from there?

Well, I just pretty much ignore everything smart and do it in the most slavelike moronic way you can imagine :)

I'm using XNA - which has a very procedural-looking class called "game1.cs" pr. default. Everything in that class reminds me of a standard procedural structure - so I guess that's why I've had an easier time adapting to it.

To me, at this stage - it's about getting all the basic functions working before I go about actually designing the code in a smart way. I have to make the game do what I want it to do, so I know it's possible for me, and I'm just the kind of person who NEEDS to see it working. I can't sit down and study all the time, because I have a ton of work that needs to be done - beyond just the code.

It's the only way I can accomplish anything, as I've never learned object oriented code from the ground up. In fact, I've never actually read any books about it - so I really have no idea what I'm doing half the time.

Yet, I've managed to make a simplistic engine - where a "dungeon map" object holds tiles (also objects) that I draw based on position and facing. It works :)

At the moment, I'm trying to figure out the best way of drawing objects (physical objects) on specific tiles - and I'm using a "tile class" containing information about the kind of tile (wall, floor, etc.) and I'm probably going to use multi-dimension arrays for decorations, and some kind of an array for the items.

I have to figure out what objects on what sides of what tiles to include in the draw function - depending on position and facing, as I'd like to do just a little optimising.

So that's what I'm struggling with atm :)

Maylander
March 8th, 2011, 13:57
Fortran!

Jokes aside, if you're serious about programming - stick with any OO language and pick up a book as thick as a brick, then work your way through. It will no doubt take a considerable amount of time, but I honestly don't see a simple way of learning proper programming from scratch. There are no short cuts to understanding programming.

Either that or use some sort of toolset with a graphical interface, specifically designed to make games or mods. They often require you to do basic scripting (triggers and so on), but no more than that.