Do you have any news for us here? Is there any progress or trouble?
One little wish (if you are still on it), please keep in mind that we once want a master server to setup/find games.
We need no implementations yet, just keep it in mind when you design protocols.
Hey buddy, sorry for the late response!!
Yea, lots of progress, but lots of work. I've also been fiddling with a few other projects, Lincity-NG, KDevelop and gdb recently. I might try to start working on gdb's Project Archer (
http://sourceware.org/gdb/wiki/ProjectArcher) and if I like it, I might try to get a paying job working on gdb even! I've also have had a lot of other work to take care of over the past few months, but progress indeed is being made. No real problems. I posted a minor enum quandary recently, but nothing I'm worried about, I'm using the copy & paste mechanism for now because it's simple.
OT: On the topic of languages and enums (but off of this topic
), I'm not even happy with Java 5's enums
But that's ok, it's better (in most ways) than how we did enums before in Java (and I still have projects that used old-school Java enums -- basically it enforces it's behavior via private & protected constructors & such). In fact, I have a Java project that uses polymorphic Java enums, that one's a trip! It takes a lot of rules to enforce it, but they have come out cleanly thus far and work great over network (RMI over IIOP) and other serialization situations -- compact on the wire, yet safe for ensuring the same bytecode is using it on each end. I rarely use the default Java object serialization across the wire, because I think it's too fat (even compressed). All of this while handing a variable inheritance tree is tricky, but it served the specific application very nicely. Oh yea, they were also annotated for use in Java 5 Persistence (via Hibernate) and that's where they were mostly used. But, I'm WAAAY off topic! (sorry guys!
)
So since I'm doing the networking from the ground up, I'm just trying to make sure the quality is top notch. I've refactored and reexamined the design a number of times now (sometimes on paper, UML or text/word doc, other times in code). I'm getting happier with the design, I just want to make sure it's nice and clean.
If I find a UML editor (preferably one that at least does descent C++ reverse engineering) I'll try to spit out another class diagram and maybe convert the text I posted earlier into a real visual sequence diagram (although I think the text at least serves it's purpose). I want to make sequence diagrams for each major networking operations during game play as well (what I covered is just in the lobby). Most of this is already in place, it's just getting altered.
Also, I've added this Printable C++ class (an abstract interface) and an ObjectPrinter class to print Printable objects and I quite like it. Having this in place will make debugging the networking code very nice. Example output:
361750: sent to peer[0]: NetworkMessagePing {
NetworkMessage {
size = 22
type = NMT_PING
writing = false
simRxTime = 292632639351
}
id = 213
time = 292632534356
timeRcvd = 0
pong = false
}
The idea here is to cut out as many possible ways to be confounded as reasonably possible. Silly bugs can be hard to trace down once they go across the wire, is the problem on the client or the server? Well with all messages logged, it's easier to tell.
Looks good.
Thanks!
OT:
but this is the nature of a requirements/specification text
Apparently this is a specific language. I read this about the C++ Standard by James Kanze at http://groups.google.com/group/comp.lang.c++/browse_thread/thread/28b14a1308974070:
"The standard is written in a variant of English sometimes called standardese. It's designed (or at least intended) to be
absolutely precise and unambiguous, even at the cost of understandability. It doesn't always succeed with its intent,
but in all cases, precision and a lack of ambiguity have precedence over readability."
Hah! no doubt, it definitely begins to become a language of it's own. But if I don't specify things like this, then people die. Well.... not actually at the moment, but if I were working on code for life support systems, heavy machinery, etc., people could die from ambiguity. Certainly projects, careers and businesses literally die, right and left as a result of these types of mistakes (it's scary!). But I would rather be on a low-paying project with a high chance of success than a six figure project that's doomed (I've been there, it's scary as hell and not worth the pay!).
So anyway...
[0.2.12]: Clients should be able to connect when server is in lobby but there's not an open slot set to "network" (i.e., be in limbo for a time while host changes settings)
Will the server want the first people in to automatically be assigned to a slot? and it doesn't explain what happens when there are two people in limbo and a slot is opened.
I propose that a que (with a max amount of items) be created where players are sent to when they join. The server can then add or remove the desired network or CPU players to or from a slot (the position of which is moveable by the server). Empty slots should be visual and numerical.
Perhaps before clients connect server can adjust settings then press a listen button to allow clients to enter the que (something useful for a master server so games don't appear immediately).
How will specators be dealt with?
Spectators! What a wonderful idea! (why didn't I think of that?
So I think that sounds like a lovely idea and very apropos. So perhaps when a client initially connects, they automatically go into the observer pool as a substitute for "limbo". The person on the server then has to select who they want in which slot. Alternately, people can be automatically sucked out of the observer pool when the server sets a slot to be network controlled and kicked back to the observer pool when they close it or set it to AI, plus giving them the option to manually move them around. I dunno how to best do that in the UI at this point, but I know how to best implement it in the supporting classes that the UI will interact with.
However, spectators will require a new enum entry for the NetworkRole enum (I've already added them
and some other various code here and there to manage it. Because I want to allow two players to control the same faction (optionally of course) as well as allow players to control more than one faction on their team, this presents its self at a good time. If coded correctly, it can actually simplify things more than complicate it. Each player basically gets a list of factions and teams they can control as well as factions and teams they can observe. This is important for good AI when scenarios involving compound teams to best simulate the story line (i.e., having two AIs, each configured differently, both controlling the same faction can produce some interesting, if not confusing outcomes).
# GsAutoRepairEnabled - rather or not auto-repair is allowed
# GsAutoReturnEnabled - rather or not units will automatically return from auto-commands like auto-attack, auto-repair, etc.
I don't know if I agree with GsAutoRepairEnabled and GsAutoReturnEnabled being forced on clients. It seems like personal preference to me.
Also here are some things that you didn't mention: syncing tech trees or downloading maps, password protected joining.
hmm... Some may see these as a bit of cheating because the computer is doing something for you, so I feel that it's probably important to allow the server to define rather or not they can be enabled in the game rules. I hadn't considered that in a network game, the host allows them, but one of the players may not wish to use them, so I agree, there should be a way to disable it for the client that doesn't want it. So perhaps it's only enabled if it's enabled in the local game settings and also the network GameSettings? We can worry about a pretty way to present that in the UI later (as long as the actual rules make sense for now).
Thanks for your feedback hailstone!
By syncing, do you mean the ability to play on a map or tileset that one player does not have? If so, that is a must. Not sure how that'll cope with a tileset though, seeing the size of that.
No, I'm referring to the synchronization of units in game. I'm not opposed to a feature that allows you to transfer content files while in the game lobby, there is already full support for transferring files in the code (that's now network games are resumed, the server sends each client the saved game). However, I just want a nice well-thought out paradigm. My primary concern is that whatever functionality that allows people to share content needs to be absolutely safe from exploitation. That's the only reason I don't quickly throw in a few lines of code to allow you to sync tile sets, maps and tech trees with others from inside the game (I want it done right basically). My real preference is to have a system similar to Wesnoth where there are update servers and you can download mods, tilesets, etc. from there. This gives some ability for files to be monitored and checked for exploits should any surface. Then, if two people wanted to play but one player didn't have the files, the client could sent the file data (summary) to the other client and they could then retrieve it from the main server (from in game). All of this is functionality I don't plan on personally pursuing very soon.
Why can't we have each player choose his or her own tileset? The as long as the walkable/unwalkable parts are the same, it shouldn't change gameplay. (most tilesets have the same items as walkable/unwalkable anyway).
Currently, it can be raining on one network game and clear in another. That's a bug (in bug database) and will be fixed soon in >=0.2.12. Because tilesets define weather and can potentially effect visibility, I'm not sure that it would be appro0priate to allow different tile sets. Either way, that would also require hacking up the game further and I'm not sure I'm in favor of that particular idea.
Lookin' good. I never could understand network code. That's the one thing worse than AI. (AI isn't that bad actually, unless we are talking about RTS AI, which I imagine is the hardest).
Thanks! OT: No, RTS AI isn't the hardest at all! RPG AI (of the type we haven't seen yet) is the hardest IMHO. I started designing a personality engine to simulate real interactions with NPCs a few years ago just to see how closely we could make a video game character behave like a real living organism. I came up with some interesting ideas, but decided that the end result (after a lot of work) probably wouldn't benefit man kind because it could become too engrossing and video games (especially MMORPGS) are already far too immersive as it is! I had the help of a friend who's studying psychology and already has a degree in biochemistry. This was valuable because the first level of the design was the simulating the reptilian brain (you can't simulate a personality until you understand the layers and instincts that make up a personality, animal, human, imaginary species, or otherwise). You have to run a simulation for each new character based upon events in their lives that form their persona, coupled with their genetics, environment and social interactions. Once you do that, you can use the persona data to have an RPG character that interacts with you in a fashion based upon their (simulated) life experiences. Further yet, memory continues to accumulate and the process never stops, so the next time you interact with them, they will respond according to how previous interactions went. This was originally an extension of Everquest's crappy "faction system" when I was doing some RPG hacking long ago. -- But again, WAAAAYY off topic!