Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » FreeStars » Writing a C# or Java client?
icon3.gif  Writing a C# or Java client? Mon, 03 July 2006 17:00 Go to next message
ekolis is currently offline ekolis

 
Petty Officer 2nd Class
Stars! Nova developer
Stars! Nova developer

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 Wink)? 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! Very Happy

edit: oops, it looks like I was mistaken in my belief that the client and server communicate through game files only Sad
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 17:28 Go to previous messageGo to next message
Bdragon is currently offline Bdragon

 
Crewman 3rd Class

Messages: 4
Registered: July 2005
Well, there'd have to write a bridge of some sort, the API is a c++ api. Possibly a swig wrapper would be enough. (I should look into that sometime..)

Actually, it would be nice to have a client library that sits on top of libfs and manages stuff clients need to manage.... The raw libfs library is kinda confusing at times...

As far as clients go, the more the merrier Very Happy

(various links)
http://refdesk.rtk0.net/fsdocs/ (api docs)
http://sourceforge.net/projects/frontierproject (the client I'm writing)
http://sourceforge.net/projects/gstars/ (another client)
http://www.swig.org/ (simplified wrapper and interface generator)

Report message to a moderator

Re: Writing a C# or Java client? Mon, 03 July 2006 19:27 Go to previous messageGo to next message
ekolis is currently offline ekolis

 
Petty Officer 2nd Class
Stars! Nova developer
Stars! Nova developer

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... Sad
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... Razz (Yes, I do know what pointers are; they are just such a pain for me after being spoiled by reference types! Wink)
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! Razz
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... Sad
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! Wink

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! Razz 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? Wed, 05 July 2006 11:11 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
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.


- LEit

Report message to a moderator

Re: Writing a C# or Java client? Thu, 06 July 2006 07:31 Go to previous message
m.a@stars is currently offline 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. Teleport

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? Sherlock



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Previous Topic: New Technology Browser
Next Topic: Stupid question - where's the server code?
Goto Forum:
  


Current Time: Fri May 03 23:17:53 EDT 2024