Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Bar » Stars 3
Re: Stars 3 Thu, 05 June 2014 07:55 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
theval wrote on Thu, 05 June 2014 13:52
No, I'm working a Qt GUI for freestars. I have no time to contribute to your project, though I appreciate your effort and wish you success.

Cool. Does that mean you have a clear idea which parts of Freestars are more geared towards the client-side or the server-side of things? Will it also perchance mean your "Qt GUI" could be a client for some other server? Sherlock



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 08:12 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
m.a@stars wrote on Thu, 05 June 2014 13:55
Cool. Does that mean you have a clear idea which parts of Freestars are more geared towards the client-side or the server-side of things?


Absolutely. 95% of FreeStars is a set of classes that allow you to pull various functions of the game, load structures, etc. A server is just a CLI executable that takes a file or a set of files as an input and produces another file or a set of files as output.

As far as GUI is concerned, I just grab a .m file with FreeStars API (basically the same set of classes), load it into the memory and show stuff in various widgets. The GUI will eventually use REST API, similar to what you're proposing to submit race files to starting games, pull game files from a running game and submit your orders.

It would be trivial then to use a language of your choice to create a set of scripts that implement this REST API to feed these files into freestars executable, inform the client about turn completion, etc.

m.a@stars wrote on Thu, 05 June 2014 13:55
Will it also perchance mean your "Qt GUI" could be a client for some other server? Sherlock


As long as the other server supports FreeStars file data format.

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 08:23 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
theval wrote on Thu, 05 June 2014 14:12
As long as the other server supports FreeStars file data format.

That can be negotiated. Cheers



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 09:00 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
m.a@stars wrote on Thu, 05 June 2014 13:23
theval wrote on Thu, 05 June 2014 14:12
As long as the other server supports FreeStars file data format.

That can be negotiated. Cheers

Doesn;'t necessarily need negotiation - conditional on translation being possible...

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 10:10 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
Is there a document specifying the file format(s) used somewhere?

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 10:15 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
mrvan wrote on Thu, 05 June 2014 16:10
Is there a document specifying the file format(s) used somewhere?


No, but it is pretty self-explanetory. The Data folder of FreeStars code tree contains an example of a full game with host/gen/uni/player/order files. My client can open any of 3 player files. Here is a link to one of them:

http://sourceforge.net/p/freestars/code/HEAD/tree/trunk/Data /TestGame.m1

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 10:40 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
Cool, thanks. Those files will be useful in any case as testfiles.

I concluded from the fact that the last post in the freeciv folder was 3 years old that development had died, but apparently this is not the case?

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 11:12 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
mrvan wrote on Thu, 05 June 2014 16:40
Cool, thanks. Those files will be useful in any case as testfiles.

I concluded from the fact that the last post in the freeciv folder was 3 years old that development had died, but apparently this is not the case?


Well, I have absolutely no relation to original FreeStars developers. But that's the beauty of open source software that you can grab a piece you like and continue working on it.

Eventually I'll have to publish my changes as GPL 2 license dictates, so yes, it continues.

Shocked I just realized the power of GPL 2 Shocked It gives additional motivation to create software! With GPL 3 or BSD I can grab a half-completed project and use it in some other commercial project and you'll never know where your efforts went. Whereas GPL 2 virality pushes me to invest into the project and not divert efforts to my own ventures.

So, on one hand we can think of a GPL 2 project as a viral openness project, on the other hand we can think of it as a self-propelling through freedom project. Yes

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 11:37 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
XAPBob wrote on Thu, 05 June 2014 15:00
Doesn;'t necessarily need negotiation - conditional on translation being possible...

I meant this kind. Teleport



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 12:17 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
@theval: I know the GPL only dictates releasing the code as soon as you publish your binary, but I would like to encourage you to put your client code up on github immediately. You shouldn't worry about code not being "ready", 99% of projects on github aren't ready by any definition. The worst that can happen is that everyone ignores it, but if you don't publish it that will happen as well...

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 14:36 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
mrvan wrote on Thu, 05 June 2014 18:17
@theval: I know the GPL only dictates releasing the code as soon as you publish your binary, but I would like to encourage you to put your client code up on github immediately. You shouldn't worry about code not being "ready", 99% of projects on github aren't ready by any definition. The worst that can happen is that everyone ignores it, but if you don't publish it that will happen as well...


Pushed, please have a look:
https://github.com/vkholodkov/freestars

Event though cmake easily generates make files for Windows I'm not going to release any binaries, because I don't want to build them using MSVC. Instead, I want to setup MinGW and it takes time and effort. But it's my priority at the moment, so if you really want, please do it. I'll be happy to incorporate build system fixes that makes it compile on Windows.

If you have no patience to get your head around it, here are couple of screen shots:

Game view:
[img]http://www.grid.net.ru/freestars/ss/freestars_june5.png[/img]

Advanced New Game Wizard victory conditions page:
[img]http://www.grid.net.ru/freestars/ss/angw_june5.png[/img]

So what is the state of things now?

Done:
* player file loading
* messages view
* planet status tiles
* basic map view
* planet habitability and minerals report

Challenges:
* there is no one yet to populate messages file (messages.ts). FreeStars is supposed to produce a lot of messages as tags. Would be great if some could grep lines such as "AddMessage(" and add the text to the messages.ts. After translating messages.ts messages will appear in full in the message view.
* lot's of graphics is not available, such as planet icons, tool bar buttons, as well as symbolic images that stars! is full of.
* various important tit bits are not implemented, such as text colouring (e.g. planet value), thousand separator, etc
* need to write stories, such as "If you colonize this your population will grow by that. You posses technology to terraform to that". There are myriads of them and they all depend on various factors --> requires experienced player so as not miss anything

This is it so far. Apart from that, I'm having fun working on it in my spare time...

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 14:48 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
Oh yeah, requirements.

You need cmake installed, Qt4 with linguist tools, gcc on linux and MSVC on Windows.

After MSVC projects are generated, add include and library paths to Qt (not needed on Linux). Make sure QtCore4.dll and QtGui4.dll are either in your path or in current directory.

Run the client from the top source directory, so that it can find rules/ (might crash otherwise).

github is always welcoming your issues if you find one.

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 14:50 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
theval wrote on Thu, 05 June 2014 20:36
So what is the state of things now?

You mean everything else is already done & working, server-side? Sherlock

I can provide stories. Twisted Evil There was also the full dump of all Stars! preformatted msgs



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 15:05 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
m.a@stars wrote on Thu, 05 June 2014 20:50
theval wrote on Thu, 05 June 2014 20:36
So what is the state of things now?

You mean everything else is already done & working, server-side? Sherlock


The server side seems to be 80-90% complete. But this doesn't bother me whatsoever. The reason for this is that structurally complete engine is MUCH MUCH easier to extend (which is the case now). I.e., even though some details might not be working, I can see that the game is loading and I fetch most of the objects from it.

m.a@stars wrote on Thu, 05 June 2014 20:50
I can provide stories. Twisted Evil


Cool! We need to agree how I can supply you context, i.e. what is available and in what range.

m.a@stars wrote on Thu, 05 June 2014 20:50
There was also the full dump of all Stars! preformatted msgs


This looks like creative work done by original authors. Someone has to artistically rewrite it. Only after that it can go in.

Then it needs to be matched with the output of grep "AddMessage(" *.cpp in Server/ dir and put into QtClient/messages.ts





Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 15:15 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
I managed to build/run using the following

$ sudo apt-get install cmake libqt4-core libqt4-gui liqt-dev
$ cmake CMakeLists.txt
$ make
$ cd QtClient
$ ./fs-client-qt

When I run it and open TestGame.m1 I get an error: basic_string::_S_construct null or not valid.
When I do Game-> New I get the new game dialog, but am unable to select any players (clicking/right clicking the diamonds does nothing)

Am I using a wrong version of QT or missing some dependencies?

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 15:26 Go to previous messageGo to next message
LittleEddie is currently offline LittleEddie

 
Lieutenant
Helped track down one or more Stars bugs

Messages: 517
Registered: February 2011
Location: Delaware
Just to get things up to date in my mind (that's a good one) Laughing

Edit: And this thread is moving fast....

There's no use reinventing the wheel, as in the logic mostly works and it's something to get ideas from.

Stars! Nova code can be found here:
https://sourceforge.net/p/stars-nova/code/ci/master/tree/
// ============================================================================
// Copyright (C) 2008 Ken Reed
// Copyright (C) 2009, 2010 The Stars-Nova Project
//
// This file is part of Stars! Nova.
// See <http://sourceforge.net/projects/stars-nova/>.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>
// ===========================================================================


FreeStars
https://sourceforge.net/p/freestars/code/HEAD/tree/

Copyright 2003 - 2005 Elliott Kleinrock, Dan Neely, Kurt W. Over, Damon Domjan

This file is part of FreeStars, a free clone of the Stars! game.

FreeStars is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

FreeStars is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with FreeStars; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

The full GPL Copyright notice should be in the file COPYING.txt

Contact:


[Updated on: Thu, 05 June 2014 15:32]

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 15:37 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
mrvan wrote on Thu, 05 June 2014 21:15
I managed to build/run using the following

$ sudo apt-get install cmake libqt4-core libqt4-gui liqt-dev
$ cmake CMakeLists.txt
$ make
$ cd QtClient
$ ./fs-client-qt



When I run it and open TestGame.m1 I get an error: basic_string::_S_construct null or not valid.


You need to say QtClient/fs-client-qt from freestars/ folder, because the server code is trying to open rules/MyModRules.xml which is obviously not available in QtClient/

mrvan wrote on Thu, 05 June 2014 21:15
When I do Game-> New I get the new game dialog, but am unable to select any players (clicking/right clicking the diamonds does nothing)


I just started working on this part yesterday.

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 15:40 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
LittleEddie wrote on Thu, 05 June 2014 21:26

FreeStars
https://sourceforge.net/p/freestars/code/HEAD/tree/


Right, this is where it comes from.

LittleEddie wrote on Thu, 05 June 2014 21:26

Copyright 2003 - 2005 Elliott Kleinrock, Dan Neely, Kurt W. Over, Damon Domjan


I tried to contact Elliott, but my mail bounced and he hasn't been on the forum for many years...

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 16:23 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
theval wrote on Thu, 05 June 2014 15:37

You need to say QtClient/fs-client-qt from freestars/ folder, because the server code is trying to open rules/MyModRules.xml which is obviously not available in QtClient/


No luck Sad

http://i.imgur.com/jRHkY9G.png

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 16:30 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
mrvan wrote on Thu, 05 June 2014 22:23
theval wrote on Thu, 05 June 2014 15:37

You need to say QtClient/fs-client-qt from freestars/ folder, because the server code is trying to open rules/MyModRules.xml which is obviously not available in QtClient/


No luck Sad

http://i.imgur.com/jRHkY9G.png


And if you try this?
https://github.com/vkholodkov/freestars/commit/26970f1e58f81 ddc022facd6d46f2cf3ac2e080b

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 16:38 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
Still no luck I'm afraid

http://i.imgur.com/pMW50X1.png

I normally don't use Qt, so is it possible I'm just missing some kind of library?

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 16:43 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
mrvan wrote on Thu, 05 June 2014 22:38
Still no luck I'm afraid

http://i.imgur.com/pMW50X1.png

I normally don't use Qt, so is it possible I'm just missing some kind of library?


It's possible that it is missing some file that I forgot to commit. You can try to trace it:

$ gdb QtClient/fs-client-qt
$ r
$ bt full

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 17:08 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
I'm not sure how the tracing works, but this might be a hint:

81 ../sysdeps/unix/syscall-template.S: No such file or directory.

full trace at https://gist.github.com/vanatteveldt/e6c67e4a196f9d76ec85

(I ran the program, got the error, pressed control+c to get the prompt, then ran the race. Was that what I was supposed to do?)

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 17:15 Go to previous messageGo to next message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
mrvan wrote on Thu, 05 June 2014 23:08
I'm not sure how the tracing works, but this might be a hint:

81 ../sysdeps/unix/syscall-template.S: No such file or directory.

full trace at https://gist.github.com/vanatteveldt/e6c67e4a196f9d76ec85

(I ran the program, got the error, pressed control+c to get the prompt, then ran the race. Was that what I was supposed to do?)


It's already too late at this point. I'm afraid in order to dig down to the solution you need to set a break point at FreeStars::MainWindow::loadPlayerFile and then step over or into depending on the context:

$ b FreeStars::MainWindow::loadPlayerFile
$ s or n depending on the context

You might also want to try to break at FreeStars::Game::LoadPlayerFile, but I feel that by then the exception is already thrown.

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 18:43 Go to previous messageGo to previous message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
theval wrote on Thu, 05 June 2014 21:05
Cool! We need to agree how I can supply you context, i.e. what is available and in what range.

Send me an email. Smile


Quote:
This looks like creative work done by original authors. Someone has to artistically rewrite it. Only after that it can go in.

Ouch! It looks like just log msgs to me, with just a touch embellishment here and there. Lurking



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Previous Topic: Stars! on a tablet ??
Next Topic: Replacement needed.
Goto Forum:
  


Current Time: Fri Apr 19 17:41:41 EDT 2024