Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Bar » Stars 3
Re: Stars 3 Mon, 02 June 2014 10:45 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
Not to take attention away from the pretty lights, but if we want to move forward with this I think

1) everyone interested in contributing should approve or critique the current engine setup
2) everyone interested in contributing should pick one (preferably simple) step in the order of events and do a first (possibly incomplete) implementation

I think tasks that are simple to implement are: [with possible simplifying assumptions in brackets]

16 mining
17 production [limited to factories/mines/defenses/scanners and maybe terraforming?],
19 properly implementing pop growth including planet hab values
2+3+5 wp0 load/unload tasks [limited to colonists][assuming infinite fleet capacity]

I have no preference so I'll happily pick whatever no one else picks.

These are not as romantic as BB fights or fleet design, but I feel that it is important to move the project to a shared project and start getting code out there.
If these basic tasks are there is even becomes possible to make a not totally trivial client; in fact it is enough to do a bit of testbedding on optimal pop growth/resource integrals.

I have not problem helping out with writing python, unittests, and working with git. There is a download as zip link on github so you don't need anything else than python to get started.




[Updated on: Mon, 02 June 2014 10:48]

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 12:25 Go to previous messageGo to next message
platon79 is currently offline platon79

 
Chief Warrant Officer 3

Messages: 185
Registered: February 2004
Location: Norway
It's great to see that the thread I started have sparked such an interest in writing an open source implementation of stars! I really hope that it will succeed this time. I think the architecture presented shows great promise. Being a software developer myself, I'd like to contribute, but with 3 small kids, and no knowledge of phyton I don't think I will have the time at the moment. Maybe when the server is ready I can help with the implementation of a java or Android client.

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 12:41 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
Hey Platon,

Great to know you are interested in the project!

I think most of us have little time, so it would be great if you could somehow be involved, if only in code review or thinking about architecture.

Also, you should really not be afraid by python. For example, take a look at the move fleets stub code. If you know any language like C, C#, or Java you should be able to read and write it fine (once you get over the indentation-as-blocks).

This link seems to have a very compact overview of python syntax and semantics aimed at programmers, so it might be worth having a look at.

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 13:25 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
Writing python is very like writing pseudocode. nithing to fear Wink

I might grab population growth (two modules, one for planets, the other for shipping)

I presume we're replicating existing behaviour at the moment.
Also I recall that Hab is an integer -26<H<101 and H!=0...

I'll need a second call available to calculate the "next year pop" for the people doing the autobuild queues.


[Updated on: Mon, 02 June 2014 13:32]

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 13:45 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
I have the working code for the RaceWizard in Javascript (and C), which includes Hab value calculations (as reverse-engineered from the EXE, refactored by me) and Terraforming (crafted by me, and apparently accurate). There's several "unit" tests, and a few comments. It should be easy to port to Python by anyone who knows Python. Rolling Eyes

I also have the Fuel Usage code, which includes travel & coords calculations (for fleets and packets), as Stars! does them. The packet part includes decay and is apparently accurate. Whip

There's also the old Econ calculator, which includes math about max Terra, Pop, Facts, Mines, etc. Also in js. Work at computer

My version of the Order of Events is a bit more "deconstructed" and has more smaller sections. We should probably compare notes ASAP. Sherlock

Last but not least, the All Items Table dumper has a lot of code to deal with techs, items, engines, and hulls that could perhaps be of use somewhere. Teleport



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 13:46 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 Mon, 02 June 2014 19:25
I might grab population growth (two modules, one for planets, the other for shipping)

Or perhaps one module, callable from two places? Sherlock



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 14:13 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
XAPBob wrote on Mon, 02 June 2014 13:25
Writing python is very like writing pseudocode. nithing to fear Wink

I might grab population growth (two modules, one for planets, the other for shipping)

I presume we're replicating existing behaviour at the moment.
Also I recall that Hab is an integer -26<H<101 and H!=0...

I'll need a second call available to calculate the "next year pop" for the people doing the autobuild queues.


Cool. Feel free to add any 'generic' calls to the tools module. We can always refactor that module as needed. The autobuild module can also import the pop_growth module and use a function from there. Do whatever seems most useful.

I will take the job of merging and cleaning up modules on me. If we pick up steam, I'll move the repository to a "team repository" and we can all have commit rights (but I like to keep a bit of control initially to enforce some consistency if no one objects).

I'm not quite sure what you mean by a module for shipping, or do you mean pop growth/decay in ships (for IS/AR)?

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 14:18 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
m.a@stars wrote on Mon, 02 June 2014 13:45
I have the working code for the RaceWizard in Javascript (and C), which includes Hab value calculations (as reverse-engineered from the EXE, refactored by me) and Terraforming (crafted by me, and apparently accurate). There's several "unit" tests, and a few comments. It should be easy to port to Python by anyone who knows Python. Rolling Eyes

I also have the Fuel Usage code, which includes travel & coords calculations (for fleets and packets), as Stars! does them. The packet part includes decay and is apparently accurate. Whip

There's also the old Econ calculator, which includes math about max Terra, Pop, Facts, Mines, etc. Also in js. Work at computer

My version of the Order of Events is a bit more "deconstructed" and has more smaller sections. We should probably compare notes ASAP. Sherlock

Last but not least, the All Items Table dumper has a lot of code to deal with techs, items, engines, and hulls that could perhaps be of use somewhere. Teleport


Could you perhaps place the relevant algorithms or js code somewhere organized by "order of events" module? Also, could you post your version of the order of events?

A logical place to post would be a 'docs' or 'design' folder in the repo. If you click on the "+" icon in github and type a slash in a file name, you can create the file right there from the web interface (accept the message about forking).

Also, I would still urge you to try your hand at a simple python module, e.g. mining. As XAP says, the python code is not scary, and I will gladly help you.

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 14:31 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
XAPBob wrote on Mon, 02 June 2014 13:25
I presume we're replicating existing behaviour at the moment.


Yes. We will probably introduce flags/settings at some point, especially some rebalancing options would be nice (CA reduced instead of free terra, JOAT less points for NAS, etc)

The only places where I could be tempted to do something right now are the "cheat" enabling bugs like the N-S minefield dodge. We could also consider solving things like the unfinished item rounding bug talked about recently. Also, on borderline cases where it is very difficult to replicate the exact behaviour I would be tempted to settle for 'good enough', especially for a first version.

Come to think of it, what about a rough release plan like:

0.1 - single player mode, no tech tree, fixed ship designs (e.g. scout, colonizer, medium freighter), limited PRT's/LRT's. Good enough for benchmarking pop/resource growth.
0.2 - full single player mode. Good enough for all offline games we play now without the AI
0.3 - multiplayer mode, without wormholes/MT/minefields
1.0 - full clone (except for AI)
1.x - extra options, especially for balancing and alternative rule sets


[Updated on: Mon, 02 June 2014 14:37]

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 15:08 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
Bug fixes then: ISB/gate scanning, minefield immunity (various), min damage?

Double growth for IS is an OoE bug, so won't affect me.

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 15:45 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
The release plan sounds ok. Rolling Eyes

The replication needs to be close, except of course the most egregious bugs, since many players rely on things like IS "double growth", and even the min dmg bug might become a popular tactic. Sherlock



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 15:51 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
The gate scanning should be fixed, that's plainly a bug. I'm not too sure about the others, especially the min damage given the amount of discussion on it, but frankly I don't really care Smile

M.A. sent me two docs that I've added to a new docs folder on the repo: the race wizard and planet calculation code and a more detailed order of events.

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 17:04 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
I threw in min damage/doubled growth as examples of "contentious" bugs.

I *do* think we should have actual damage recorded, rather than 1/512ths, possibly even per ship???

But that's quite a way away (and we could impose a minimum damage value deliberately)


[Updated on: Mon, 02 June 2014 17:21]

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 19:12 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
m.a@stars wrote on Mon, 02 June 2014 18:46
XAPBob wrote on Mon, 02 June 2014 19:25
I might grab population growth (two modules, one for planets, the other for shipping)

Or perhaps one module, callable from two places? Sherlock


One module, with the base function publically exposed for calling from elsewhere.


2 questions:
Overcrowding formula?
Red planet formula?


I might go and convert this: http://starsautohost.org/sahforum2/index.php?t=msg&th=22 99&prevloaded=1&rid=1560&start=0 into python too, given that I've already ported it to perl once...


[Updated on: Mon, 02 June 2014 20:04]

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 21:27 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
Thanks for the pull requests! I'll add some unit tests and merge tomorrow.

Note that the planet value code is also in the javascript file (racewizard) in the docs (in the github repository), that might be easier to convert than the C code.

Report message to a moderator

Re: Stars 3 Mon, 02 June 2014 21:35 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
I'm very rusty and busy right now,

Reading through this, I'm thinking the message system will have to be set up soon as most of the OoEs have to post messages. It may be better to think about the messages while doing the code then to add it later as an afterthought.

LittleEddie

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 01:47 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
@LittleEddie: Great to hear that you are interested to help think about it. Feel free to contribute anytime that you can find the time!

Do you have a specific idea for the messaging?

My most simple idea would be that there is a list of messages on the 'universe' state for each player, and that processing modules can append messages to the list for specific events (e.g. overcrowding).

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 02:27 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
Yes, an array that can be appended to from eh module is about right.
Maybe a tools.message(player,message)?


[Updated on: Tue, 03 June 2014 02:29]

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 04:29 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 Tue, 03 June 2014 01:12
Overcrowding formula?
Red planet formula?

I have seen the math for those 2 somewhere but IIRC recently some1 posted about Resources from overcrowded planets. Sherlock

Dunno if recording dmg per ship will need too much space. At any rate, the Jeffs used just 2 buckets, we could use more (in the future). Hit over head

As for the messages, don't forget to add a "class" tag to them, for filtering. The more classes, the finer the graining. Work at computer



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 04:29 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
mrvan wrote on Tue, 03 June 2014 02:27
Thanks for the pull requests! I'll add some unit tests and merge tomorrow.

Note that the planet value code is also in the javascript file (racewizard) in the docs (in the github repository), that might be easier to convert than the C code.

I've already converted it to perl, so it's not that far off. I'll do it by clicks (we can then rename those pesky ambiguous low grav values at leisure).

Question - do we want to encode the additional flexibility that the original code has (but never exposed) of having an "off centre" perfect (so you get a short tail on one side and a long tail on the other?) I think it's probably easier to add it in later if needed.

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 04:31 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 Tue, 03 June 2014 08:27
Yes, an array that can be appended to from eh module is about right.
Maybe a tools.message(player,message)?

And logs. Plenty of logs for bookkeeping, bug-tracing, statistics, end-of-game summaries, "first" awards, etc. Lurking



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 04:34 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
m.a@stars wrote on Tue, 03 June 2014 09:29
XAPBob wrote on Tue, 03 June 2014 01:12
Overcrowding formula?
Red planet formula?

I have seen the math for those 2 somewhere but IIRC recently some1 posted about Resources from overcrowded planets. Sherlock

Thanks, not dealing with resources at the moment, just growth (or death)

Quote:

Dunno if recording dmg per ship will need too much space. At any rate, the Jeffs used just 2 buckets, we could use more (in the future). Hit over head

Well, the design contains the "original armour/shield" values, so we only need two integers - It depends how constrained we feel for space of course, and with JSON it can be added later Wink
Quote:

As for the messages, don't forget to add a "class" tag to them, for filtering. The more classes, the finer the graining. Work at computer

Class per "OoE" or arbitrary class IDs (maybe prefixed by an OoE ID?)


[Updated on: Tue, 03 June 2014 04:40]

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 04:38 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 Tue, 03 June 2014 10:29
I'll do it by clicks (we can then rename those pesky ambiguous low grav values at leisure).

Internally, the RW does it all by clicks. As for the low gravities, I've designed a simple and unambiguous clicks-to-grav-to-clicks formula that could be used (in the future, in the client side). Teleport


Quote:
do we want to encode the additional flexibility that the original code has (but never exposed) of having an "off centre" perfect (so you get a short tail on one side and a long tail on the other?) I think it's probably easier to add it in later if needed.

I'd like it, as long as it doesn't take too much time to do. Alas, we don't have real-world test-cases for it. Sherlock



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 04:45 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 Tue, 03 June 2014 10:34
the design contains the "original armour/shield" values, so we only need two integers - It depends how constrained we feel for space of course, and with JSON it can be added later Wink

2 Ints, times 2 (or 4) bytes each, times all tokens (or all independent ships) in the game can get big... All the more reason to have separate fleet data per player, so as to not require excessively large amounts of contiguous storage. Whip

Quote:
Class per "OoE" or arbitrary class IDs (maybe prefixed by an OoE ID?)

Or per module. Dunno, it'll be used by the client, so just keep it simple. Improve later! Cheers



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 04:54 Go to previous messageGo to previous message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
XAPBob wrote on Tue, 03 June 2014 00:12


2 questions:
Overcrowding formula?
Red planet formula?



Both are now added.

The get_hab function (as yet unwritten) is assumed to return a signed integer between -45 and 100
This matches the storage of the pgr in terms of talking about percentage values as integers rather than fractions (this decision wants cementing asap, and we need to decide that all percentages will be defined in one sense or the other)

Report message to a moderator

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


Current Time: Thu Apr 18 21:06:51 EDT 2024