From: aaron@clark.edu (Aaron Auseth)
Newsgroups: rec.games.programmer
Subject: Re: Help passing data on multiplayer game.
Date: 10 Apr 92 03:27:28 GMT
Article-I.D.: clark.1992Apr10.032728.12059
Organization: Clark College, Vancouver, Wa.  USA

In article <1992Apr9.151128.1804@ux1.cso.uiuc.edu> tmkk@uiuc.edu (K. Khan) writes:
>
>In article <1992Apr8.164336.2791@clark.edu> aaron@clark.edu (Aaron Auseth) writes:
>>I'm attempting to make a multiplayer dungeon game like nethack, except it is
>>real-time, and it is running on a PC network (NOVELL).  I have a good portion
>>of the standalone dungeon part done, but I'm to the part of passing some
>>data to the other players PC's....
B
>
>What sort of development tools (C compiler, function libraries, etc.)
>are you using to develop this game?

I'm using TURBO C++ and NWAPI's for IPX messaging (haven't figured out SPX).
I've written some VIDEO stuff in asembly for speed.  The game is text based
using generated font symbols and a scrolling map.  

My problem is keeping track of all the data on several machines without
significantly slowing down the environment.  I've decided to use different
sockets for each level of the game so that if Player1 and Player2 are on
different levels they don't have to sift through the IPX packets.  I currently
have a 100 X 100 map and up to 50 monsters and unlimited items.  My first 
(and only) attempt was to have each PC keep it's own copy of the map and data.
The first PC to enter the game would move the monsters and send the new
positions to the other PC's.  I only allowed 20 monsters to move per cycle
which cut down on the IPX packets, yet processing only 20 packets, updating
the monsters, and redrawing the screen took longer than expected.  I have since
rewritten my display routines to make them faster.  I still haven't addressed
changing levels (with multiple players).

Here is a sample scenario:  Player1 is on level 5 when Player2 comes down the
stairs.  How does Player2 get the data for the level?

1)  Player1 can send the data through *several* IPX packets.  Player2 would
    pause until he received enough data to start displaying the map and
    monsters.  (I don't want to slow Player1 down since he is actively playing
    the game, but Player2 can wait several seconds to change levels).
    
    Since I have to send the map/monster data in small blocks to Player2, how
    do I make sure that when Player2 finishes receiving all the data he has
    the latest uptodate data?  Monsters will have moved since the data was
    first sent from when the last of the data was sent.

2)  Have a dedicated PC that will move the monsters and items.  Store the
    maps on disk.  Player2 would load the map and pause until it received
    all of the monster and item locations, then continue.  Player1 would
    have nothing to do with Player2 (they would see eachother still).

    The problem here is I can only scrape up an old 8088 machine and if
    40 people were playing on 40 different levels, I can't expect an 8088
    to keep track of (50 x 40) 200 monsters as well as keep 40 map levels
    in memory.  The 8088 wouldn't beable to move the monsters fast enough
    to make the game interesting.

Option #1 is my personal choice, but I'm not sure how to send the data 
properly.  Option #2 I think is too slow, it would be better to have each
of the 40 players moving their own monsters.

I'm hoping someone will give me some good ideas on how to accomplish the 
"option #1" data transfer to another player.  I haven't seen anything like
what I'm doing except for a UNIX game that had non-scrolling screens.
Newsgroups: rec.games.programmer