Writing a C# or Java client? |
Mon, 03 July 2006 17:00 |
|
ekolis | | | Messages: 51
Registered: May 2006 Location: Cincinnati, OH, USA |
|
|
Say... I can get the server to compile, but not the client (can't figure out how to configure wxWidgets properly!)... I've also wanted to write my own 4X game, but I've never been able to follow through on it... Perhaps an easier task would be writing a new client for FreeStars in C# or Java (my C++ skills are quite rusty )? Since IIRC the client doesn't interact directly with the server (it only interacts through the various game files), perhaps this is doable? If so, could someone point me in the direction of the formats of the various files used by the client?
Thanks!
edit: oops, it looks like I was mistaken in my belief that the client and server communicate through game files only
http://starsautohost.org/sahforum/index.php?t=msg&th=284 6&start=0
Does this mean that writing a client in another language is impossible, or that it will simply take some wrapper classes around the server API's? If that's possible... boy, there are a lot of API's, according to the documentation! Any suggestions as to where to start?
[Updated on: Mon, 03 July 2006 17:04]
Mr. Flibble says...
Game over, boys!Report message to a moderator
|
|
|
|
Re: Writing a C# or Java client? |
Mon, 03 July 2006 19:27 |
|
ekolis | | | Messages: 51
Registered: May 2006 Location: Cincinnati, OH, USA |
|
|
I looked at swig and it appears that it only supports C fully as an input file, not C++ - certain features of C++ simply won't work...
However, in C# it's fairly simple to import methods, etc. from a C++ DLL... the problem would probably be that FreeStars seems to use a lot of pointers, which is of course typical for C++ but might be problematic for writing a C# wrapper, seeing as I've never messed with what C# calls "unsafe" code... (Yes, I do know what pointers are; they are just such a pain for me after being spoiled by reference types! )
Your client uses wxWidgets too, right? I just couldn't get that thing to configure or link or something when I tried to build the "default" client... that's part of the reason I'm wanting to write my own - I want to have one that doesn't use wxWidgets so I can play around with FreeStars!
Though sometimes I wonder, should I even bother, because if the rumors of Empire republishing Stars are true, we might all get shut down - they are a rather evil company, having killed off Stars in the first place, after all...
Well, guess it's time to have a look at the API docs and figure out how to make C++ pointers work in C# programs!
edit: Well, I looked around, and it looks like it's only easy to import static functions from C++ into C# - no classes or anything; to do that I'd basically have to rewrite the classes from scratch! So much for that idea...
[Updated on: Mon, 03 July 2006 20:00]
Mr. Flibble says...
Game over, boys!Report message to a moderator
|
|
|
|
Re: Writing a C# or Java client? |
Thu, 06 July 2006 07:31 |
|
m.a@stars | | Commander | Messages: 2765
Registered: October 2004 Location: Third star to the left | |
|
LEit wrote on Wed, 05 July 2006 17:11 | It should be possible to write a client in any language you want to use. However, some of the logic needs to be the same as the server, and the easiest way to do that (and to maintain it through changes) is to use the same code, so some way of using a C++ library would be make writing a client much easier.
|
I wonder just how many formulas that library should implement, and how would each be queried.
As in
fuelspent = getFuelUsage(mass, warp, engine)
newPop = getPopGrowth(initialPop, raceInfo, planetValues)
and so on...
Do we have a listing of just what kind of info will clients (and client-coders) need, and how will the server provide/create it?
So many Stars, so few Missiles!
In space no one can hear you scheme! Report message to a moderator
|
|
|