• 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

making planets

Using PlanetGen (free!) and GIMP (also free!) you can create a world with the hydro & stuff you want, save off the BMP image, open that in GIMP, map to a sphere, and voila - instant custom planet:

garden.jpg


and a world 30% water:
p2.jpg


both took less than 10 minutes. I need to play with the lighting, hue & all that to see about atmospheric effects & stuff, but for a quick planet, cool!

(sorry about the size - I left the 1st one too large). Anyway - now to see about designing those worlds. At least I know I can do it for free.
 
more worlds

worlds.png


See http://www.gharat.net/ for the PlanetGen software, and he also has images of the system planets (the hot house is Venus, rock ball Pluto).

And that's just the basic stuff without playing with the colors, hues & all that to make them more dimensional. And the nice thing is, if I create a map I like for a specific planet, I can save off the flat map (PlanetGen creates both a relief and climate map!) and the globe/sphere image from GIMP & have them available in my little program by adding them. I really am getting carried away with various things here. You could even add tags like 'referee map' and 'player map'. If I took a page from Universe under development, I could make you log in as a player or a ref, and start tagging things. But, I think there are serious limits to how fast the XML file I/O really is (a DB is a lot better and as easy, but I needed to play with XML a bit, and I wanted to see how fast it was. Hard to tell while I am usually in debug mode, but it seems fast enough for my small file so far)

Must...stop...playing. What will I do when I start a real job Monday?!
 
trade reports

as per the T5 forum, I've added some trade reports. Testing the T5 version, but it *should* work for classic & Mongoose as well, but I've not checked (all systems share a common cargo object, each version just calculates the cargo.basesellingprice in its own way).

report 1 lists all the origin codes (essentially base buying price) for all systems in your world list (could be the entire sector, which is why it took longer the 1st time I ran the report, because not only did it generate the cargo codes, but, since I created a world each time to create the cargo, it also updated my notes file with the T5 extensions it rolled up. I was wondering why it took almost a minute to process the Marches!).

Report 2 is more useful: it lists the base selling cost on all systems within jump range (and yes, there seems to be a glitch, I'm looking at you, Grant!):
Code:
Selling from Alell [1706] Cargo Origin Code: A - Pa Ph Ri Cr5000
 
Louzy                D322A88-8 [1604] Cr7000
Grant                X664100-0 [1607] Cr5001
Efate                A646930-D [1705] Cr7000
Alell                B46789C-A [1706] Cr6000
Menorb               C652998-7 [1803] Cr6000
Uakye                B439598-D [1805] Cr5000
Whanga               E676126-7 [1806] Cr5000
Knorbes              E888787-2 [1807] Cr7000
Forboldn             E893614-4 [1808] Cr5000
Boughene             A8B3531-D [1904] Cr5000
Feri                 B384879-B [2005] Cr6000
Roup                 C77A9A9-7 [2007] Cr7000

Both reports are actually just generating files - taking the easy way out so users can load the file & fancy it up however they want.

I've also created most of the 11 Berka-style planets, added that method to the world class so you can get the image (world.BerkaImage, returns a stirng such as 'garden' or 'desert', I then use the images 'gardenWorld.jpg' or 'desertWorld.jpg' to load the image). Not yet released this version & images. Will in the next few days or so if there is any interest.

world20.png
 
more worlds

found an on-line fractal world generator, and it creates the world & stats. See http://donjon.bin.sh/sf/world/index.cgi

The images make better world maps/globes I think. So now to look into finding a PC-based one or (gasp!) write my own (there are a lot of libraries/sample code out there telling you pretty much how to do it).

Also finished the Mongoose buy/selling part. The search now loads all common (already did that) and all trade-code specific cargoes (new) and 1d6 random goods. I'm not checking for the illegal ones - so they may show up.

Decided to update my blog for this: http://traveller-ct.blogspot.com/

worldgen.cgi.jpg
 
Last edited:
How you keep this updated coliver. I started work on a similar stand alone single player game about a year ago. After putting it away some months ago your post has invigorated me to start back up.

It's written in VB.net (XML literals are a gas!). I played around with MY SQL for database stuff, but found that XML is much easier and simpler for the really small amount of data you need. I used another app I made to turn the COREdata into a known space xml db:

Code:
<Imperium Name="Charted Space">
  <World Sector="eC">
    <HexLocation>0101</HexLocation>
    <Name>Zeycude</Name>
    <UWP>C330698-9</UWP>
    <Starport>C</Starport>
    <Size>3</Size>
    <Atmosphere>3</Atmosphere>
    <Hydrosphere>0</Hydrosphere>
    <Population>6</Population>
    <Government>9</Government>
    <LawLevel>8</LawLevel>
    <TechLevel>9</TechLevel>
    <Bases></Bases>
    <TradeCodes>Na Ni Po De</TradeCodes>
    <TravelZone></TravelZone>
    <PBG>613</PBG>
    <PopMultiplier>6</PopMultiplier>
    <Belts>1</Belts>
    <GasGiants>3</GasGiants>
    <Allegiance>Zh</Allegiance>
    <GDP>1380000000</GDP>
  </World>

The travel codes are actually created while parsing the COREdata file into this xml file. (I have another xml file that is much larger that includes the BasePrice and CargoUCP)

The player can select Sector and then planet to start out on:

startmenu.jpg


The ship is then selected. Another XML file:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Ships>
	<Ship Type="Type A Free Trader">
		<ShipClass>Hero</ShipClass>
		<Cost>37080000</Cost>
		<ShipTons>200</ShipTons>
		<IsStreamlined>True</IsStreamlined>
		<JumpRating>1</JumpRating>
  		<JumpFuel>20</JumpFuel>
   		<HasScoops>True</HasScoops>
   		<HasPurification>False</HasPurification>
   		<ManeuverGs>1</ManeuverGs>
   		<PowerPlantFuel>10</PowerPlantFuel>
		<ComputerModel>Model/1</ComputerModel>
   		<Cargo>82</Cargo>
  		<Staterooms>10</Staterooms>
  		<Passengers>6</Passengers>
  		<LowBerths>20</LowBerths>
  		<Crew>4</Crew>
		<CrewDesc>Pilot, Engineer, Medic, and Steward</CrewDesc>
		<CrewExpense>15000</CrewExpense>
		<SmallCraft></SmallCraft>
    	</Ship>

This is the main interface, with a box containing the possible destinations within range:

main1.jpg


The top left image icon (hand exchanging money) bring you to The Exchange:

exchange.jpg


I'm impressed that you are attempting to cover all the different trade sytems. Just doing CT/Merchant Prince is a handfull.

Also, like the log/noted sections and I agree a decent printing class is hard to do.

As far as calculating systems within jump range, here are the functions I used (it's in VB.net but I'm sure you can translate):

Code:
Public Function CalcDistance(ByVal SourceWorldLoc As String, ByVal DestWorldLoc As String)

        Dim X1 As Integer
        Dim X2 As Integer
        Dim Y1 As Integer
        Dim Y2 As Integer
        Dim Xd As Integer
        Dim yoff As Integer
        Dim ymin As Integer
        Dim ymax As Integer
        Dim ymod As Integer
        Dim distance As Integer

        X1 = CInt(Microsoft.VisualBasic.Left(SourceWorldLoc, 2))
        Y1 = CInt(Microsoft.VisualBasic.Right(SourceWorldLoc, 2))
        X2 = CInt(Microsoft.VisualBasic.Left(DestWorldLoc, 2))
        Y2 = CInt(Microsoft.VisualBasic.Right(DestWorldLoc, 2))

        Xd = Math.Abs(X1 - X2)
        yoff = Xd \ 2
        If (X1 Mod 2 = 1) And (X2 Mod 2 = 0) Then yoff += 1
        ymin = Y1 - yoff
        ymax = ymin + Xd
        ymod = 0
        If Y2 < ymin Then ymod = ymin - Y2
        If Y2 > ymax Then ymod = Y2 - ymax

        distance = Xd + ymod

        Return distance

    End Function

    Public Function HexArray(ByVal originWorldLoc As String, ByVal jumpNumber As Integer)
        Dim returnedArray As New ArrayList()
        Dim hexLoc As String


        Dim Xorg As Integer = CInt(Microsoft.VisualBasic.Left(originWorldLoc, 2))
        Dim yorg As Integer = CInt(Microsoft.VisualBasic.Right(originWorldLoc, 2))

        For x = (Xorg - jumpNumber) To (Xorg + jumpNumber)
            For y = (yorg - jumpNumber) To (yorg + jumpNumber)
                hexLoc = CStr(Format(x, "00")) & CStr(Format(y, "00"))
                returnedArray.Add(hexLoc)


            Next
        Next

        Return returnedArray
    End Function

    Public Function JumpMap(ByVal originWorldLoc As String, ByVal jumpRange As Integer)
        Dim reachableList As New ArrayList()
        Dim reachable As New ArrayList()

        reachable = HexArray(originWorldLoc, jumpRange)
        For Each hexloc In reachable
            If hexloc = originWorldLoc Then Continue For
            Dim inRange As Integer
            inRange = CalcDistance(originWorldLoc, hexloc)
            If inRange <= jumpRange Then
                reachableList.Add(hexloc)
            End If
        Next
        Return reachableList

    End Function

As you can see these three fuctions create a map of hex numbers within jump distance of the ships origin world. This reachableList of hex number is compared to the sector info and the listbox on the main view shows the possible destinations and jump distance.

I really only got about as far as navigating thru the sector, refueling, and buying trade goods. Still need to add freight, passengers and some mechanism to hire/fire crew members. Lots on the list...

Keep us up to date!
 
resurrection

RKFM,

Looks like we approached this with very similar designs. I stuck w/XML since I wouldn't have to deal with a DB (simply to make installs easier, as well as the files generally being so small it did not need a lot of overhead).

I think we got the distance stuff from the same place - from what I recall that looks like the formula I was using.

Never went much further - my new job started, and I had to make the huge emotional transition from telecommuting for 14 years to working in an office as tech support. Oddly, I started a new job exactly 1 year later, now back in development (electronic health records - designing a system from scratch). Getting to use all the current tech now for the Windows client: WPF, ORM, .Net 4.0, LINQ (all meaningless to anyone not developing MS stuff, but pretty interesting stuff to me at least).

My ship XML file was similar to yours, except I had 1 file per ship, and it would contain version info, ship data, cargo info (both current & sold, which is how I kept a history, plus I wanted to play with XPATH & LINQ), and the travelogue (automatic entries for jump & entering systems, buy/sell, and user generated stuff as well).

Code:
<?xml version="1.0" encoding="utf-8"?>
<ShipData>
  <system version="T5">
    <day>135</day>
    <year>1100</year>
    <sec>Alell         1706 B46789C-A    Ri                 410 Im M7 V M7 D</sec>
    <secfile>SPINWARD.SEC</secfile>
    <sectorName>Spinward Marches</sectorName>
    <cargoID>6</cargoID>
    <tradeDM>1</tradeDM>
    <illegals>false</illegals>
  </system>
  <Ship>
    <Name>T5 Test</Name>
    <Manuever>2</Manuever>
    <Power>2</Power>
    <Jump>3</Jump>
    <Cargo>100</Cargo>
    <CargoHeld>0</CargoHeld>
    <credits>810775</credits>
    <costs>
      <Monthly>25000</Monthly>
      <perJump>5000</perJump>
      <lastPaid>100/1100</lastPaid>
    </costs>
  </Ship>
  <Cargo>
    <lot cargoID="1" origCode="A - Pa Ph Ri Cr5000" dTons="17" sold="true">
      <desc>novelties: variable tatoos</desc>
      <purchase date="114 - 1100" system="Alell         1706 B46789C-A    Ri                 410 Im M7 V M7 D">
        <baseprice>5000</baseprice>
        <finalprice>85000</finalprice>
        <avMod>0</avMod>
      </purchase>
      <selling date="121 - 1100" system="Efate         1705 A646930-D  B Hi In              810 Im K4 V">
        <baseprice>5000</baseprice>
        <finalprice>154700</finalprice>
        <avMod>1.3</avMod>
      </selling>
    </lot>
    <lot cargoID="2" origCode="A - Pa Ph Ri Cr5000" dTons="16" sold="true">
      <desc>rares: nectars</desc>
      <purchase date="114 - 1100" system="Alell         1706 B46789C-A    Ri                 410 Im M7 V M7 D">
        <baseprice>5000</baseprice>
        <finalprice>80000</finalprice>
        <avMod>0</avMod>
      </purchase>
      <selling date="121 - 1100" system="Efate         1705 A646930-D  B Hi In              810 Im K4 V">
        <baseprice>5000</baseprice>
        <finalprice>224000</finalprice>
        <avMod>2</avMod>
      </selling>
    </lot>
...
 <Travelogue>
    <system system="Alell         1706 B46789C-A    Ri                 410 Im M7 V M7 D" date="100 - 1100">
      <not"Menorb        1803 C652998-7    Hi Po              310 Im M5 II" date="107 - 1100">
      <note>arrived at Menorb</note>
      <note>Prepping for jumping from Menorb</note>
      <note>Jumping from Menorb to Alell</note>
    </system>
    <system system="Alell         1706 B46789C-A    Ri                 410 Im M7 V M7 D" date="114 - 1100">
      <note>arrived at Alell</note>
      <note>Cargo purchase: A - Pa Ph Re>Prepping for jumping from Alell</note>
      <note>Prepping for jumping from Alell</note>
      <note>Jumping from Alell to Menorb</note>
    </system>
    <system system=i Cr5000 / 17 tons for Cr85000 (novelties: variable tatoos)</note>
      <note>Cargo purchase: A - Pa Ph Ri Cr5000 / 16 tons for Cr80000 (rares: nectars)</note>
      <note>Cargo purchase: A - Pa Ph Ri Cr5000 / 17 tons for Cr85000 (consumables: music)</note>
      <note>Prepping for jumping from Alell</note>
      <note>Jumping from Alell to Efate</note>
    </system>
    <system system="Efate         1705 A646930-D  B Hi In              810 Im K4 V" date="121 - 1100">
      <note>arrived at Efate</note>
      <note>Cargo sold: A - Pa Ph Ri Cr5000 / 17 tons for Cr154700 (novelties: variable tatoos)</note>
      <note>Cargo sold: A - Pa Ph Ri Cr5000 / 16 tons for Cr224000 (rares: nectars)</note>
      <note>Cargo sold: A - Pa Ph Ri Cr5000 / 17 tons for Cr178500 (consumables: music)</note>
      <note>Cargo purchase: D - Hi In Cr2300 / 24 tons for Cr55200 (data: raw sensings)</note>
      <note>Cargo purchase: D - Hi In Cr2300 / 22 tons for Cr50600 (data: upgrades)</note>
      <note>Cargo purchase: D - Hi In Cr2300 / 29 tons for Cr66700 (pharms: restoratives)</note>
      <note>Prepping for jumping from Efate</note>
      <note>Jumping from Efate to Grant</note>
    </system>
 
Making Planets

I use Flaming Pear's LunarCell plugin; works with Paint Shop Pro 5 and later (5, 6, and 7 can be had off Amazon or other places for as low as $5 -- an excellent buy for the PC), as well as Photoshop. It's not Traveller-customized, and it can't make gas giants, but the planets are excellent.
 
coliver988 released the source code to me, I have been working on a new version.. currently it only supports Mongoose, I have also contacted Matthew Sprange at Mongoose who says that they have no issues with the trade data being shipped with the program as long as the program is distributed for non-commercial hobby use.

The code will be open sourced and I will be posting an installer here at COTI soon
 
I will be looking forward to that; I'm running a game of TravellerHero currently and it would be very helpful to automate the trading part of our game.
I can't wait to see the source code, either; as a 15-year programmer I love indulging in Traveller projects and I'm always curious to see how others do them.
 
Hopefully I can get it tidied up enough for some sort of release this weekend.

I haven't done a .NET installer before, but I have got it to run on another computer, so I don't think it will be too difficult
 
For installers, you'll need to drop back to 3.5 if you want to use the default MSI installer in VS2010 (if that's what you are using - it's not even available in 2012 which is what I currently use:only install shield which may work...). If you have a site, ClickOnce works well - you publish to that, and depending on how you set up things, it will check for updates every time they use the program.

I've never gotten the Flexera installer stuff to work correctly, but I'm impatient.

I may get around to writing a 3rd version of this as well just for fun if I ever get the time (or is this the 4th). This time for RT so it will run on tablets or PCs. All 15 RT tablets out there... :) Or maybe play with Azure and make the whole thing web based. Except I'm not particularly good at web side development.

The only thing I recall at this point is that it did originally support Classic, Mongoose & T5 as I understood it. Based on those files which apparently we can now fill out...
 
It is using the .NET Framework 3.5

I'll have a look at the default MSI installer... I do also need it to make some changes to the registry.. there is a hack to get the traveller map support working needs to be put in the registry

I am afraid I pulled the support for the other versions. I was changing some of the structures internally and I was despondent that I would ever get it to a releasable position if I had to keep checking all the different versions to see if they still worked, also I did not have some of the rules set and I feared that the T5 code probably no longer represented the T5 rules, as it was for beta T5. The code still forks internally in the trade class for different versions and I do actually want to support at least another version in the future.
Don McKinney has given me permission to use his version which would be my favoured rule set.
http://dmckinne.winterwar.org/pdfs/MT Trade and Commerce variant.pdf
If I have time I will return the old version CT T5 code to the trade class even if it is in a commented out, perhaps somebody else wants to get it working.
In my latest version, after I had recently sent code to you, I renamed the Mongoose version tag to "MGT" from "MT" as "MT" is Megatraveller ;)

I figure at this stage the most important thing is to get it released as a (semi) working version.
 
Back
Top