MMORPG in QBASIC?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Anonymous

MMORPG in QBASIC?

Post by Anonymous » Thu Apr 06, 2006 7:44 am

:D I would like to ask if it is possible to create a MMORPG (massively Mutiplayer online role playing game) on QBASIC...
Thannks.. I'm kinda new so I'll introduce myself, name's Anthony Prince B. Merluza aka Hero_bash, 13 yrs. old from the Philippines.. I studies programming, and webdesign..
so is mmorpg possible in any way?

Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re » Thu Apr 06, 2006 9:26 am

No.
I have left this dump.

Anonymous

Post by Anonymous » Thu Apr 06, 2006 10:03 am

too bad.. then waht's the best kind of game can it do?

RayBritton
Veteran
Posts: 109
Joined: Thu Feb 10, 2005 12:38 pm

Post by RayBritton » Thu Apr 06, 2006 11:30 am

you could also try FreeBASIC, someone is making a MMORPG (fieldview - thats the name i think) in it

DaveUnit
Veteran
Posts: 72
Joined: Sat Oct 29, 2005 10:07 am
Contact:

Post by DaveUnit » Thu Apr 06, 2006 2:05 pm

Yeah, and the person that's making it is none other than Z!re that posted earlier.

Good work btw, Z!re. It's looking good.

thegrogen
Coder
Posts: 14
Joined: Fri Mar 25, 2005 1:33 pm
Location: Vancouver BC
Contact:

Post by thegrogen » Thu Apr 06, 2006 2:54 pm

I don't understand why so many people want to write MMORPGs.
Current projects:
oberonOS
Project HYDROGEN

User avatar
Deleter
Veteran
Posts: 119
Joined: Sat May 07, 2005 7:31 pm

Post by Deleter » Thu Apr 06, 2006 2:59 pm

its the current industry fad....thats why

Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re » Thu Apr 06, 2006 3:24 pm

Some history:
FieldView started as a massive RPG in QBasic, it was then called MOoRPG
There's a few sections about it in various QBExpress issues.

When FB was released, the project moved there. And as networking was no longer a problem, we thought: What the hell

And here we are. It's still the same old MOoRPG, but now you can play it with other people.

Or to put it this way, you wont have to interact with other people to play FieldView
I have left this dump.

RyanKelly
Coder
Posts: 48
Joined: Sun Jan 22, 2006 6:40 pm
Contact:

Post by RyanKelly » Thu Apr 06, 2006 6:04 pm

Z!re wrote:No.
The babel fish gave me this Z!re to English translation:

"Writing an internet application in QB requires a wealth of knowledge and effort. You'll need to set up a pure DOS system, aquire and setup TCP drivers and either an ethernet card driver or a PPP driver and dialer. Then you'll need to learn lower level DOS programming techniques to interface with the TCP driver from Qbasic. Since every bit of this knowledge is antequated, your time would be better spent learning about currently used systems and programming methods."

I on the other hand say: Yes. It will take you five years, and you will find very few people with the experience neccessary to help you along the way, because the overlap in time of the hey day of DOS and the rise of TCP/IP networking was very, very brief.

Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re » Fri Apr 07, 2006 4:56 am

[quote="RyanKelly"][/quote]It's not possible. A QB program is simply not fast enough to handle all the information. Assuming the world is larger than a 100x100 grid, and that there are more than 2 people playing.

As I'm making a MMORPG, I know it's impossible, there's just too much data being sent around. And to top it off, QB doesent have an accurate enough timer to allow for online games. (Unless you make them turnbased, but a turnbased MMORPG, come on....)

So while tecnically, it can be done, it's not even close to worth doing for the learning experience alone.
And for a complete game being made, wont happen, ever.

Like I said, thats the reason FieldView was singleplayer on QB, and multiplayer on FB


EDIT: Thanks for the translation btw :P :D
I have left this dump.

RyanKelly
Coder
Posts: 48
Joined: Sun Jan 22, 2006 6:40 pm
Contact:

Post by RyanKelly » Fri Apr 07, 2006 10:02 pm

I wasn't sure I could trust a machine translation. ;)
Z!re wrote:It's not possible. A QB program is simply not fast enough to handle all the information. Assuming the world is larger than a 100x100 grid, and that there are more than 2 people playing.
It's a matter of design and ambition. I don't think what you've done with FieldView could be done with QB, even if the basic code were a wrapper for machine code routines, but a less ambitious project on par with some of the games popular on MajorBBS systems in the mid 90s could be done in QB with the right level of grey matter optimization. I think if a beginner were to school himself to the point of being able to implement a telnet clone of Tradewars, he'd have something to be proud of. Like I said... a five year project.

User avatar
Deleter
Veteran
Posts: 119
Joined: Sat May 07, 2005 7:31 pm

Post by Deleter » Thu Apr 13, 2006 5:16 pm

well, a MUD could almost be considered an MMO if you throw in quests, I bet qb could do that. :P Though supporting enough players would be a trick. With the effort and time it would take to make it, one could learn FB and write it in that ten times over.

zorrozX2
Newbie
Posts: 2
Joined: Tue Feb 27, 2018 10:17 pm

Re: MMORPG in QBASIC?

Post by zorrozX2 » Tue Feb 27, 2018 10:46 pm

I think, it is possible to create an online multi-player game in Qbasic, HOWEVER, you will need more than just QBasic. Here is how I would do it: I have a program called WGET.EXE, which can download a web page from the internet. Each player's location and data would be stored in a file on a server. And QBASIC would occasionally run WGET.EXE to get this file from the internet. Your program would also have to read this file to find out where each player is on the field. So, then it is up to the QBASIC program to display the various players and the playing field. That in itself is a difficult task, but I am not here to discuss that.

So, my suggestion is use WGET!!! This is an awesome program, and it would help you a lot. The QBASIC program would have to run in a DOS box under Windows XP, because WGET doesn't work in pure MS-DOS. Although WGET is a command line utility, it has to have Windows running in the background or else it won't work.
You can get it here : http://gnuwin32.sourceforge.net/packages/wget.htm

Now, whether your program downloads a file from the internet periodically, let's say, every 20 seconds or every time you make a new turn, that's up to you.

Each player will also have to broadcast periodically his / her status and location to the server. And we do that with WGET as well. You know website URLs look like www.something.com/mywebpage.html?blahblahblah

That "blahblahblah" is the argument list. That's how you can pass data to the server. You have to write a program in Perl programming language or PHP or Python and upload that program to the server. This program will have to read the data from the argument list and save it in a file on the server. The server doesn't need to have gigabytes of space. I think, all you need is a few kilobytes. So, you can sign up to a free server. The program that resides on the server will start to run whenever you try to download it. The server is already set up so that each time you try to access that program, instead of downloading it, the server executes the program. And your program looks at the argument list and saves it in a file. So simple. Then you run WGET again to download the status file. and your QBASIC program reads the file and updates the screen.

Unfortunately the more often you try to update your status and download others' status with WGET, the slower the game, because each time you run WGET, it takes about a second to run. So, if you constantly run WGET in the background, then your program will be full of pauses. ALSO, keep in mind, that if several people are trying to WRITE to the file on the server at the same time and then read from it at the same time, someone might get an access denied error. Every time you write to a file, it becomes inaccessible to others. Another disadvantage to this solution is that you can't really get an update from the server. For example, if you were to write a chess program that allows two persons to play chess over the internet, then your QBASIC program would often have to download the file from the internet just to see if the other person has made a move yet. This constant downloading is not a very efficient solution. It would work, but it's not a nice programming solution.
Last edited by zorrozX2 on Wed Feb 28, 2018 12:30 am, edited 1 time in total.

zorrozX2
Newbie
Posts: 2
Joined: Tue Feb 27, 2018 10:17 pm

Re: MMORPG in QBASIC?

Post by zorrozX2 » Wed Feb 28, 2018 12:28 am

Here is a simple Perl program that you would upload to your server (see source code below). You can save it as "Save.pl" on the server. Let's say you have a domain name called www.mygamecenter44.com and so you upload this perl script to the server.

You would call WGET to send data to the server in this manner:

SHELL "wget -q --output-document=D.TXT http://www.mygamecenter44.com/Save.pl?055-33-DXW77"

And you would download the shared data from the server like this:

SHELL "wget -q --output-document=D.TXT http://www.mygamecenter44.com/status.txt"

The first number after the ? mark tells the program which user you are. Whatever comes after that gets saved in the status.txt file. When you download status.txt file, the first number on each line is the number of seconds since Jan 1970. The second number is the IP address of the user who updated that status line.

Each user's data is stored on a different line in status.txt. The possible user codes are 0-9 and A-Z. So, there can be no more than 36 users playing at any given time using this program. The code is simple if you want to modify it. Perl is easy to learn. All it takes is a few hours to get familiar with it.

Save.pl file:
############################################
#!/usr/bin/perl -w

use strict;
use warnings;

my $FILENAME = 'status.txt';
my $IP = Trim($ENV{'REMOTE_ADDR'});
my $ARG = Trim($ENV{QUERY_STRING});
my $ROOT = Trim($ENV{'DOCUMENT_ROOT'});

print "Content-type: text/html\n\n<HTML><BODY>";
my $VALID = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';

print '1'; defined $ARG or exit;
print '2'; length($ARG) >= 2 or exit;
print '3'; my $USER = uc(substr($ARG, 0, 1));
$USER = index($VALID, $USER);
$USER >= 0 or exit;
print '4'; $ARG = substr($ARG, 1, 2000);
my $F = $ROOT . $FILENAME;
my $PREVSIZE = -s $F;
print '5'; my @LINES = ReadTextFile($F, length($VALID));
print '6'; while (@LINES < $USER) { push(@LINES, ''); }
$LINES[$USER] = time . " $IP $ARG";
print '7'; WriteTextFile($F, @LINES);
print "\n<BR>FILE NAME: " . $FILENAME;
print "\n<BR>PREV SIZE: " . $PREVSIZE;
print "\n<BR>CURRENT SIZE: " . -s $F;
exit;

# This function removes leading and trailing spaces, tabs, and new-line characters from a string and returns a new string.
# Usage: STRING Trim(STRING)
sub Trim { my $STR = shift; return '' unless (defined $STR); return '' if (length($STR) == 0); my $j = 0; my $i = -1; for (my $x = 0; $x < length($STR); $x++) { if (ord(substr($STR, $x, 1)) > 32) { if ($i < 0) { $i = $x; } $j = $x - $i + 1; } } return substr($STR, $i, $j); }

# This function reads no more than N number of lines from a text file and returns the contents as an array.
# Usage: ARRAY ReadTextFile(FILENAME, N)
sub ReadTextFile { my $NAME = shift; my $N = shift; my $i = 0; my @DATA; return ('') unless (-f $NAME); open my $FILE, '<', $NAME or return @DATA; while (my $LINE = <$FILE>) { last if ($i >= $N); $DATA[$i++] = Trim($LINE); } close $FILE; return @DATA; }

# This function writes a list of lines to a text file. Returns 1 on success or 0 on failure.
# Usage: INTEGER WriteTextFile(FILENAME, STRINGS...)
sub WriteTextFile { my $NAME = shift; my $DATA = join("\n", @_); open(my $FILE, '>', $NAME) or return 0; print $FILE $DATA or return 0; close $FILE or return 0; return 1; }

__END__

commandvom
Coder
Posts: 10
Joined: Mon Sep 06, 2010 8:41 am

Re: MMORPG in QBASIC?

Post by commandvom » Thu Mar 15, 2018 7:38 am

Hi people!
I have a mmorpg in QB64 SDL, the website is:

http://aetricia.ddns.net

the server is online (under development)
you can download the client and inmmerse in Fantastic Lands of Aetricia!

I post at the forums of www.qb64.net, a old version of the source code of the server/client:

http://www.qb64.net/forum/index.php?top ... #msg124877

Regards!

Post Reply