Author Topic: Where to start?  (Read 25458 times)

MeowMeow_Prince

  • Newcomer
  • Posts: 4
  • Karma: +0/-0
    • View Profile
    • Email
Where to start?
« on: January 31, 2014, 04:14:01 AM »
I would like to start making my own RL, But don't know where to start
if possible I would like someone to point me in the right direction

- I have previous experience in C++ and other languages and am also willing to learn a new language to do this.

Aukustus

  • Rogueliker
  • ***
  • Posts: 440
  • Karma: +0/-0
    • View Profile
    • The Temple of Torment
Re: Where to start?
« Reply #1 on: January 31, 2014, 07:09:23 AM »
I started developing my roguelike in Python, of which I had actually no previous experience. I was taught C# at my school but Python isn't that much different language.

There's this nice tutorial on roguebasin. I took the final code from this and started adding stuff to it.
http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod

NON

  • Rogueliker
  • ***
  • Posts: 349
  • Karma: +0/-0
    • View Profile
    • Infra Arcana
    • Email
Re: Where to start?
« Reply #2 on: January 31, 2014, 08:12:14 AM »
When I started, I had *no* experience with C++, only some GameMaker (and an ADA-course).

I used SDL, and followed these excellent tutorials for making a simple SDL game:
http://lazyfoo.net/SDL_tutorials/

I think it worked out well for me. I just tried to get a game running, and learned more C++ concepts as I  went along.

I had no idea how other roguelikes were made, I invented my own solutions for everything, which was more fun at first. Of course I made lots of horrible mistakes1, and I've had to refactor things over and over. But it was a good learning experience.

1In the very beginning, the map was an array of integers. These integers represented different terrain types. So maybe 0 was floor, 10 was wall, 20 was grass, etc. These were only referred to by their integer value throughout the code. For example when the map generator created a room, it put a bunch of zeroes in a rectangular area. When the player was walking, the game checked that the cell you attempted to walk into was != 10. I had text files on my hard drive which listed the integers, and which terrain they represented!!! This was before I even knew about enumerated types....

Now after two C++ courses, and several thousand hours of programming, my code looks very different :D
Happy is the tomb where no wizard hath lain and happy the town at night whose wizards are all ashes.

reaver

  • Rogueliker
  • ***
  • Posts: 207
  • Karma: +0/-0
    • View Profile
Re: Where to start?
« Reply #3 on: January 31, 2014, 10:57:58 AM »
Depends on your programming approach:
  • Top to bottom: Get the source from one of the many open-source RLs out there, tinker and change stuff.  Or start from libtcod.
  • Bottom to top: Start with mini prototypes, e.g.
    • generate a map
    • do some pathfinding
    • do some los/fov
    • do some ai
    • add some stats
    • instantiate monsters out of the stats
    and so on and so forth. Again, you could check libtcod for some of the above bits if you don't fancy doing everything yourself.
You could also follow this: http://www.roguebasin.com/index.php?title=How_to_Write_a_Roguelike_in_15_Steps or other nice articles in RogueBasin.

I don't think there's a universally right direction, just find what's right for you in terms of not abandoning the project, not losing motivation and getting things done.

Quendus

  • Rogueliker
  • ***
  • Posts: 447
  • Karma: +0/-0
  • $@ \in \{1,W\} \times \{1,H\}$
    • View Profile
    • Klein Roguelikes
Re: Where to start?
« Reply #4 on: January 31, 2014, 11:42:14 AM »
Take the quickest route possible to basic user interaction.  "@ walking around a map" is a common phrase, but of course it might be a sprite. Once you have a game you can play, you can start adding other things to the game. The 15 steps article is good; I followed it loosely when I made my first roguelike. Of course you can skip a lot of steps and do the last five steps in any order.

I prefer SFML or libtcod as a display library, but if you do use SDL I would second the recommendation of the tutorials on lazyfoo.net.

For languages, go with whatever you're most comfortable or fluent with. Writing a roguelike can be a complex task and it's easier not to combine it with learning a whole new language.

Pickledtezcat

  • Rogueliker
  • ***
  • Posts: 62
  • Karma: +0/-0
    • View Profile
    • Pickledtezcat Game Development Blog
Re: Where to start?
« Reply #5 on: January 31, 2014, 03:15:30 PM »
I'm only part way through my own game but I'd say its a good idea to start with the level generator before combat or ai or magic or other things.
That can be one of the hardest parts because if the level generation isn't convincing or interesting the game probably won't be either. In a randomized game world the level layout is your "plot". How you move through the level is what shapes your gaming experience. If the map is too random the player may feel lost or bored, not random enough and it gets repetitive very quicky.

Placing rooms is just a start. How will you populate and decorate those rooms so they're not just empty rectangles? Will you have keys for doors? How can you keep one area secure while making sure the required key is not inside? will you have puzzles? They are a big part of rpgs but randomized puzzles are not easy to program without a lot of planning.
Anyway, I agree with most of the 15 steps but I think random level generation is something worth investing in early on.

on the otherhand you may want to get a working game first an leave perfecting procedual generation until later.
A blog about my 3d Roguelike: http://pickleddevblog.blogspot.kr/

guest509

  • Guest
Re: Where to start?
« Reply #6 on: January 31, 2014, 04:59:28 PM »
If I were to start today I'd go for python and libtcod.

The reasoning is that
1. Easy to learn, trivial if you have any other programming experience.
2. Lots of code to look at already.
3. Common programming language you might use later in professional life.

I DO NOT recommend any of the game engines to start out. Like Gamemaker or Construct. Not for Roguelikes. I use Gamemaker but I learned to program first. It's not built well for turn based games, though it's doable.

Unity would be good to use and learn if you were looking to make 3D games. In fact if you want 3D that's pretty much the only way to fly from what I've been told. But again, learn to program before you jump into that.

There's also the T-Engine used to make TOME4. Some people like that one, it uses LUA files and has a lot of common Roguelike things already implemented.

CrowdedTrousers

  • Newcomer
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Where to start?
« Reply #7 on: January 31, 2014, 10:30:59 PM »
I had aspirations for a long while, but I hadn't programmed in anger since Uni.  Late last year I stumbled across Jotaf's python tutorial (the one Aukustus links to).  Within four-ish days I had it up and going and enough of a handle on Python that I was adding my own content and mechanisms.  I find Python easy to prototype in so I can rapidly implement ideas and see what they looked like.  Now my project is almost un-recognisable from the tutorial.

CaptainKraft

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: Where to start?
« Reply #8 on: March 12, 2014, 05:56:35 PM »
I would like to start making my own RL, But don't know where to start
if possible I would like someone to point me in the right direction

- I have previous experience in C++ and other languages and am also willing to learn a new language to do this.

Someone already mentioned using libtcod and following the Python tutorial on RogueBasin. Since your experience is in C++ I would recommend trying out Code::Umbra's tutorial since it is based in C++. This way you won't have to learn the nuances of Python to get up and running quickly.

Also make sure you frequently reference the libtcod docs.
Build a man a fire, and he'll be warm for a day.
Set a man on fire, and he'll be warm for the rest of his life.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Where to start?
« Reply #9 on: March 12, 2014, 10:14:41 PM »
Don't read tutorials. They are not games and often written by poor programmers.

Look at the source code of actual games, good ones, and try to figure out how it works.

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: Where to start?
« Reply #10 on: March 12, 2014, 11:23:36 PM »
If your thinking about "where to start" involves musing over whether you need to learn a new programming language, you're light years away from doing anything serious with computers (although I'm sure you can find people who will tell you writing a roguelike game doesn't qualify on that count). You need to find an excuse to write a real program (something at least several thousand lines long that performs a commensurately nontrivial task), maybe something for school or whatever. When you're done with that, you'll be able to decide what more, if anything, you need to know to be able to program a roguelike game or something like one.

CaptainKraft

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: Where to start?
« Reply #11 on: March 13, 2014, 12:21:44 AM »
Don't read tutorials. They are not games and often written by poor programmers.

Look at the source code of actual games, good ones, and try to figure out how it works.

I think this is (mostly) good advice. Some people learn very well from tutorials, but if they don't help you improve, you should definitely avoid them.

Reading source of other games can also be very valuable. That and learning how to really understand official documentation will go a very long way.

If you want to jump right to learning the best way possible (although, may be a bit slower learning) then go to the docs and examples of GOOD source code.
Build a man a fire, and he'll be warm for a day.
Set a man on fire, and he'll be warm for the rest of his life.

CaptainKraft

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: Where to start?
« Reply #12 on: March 13, 2014, 12:25:34 AM »
If your thinking about "where to start" involves musing over whether you need to learn a new programming language, you're light years away from doing anything serious with computers (although I'm sure you can find people who will tell you writing a roguelike game doesn't qualify on that count). You need to find an excuse to write a real program (something at least several thousand lines long that performs a commensurately nontrivial task), maybe something for school or whatever. When you're done with that, you'll be able to decide what more, if anything, you need to know to be able to program a roguelike game or something like one.

As a computer science student I'd like to advise against this*. You will definitely learn a lot when writing "real programs" or learning via college courses, but you won't be learning how to make games. In fact, you will learn a lot of things that are either completely useless in making games or detrimental when making games. If you want to learn to make games, there is only one way to do that: make games.

*My advice is given in a black and white format but there are always exceptions. I just don't want you to think that you need a college course or that you need to write generic software in order to learn. You absolutely do not need to do those things.
Build a man a fire, and he'll be warm for a day.
Set a man on fire, and he'll be warm for the rest of his life.

ekolis

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 186
  • Karma: +0/-0
  • get ye dennis
    • View Profile
    • Ed's home page
    • Email
Re: Where to start?
« Reply #13 on: March 13, 2014, 01:33:15 AM »
If your thinking about "where to start" involves musing over whether you need to learn a new programming language, you're light years away from doing anything serious with computers (although I'm sure you can find people who will tell you writing a roguelike game doesn't qualify on that count).

He didn't say he's completely new to programming; he said he has previously used C++, and asked if other languages would be more suitable for roguelike development.

And as for that question, MeowMeow_Prince, I'd say if you're familiar with C++, then go ahead and use it. There's really no "preferred" language for roguelike development; everyone uses what they're most comfortable with. I personally can't stand C++, but then that's just me ;)
The Ed draws near! What dost thou deaux?

>EAT SANDVICH

Zireael

  • Rogueliker
  • ***
  • Posts: 604
  • Karma: +0/-0
    • View Profile
Re: Where to start?
« Reply #14 on: March 13, 2014, 09:23:50 AM »
If you want to learn programming, sure, start from scratch in Python or C or whatever floats your boat.

If you want to see results speedily without having to do "@ moving around" stuff, you could use T-Engine. It's Lua-based, really powerful and allows you to dig in immediately.