Bay 12 Games Forum

Please login or register.

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

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

The Watcher

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #720 on: October 07, 2012, 06:15:21 am »

If you want to be productive with a newly picked up language, I don't see why one would pick C++.

Also, what's your bone with C++ (as in bone to pick)? C# and Java are just different from C++. None of them are more "hardcore" nor is any one especially inefficient. Different feature sets, that's all.
Logged

MorleyDev

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

None of them are more "hardcore" nor is any one especially inefficient. Different feature sets, that's all.

Well...it's more "none are inefficient for their best case usage". C++ is inefficient in terms of programming time compared to other languages, but can produce extremely efficient code when done right (of course doing it wrong will always produce inefficient code, regardless of the language), whilst languages like C# and Java are inherently often slower because of a wide variety of reasons, but typically used where the advantages outweigh the inefficiencies from a lack of control (which can result in a net gain from a business perspective). Moore's law allows programmers and tools to have these little inefficiencies without it causing any problems.

Of course all languages have little quirks that annoy the coders (though most programmers who use the language too much seem to develop stockholm syndrome...).
« Last Edit: October 07, 2012, 06:23:51 am by MorleyDev »
Logged

The Watcher

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #722 on: October 07, 2012, 06:22:24 am »

Hmm... I considered efficiency as the sum of speed (of the code) and productivity :P

But yeah, what I was getting at.
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #723 on: October 08, 2012, 12:43:59 pm »

I seem to be having some basic trouble with Python.  Like... how do you actually do anything meaningful?  I've looked at tutorials and they're like "Type this into the IDLE and hit enter" and I'm like "That doesn't do anything to let me save a file, or even write across multiple lines."  Sure, it shows that it works, but it doesn't show how to make an actual program.

Mephisto

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #724 on: October 08, 2012, 01:08:53 pm »

I seem to be having some basic trouble with Python.  Like... how do you actually do anything meaningful?  I've looked at tutorials and they're like "Type this into the IDLE and hit enter" and I'm like "That doesn't do anything to let me save a file, or even write across multiple lines."  Sure, it shows that it works, but it doesn't show how to make an actual program.

Have you looked at Dive Into Python? That's one of the sources I learned from.
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #725 on: October 08, 2012, 01:33:39 pm »

As with others, that actually doesn't tell you how to start from scratch.  A friend on Steam chat gave me the super-secret password - press Ctrl-N to actually start writing!

Now I'm having trouble importing a module.  http://roguebasin.roguelikedevelopment.org/index.php/Complete_Roguelike_Tutorial,_using_python%2Blibtcod,_part_1 - cannot get this to run without crashing.  Keeps giving errors that the module doesn't contain any function.

EDIT: Appears that's a tad out of date.  libtcod has different functions in 1.5.1 as it does in 1.5 - namely console_set_foreground_color is now console_set_default_foreground and similar annoying word differences.
« Last Edit: October 08, 2012, 01:40:37 pm by Girlinhat »
Logged

da dwarf lord

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #726 on: October 08, 2012, 02:49:10 pm »

As with others, that actually doesn't tell you how to start from scratch.  A friend on Steam chat gave me the super-secret password - press Ctrl-N to actually start writing!

Now I'm having trouble importing a module.  http://roguebasin.roguelikedevelopment.org/index.php/Complete_Roguelike_Tutorial,_using_python%2Blibtcod,_part_1 - cannot get this to run without crashing.  Keeps giving errors that the module doesn't contain any function.

EDIT: Appears that's a tad out of date.  libtcod has different functions in 1.5.1 as it does in 1.5 - namely console_set_foreground_color is now console_set_default_foreground and similar annoying word differences.

And a warning for the future, the new version of libtcod has different mouse functions so when you get to that you may have some trouble :)
Logged

postal83

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #727 on: October 08, 2012, 02:51:56 pm »

Been working on this roguelike for a few weeks now.  Just been getting into the procedural map generation stuff.  Ensuring that rooms are all connected is proving to be a LOT harder than I thought  :-X
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #728 on: October 14, 2012, 11:12:21 am »

So, blundering along here.  Anyone know off-hand how to add A* pathing or similar to a Python game?  The tutorial I've been picking over has an example of rather poor pathing, where monsters just take the next step closer to you and would be defeated by a corner or pillar.

Mephisto

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #729 on: October 14, 2012, 11:38:22 am »

So, blundering along here.  Anyone know off-hand how to add A* pathing or similar to a Python game?  The tutorial I've been picking over has an example of rather poor pathing, where monsters just take the next step closer to you and would be defeated by a corner or pillar.

libtcod apparently has A* built-in. I've barely used the library myself, so I can't really answer how you would use it. You can choose between A* and Dijkstra (Click the check boxes at the top of the screen to add code samples for your language(s) of choice).

The problem with that is that it seems you would have to use the entire FOV module to do so. That may not be a problem if that's what you want.
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #730 on: October 14, 2012, 11:44:48 am »

I'm... afraid I don't quite follow how to implement that :s

Mephisto

  • Bay Watcher
    • View Profile
Re: The Roguelike Development Megathread
« Reply #731 on: October 14, 2012, 12:00:44 pm »

Neither do I. Assuming libtcod 1.5.1, you could check the file "samples_py.py" starting at line 719 to see how the sample app implemented it.
Logged

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #732 on: October 14, 2012, 12:29:20 pm »

Yeah, but the examples are a little poorly commented.  I'm sure it makes sense to someone who knows what they're looking at, but if you already know it then why do you need it?

The Rookie

  • Escaped Lunatic
    • View Profile
    • The Rookie
Re: The Roguelike Development Megathread
« Reply #733 on: October 14, 2012, 04:37:28 pm »

Yeah, but the examples are a little poorly commented.  I'm sure it makes sense to someone who knows what they're looking at, but if you already know it then why do you need it?

Here you go:
Code: [Select]

    # Create path.
    path = lib.path_new_using_map(fov_map, 1.41)

    # Compute path.
    lib.path_compute(path, obj.x, obj.y, target.x, target.y)

    testx, testy = lib.path_walk(path, False)

    # Make sure tile isn't blocked by any other objects.
    if not is_blocked(testx, testy):

        obj.x, obj.y = testx, testy


Be sure to check out this as well. Really in-depth documentation on libtcod. Good Luck!

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: The Roguelike Development Megathread
« Reply #734 on: October 14, 2012, 04:45:13 pm »

Again, that's... kind of only useful if you know what it already is...
Code: [Select]
    # Create path.
    path = lib.path_new_using_map(fov_map, 1.41)
I only know that 1.41 is the cost of a diagonal move by the info on another page.
Code: [Select]
    # Compute path.
    lib.path_compute(path, obj.x, obj.y, target.x, target.y)
I really have no idea what this actually does.  I mean, I can see that it's your starting position and your target position, but I don't know what it does and that would be really helpful if I want to use it reliably.
Code: [Select]
    testx, testy = lib.path_walk(path, False)
I really have no idea about this one at all.  Where did testx and testy come from?  What is this doing?  What is False?
Code: [Select]
    # Make sure tile isn't blocked by any other objects.
    if not is_blocked(testx, testy):

        obj.x, obj.y = testx, testy
Same as above, I've gotten lost now.

Examples are mediocre.  Examples with comments about what they're doing are what matters.  It's like watching traffic and trying to understand how to drive - you get the idea that it goes forward and it has something to do with the wheels, but until you're actually told what the variables do then you have no idea what numbers to plug in.
Pages: 1 ... 47 48 [49] 50 51 ... 72