LuaVegaOgre : About

The point of no return for both Ogre ports. Permanent links will be stickied on top with current information of each port (Lua and Python)

Moderators: ghoulsblade2, strook

Post Reply
ghoulsblade2
Bounty Hunter
Bounty Hunter
Posts: 136
Joined: Tue Jul 27, 2010 7:41 pm
Location: germany
Contact:

LuaVegaOgre : About

Post by ghoulsblade2 »

NOT YET PLAYABLE, beware, at the moment this is just a small technical experiment.

LuaVegaOgre is my experiment with vegastrike data in ogre3d engine with heavy lua scripting, not using the original codebase at all, so rather an attempt to rewrite from scratch.

Don't confuse with strook's vegaogre that rather uses the original codebase and python,
Original forum thread: http://vegastrike.sourceforge.net/forum ... 27&t=15545

screenshots and vids :
http://www.youtube.com/watch?v=nKH-Y6-xLSs (early fly around test, outdated)
http://vegastrike.sourceforge.net/forum ... &mode=view
http://vegastrike.sourceforge.net/forum ... &mode=view
http://vegastrike.sourceforge.net/forum ... &mode=view
http://img34.imageshack.us/i/space10.png/
http://www.youtube.com/watch?v=Em7A3RJ7J6I&hd=1 (ship models imported)
not playable, just an experiment and worked on only infrequently.

github https://github.com/ghoulsblade/vegaogre
includes ubuntu natty (11.04) 64 bit binary, but not tested on other machines. (you'll need ./installdeps.ubuntu.sh)
run using ./start.sh
if it fails try compiling using
./installdeps.ubuntu.sh && ./premakelinux.sh --nosound
see also README.txt
ghoulsblade2
Bounty Hunter
Bounty Hunter
Posts: 136
Joined: Tue Jul 27, 2010 7:41 pm
Location: germany
Contact:

Re: LuaVegaOgre : About

Post by ghoulsblade2 »

oh, nice, a subforum, thanks =D

(currently working on reverse engineering the vegastrike network protocol and then building a simple lua server that doesn't blow up when i buy a new ship)
charlieg
Elite Mercenary
Elite Mercenary
Posts: 1329
Joined: Thu Mar 27, 2003 11:51 pm
Location: Manchester, UK
Contact:

Re: LuaVegaOgre : About

Post by charlieg »

Paying attention, as always 8) I'm curious to see how far you take this. Looks good so far.
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: LuaVegaOgre : About

Post by pheonixstorm »

Making this a sticky so we don't lose the info in some obscure thread
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
ghoulsblade2
Bounty Hunter
Bounty Hunter
Posts: 136
Joined: Tue Jul 27, 2010 7:41 pm
Location: germany
Contact:

Re: LuaVegaOgre : About

Post by ghoulsblade2 »

making progress on the network protocol, i'm catching the traffic between client(vegastrike from svn trunk) and server(vegaserver from svn trunk)
and finding out what the raw data means.

This way i can implement the protocol without needing to port a whole bunch of classes from the old vegastrike network code, which is rather... urr.. "complex" =)

http://vegastrike.sourceforge.net/wiki/ ... ket_format
has an interesting list of what network packets are available,
it might not be up to date, and is missing a bunch of info, but you can see the general direction.

after a bunch of digging and experimenting, i found out that each packet is prefixed with 2 headers :

Code: Select all

vegastrike/src/networking/lowlevel/vsnet_sockettcp.h:71: struct Header // VsnetTCPSocket::Header
vegastrike/src/networking/lowlevel/packet.h:24: struct Header // Packet::Header
The first header, VsnetTCPSocket::Header, has length, priority and flags, mostly used to organize the data chunks on a socket i guess, possibly for mix with udp, not sure if that's used tho, i'm only looking at the tcp part so far.

The second one, Packet::Header, has the actual command from that list, like CMD_CONNECT, CMD_CHOOSESHIP etc, serial, timestamp, datalen and flags,
which is what i was looking for.

so unless there's some more special cases i missed for the protocol itself or udp,
all that's left is to interpret the payload data, which is different for each command,
but should be easy to look up in the vegastrike source.

So looks like we might soon get a new server =)
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: LuaVegaOgre : About

Post by pheonixstorm »

I think udp and tcp are supposed to be used, both are programmed in. I also read somewhere that the packets were supposed to be compressed but I don't know if they actually are or not.

Think you can make a new net driver for the server that can handle a few thousand connections w/o a hitch? And if you want to go ahead and try making it threaded which would be better to use boost.threads or the OS native threading headers (pthread/MS threading) through a wrapper like zthread?

I'm not entirely sure but I think boost threads were supposed to be simple and easy to use compared to actual native threading code... Anyway.. there's my thoughts and question.

One last question (popped into my head right when I moused over submit). What would be best to thread. Each connection/player or each unit (AI and players)?
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: LuaVegaOgre : About

Post by pheonixstorm »

while i'm thinking of it, have you checked out the networking code for Ryzom? Its the only commercial mmo that has open sourced itself. Might be worth a look for some ideas or pointers :lol: stupid programming humor
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
ghoulsblade2
Bounty Hunter
Bounty Hunter
Posts: 136
Joined: Tue Jul 27, 2010 7:41 pm
Location: germany
Contact:

Re: LuaVegaOgre : About

Post by ghoulsblade2 »

"net driver for the server that can handle a few thousand connections w/o a hitch"
if vegastrike multiplayer ever gets so popular that there's a few thousand players online at the same time, then there'll also be a bunch more programmers around to improve the netcode ;)

For now i'm aiming at singlethreaded for a few dozen players.
If that is regularly exhausted, which i doubt,
we can still upgrade it to multi-threaded for possibly 100 or so.

There's a number of things you can do with treads, depending on workload, number of players etc, per connection is one possibilty that can tie to network speed well,
otherwise a pool of worker threads that gets "jobs" could use cpu-cores more efficiently than hundreds of threads and allow load balancing. But we can think about those if they really become neccessary =)
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: LuaVegaOgre : About

Post by pheonixstorm »

I think tharin had at most 20 or so connected at one time. For that few connections I can always ask sourceforge if we can host a dev server there. If not maybe our new site host provided we dont suck up a lot of cpu and ram.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
ghoulsblade2
Bounty Hunter
Bounty Hunter
Posts: 136
Joined: Tue Jul 27, 2010 7:41 pm
Location: germany
Contact:

Re: LuaVegaOgre : About

Post by ghoulsblade2 »

I have a server rented with a bunch of spare cpu that should be fine for a dozen players or so.
Unlike the original vegastrike server (afaik) i don't want to simulate the full universe all the time.
Only stuff that happens near the players. e.g. in their system, or possibly only at the planet/station where they currently are, so load shouldn't be that high.

Ryzom : I was heavily involved in the opensource 3d client iris for the good old ultima online mmo,
there's also a opensource server called runuo made by the community for that (which we often looked up net protocol in). Lots of free servers use this server software, some of which have over 100 players average online, so i'm a bit familiar with mmo networking code already.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: LuaVegaOgre : About

Post by pheonixstorm »

Nice to know. I bring up Ryzom though (to anyone who does opensource) simply because it is a commercial product and in theory should have higher quality code than some opensource projects. Thats theory anyway... Also why (somewhere) I mentioned the Quake networking code from Quake Arena I think it was or one of the quake games Id did that is supposed to be highly optimize (even for 10 year old code)

One question though, do you use C or C++ plus for networking code and which would actually be better?
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
ghoulsblade2
Bounty Hunter
Bounty Hunter
Posts: 136
Joined: Tue Jul 27, 2010 7:41 pm
Location: germany
Contact:

Re: LuaVegaOgre : About

Post by ghoulsblade2 »

Ryzom : dunno, too much effort to study it properly, you'd have to get the game to run and know how gameplay works to make much sense of the code, and ryzom is fantasy afaik, so walking around on fairly limited terrain rather than flying in a system spanning lightminutes, so hard to tell if any techniques used there will even be applicable to vega.

C/C++ : neither, i use lua for network code. Heavy scripting, C++ is just for making libs accessible in lua, and optionally for optimizing processor intensive calculations, but that's only done late when there really are measurable bottlenecks.
Dair
Star Pilot
Star Pilot
Posts: 4
Joined: Thu Oct 13, 2011 6:41 am

Re: LuaVegaOgre : About

Post by Dair »

Ryzom is nice because it utilizes a multi-service architecture which means it can scale up without any reworking on that end, but like you say just understanding its inner workings and seeing how applicable it would be will take a great deal of effort. Also my experience with Ryzom was that they really focused on designing the engine around specific goals and limitations, its actually one of the reason I chose not to use their engine in a project I am working on because their physics and level design was really simplified in some aspects and it meant alot of core would need to be reworked. There comes a point where you if your going to change that much core stuff you might as well write something new or find something more applicable even if its simpler and less fully functional.

Personally I think a good point to make, that I believe you are already aware of is, until you really know what you need its hard to say what will work best for networking and server architecture. Plus it should also be noted that bandwidth is probably not the greatest concern in the server, generally most hosting setups will provide a 100mbs connection at several gigs of data a month which is plenty for a starting out playerbase, and should be enough hundreds of connections using a reasonably well thought out network protocol, the current servers I run and test/develop on I think could reliable support up to around 1000 players given the methods used, where I am not server the can handle the load though is in processing all the world events, AI, physics etc, but I hope to discover in the not so distant future.

I think ultimately as you suggest the greatest optimizations will be make sure that your only running portions of universe where there is players to interact, AI, physics, database querying, socket handling, and passing events around from process to process or service to service will turn into your biggest load I think. Even then I believe you're going to need a heck of alot of players to see your server loading up heavily, but until you do you won't really know what to optimize towards.

You might want to take a look at the WorldForge libraries ( https://github.com/worldforge) namely atlas-cpp, eris, metaserver-ng, skstream, as the overall goal was to be open ended in design to be useful for any style of mmorpg game type, its very modular, well designed, and readable code and might be worth a look. There are limitations and issues, but this is mostly to due to the philosophy of not trying to optimize until you really understand where the problems are. As evidenced in the following conversation a few years ago on the mailing list. http://mail.worldforge.org/pipermail/ge ... 06224.html

I hope you don't mind my adding my two cents here, but I thought it couldn't hurt to add some input since I've run both a Ryzom server for testing, and still maintain a number of WF ones which perform very admirably on a small to medium scale internally, I'm really looking forward to seeing how they load up in the future.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: LuaVegaOgre : About

Post by pheonixstorm »

All input is welcome. Other than the current VS sever I have only tested a few of the WoW clones such as Ascent/Arcemu and Mangos. I still haven't completed an Evemu setp but want to.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
Post Reply