> First, the goal to this point was to make a server that is versatile
> enough to scale well for a monolithic server, like Wesnoth's main
> server.
> This server would accept new connections and allow you to join an
> existing game or make a new one.
> The server must also allow for individual servers to be run, either
> for personal games when the main server is full (or not wanted) or for
> singleplayer games.
Right, a worthy goal which would serve the project well, I believe. To
my knowledge, there is no game in the vein of FFT/Disgaea with a
multiplayer environment. Plus, servers can easily be run headless
(i.e.: dedicated) and the door is wide open for custom servers with
custom rules.
> Second, how to deal with ai and hotseat. Chatting with saluk he showed
> that you can have multiple connections in a reactor - I did not know
> this.
> The problem is, to do that with pb (as we have) would create a new
> client for each (I believe, I have not tested much of this though, so
> if anyone with twisted knowledge cares to jump in :) ), which would
> rebuild the whole game interface for each, or at the very least
> require some significant hacking to be able to get to work.
> Now, we could offload the ai to the server, which makes sense, but
> then, we still have the issue of hotseat - swapping windows would not
> be ideal.
> Also, once we put that kinda of logical task on the server, the number
> of games that can be run go down very quickly.
I assume you mean multiple connections from a single client (a server
must obviously be able to accept multiple connections from different
clients!), which I can't see having a need for. It was ajhager's
original suggestion that AI players simply be their own client. There
really is not any additional overhead doing it this way as the network
interface that is exposed for human players is the same for AI and
simply boils down to function calls with the RPC-style PB.
Hotseat is quite simple. You just use the singleplayer client with
slightly different rules on the server end. In hotseat, it is always
"your turn", i.e.: the server accepts actions from a single client all
the time. Remember that there is very little logic on the client side,
it only displays what is going on in the game and sends input to the
server. It is up to the server to determine which team or unit is
allowed to move. The client only needs to act on these things for
superficial reasons, i.e.: to show whose turn it really is so valid
input can be sent to the server. Still, this is little code.
Everything else going on in the game logic-wise is not for the client
to know.
> We discussed having mutliple players make use of the same client,
> which would probably work, but that would mean either removing or
> hacking around the twisted Avatar/Realm stuff - which kinda negates
> their purpose, I think...
It seems that you unfortunately still do not understand the purpose of
the Avatar/Realm. These are just *permissions* they have *nothing* to
do with the client. I am sure part of the problem (and with Twisted in
general) is the names. They don't really describe what things do.
Anyway, here it is simply a matter of some Avatars having permission
to things that others do not have. This boils down to one Avatar can
call functions that another cannot. If a client tries to do something
that it is not allowed, it is simply ignored (ok, knowing Twisted
there is probably an exception, but that is easy to deal with).
For our purpose, we really only *need* two. An Avatar that has created
the game and thus has permission to shut down the game, or change
maps, or pause, or change the settings for playing on a new map. The
other Avatar represents other players joining and thus they do not
have permission to do any of the aforementioned things. For
singleplayer, the server is automatically started by starting a
singleplayer game thus making the single client the creator and giving
him permission over his own game. For (dedicated) multiplayer there
could be a simple password exchange that would give these priviledges
to a server admin.
> And finally, the game code, as it is currently designed, requires the
> net stuff to be pretty much set, and not changing much to work on the
> game code.
IMHO, the networking is only a very loose wrapper. You call a function
on the client side, the server receives it and passes it on to the
game logic (perhaps with some simple filtering at the server stage).
Same with the opposite direction. I believe this is very similar to
the MVC paradigm (Model-View-Controller), where the client is the
view, the game is the model, and the client/server code is the
controller.
> So, I am left in a rather annoying state. I don't have the expertise
> in twisted to feel comfortable with the amount of work required to
> make any of the ideas above work. Neither do I have the time to devote
> at this point.
I was under the impression that we already went through this stage. I
remember spending some good quality time working through the network
code with you. =)
> So, we have a choice.
> We can forge ahead with the current design for the game, which is
> basically to get the server and client working really well then
> implement the game on top.
I prefer this approach, simply because once it is done then we have
multiplayer for all time for free. I think the initial cost is also
much lower than you are expecting. Keep in mind that not going this
route would mean ditching the 3rd (or 4th?) generation of networking
code written for this project (mind you, they were all very similar).
IMHO, it is also a very bad strategy to try to shoehorn networking
into a working game where networking was not the original design. This
sort of networking setup has been used successfully in quite a few
games such as all the id games since Quake II, I believe, also all the
Half-Life games, and probably many more. Yes, these games are quite
clearly in a different genre, but the software architecture is what is
important and once the client/server code is up and running, the
majority of the work goes on in the server, and the client faithfully
does what it is supposed to do.
> Personally, I prefer the latter. When I originally signed on to the
> object it was to help in the graphics department, and after that the
> game play itself. Now, having lost a few other project leads I have
> accepted the position to try, one last time, to resurrect this project
> into a great game.
Ok, so you already have a full graphics engine implemented and
probably done better than if it had just been specific to GMR itself.
In fact, in terms of GMR, there is not much the rest of us could have
done without Pyggel being in the state that it currently is in (ready
to use). That said, I would be happy to work with you on getting the
networking going.
> Unfortunately, I don't have the time to implement everything we had
> planned before in a reasonable amount of time, or in a clean manner.
What's the rush? This doesn't have to be done in a week. People will
be interested just to see that *some* progress is being made.
> The original game was not networked, it had hotseat and ai, until the
> last version.
> With the last version, though, the project lead left (I believe to
> college) and the game itself was getting too large and unmanageable to
> continue, and people slowly lost interest and it died.
>
> I have a feeling this project is now going that way. Not the too large
> part, as we are still just barely breaking ground. But the network is
> fast becoming unmanageable/incomprehensible to me.
The interest level is pretty much the same as it was about a year ago,
yet here we are still.
> Also, I appear to be the only active member left, and I feel that
> getting more people involved is the only way this project can
> continue.
Hey, I am still here!
I completely disagree that "the only way this project can continue" is
by having more people involved. More progress has been made recently
than when we had 4-5 people on the project. Or have you forgotten all
the deadlocked debates in the early days of GMR? IMHO, it is better to
make sound design decisions now with fewer hands in the pie and then
when we get additional help, there will already be a framework for
people to start from.
> I for one am losing interest in the project, at the current time, rate
> of progress, and workload. I don't like that and hope this project
> will continue.
Well, I am sorry to hear that. I can only hope that whatever motivated
you to create a 3D graphics library nearly by yourself will motivate
you to also lay the groundwork for a playable game (a much more
exciting endeavor, IMHO).
-Markus