Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Kalantir

Pages: [1] 2 3
1
Programming / Re: Using -- and ++
« on: June 14, 2012, 05:32:18 PM »
the C compiler is allowed to do things in any order it wants, so it can increment first and then access the incremented value, or use the value before increment
Actually, I'm pretty sure it depends on whether you do array[++i] or array[i++].  If you do ++i, it increments first and then accesses the variable at the new iterator position.  if you do i++ it accesses the variable at the current iterator position and then increments.

Quote from: pueo
I'm thinking of transferring out of C, some things are a pain.
I couldn't even imagine myself designing a game (especially an rpg) without using the OOP features that are provided in C++.  It helps with code organization/readibility and saves you from having to do a lot of extra work.

2
Temple of the Roguelike / Roguelike Database Broken?
« on: February 27, 2011, 10:08:43 PM »
I went through and rated all the roguelikes I played, and went to leave some comments, to find that I was no longer logged in.  So I assumed my session timed out and logged back in.  I re-rated all the roguelikes I've played and went to leave a comment and found that I was once again logged out.  I logged back in, and scrolled to the bottom of the roguelike databse screen and saw that it said I was already logged out.  How do I log in to the databse?

3
Programming / Re: Const correctness trouble
« on: February 27, 2011, 06:57:40 PM »
I don't really want to break the non-const gui system

I wasn't saying you should change it to use const so that you can pass it a c_str.  I was thinking you would change it from this
Code: [Select]
function(char *input)

to pass by pointer like this
Code: [Select]
function(std::string *input)

or pass by reference like this
Code: [Select]
function(std::string &input)

It would still be non-const.

A similar approach would be to simply overload the functions so you could pass const or non const, but it sounds like you don't want to do that.

But, if copying it over to an array works without causing any noticeable loss of speed, than it really is the easiest solution

4
Programming / Re: Non-random content
« on: February 26, 2011, 08:59:30 PM »
If there is a lot of static content in the early game, like in ADOM.  I believe that one of the following things also needs to happen.

1.  The early game should be easier then is the norm for roguelikes so that we dont feel like we're doing the same exact thing repeatedly while we're getting used to the game.

2.  There should be many different paths to choose from. For example, I choose this quest it starts Quest Chain 1, but if I choose that quest, it starts Quest Chain 2.  If starting one quest chain locks off other quest chains, that gives replay value.  It might be useful to have the quest chains overlap at points if you do this.  Sub quest chains should behave similarly.

3.  Randomness.  I know we're talking about static content here, but there are different degrees of static.  Think of Omega.  You start in the same city every game.  There is always the same shops and guilds and castle and hedgemaze, but all the shops are in different buildings.  Personally, I found that approach to be annoying, but perhaps if there was a map of the town easily accessible at the beginning it would be more of a real feature(because the annoying part was having to open every door to see where all the shops were so I could then fast travel to them later).  You could even take it further than Omega and actually have the building locations change as well.  This is just one example of how randomness can still exist in static content.

Just my 2 cents...

5
Programming / Re: Const correctness trouble
« on: February 26, 2011, 08:02:58 PM »
Yes, you can't take c_str and show it with routines that don't use const parameters, can you.

Are they library functions or your own functions.  If they are your own functions you should be able to pass it by reference or pointer and deal with it from there.  If they are library functions which require (char *), you might be better off using c style strings or copying the string to a char * before passing it.

An alternative is to make your own string class which uses char * as it's underlying storage and have a function similar to c_str that returns a reference to it's own storage.  This could probably be seen as unsafe though, as private variables are only supposed to be modified by the classes member functions.  Honestly I don't even know 100% if this is possible, just an idea.

Another alternative still, if the function that takes char * is part of a library you are using, you could make a copy of the header file and change it to use std::string instead.  You could probably accomplish most of the work with a find and replace feature

Ok, I have one last idea.  You can probably modify std::string itself by adding a function which returns a char *.  It would probably be as simple as copy and paste c_str() with some slight modifications.  I imagine it probably typecasts it to const before returning it, as it's not const internally.  It's probably a matter of removing the typecast.

Just found this through google
Code: [Select]
void g (const char& c)
{
  val = f(const_cast<char&>(c));
}

It appeared to work for the person who posted the thread.  But someone warns not to use it unless you are absolutely sure it will not be altered on the other end or it could cause a fault.  This probably goes for the method of altering the string class as well

6
Programming / Re: Const correctness trouble
« on: February 26, 2011, 05:33:00 PM »
What do you mean when you say string is const only?  Are you talking about string.c_str()?

We need more info to understand what your problem is, but here is the rundown on const correctness.

Code: [Select]
class foo
{
private:
    const int bar;
    int someValue;
public:
    foo(int foobar) : bar(foobar)
    {
        someValue = 0;
    }
    int GetValue() const
    {
        return someValue;
    }
    const int GetBar()
    {
        someValue++;
        return bar;
    }
};

Ok, clearly this class doesn't really do anything useful.  It's just for example.  bar is a const int, which means to initialize it we have to do something special with our constructor(: bar(foobar)) in order to initialize it.
GetValue returns an int, but is a const function because it does not modify any variables.  GetBar is not a const function because it modifies someValue, but it does return a const int(in this case, bar).

Technically, you could write any program without using const, but it's important to use it when applicable for readability and to protect against bugs resulting from variables(which should be const) being modified.

7
There is a roguelike which uses this concept called Astral Tower.  Very incomplete, but shows promise

8
Programming / Re: Movement question
« on: November 16, 2010, 01:52:52 AM »
Why?  It's trivial to add support for diagonal directions and some roguelike players (such as myself and all my friends) will find the lack of diagonal support to feel restrictive and in some cases, this borders on making the game unplayable.

If you choose not to add diagonal movement, make sure to also leave out diagonal attacks on the part of creatures to avoid enemies getting cheap shots on you.

9
Classic Roguelikes / Re: Omega
« on: November 06, 2010, 06:05:00 AM »
After some experimenting I have to admit i can't figure out how to use a torch either.  If I figure it out, I'll let you know.

10
Early Dev / Feature Creeper
« on: November 06, 2010, 04:03:28 AM »
I just beat Feature Creeper for the first time and I must admit it is pretty fun!  Anyone else here played or beaten it?  I thought the ending was a little anti-climatic and there's a little bit too much luck involved imo.  Other then that its a solid coffee-break roguelike.

http://code.google.com/p/featurecreeper/

11
Classic Roguelikes / Re: My first roguelike
« on: November 05, 2010, 08:29:19 PM »
As far as I can tell, you're doing everything correctly.  I would like to warn you though, Dungeon Crawl is a very brutal game, even for a roguelike.

12
Didn't read the entire thread but... here's what I think.

Standardized control in roguelikes would be ideal, but as stated before, it's not very likely to actually happen.
So, for this reason, we should be thinking outside the box.  A few roguelikes currently support remapping the controls to (almost) whatever the player wishes.  This is good practice imho.  However, the problem is, remapping the controls usually involves editing (or creating) a file and swapping controls around until you find a configuration the game likes(eg. No key is mapped out to more then 1 command).  In addition to being tedious and frustrating, its also not a very good solution.

I don't know if most roguelike devs are just too busy or just don't know how handle file i/o, but it appears to me that allowing the player to remap the keys from in-game is not only the obvious solution, but trivial to implement as well.  Upon exiting the options screen, it merely has to save the keymappings (along with any other options) to a config file.  Problem solved.  Everyone wins!

Although, I do not think that standardized control are THAT important, it certainly would be nice if I could just load up the game and get started without getting bogged down by help files.  For this reason, I deem movement controls to be the most important.  There seems to be a huge split in the roguelike community about numpad vs hjklyubn vs arrow keys.  The easy solution is, support all 3!  It's not that hard.  Seriously.

Other then movement controls, I rarely find myself being annoyed at the controls chosen for any given roguelike.  However, inventory management generally seems to be more complex then is necessary.  Have any of you played Astral Tower? http://lordarchibald.republika.pl/main.html  Although a very incomplete game, he had the right idea as far as inventory goes(Although I admit I think he OVER-simplified it).  An more specific example of why I think inventory management is Nethack.

Observe the following Nethack commands:

(P)ut on
(W)ear
(w)ield
(R)emove
(T)ake off

They all do different things(technically), but they also could be reduced to a single command.  Even commands like quaff, read, zap, etc could also be simplified down to the same command easily enough.  If there is a legit reason to make it a separate command, then don't hesitate to do so.. but don't make it it's own command just because you can.

Anyways, that was just my 2 cents...

13
Classic Roguelikes / Re: What options do I set in TinyTerm to play Crawl
« on: November 03, 2010, 07:51:06 PM »
You could try this alternative if you are having problems - http://www.9bis.net/kitty/  It's more or less just a portable version of putty, but it works for me.  Alternatively, have you tried hitting ctrl-r to refresh the screen after entering the game?  Is this a problem that persists in every state of the game? or just going from menu to in-game?

14
Does it count if I beat Rogue Clone?  I cant seem to find the original windows binary I used to use.

15
Classic Roguelikes / My idea of a fun roguelike has changed...
« on: October 31, 2010, 03:07:12 AM »
At first, I loved roguelikes such as Nethack, Adom, Omega, and such because they were so in depth and challenging that it gave a feeling of satisfaction when I reached a part of the game I hadn't yet been to.  Now however, I find that my standards are changing.  I would like to play many easy-medium difficulty roguelikes of short-medium length.  The problem is, I am having trouble weeding out the ones worth playing from the ones I haven't.  Here's a list of the ones I've played which match what I'm talking about.

A Quest Too Far
Ali Baba's Cave
Berserk!
Hydra Slayer
You Only Live Once

Do any of you have any roguelikes you could recommend which is along the same lines as those?

Pages: [1] 2 3