A Conversation for The H2G2 Programmers' Corner
- 1
- 2
Text Based Games and HTML Parsers
26199 Started conversation Mar 20, 2002
Hmm, does anyone have any experience in the world of online text-based games? I mean MUDs, MUSHes, MUCKs, and all the other oddly messy sounding bunch... grin...
I'm writing one, y'see, I wondered if there were any old hands hanging around these parts...
And if not... the formatting in my game will internally be specified using HTML like tags... then converted to ANSI or other formats before it gets sent to the players... now, I've already written something which'll do that, but, it kind of lacks sparkle... does anyone have experience in neat and intelligent ways of doing that sort of thing?
Any sage advice appreciated
26199
Text Based Games and HTML Parsers
Dancer (put your advert here) Posted Mar 20, 2002
Actually, the best way to do this is keep your information in XML and use an XML parser to create the data to be sent.
Xerces is a good free parser, You can download it from http://xml.apache.org
Yours
Dancer
Text Based Games and HTML Parsers
26199 Posted Mar 20, 2002
Hmm. That does sound like a good idea
Although it needs to do clever things, like tags that randomly display one of a set of strings, and tags that display different text depending on certain in-game conditions... are those kinda things doable in XML?
Text Based Games and HTML Parsers
MaW Posted Mar 20, 2002
Depends how you handle it. Straight XSLT transforms might not be able to do it, but with a decent parser I don't see any reason why you can't take the document tree which the parser generates, play with it a bit (dealing with those elements) and then use XSLT to output it, or just traverse the tree with your own algorithm to generate the output.
Alternatively, you could develop and implement your own markup system specifically designed for your needs (okay, so I always go for the hard way...)
Text Based Games and HTML Parsers
Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista) Posted Mar 20, 2002
I wrote a couple of "educational" text adventures for Aberdeen Council back in 1986... I was just using "The Quill" on Sinclair Spectrum machines, plus an editor I wrote in QL BASIC...
Text Based Games and HTML Parsers
26199 Posted Mar 20, 2002
Hmm, nod, I'll certainly look into it... I'm starting to gain a healthy appreciation for the idea of letting other programmers do a good deal of the work for you... grin... alright, so doing things yourself from scratch is fun (well, not quite from scratch - I'm not writing my own compilers in assembler ), but so is an end result that does what you want it to do...
Thanks for suggesting it, anyhow, it may save me some hassle
Hmm, I take it you two are strangers to the genre, seeing as you haven't commented on the whole game aspect?
Text Based Games and HTML Parsers
26199 Posted Mar 20, 2002
Three, hi there Peet
Hmm... well, that's a start
Have you played with multi-player text adventures at all?
Text Based Games and HTML Parsers
Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista) Posted Mar 20, 2002
I played a little MUD on a DEC 20/50 in 1980...
With multiplayer stuff, you need to decide on the communications model you will be using. A single central server guarantees that everyone sees the game messages in the right order, but it's a "brittle" system. All players are relying on a single machine having the bandwidth available to cope with them.
A distributed server system such as used for IRC is far more robust, but introduces the concept of "lag", where different players may see messages appearing on screen in different orders. With a large number of players, this system is far more stable, so if you think it's going to be popular, the game should be designed with lag in mind from the outset.
Text Based Games and HTML Parsers
26199 Posted Mar 20, 2002
Hmm... I don't think 'm planning on ever really having more'n a hundred players there at once... so in terms of bandwidth, that's going to be fairly minimal... hmm...
I'd love to do a peer-to-peer based game, but that's moving away from the traditional single-server model, which is what 'm going for this time... hmm... maybe a future project
Text Based Games and HTML Parsers
Martin Harper Posted Mar 22, 2002
Bandwidth isn't the issue - it's lag. That's the time taken between sending a message and it being received - and it's pretty much independant of the size of the message - at least for the type of game you're talking about. The internet distance between players is far more important - if everyone's going to be on the same LAN, you can get away with a lot more...
To my mind, effectively dealing with lag is a critical issue for online multiplayer games. If you don't deal with it, or deal with it poorly, the game's sunk without trace.
Text Based Games and HTML Parsers
Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista) Posted Mar 22, 2002
Text Based Games and HTML Parsers
26199 Posted Mar 22, 2002
Hmm. I suppose that is true... certainly, players in MUDs I've been to that have fast connections... cable modems, etc... have advantages over those on 56K modems, simply because they suffer less lag.
Then again, I hate 56K modems, so maybe I should just hope the world will get rid of them while I'm not looking
Text Based Games and HTML Parsers
Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista) Posted Mar 22, 2002
It's best to assume tht everyone's on a 28.8 modem, and in a different time zone... If you design the game with that in mind, it should work under pretty much all "real-world" circumstances.
Text Based Games and HTML Parsers
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Mar 22, 2002
Text Based Games and HTML Parsers
26199 Posted Mar 22, 2002
Hmm, 's probably about the safest type of multi-player game for that one... all data stored on the server, nothing local... and only text-based server-client interaction.
Still, yus, 's always something to worry about, there'll be someone who tries to cheat, or just tries to upset the server...
Text Based Games and HTML Parsers
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Mar 22, 2002
or figures out a way to couse a /0, all well. I just went though a search engine writen in CGI and buffered all the things that people shouldn't have access to, but they can if there cleaver enough or stupid enough.
-- DoctorMO --
Text Based Games and HTML Parsers
MaW Posted Mar 22, 2002
You might also improve speed a bit by compressing all the text going back and forth with zlib or something (just remember to use a very new version of zlib, there are security holes in some older ones).
Text Based Games and HTML Parsers
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Mar 22, 2002
MaW ---> Theres a person in the Programming Corner waiting room, awaiting his membership. <----
Thats a quaint idea.
-- DoctorMO --
Text Based Games and HTML Parsers
26199 Posted Mar 22, 2002
Ah, but in the great tradition of such games, you should be able to play using telnet...
Still, I'll do my own client as well, an' there's no reason that shouldn't have compressed text... hmm... it could be useful in some cases, bulletin boards full of messages, that kinda thing...
Text Based Games and HTML Parsers
MaW Posted Mar 23, 2002
Yes DoctorMO, and what does that have to do with me? I don't run the Programmers' Corner.
Definitely worth looking at, 26199
Key: Complain about this post
- 1
- 2
Text Based Games and HTML Parsers
- 1: 26199 (Mar 20, 2002)
- 2: Dancer (put your advert here) (Mar 20, 2002)
- 3: 26199 (Mar 20, 2002)
- 4: MaW (Mar 20, 2002)
- 5: Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista) (Mar 20, 2002)
- 6: 26199 (Mar 20, 2002)
- 7: 26199 (Mar 20, 2002)
- 8: Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista) (Mar 20, 2002)
- 9: 26199 (Mar 20, 2002)
- 10: Martin Harper (Mar 22, 2002)
- 11: Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista) (Mar 22, 2002)
- 12: 26199 (Mar 22, 2002)
- 13: Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista) (Mar 22, 2002)
- 14: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Mar 22, 2002)
- 15: 26199 (Mar 22, 2002)
- 16: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Mar 22, 2002)
- 17: MaW (Mar 22, 2002)
- 18: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Mar 22, 2002)
- 19: 26199 (Mar 22, 2002)
- 20: MaW (Mar 23, 2002)
More Conversations for The H2G2 Programmers' Corner
Write an Entry
"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."