• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

.NET control for Traveller

CT Trade under development

I've added the ability to search for trade for those ships using Classic Traveller. The buy/sell is not there yet, but should be simple to implement as the cargos are all the same regardless of version.

I converted my v1. XML file to CSV for CT (a 10 minute program saved me a few hours of typing - I may be getting better at this!):
Code:
# Classic Traveller trade goods
#d66,description,base price,quantity,purchase DMS,resale DMS

#d66 - D1 + D1; use appropriate mods according to T&C rules
#quantity - 3Dx6 = 3 d6 * 6
#purchase & resale DMs: 6 of each in the following order:
# agriculteral, non-agri, industrial, non-industrial, rich, poor

11,Textiles,3000,3Dx5,-7,-5,0,-3,0,0,-7,-5,0,-3,0,0,

Nice thing for the trade class, is that you pass in the ship & world you are at, so that you just call 'findcargo(ship, world)' and it automatically finds the correct version of trade based on the ship.Version (CT, T5, MT or CU).

CTTrade1.png


Once I get that part done I may release the stub files (as above) and the program, although I am thinking I will rework the XML cargo nodes to be a match for the cargo structure I use, to simplify things.
edit: And I've forgotten to multiply the price x tonnage.
 
CT trade completed, adding Mongoose Trade

couple of hiccups on the CT trade (my tables were wrong, and I was applying ALL trade code mods rather than just the ones applicable to the world buying/selling. I've also added a method to retrieve a cargo from the ship by cargo ID (cargo = ship.loadCargo(cargoID)) to make passing around the cargo objects a bit easier.

Now I'm working on the Mongoose trade. A bit more complicated and it will require a common goods table (and now that I am thinking about that, I think T5 may have a similar mechanism I've overlooked).

The table is more complicated as there are more trade classifications in MT (&T5) than classic. So rather than hard-code the trade, and in keeping with the CSV format, I've done the following:
Code:
#Mongoose Trade goods

#see also MTCommon.csv for the common/trade goods by trade code

#d66,description,base price,quantity,[availability],[purchase DMS],[resale DMS]

#d66 - D1 + D1; use appropriate mods according to T&C rules
#quantity - 3Dx6 = 3 d6 * 6
#availability: all = available for all systems
#  else trade codes, 1 space for readability: [all] or [Ag Ri] = Agriculteral, Rich
#purchase/resale DMs: similar to availability, but adding the DM (with +/- sign!):
#  [In+2 Ht+3 Ri+1] = Industrial +2, High tech +3, Rich +1

11,Basic Electronics,10000,1Dx10,[all],[In+2 Ht+3 Ri+1],[Ni+2 Lt+1 Po +1]

I'll also have to add the common goods table which is a listing of goods that are always available, as well as those that are available based on world trade codes.

And Mongoose gives you several cargoes at a time. The other 2 versions you get 1 cargo per roll (per day in T5, per week in CT). So I may rewire the 'findcargo' routine to return a list of cargoes instead of just 1, and in T5/CT, that list will only have 1 cargo item in, Mongoose all the common & ones based on trade code, then the 1d6 additional cargoes (which can have cargoes not normally associated with that world).

Should have that done shortly.

edit: hmm - I don't actually need a common goods table - that is merely a recap of the trade goods availabilities. Cool - one less thing to deal with!

And yes - I do enjoy talking to myself! :)
 
Last edited:
Initial Mongoose trade find working

it now supports searching & buying cargo Mongoose style, although there are some issues with the trade rules I need to check on (the examples don't match the rules as listed and are open to interpretation. Traveller, having to interpret rules? :devil:)

Anyway, I've got the 'all' or common goods stuff in place, and since the program does not care about version (the back-end class does) the buy/sell stuff just works regardless (well, the sell will once I get the MT trade method in there - currently it will do nothing...sells at Cr0). Just need to add the trade code matches, and then the 1d6 random matches. But, as the cargo creation is already in place, that should be done in 15 minutes or less.

The other system-wide change was making the trade routine return a list of cargoes rather than just one. CT & T5 just happen to only return 1 cargo item in that list, Mongoose quite a few.

The longest part was getting the trade table entered!

Another few days of playing & I'll probably release the pgm & stub data files to the file section here, & maybe to the Free Traveller site. Along with a read me file!
 
added buy/sell DM to ship's data

I've added the buy/sell actual value DM to the ship's data file, and I am hoping that's about done. I need to start actually play testing this to see how useful/consistent it is. And I still need to finish the passenger part (T5 is done, but that is a straight roll for each type regardless of where you are going; the other versions are supposed to be according to where you are headed next & I plan on avoiding that, although I suppose I could add a flight plan page in there...hmmm....)

You have to pick an SEC file, it loads & then you pick the world system to start in.

Currently this is only for adding new ships. I probably should add the option to load/update existing ships as well.
shipdata.png


and the XML part of the ship data file (not sure why I stuck in in the system node rather than ship node, same for cargoID, but anyway):
Code:
<?xml version="1.0" encoding="utf-8"?>
<ShipData>
  <system version="MT">
    <day>100</day>
    <year>1101</year>
    <sec>Alell         1706 B46789C-A    Ri                 410 Im M7 V M7 D</sec>
    <secfile>SPINWARD.SEC</secfile>
    <cargoID>1</cargoID>
    <tradeDM>1</tradeDM>
  </system>
  <Ship>
    <Name>MT Test</Name>
    <Manuever>2</Manuever>
    <Power>2</Power>
    <Jump>2</Jump>
    <Cargo>100</Cargo>
    <CargoHeld>10</CargoHeld>
    <credits>115000</credits>
    <costs>
      <Monthly>25000</Monthly>
      <perJump>5000</perJump>
      <lastPaid>100/1101</lastPaid>
    </costs>
  </Ship>
...
 
So, um, how does one download/use it... ===>"Not completely useless on computer but lost."

that's just the documentation - a plain HTML site that shows the structures, methods and all that stuff that goes into the actual class. I've not compiled the class as a DLL, but could. But there are some assumptions: it needs certain files to operate (xxGoods.csv, xxValue.csv, xxTradeCodes.csv, etc where 'xx' is CT, MT, T5 or CU for Classic, Mongoose, T5 or a custom set of codes). But the class could be compiled as a library & then dumped into any other programming language that can use a DLL.

I'm vaguely planning on releasing the actual program with the 1st line for each of the files (aside from the header description notes) so that it is useless unless you have the rules. As per another thread, though, I can't quit messing with it and so it will probably never be completed (I just added the ability to update the ship file via the same form as the new ship file. And I plan on adding the jump ability on the tab that indicates systems that are within the ship's jump capacity. It never ends!)
 
BTW - that class could be used in web pages or regular Winform apps(1). While some people see no future in desktop apps, I think the future will be using both(2). For instance, I've added a menu option to use the TravellerMap JumpMap page to show the jump map according to the current world/ship jump range (currently the sector is hard-coded as Spinward Marches - I need an entry for the sector, as I cannot assume the SEC file will consistently contain the sector name). But the world hex & ship jump range [world.Hex, ship.Jump] are passed in according to your current ship file in use).

All because I've never gotten around to figuring out graphics stuff: 23 years of writing rating/billing/inventory software means I've missed out on the big internet revolution and all that fancy stuff (although I've a new job starting next month that uses software that is transitioning from Borland C++ to ASP.Net, so I may start learning more about that beyond the ASP.Net stuff I did for our in-house database stuff [although I'm just starting as a tech support level, so I may never get to do much actual programming professionally for a while :( )

(1) I'd like to say I could use it on my phone, but alas, I'm playing with ASP.Net 3.5 stuff (LINQ) so I think that my 6.1 WinMobile doesn't support that stuff yet. It would be one heavily tabbed interface - not sure how well I can write for small screens!

(2) we're transitioning back to the 60's style of mainframe/client, with the mainframe being the web (cloud, server, whatever the marketing word of the day is) and the client is your browser. Like clothing, programming practices tend to be cyclical.
 
added skinning, released with truncated files

I've added skinning (but may take it back out - it requires a 3rd party DLL that pretty much makes the download 3x larger). But hey - you can make it look more SF. I need to see about how the XML skins are created so I could make a more Traveller-like one.

(nice thing is I don't have to do anything other than set that component to skin everything: pretty much it is simply skinCrafterLight1.Skin = DMSoft.Skinset.None;)

I've also released it in the files->software section of this site.

world12.png
 
one more thing, not yet released

to make the next jump selection easier, I've added the option to only list those systems in jump range of your current ship:

world13.png


I'll probably also add the option to jump from the tab that already lists those systems in jump range - currently double-clicking one gives you the world info. I'll probably just add the 'jump to this system' on that screen.
 
initial world images added

playing with adding images on the world info display (available when you double-click a world in the jump-reachable list tab, I may have to get around to adding it to the main world info tab), and still trying to work my way up to being able to do a J6 map using GDI rather than cheating & using the TravellerMap web site (but I'm a firm believer in not re-inventing the wheel, along with being inherently quite lazy).

I'm not liking my approach to the image: I'm just basing it off the atmosphere & really it needs to be based on size, atmo & hydro. But I've currently only 6 or 7 images someone posted as free to use, and so I'm using them currently.

I may get energetic & search for some world images, then base it initially by size, then within that, hydro then atmo maybe. Ideally, I'll figure a labeling system so that the user can supply their own images & we can tag them somehow.

(hmm - I probably should also indicate the Traveller version for the world, along with the date, and I suppose see if there are any notes posted for that system. Fortunately this is an experiment in object oriented programming, and that form creates a new Traveller.World world, so all that work is actually already done - I just need to load it. Life is good!)

world14.png
 
added notes to jump world info

went ahead & added the note as read-only:
world15.png


after adding the tabs & text boxes, it was all of two lines of code to get the notes displayed:

edNotes.Text = world.Notes;
edNPC.Text = world.NPCNotes;

where edNotes is the edit box for system notes, and edNPC is the edit box for NPC notes. The 'world.Notes' is a method in the world class to retrieve the notes for that system (and I save the notes in the XML file notes.xml so that anyone with a plain text editor can mess around. While a DB back-end makes a lot more sense in so many ways, I'm trying to also keep everything text based to simplify both deployment & maintenance). I'm really liking this OOP stuff!

If anyone wants this DLL, let me know. It could be useful to someone able to write a good user interface - I have more fun just writing good back-end code for some reason.
 
World Pictures

Using Vue (graphics program), I suppose that many of
us (on the board) could generate image templates based
on profile(s) for a data base to generate a specific image.

Size could be a number in a corner and hydo gives us a
land vs. water scale, atmos would be an "Alpha" layer
for semi-transparent cloud cover. Which gives us a look
of a planet.
[ based on CT stats ....]
 
Quite possible - and I may even have a few programs to do things like world designs. I may add a world image element or attribute to the XML notes file (that goes with the SEC file) to have a world image pre-specified, allowing users to create & add their own images if they wanted to.

Got carried away, added a tab for the Traveller map: load a world & that tab has the TravellerMap web page with that system centered. All the goodness of that web site without the chrome (to quote the author, whom I need to contact to let him know I am once again using his stuff...):

world17.png
 
Got carried away, added a tab for the Traveller map: load a world & that tab has the TravellerMap web page with that system centered. All the goodness of that web site without the chrome (to quote the author, whom I need to contact to let him know I am once again using his stuff...):

Very nice. Keep at it!
 
I'm not liking my approach to the image: I'm just basing it off the atmosphere & really it needs to be based on size, atmo & hydro. But I've currently only 6 or 7 images someone posted as free to use, and so I'm using them currently.

Have you considered the BeRKA system (designed by P-O "BeRKA" Bergstedt)? It's more symbolic ...
  • Terran World: Atmosphere 6 or 8, Hydrosphere 3+
  • Garden World: Atmosphere 2-9, Hydrosphere 1+, not Terran
  • Glacier World: Some Terran worlds or Garden worlds may be Glacier worlds.
  • Desert World: Atmosphere 2-9, Hydrosphere 0
  • Exotic World: Atmosphere A or D, or (Atmosphere B or C, Hydrosphere 1+)
  • Hothouse World: Atmosphere B or C, Hydrosphere 0
  • Ocean World: Hydrosphere A
  • Ice-capped World: Atmosphere 0 or 1, Hydrosphere 1+
  • Rock Ball: Size 1+, Atmosphere 0, Hydrosphere 0
  • Asteroid Belt: Size 0
  • Unexplored World: No player data is available
It is used in Universe with the following modification that a Glacier Worlds is any Terran World or Garden World where the PRIMARY star in the system is a dwarf, sub-dwarf, or is a main-sequence star of spectral class M3 to M9.

Thus the BeRKA system only requires 11 images to convey a sense of the world in question.
 
Have you considered the BeRKA system (designed by P-O "BeRKA" Bergstedt)? It's more symbolic ...
  • Terran World: Atmosphere 6 or 8, Hydrosphere 3+
  • Garden World: Atmosphere 2-9, Hydrosphere 1+, not Terran
  • Glacier World: Some Terran worlds or Garden worlds may be Glacier worlds.
  • Desert World: Atmosphere 2-9, Hydrosphere 0
  • Exotic World: Atmosphere A or D, or (Atmosphere B or C, Hydrosphere 1+)
  • Hothouse World: Atmosphere B or C, Hydrosphere 0
  • Ocean World: Hydrosphere A
  • Ice-capped World: Atmosphere 0 or 1, Hydrosphere 1+
  • Rock Ball: Size 1+, Atmosphere 0, Hydrosphere 0
  • Asteroid Belt: Size 0
  • Unexplored World: No player data is available
It is used in Universe with the following modification that a Glacier Worlds is any Terran World or Garden World where the PRIMARY star in the system is a dwarf, sub-dwarf, or is a main-sequence star of spectral class M3 to M9.

Thus the BeRKA system only requires 11 images to convey a sense of the world in question.

that would work for me. Currently, if you go to a system that is not yet visited, depending on the version I roll up all the extensions (pretty much T5 only so far) then add an entry for that system in the notes.xml file with that so we never re-roll it again. I also calculate the planet image, and I think I'll poke around to see if I can find those 11 types as you described. And I'm going to update the XML to have a place holder for the world image, so that,if a user decides to have a special one for specific systems, then they can use that.

In fact - I think I'll add an image node to the file per system, and have sub-elements for things like the system, gas giants, maps, whatever. Something like (and I need to think through it a bit more):
Code:
<Notes>
  <system sec="Feri          2005 B384879-B  S Ri                 620 Im G4 V M3 D">
    <npcnote></npcnote>
    <note></note>
    <extensions version="T5">
      <ex>Importance    : 4</ex>
      <ex>Resources     : 7</ex>
      <ex>Labor         : 8</ex>
      <ex>Infrastructure: 11</ex>
      <ex>Barriers      : 4</ex>
      <ex>Resource units: 224</ex>
      <ex>Nobility      : Baron</ex>
      <ex>Worlds: 10</ex>
    </extensions>
    <images>
        <mainworld>image.jpg</mainworld>
        <system>image2.jpg</system>
    </images>
  </system>
  ...
 </Notes>
 
user-defined images

Figured a way to do this. I dynamically create the image menu from the notes.xml file:
world18.png


the file has an images node per system, and you can add images in there such that:

Code:
  <system sec="Alell         1706 B46789C-A    Ri                 410 Im M7 V M7 D">
    <npcnote></npcnote>
    <note></note>
    <extensions version="T5">
      <ex>Importance    : 4</ex>
     ......
    </extensions>
    <images>
      <img desc="world">Alell.jpg</img>
    </images>
  </system>

so the menu gets created based on the images/img attribute, the actual image is stored as the value. That way the user can add any number of images for each system & have the menu reflect what they want to name it in the menu (so I don't have to). There's yet another form to actually show the image when you click on the item, and currently it only takes jpg (I suppose it could take anything that Windows handles actually)

I just have to write the code to add that element in there (and that whole LINQ/XML thing makes that fairly trivial).

And if anyone is C# oriented, here's the code for clearing/creating that menu strip item (where world.Images returns a list of images in the format desc:value):
Code:
// load any images up
private void loadImages()
  {
     try
     {
          ((ToolStripMenuItem)menuStrip1.Items["tbImages"]).DropDownItems.Clear();
          if (this.world.Images != null)
          {
              foreach (string image in this.world.Images)
              {
                  string[] item = image.Split(new char[] { ':' });
                  ToolStripMenuItem mi = new ToolStripMenuItem(item[0] + ": " + item[1]);
                        ((ToolStripMenuItem)(menuStrip1.Items["tbImages"])).DropDownItems.Add(mi);
                  mi.Click += new EventHandler(subMenu_Click);
              }
          }
      }
      catch (Exception ex)
      {
          MessageBox.Show("Error in image menu generation: " + ex.Message);
      }
  }

I start my new job next week, so my rate of playing with this will go down dramatically then.
 
user defined images added

got the class method for the world ( world.saveImage(image, description) ) to save off a new image item in the notes. There's a file->add world image option on the menu that loads this form up:

world19.png


hit save & it adds the new node (it will also add the images node if that is not already there - backwards compatibility!)

I need to also add the new item to the drop-down menu if successfully added.

I've also removed the skinning - it was causing some stability issues (it was designed to VS2005, and I am using VS2008/Express, and while that should not cause a problem, it was not worth the problems it was causing).

the previous ':' delimiter for the file name/description splitting has been changed to '|' to allow for full path image names (c:\whatever), meaning that you don't have to have the images all in the same directory.
 
Last edited:
Using Vue (graphics program), I suppose that many of
us (on the board) could generate image templates based
on profile(s) for a data base to generate a specific image.

Size could be a number in a corner and hydo gives us a
land vs. water scale, atmos would be an "Alpha" layer
for semi-transparent cloud cover. Which gives us a look
of a planet.
[ based on CT stats ....]

turns out GIMP can do it. I found a Photoshop tutorial on how to make planet icons (http://webdesignledger.com/tutorials/how-to-create-a-planet-icon-set-in-photoshop) and GIMP works close enough. To make a sphere out of a texture, though, is Filters->Maps->Map objects, then you can project on a plane, sphere or whatnot.

found a good source here: planet textures (edit - oops - that is a specific format, not BMP or jpg)
My 1st attempt (all of 10 minutes, most of that searching for how to 'sphereisize' in GIMP) is here (and obviously I need to scale down - but hey, this is the 1st time I've actually used GIMP!)

So I just need to find some appropriate textures for the 11 Berkley-style planets and go from there.

nebulae_2a.jpg
 
Last edited:
Back
Top