Thread: text-based rpg help

  1. #16
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Quote Originally Posted by Hunter2
    New idea for obfuscated code competitions: Write a program which, when compiled and then opened in a text editor, is a fully readable novel...
    Easy. Just create a small program with only a return statement in it. Then copy and paste the novel to the end of the executable.

    You weren't talking about the executing part be the novel were you?

  2. #17
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    >>signed wrapping is undefined behavior and may or may not work the way you expect it to.
    To echo Vicious: Wow, didn't know that.

    Glad to learn something new

    **EDIT**
    Err, hmm... I was thinking that the novel would be the operating code, not just something appended at the end of the file

    By the way, good grammar and an immersive plot will score extra points
    Last edited by Hunter2; 09-01-2004 at 09:34 PM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  3. #18
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by MMD_Lynx
    heh...that's useful. that's kinda how i was gonna encrypt it. but i was gonna reverse it too
    like "Hello, world!" would be "!dlrow ,olleH"
    you could also use simple XOR encryption, and have the user create a password that will be mixed with another 128 bits to create the key... for example:

    user password: PASSWORD
    random key (128 chars): v5r6a48e78c618a697re81...
    user password and key (key): PvA5SrS6WaO4R8De78c618a697re81...

    when the program puts data into the database, you can use that key to encrypt it:

    out<<data^key;

    then when the user enters their password, you can extract it from the key to check if it's right... then if it is... do the same you did to encrypt it:

    in>>data;
    data=data^key;

    the main problem with mixing the key and password is that when they want to change the password, you have to then decrypt and reencrypt everything in the file so their new password will still be valid... for example:

    old password: PASSWORD
    new password: ADMINISTRATOR
    old key: PvA5SrS6WaO4R8De78c618a697re81...
    new key: AcD1M8IeNrI6SaT1RtA8TrO6R54cvr5a64r861a...

    in>>data
    data=data^old key;
    out<<data^new key;

    this method is fairly secure, with the biggest security issue being having the password integrated with the key in that way. you may even consider not having the password integrated with the key at all, but stored somewhere else, also encrypted with a different key.

    here's some code to get you started: http://www.cprogramming.com/cgi-bin/...ategory&CID=12
    Last edited by major_small; 09-02-2004 at 09:04 AM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  4. #19
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    How far are you in making your text based rpg? I started one not to long ago but I have accauly quit because I wasn't learning anuthing new and got boring. I never even got the map part let alone the magic system.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A bunch of Linker Errors...
    By Junior89 in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2006, 02:59 PM
  2. text rpg help
    By xxwerdxx in forum Game Programming
    Replies: 1
    Last Post: 11-26-2005, 08:16 PM
  3. Check out My Text Rpg Game
    By knight543 in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2002, 10:40 PM
  4. Text based GUI?
    By jon_nc17 in forum C++ Programming
    Replies: 1
    Last Post: 05-16-2002, 11:45 AM
  5. Text Based Game
    By drdroid in forum C++ Programming
    Replies: 2
    Last Post: 02-18-2002, 06:21 PM