Allegro.cc - Online Community

Allegro.cc Forums » The Depot » MUD Engine: v0.05 - Online!

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
MUD Engine: v0.05 - Online!
LSd016
Member #3,561
May 2003

When you develop it into a stable system with scripting support, think about adding some simple story. Like a legendary sword buried in dungeons of the Kraków castle, which can then be used to defeat the mighty dragon sleeping deep inside the nearby lair.

____________________________________________
[update soon]

Derezo
Member #1,666
April 2001
avatar

Yeah, I intend to have a small base story in areas that I build. Then other areas that are built by other people will be sort of like side quests. There will eventually be more side quests than there is a base plot..

In a MUD though, it's difficult to keep a story throughout the entire thing.. since there's no real "beating" it.. just finishing different quests and what not.. So there never really is an end, when you finally save the world and vanquish all evil... you just kill evil (or good!) in different lands, and in different ways. :)

"He who controls the stuffing controls the Universe"

Thomas Fjellstrom
Member #476
June 2000
avatar

OF COURSE theres no real beating it ::) yeesh, when you kill someone they don't die! Hows that work eh? (I'm dumb! or should I say "doesn't work".) :P

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Derezo
Member #1,666
April 2001
avatar

MUD said:

You have been KILLED!
Lucky for you, this hasn't been implemented yet.

;D

When you kill npcs they die properly though.

"He who controls the stuffing controls the Universe"

Radagar
Member #2,768
September 2002
avatar

Heh, you're well on your way to having a decent MUD. Keep up the good work =)

This thread inspired me to grab a stock copy of Smaug and start playing with it. So far, I'm having fun!

------------
Radagar - So your vote is for A.D.H.D.?
Chris Katko - Well, that was uninten--ooh kitty!

Thomas Fjellstrom
Member #476
June 2000
avatar

How do you feel Derezo? You're know Inspiring!

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Derezo
Member #1,666
April 2001
avatar

emote sniffles.
emote sheds a tear.

I feel so proud! :)

Text games are definitely the most fun to program. You don't need any media (images, music, sounds, models) to start it up. Not even programmers art! :)

BTW, Oscar, I can't see a problem in the name validation code.
Here's the code which checks to see if a name is valid.

int CheckNameReq(char *str)
 {
  int i;
  
  if(strlen(str) < 3) return 0;
  for(i=0;i<strlen(str);i++)
   {
    if(!isalpha(str<i>)) return 0;
   }
  return 1;
 }

If you use the arrow keys to move your cursor back from the client, it sends the keys as part of your name.. and arrow keys aren't alpha characters.. so, it makes your name invalid. So if you pressed Gn<leftarrow>i<enter>, it would actually send it in that order. The i would be after a left arrow which is after the n. Stupid windows telnet.

If that wasn't the problem, then I'll need to double check my buffering code to make sure it doesn't add characters on the end under certain conditions... and maybe strip spaces off the name when I check it, just in case.

"He who controls the stuffing controls the Universe"

X-G
Member #856
December 2000
avatar

Some telnet clients send some control sequences on connect that your server might not be able to cope with. These might be interpreted as part of the name on first attempt.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Oscar Giner
Member #2,207
April 2002
avatar

Nope. I press 'Gin', only, no other character. It fails the first time, and accepts it the second.

I tried a name with more than 3 characters and the same happens: the first time I connect and enter the name it says that the name should have at least 3 letters. I use Putty.

I've tested with windows telnet and it works. (I spend some time trying to figure out how to set the port).

So the problem doesn't seem to be CheckNameReq.

One speed tip: save the value of strlen(str) in a variable, so there's not a function call every loop :)

X-G
Member #856
December 2000
avatar

Like I said. Telnet sends control characters on connect. Derezo's server thinks these are part of your name (and obviously, they are not alphanumeric, hence the error). You can't see them, but they're in there.

With putty, you could try connecting in Raw mode rather than Telnet mode.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Oscar Giner
Member #2,207
April 2002
avatar

Yes, connecting in raw mode solved the problem.

[edit]
BIG BUG:

1STAT
2Stats:
3VNUM: 0
4NAME: Gin
5HP: 64090 / 2000
6MN: 0000 / 0000
7STR: 212
8AGI: 101
9INT: 1
10LCK: 1
11VIT: 1
12ATT PTS: 0
13Level Information:
14LEVEL: 3
15EXP: 4371
16AP: 28
17Class Information:
18CLASS: Squire
19Coins on hand:
20Copper: 200
21Silver: 100
22Gold: 100
23Platinum: 0
24Modifiers:
25 1 - 4 - 10
26>

I have 64090 HP!
The last time I checked the HP I had more than 4000. I exit and enter again (after trying to kill you;D), and I have that high amount of HP.

Derezo
Member #1,666
April 2001
avatar

Hmm.. I'll hafta look into that HP bug.
Got all night to work on it now ;)

CGames said:

Derezo, you must send \r instead of \n, eh?

Yep, working on fixing them all.
I have most of it converted to \r\n instead of just \n.. but some have not yet. Was working on that before I left earlier.

CGames said:

Derezo, did you add support for backspace? if you did, you did, it seems to be a bit buggy.

Yeah... I'll hafta check it out. I noticed sometimes it skips them for some reason. (Oh how I hate windows telnet..)

X-G said:

Some telnet clients send some control sequences on connect that your server might not be able to cope with.

It's not top priority, but I'll look into that.
If it's something simple (if it has a delimeter, or is only 1 character), it wont be hard to ignore.

Oscar said:

save the value of strlen(str) in a variable

Yeah. Thanks for reminding me. In my head I was thinking it was only called twice.. but no, it's called every loop :P

"He who controls the stuffing controls the Universe"

CGamesPlay
Member #2,559
July 2002
avatar

Well, actually, this is the problem I've found with the backspace:

>
lookk^H<enter>

Huh?
>
lookk^H <enter>
//...
>
looo^hk<enter>
//...
>

In other words, when you recieve a backspace, you decrement your string pointer, but what you should do is set the current location to ' ', then decrement. or even '\0'.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Derezo
Member #1,666
April 2001
avatar

Of course. That's why sometimes if I do multiple backspaces it does nothing.. :P

Thanks.

"He who controls the stuffing controls the Universe"

CGamesPlay
Member #2,559
July 2002
avatar

Also in Win telnet, I notice the death messages look something like this:

SOmething something!
                   blah!
                        d dropped 31 platinum // assume 80 cols here
coins!
      >

Is that because of the \n problem? I thought a \n went to the next line and flushed, \r just flushed. Am I wrong?

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

X-G
Member #856
December 2000
avatar

\n goes to the next line, \r resets the cursor to the column 0 again.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Thomas Fjellstrom
Member #476
June 2000
avatar

\r is a carrige return, which returns the "carriage" to teh start. \n is a line feed, which feeds another line... Think in typwriter terms. a \n without a \r will just advance a line, a \r will just return the cursor to the start of the line. add em both and you get tot he first char on the next line.

Thankfully, the best OS's chose a single char to do newlines.

Derezo, have you looked at any Telnet specs? so you can correctly handle the Telent protocol? (yes, there is a protocol spec, it tells you how everything is handled, and lists the various controll chars)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

CGamesPlay
Member #2,559
July 2002
avatar

Ok, and in UNIX, \n does both?

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Thomas Fjellstrom
Member #476
June 2000
avatar

in text files and such.. yeah, and \r is just a carriage return.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

spellcaster
Member #1,493
September 2001
avatar

Isn't it great that Win, Unix and Mac all havwe different ways to handle the end of line?

:)

Makes programming more interesting ...

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Derezo
Member #1,666
April 2001
avatar

SC: Not unless by more interesting you mean more frustrating. ;)

Quote:

Derezo, have you looked at any Telnet specs? so you can correctly handle the Telent protocol?

Nope. I'm winging it! ;)
I will when I launch this into a full fledged MUD, with actual players.. but for now, I'm just trying to support the basics.

"He who controls the stuffing controls the Universe"

Thomas Fjellstrom
Member #476
June 2000
avatar

ugghhh... It will be sooo much easier if you dont have to worry about telnet getting int he way.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Derezo
Member #1,666
April 2001
avatar

Yeah, I know. If windows telnet were non existant, I would still be using my old buffering method :P
(Other than the command stacking problem).

Now I treat the network like a keyboard buffer and use a readkey-style method of reading from it. :(

"He who controls the stuffing controls the Universe"

Thomas Fjellstrom
Member #476
June 2000
avatar

Thats how I had to deal with my HTTP server. belive that or not.. Headers are evil ;) you can have multiple lines in one header, and stuff.. so I read one byte at a time till I find my plain \n or two \n\n... that header reader func is a wee convoluted.

But what I meant, is if you followed the telnet specs (which most other protocols are based on, ie: ftp, http...), you wouldnt be having this problem I bet :P

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Radagar
Member #2,768
September 2002
avatar

Yeah, but who likes following a SPEC? I mean, come on.. takes all the fun out of it!

Oh, wait.. I probably shouldn't be answering for Derezo.

goes back into his MUD

------------
Radagar - So your vote is for A.D.H.D.?
Chris Katko - Well, that was uninten--ooh kitty!

 1   2   3   4 


Go to: