Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Bar » Stars 3
Re: Stars 3 Tue, 03 June 2014 04:57 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:54
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)

We want Integer math whenever possible, which should be almost everywhere. Percents are a client display thing. Twisted Evil



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 05:39 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
Hab coded - assuming we have clicks stored everywhere.
tuple definitions in the pull comments.

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 06:44 Go to previous messageGo to next message
neilhoward

 
Commander

Messages: 1112
Registered: April 2008
Location: SW3 & 10023
m.a@stars wrote on Tue, 03 June 2014 01:38
XAPBob wrote on Tue, 03 June 2014 10:29
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


To what type of real-world test-cases do you refer? Do you want examples of organisms which show this type of habitat preference, or do you refer to it not having been implemented in previous builds?

Report message to a moderator

Re: Stars 3 Tue, 03 June 2014 07:12 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
neilhoward wrote on Tue, 03 June 2014 12:44
To what type of real-world test-cases do you refer? Do you want examples of organisms which show this type of habitat preference, or do you refer to it not having been implemented in previous builds?

Lacking access to enough life-bearing planets (Earth-like or not) to test real worlds, I'd settle for some old version of Stars! that showed habs calculated with that code. Rolling Eyes



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 07:38 Go to previous messageGo to next message
neilhoward

 
Commander

Messages: 1112
Registered: April 2008
Location: SW3 & 10023
We don't need other planets to see this type of hab preference in action. Pick almost any organism on earth and it will be evident.
neilhoward kicks his sarcasm filter to see if it is still working.

I can provide examples with numbers.
neilhoward thinks about brewing beer.

Report message to a moderator

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

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
I merged in the pull request, pop growth should now be more or less complete.
I've added some unit tests, https://github.com/vanatteveldt/starsengine/blob/master/test s/test_hab.py tests the hab values, but since I don't know what correct answers are I only test the ideal cases. Can someone provide more test cases?
https://github.com/vanatteveldt/starsengine/blob/master/test s/test_pop_growth.py is a fairly exhaustive test of what I think are the pop growth mechanics. Can someone please check if you agree with the assertions in the code?

Report message to a moderator

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

 
Lt. Commander

Messages: 957
Registered: August 2012
Grab a handful from a current game or 3?

Report message to a moderator

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

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
I wanted to, but I have no clue how to convert the printed values to 'clicks'... The planet report also doesn't seem to report hab values, or am I misreading it?

Report message to a moderator

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

 
Lt. Commander

Messages: 957
Registered: August 2012
starsplayertool, or the hab thread I linked above, my perl has click <-> value conversions.

Report message to a moderator

Re: Stars 3 Wed, 04 June 2014 03:53 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
mrvan wrote on Tue, 03 June 2014 20:56
I wanted to, but I have no clue how to convert the printed values to 'clicks'... The planet report also doesn't seem to report hab values, or am I misreading it?

The Planet Report gives current Habs and "possible Terra" habs. It doesn't give "clicks" which is why the getClicksFromGrav (and simpler funcs for Temp and Rad) are needed. Ambiguous values of Grav also need some bludgeoning into place. I have some code for that, but in the interim you can just note down some values from inside the game itself. And the definitive way to make sure the Habcalc code works ok is the RW points themselves for the predefined races. Sherlock



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Stars 3 Wed, 04 June 2014 11:56 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
Ok, it will be a while before I can do any coding, but I would like to help and it looks like you all can handle most of the coding as it is.

So I will do some thinking and post on Doc's list.

Ed




[Updated on: Wed, 04 June 2014 12:00]

Report message to a moderator

Re: Stars 3 Wed, 04 June 2014 14:00 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
LittleEddie wrote on Wed, 04 June 2014 17:56
Ok, it will be a while before I can do any coding, but I would like to help and it looks like you all can handle most of the coding as it is.

So I will do some thinking and post on Doc's list.

Your "mixed-engine" fuel calcs will be a neat addition. Smile

I got working C code for (pretty) map generation and auto HW placement (mixed with plenty of things that won't be needed here), working js for packet travel & decay, itemtable digestion (including hulls & techtree), and some pseudocode for fleet targeting resolution and assorted odds-n-ends. I need to do some cleaning up and sorting around, but I should be able to contribute it soon. 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 Wed, 04 June 2014 20:37 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
Quote:
Your "mixed-engine" fuel calcs will be a neat addition.


That would be for the server side where we have to est. the fuel usage over multi-turns. So we should include the IS/AR changes and account for the fuel being made during the trip by engines and fuel x-ports. That would give us a better est. of fuel usage.

This is a bigger project then I've done in the past, from 1983 to 96 I did custom "Point of Sale" software (the main money maker) in C++ but I did about everything myself and after a while it was mostly boiler plate stuff. Then I retired and when to the Caribbean and had too much Run and Beer.

Anyway, I'm busy right now but I'm working on writing the test for the movement code and then the code itself.






Report message to a moderator

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

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
LittleEddie wrote on Wed, 04 June 2014 20:37
Quote:
Your "mixed-engine" fuel calcs will be a neat addition.


That would be for the server side where we have to est. the fuel usage over multi-turns. So we should include the IS/AR changes and account for the fuel being made during the trip by engines and fuel x-ports. That would give us a better est. of fuel usage.

This is a bigger project then I've done in the past, from 1983 to 96 I did custom "Point of Sale" software (the main money maker) in C++ but I did about everything myself and after a while it was mostly boiler plate stuff. Then I retired and when to the Caribbean and had too much Run and Beer.

Anyway, I'm busy right now but I'm working on writing the test for the movement code and then the code itself.


Cool, that sounds really great. Send me a pm if you need any help in working with the repository, test modules, etc.

Edit: We do need to start fleshing out how to represent fleet, ships, and designs. I guess "ships" as such don't need a representation, i.e. a fleet can point directly to a design?

Would something like this be best:

Edit2: Why don't the code tags work on this forum? Proposal for representation at https://gist.github.com/vanatteveldt/11d69410ed49bd8ca06c


I will hopefully have time tonight to tackle the production side.

I also thought it would be good to have at least one 'integration test' with a universe definition with all fields that we are using and testing the whole process_turn chain, so we can see if there are any inconsistensies in how the universe files are used and so we have to maintain at least one example of a fully fleshed univserse+turn definition.


[Updated on: Thu, 05 June 2014 04:31]

Report message to a moderator

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

 
Lt. Commander

Messages: 957
Registered: August 2012
Code tags need wrapping in colour tags:

[ color=darkblue][ code][ /code][ /color]
#!/bin/bash
# Just a shabang example

Report message to a moderator

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

 
Lt. Commander

Messages: 957
Registered: August 2012
LittleEddie wrote on Thu, 05 June 2014 01:37
Quote:
Your "mixed-engine" fuel calcs will be a neat addition.


That would be for the server side where we have to est. the fuel usage over multi-turns. So we should include the IS/AR changes and account for the fuel being made during the trip by engines and fuel x-ports. That would give us a better est. of fuel usage.

This is a bigger project then I've done in the past, from 1983 to 96 I did custom "Point of Sale" software (the main money maker) in C++ but I did about everything myself and after a while it was mostly boiler plate stuff. Then I retired and when to the Caribbean and had too much Run and Beer.

Anyway, I'm busy right now but I'm working on writing the test for the movement code and then the code itself.

Surely that's client side. The server only cares about "this year"

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 05: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
mrvan wrote on Thu, 05 June 2014 10:15
We do need to start fleshing out how to represent fleet, ships, and designs. I guess "ships" as such don't need a representation, i.e. a fleet can point directly to a design?

Would something like this be best:

Edit2: Why don't the code tags work on this forum? Proposal for representation at https://gist.github.com/vanatteveldt/11d69410ed49bd8ca06c

Ship designs also carry "calculated" info, such as Mass, Cost (original and/or current/miniaturized), Armor, Shielding, MaxFuel, Rating, Number Built, Number surviving, Cloaking/Jamming, Init/Moves, which could be conveniently stored right with the "static" design info and recalculated when needed (such as getting tech, during prod, after battles) Lurking

Addendum: Cargo Capacity & Scanner Ranges too. Rolling Eyes

Quote:
I also thought it would be good to have at least one 'integration test' with a universe definition with all fields that we are using and testing the whole process_turn chain, so we can see if there are any inconsistensies in how the universe files are used and so we have to maintain at least one example of a fully fleshed univserse+turn definition.

Neat. Do we have a list of all the fields yet? I can fill them with "random" data as needed. Teleport


[Updated on: Thu, 05 June 2014 13:37]




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 05:52 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
LittleEddie wrote on Thu, 05 June 2014 02:37
This is a bigger project then I've done in the past

The trick is to break it down into small manageable chunks. The wave



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 06:34 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 Thu, 05 June 2014 05:50

Ship designs also carry "calculated" info, such as Mass, Cost (original and/or current/miniaturized), Armor, Shielding, MaxFuel, Rating, Number Built, Number surviving, Cloaking/Jamming, Init/Moves, which could be conveniently stored right with the "static" design info and recalculated when needed (such as getting tech, during prod, after battles) Lurking


I'm not sure I agree here. In the universe representation I think only actual information should be stored, not calculated fields. The engine can 'cache' all this info if that is good for performance, and if needed for the client we can make a 'calculated fields' API calln to avoid reimplementing things in javascript, but I think we should really restrict the API definitions (of which the universe representation is the most important) to actual unique data.

m.a@stars wrote on Thu, 05 June 2014 05:50

Quote:
I also thought it would be good to have at least one 'integration test' with a universe definition with all fields that we are using and testing the whole process_turn chain, so we can see if there are any inconsistensies in how the universe files are used and so we have to maintain at least one example of a fully fleshed univserse+turn definition.

Neat. Do we have a list of all the fields yet? I can fill them with "random" data as needed. Teleport


What I think we should do is simply fill it as we develop. What I envision is this: whenever someone writes or updates a module, always also write/update the *unit* tests (which is a minimal test of all different corner cases, exceptions, etc, of that particular module), and update the *integration test*, which should cover all representation issues (ie use all fields, with multiple instances if needed for e.g. immunities vs hab ranges) and which is meant to ensure consistency between modules.




[Updated on: Thu, 05 June 2014 06:34]

Report message to a moderator

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

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
XAPBob wrote on Thu, 05 June 2014 05:03
Code tags need wrapping in colour tags:

[ color=darkblue][ code][ /code][ /color]


Cool. I had tried the other way around (color within code) but that (obviously) didn't work. I can't edit the post anymore it seems though, so I'll just copy below:

Proposed representation for ship designs and fleets:

{"players" : [{"id": 1,
              <race info etc>,
              "ship_designs": [
                 {"id": 1,
                  "name": "Cargo Mover",
                  "hull": "medium freighter",
                  "engine": "fuel mizer",
                  "components": [{"slot": 1, "type": "super cargo pod", "quantity": 1}]
                   }
                ]
              }],
"fleets" : [{"id": 1
              "owner": 1,  
              "tokens": [{"design": 1, "quantity": 20, "damage": 12},
                         {"design": 2, "quantity": 5}],
              "fuel": 2800,
              "cargo": [0, 0, 100, 12]
            }]
}



[Updated on: Thu, 05 June 2014 06:37]

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 07:07 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
mrvan wrote on Thu, 05 June 2014 12:34
I'm not sure I agree here. In the universe representation I think only actual information should be stored, not calculated fields. The engine can 'cache' all this info if that is good for performance, and if needed for the client we can make a 'calculated fields' API calln to avoid reimplementing things in javascript, but I think we should really restrict the API definitions (of which the universe representation is the most important) to actual unique data.

Well, these would be the 2 main reasons for storing that "calculated" data somewhere convenient:
1) it's akin to "caching" (whenever some number is looked up more often than it needs to be updated)
2) it saves the client from having to calculate it, sacrificing just a few bytes of space. (speaking of which, I forgot "Cargo Capacity")
and 3) it "conveniently" centralizes things, as long as a calculation is done whenever it's easier to do (such as when a Design is 1st validated), but it's used somewhere else. Teleport

I agree it's perhaps not necessary to actually save the calculated fields to file, tho. Sherlock


Quote:
What I think we should do is simply fill it as we develop. What I envision is this: whenever someone writes or updates a module, always also write/update the *unit* tests (which is a minimal test of all different corner cases, exceptions, etc, of that particular module), and update the *integration test*, which should cover all representation issues (ie use all fields, with multiple instances if needed for e.g. immunities vs hab ranges) and which is meant to ensure consistency between modules.

So, "unit tests" will need their own data, and larger tests will need theirs, too? Fine by me. Call me when you need a nice map, ship or race designs, or just data in bulk. Rolling Eyes



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 07:13 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 12:36
Cool. I had tried the other way around (color within code) but that (obviously) didn't work. I can't edit the post anymore it seems though, so I'll just copy below:

Proposed representation for ship designs and fleets:


Have you looked into freestars code? It implements all this logic pretty much along with a big chunk of the logic of the rest of the game.

I'm curious why don't you want to reuse it?

Report message to a moderator

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

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
I don't have anything against reusing it, but I feel that in most cases the difficulty is not so much in implementing the logic, as in writing the tests, ensuring correctness, etc.

Are you familiar with the freestars codebase? Could you extract the relevants pieces of code for some of the complicated logic?

Report message to a moderator

Re: Stars 3 Thu, 05 June 2014 07:40 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:13
Have you looked into freestars code? It implements all this logic pretty much along with a big chunk of the logic of the rest of the game.

I'm curious why don't you want to reuse it?

Yup, I've looked into it more than I should have. I like some things, but not the rest. Excessive hardcoding, rigidity of structures, and others, make it a complex read, and even more complex refactoring/improving/reusing, despite its being written in my favored lingo. Confused

Successful efforts need to be simpler and far more flexible, IMO. Sherlock

Note: what's up with being unable to edit posts? I want to add "Cargo Capacity" and "Scanner Ranges" to my earlier list. Hit over head


[Updated on: Thu, 05 June 2014 07:41]




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 07:52 Go to previous messageGo to previous message
theval is currently offline theval

 
Petty Officer 3rd Class

Messages: 43
Registered: May 2014
mrvan wrote on Thu, 05 June 2014 13:28
I don't have anything against reusing it, but I feel that in most cases the difficulty is not so much in implementing the logic, as in writing the tests, ensuring correctness, etc.

Are you familiar with the freestars codebase?


Yes, I'm. I find it quite nice and accessible to unprepared contributor. There are several issues, but they are barely a problem, given that the engine is structurally complete, compiles and works.

mrvan wrote on Thu, 05 June 2014 13:28
Could you extract the relevants pieces of code for some of the complicated logic?


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.




Report message to a moderator

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


Current Time: Fri Apr 26 07:46:53 EDT 2024