Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 46 47 [48] 49 50 ... 72

Author Topic: The Roguelike Development Megathread  (Read 245551 times)

dennislp3

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #705 on: October 05, 2012, 08:57:55 pm »

So my understanding...for learning to make a C++ RL I should learn the language basics then convert a tutorial on my own? I suppose that would be even better in the long run cause I will learn more.... sorta like reading pseudo code and making it code eh?
Logged

Anvilfolk

  • Bay Watcher
  • Love! <3
    • View Profile
    • Portuguese blacksmithing forum!
Re: The Roguelike Development Megathread
« Reply #706 on: October 06, 2012, 03:56:36 am »

This has probably been discussed to death, but why use C++ at all? Since so many projects end up dying from not enough developer interest, why not go for a language that allows you to program quick and fast instead of battling the compiler and obscure errors? It's not like roguelikes need that much processing power...



Also, what kind of gameplay ideas could a roguelike in the Nausicäa world have?

a1s

  • Bay Watcher
  • Torchlight Venturer
    • View Profile
Re: The Roguelike Development Megathread
« Reply #707 on: October 06, 2012, 06:02:19 am »

No reason whatsoever. proof (though to be fair, only Pascal and Java RLs are in the "production/stable" category)
Logged
I tried to play chess but two of my opponents were playing competitive checkers as a third person walked in with Game of Thrones in hand confused cause they thought this was the book club.

alexandertnt

  • Bay Watcher
  • (map 'list (lambda (post) (+ post awesome)) posts)
    • View Profile
Re: The Roguelike Development Megathread
« Reply #708 on: October 06, 2012, 09:03:35 am »

This has probably been discussed to death, but why use C++ at all? Since so many projects end up dying from not enough developer interest, why not go for a language that allows you to program quick and fast instead of battling the compiler and obscure errors? It's not like roguelikes need that much processing power...

I agree. C++ while powerful, is not exactly the most straight forward language to learn, nor is it the most "productive". If someone is starting out learning programming is can be quite unmotivating since the errors it can produce can be very difficult to work out the meaning of.

And also since everyone who starts out learning C++ just ends up writing C code for quite some time anyway (until such things as the STL are discovered etc).

So my understanding...for learning to make a C++ RL I should learn the language basics then convert a tutorial on my own? I suppose that would be even better in the long run cause I will learn more.... sorta like reading pseudo code and making it code eh?

If you are starting out and learning to code, it might be good to start with a language other than C++ (eg Python, Lua etc). It is not so much about learning one specific language, but learning the logic of programming, and how to program in general. Once you start to develop this, transitioning to C++ should be infinitely easier than starting out with it.
Logged
This is when I imagine the hilarity which may happen if certain things are glichy. Such as targeting your own body parts to eat.

You eat your own head
YOU HAVE BEEN STRUCK DOWN!

dennislp3

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #709 on: October 06, 2012, 01:05:12 pm »

I am picking up Python as well but I primarily want to stick with C++. My reasoning is that in due time I plan to move on from simple rogue likes and would much prefer the more powerful language be something I know...not something I wish I knew when the time comes.

Also. I figure worst case scenario I can mix code...another challenge all its own to be sure but making programs in Python and having the complex parts of it in C++ is not unheard of.

I am personally not demotivated by obscure errors and difficulties brought on by C++. I enjoy these things as I can learn from each and every one of them, and I love to do things that make me think and learn.

I have been trying to learn programming for years but I have procrastinated and not done it for too long...so now I am just buckling down and actually doing it. And that's something that won't be easy to deter me from.
« Last Edit: October 06, 2012, 01:08:13 pm by dennislp3 »
Logged

alexandertnt

  • Bay Watcher
  • (map 'list (lambda (post) (+ post awesome)) posts)
    • View Profile
Re: The Roguelike Development Megathread
« Reply #710 on: October 06, 2012, 09:52:42 pm »

I am picking up Python as well but I primarily want to stick with C++. My reasoning is that in due time I plan to move on from simple rogue likes and would much prefer the more powerful language be something I know...not something I wish I knew when the time comes.

It should be noted that most languages will do anything C++ can do, and most of them can do it more simply. It would be both easier and faster to write complex roguelikes in a simpler language.

For a simple example:

Code: (C++) [Select]
std::vector<int> MyStuff;
MyStuff.push_back(0);
MyStuff.push_back(1);
MyStuff.push_back(2);
for(std::vector<int>::iterator i = MyStuff.begin(); i < MyStuff.end(); i++){
    std::cout << "Element: " << (*i) << std::endl;
}

or if you were on drugs (or just wanted an excuse to use a lambda expression (they are so fun to use)):

Code: [Select]
std::vector<int> MyStuff;
MyStuff.push_back(0);
MyStuff.push_back(1);
MyStuff.push_back(2);
std::for_each(MyStuff.begin(), MyStuff.end(), [&](int i){
    std::cout << "Element: " << i << std::endl;
});

Could just as easily be written in Python as

Code: (Python 2.x) [Select]
MyStuff = [0,1,2]
for i in MyStuff:
    print "Element:", i


Which is infinitely more readable and simple, while accomplishing the same task.

Also. I figure worst case scenario I can mix code...another challenge all its own to be sure but making programs in Python and having the complex parts of it in C++ is not unheard of.

You can do this. This is generally only useful for speed critical parts of code, since C++ is faster than Python. But if "complex" means complex algorithms/code (not speed), than Python is more than capable of running complex code.

If you still want to start off with learning C++, then I would reccomend using the Clang compiler. It generally produces more readable error messages. Good luck and remember, don't start off with something massive and complex. Start small and work your way up.
Logged
This is when I imagine the hilarity which may happen if certain things are glichy. Such as targeting your own body parts to eat.

You eat your own head
YOU HAVE BEEN STRUCK DOWN!

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #711 on: October 06, 2012, 09:57:30 pm »

Ok, so any rundown on "how do you go from zero to roguelike in Python?"  I'm fair at C++, but it's becoming increasingly clear that the language does not want to be used.  So I've decided learning Python may be the more reliable method to start doing actual code.  But how do I start setting up a screen and moving little @'s around like it means anything?

Nistenf

  • Bay Watcher
  • The cake is a lie
    • View Profile
Re: The Roguelike Development Megathread
« Reply #712 on: October 06, 2012, 10:12:38 pm »

Logged

dennislp3

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #713 on: October 06, 2012, 11:01:57 pm »

Also. I figure worst case scenario I can mix code...another challenge all its own to be sure but making programs in Python and having the complex parts of it in C++ is not unheard of.

You can do this. This is generally only useful for speed critical parts of code, since C++ is faster than Python.

Thats the idea. I am working with Python now....this might be a good way to learn even more! mixing code sounds like a fun challenge.

As for how I am learning things right now? The great interwebs and videos. Walls of text are not always easy for me to follow unless I am really involved with them (not too often).

3dbuzz.com and lots of sights like it have plenty of good (and free) vids available.
Logged

Soadreqm

  • Bay Watcher
  • I'm okay with this. I'm okay with a lot of things.
    • View Profile
Re: The Roguelike Development Megathread
« Reply #714 on: October 07, 2012, 04:16:25 am »

For a simple example:

Code: (C++) [Select]
std::vector<int> MyStuff;
MyStuff.push_back(0);
MyStuff.push_back(1);
MyStuff.push_back(2);
for(std::vector<int>::iterator i = MyStuff.begin(); i < MyStuff.end(); i++){
    std::cout << "Element: " << (*i) << std::endl;
}

Could just as easily be written in Python as

Code: (Python 2.x) [Select]
MyStuff = [0,1,2]
for i in MyStuff:
    print "Element:", i


Which is infinitely more readable and simple, while accomplishing the same task.

You know, I can pretty much see what the Python code does without knowing the language, but the C++ is all gibberish. Do you really need all that just to put three numbers into a data structure and print them? :?
Logged

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: The Roguelike Development Megathread
« Reply #715 on: October 07, 2012, 04:26:39 am »

Alternatively using the new C++11 features
Code: [Select]
std::vector<int> myStuff = { 1, 2, 3 };
for(int i : myStuff)
    std::cout << "Element: " << i << std::endl;

Really it's about finer levels of control, which naturally adds complexity.
« Last Edit: October 07, 2012, 04:30:38 am by MorleyDev »
Logged

alexandertnt

  • Bay Watcher
  • (map 'list (lambda (post) (+ post awesome)) posts)
    • View Profile
Re: The Roguelike Development Megathread
« Reply #716 on: October 07, 2012, 05:42:47 am »

Alternatively using the new C++11 features
Code: [Select]
std::vector<int> myStuff = { 1, 2, 3 };
for(int i : myStuff)
    std::cout << "Element: " << i << std::endl;

Really it's about finer levels of control, which naturally adds complexity.

Ah yes, C++11 has added alot of nice things. Shame they dumped Garbage Collection :(
Logged
This is when I imagine the hilarity which may happen if certain things are glichy. Such as targeting your own body parts to eat.

You eat your own head
YOU HAVE BEEN STRUCK DOWN!

The Watcher

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #717 on: October 07, 2012, 05:54:02 am »

I would think more precise control of memory is a good tradeoff for garbage collection.
Logged

Anvilfolk

  • Bay Watcher
  • Love! <3
    • View Profile
    • Portuguese blacksmithing forum!
Re: The Roguelike Development Megathread
« Reply #718 on: October 07, 2012, 06:10:38 am »

Not if you want to be productive. And in a roguelike, as for a majority of applications these days (over 90%), there's no reason to prefer ultimate control and efficiency over productiveness.

Heck, if you're that serious about getting into a harder-core language, at least pick Java or C#...


Oh, and Girlinhat, pick any graphics library, learns its basics, then simply make some tiles and start drawing them on a gridded screen. That should set you up :)
« Last Edit: October 07, 2012, 06:12:36 am by Anvilfolk »
Logged

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: The Roguelike Development Megathread
« Reply #719 on: October 07, 2012, 06:13:33 am »

Smart pointers work pretty well for memory management I've found, though not having to think about them is a niceness of garbage collected languages. But the places smart pointers fall down, like circular references, isn't a problem if you've got a good design for class interactions. And as far as I'm concerned, if you have circular references there is a critical flaw in your design.

It may not be the main business language any more (C# has took that role, and is definitely one of my favourite languages. It's like Java if Java actually allowed itself to evolve. And had a decently designed standard library...) but I still recommend C++ for learning because knowing those finer grain details, working closer to the machine, helps your understanding when coding in the more removed languages.
« Last Edit: October 07, 2012, 06:17:53 am by MorleyDev »
Logged
Pages: 1 ... 46 47 [48] 49 50 ... 72