Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Bar » Possible new utility for creating testbeds
Re: Possible new utility for creating testbeds Fri, 13 February 2009 14:26 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
m.a@stars wrote on Fri, 13 February 2009 02:40

So what you actually need is the Slot Position info, like this:

Destroyer Hull:
  1
 5
0 4 3
 6
  2

It's also included in the slot definition, encoded as yCoord|xCoord bytes near the end of the hull info. Sherlock

For another sample see the New space dock design wanted thread at the VML lounge.

That's just what is needed, I've checked the numbers you gave for the destroyer design and they match perfectly, so next question is which app do they come from and where do I get it.
I intend having and HTML file included with the app showing the design and the corresponding slot numbers, I've done the designs for the first 10 ships but have only been able to fill in the slot numbers on the frigate and destroyer so far. If you want to understand exactly what I am intending to produce you can see the partially completed page at http://stars.atlantissoftware.co.uk/Design.html
Hopefully the Designs should look right for everybody, they look fine in google chrome and I've just checked IE7, which although not perfect are still understandable, I'll have to look into what is causing the slight display problem in IE.

Report message to a moderator

Re: Possible new utility for creating testbeds Fri, 13 February 2009 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
PaulCr wrote on Fri, 13 February 2009 20:26

That's just what is needed, I've checked the numbers you gave for the destroyer design and they match perfectly, so next question is which app do they come from and where do I get it.

The numbers came from the Stars! exe. I just interpreted them. Very Happy

Unfortunately, the only app that I know that does it is my own "allitems table infodumper" so I'll need to tinker with it a bit to actually export the graphs. Whip

Quote:

I intend having and HTML file included with the app showing the design and the corresponding slot numbers, I've done the designs for the first 10 ships but have only been able to fill in the slot numbers on the frigate and destroyer so far. If you want to understand exactly what I am intending to produce you can see the partially completed page at http://stars.atlantissoftware.co.uk/Design.html
Hopefully the Designs should look right for everybody, they look fine in google chrome and I've just checked IE7, which although not perfect are still understandable, I'll have to look into what is causing the slight display problem in IE.

You html boxes look nicer than mine, but mine work ok in Firefox too. Rolling Eyes



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Possible new utility for creating testbeds Fri, 13 February 2009 15:22 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
Here they are, in all their ASCII glory.

I drew the slots as 2x2 boxes to better align them. You'll notice that I start from 0 instead of 1, and that # means cargo space. Teleport


  ·0·0·#·#·2·2·1·1
  ·0·0·#·#·2·2·1·1	Small Freighter

0·0·#·#·#·#·2·2·1·1
0·0·#·#·#·#·2·2·1·1	Medium Freighter

  · #·#·#·#·1·1
0·0·#·#·#·#·1·1
0·0·#·#·#·#·2·2
  · #·#·#·#·2·2		Large Freighter

  · #·#·#·#·#·#·1·1
  · #·#·#·#·#·#·1·1
0·0·#·#·#·#·#·#·2·2
0·0·#·#·#·#·#·#·2·2
  · #·#·#·#·#·#·3·3
  · #·#·#·#·#·#·3·3	Super Freighter

  · ·0·0·2·2·1·1
  · ·0·0·2·2·1·1	Scout

  ·0·0·3·3·2·2·1·1
  ·0·0·3·3·2·2·1·1	Frigate

  · · · · ·1·1
  · · ·5·5·1·1
  · · ·5·5
  · ·0·0·4·4·3·3
  · ·0·0·4·4·3·3
  · · ·6·6
  · · ·6·6·2·2
  · · · · ·2·2		Destroyer

  · · · · ·3·3
  · · ·1·1·3·3
  ·0·0·1·1·6·6·5·5
  ·0·0·2·2·6·6·5·5
  · · ·2·2·4·4
  · · · · ·4·4		Cruiser

  · · · · ·3·3
  · · ·1·1·3·3
  ·0·0·1·1·6·6·5·5
  ·0·0·2·2·6·6·5·5
  · · ·2·2·4·4
  · · · · ·4·4		Battle Cruiser

 · ·5·5
 · ·5·5·3·3
 · ·9·9·3·3·2·2
0·0·9·9·8·8·2·2·1·1
0·0·a·a·8·8·7·7·1·1
 · ·a·a·4·4·7·7
 · ·6·6·4·4
 · ·6·6			Battleship

  · 3·3
1·1·3·3·7·7
1·1·5·5·7·7·a·a
0·0·5·5·9·9·a·a·c·c
0·0·6·6·9·9·b·b·c·c
2·2·6·6·8·8·b·b
2·2·4·4·8·8
  · 4·4			Dreadnought

  · · · · ·3·3
  · · · · ·3·3·1·1
  ·0·0·#·#·#·#·1·1
  ·0·0·#·#·#·#·2·2
  · · · · ·4·4·2·2
  · · · · ·4·4		Privateer

  · ·7·7·4·4
  · ·7·7·4·4·6·6
  · · ·#·#·#·6·6
  ·0·0·#·#·#·1·1·3·3
  ·0·0·#·#·#·1·1·3·3
  · · ·#·#·#·2·2
  · ·8·8·5·5·2·2
  · ·8·8·5·5		Rogue

  · · 1·1·3·3
  · · 1·1·3·3
  · #·#·#·#·5·5
0·0·#·#·#·#·5·5·7·7
0·0·#·#·#·#·6·6·7·7
  · #·#·#·#·6·6
  · · 2·2·4·4
  · · 2·2·4·4		Galleon

  · ·0·0·#·#·1·1
  · ·0·0·#·#·1·1	Mini-Colony Ship

  · ·0·0·#·#·1·1
  · ·0·0·#·#·1·1	Colony Ship

  · · ·0·0·1·1
  · · ·0·0·1·1		Mini Bomber

  ·0·0·1·1·2·2·3·3
  ·0·0·1·1·2·2·3·3	B-17 Bomber

  · · · ·1·1·3·3
  · ·0·0·1·1·3·3
  · ·0·0·2·2·4·4
  · · · ·2·2·4·4	Stealth Bomber

  · · ·1·1
  · · ·1·1·3·3
  ·0·0·6·6·3·3·5·5
  ·0·0·6·6·4·4·5·5
  · · ·2·2·4·4
  · · ·2·2		B-52 Bomber

  · · ·0·0·1·1
  · · ·0·0·1·1		Midget Miner

  · · · ·2·2
  · ·0·0·2·2·1·1
  · ·0·0·3·3·1·1
  · · · ·3·3		Mini-Miner

  · · ·2·2·3·3
  ·0·0·2·2·3·3·1·1
  ·0·0·4·4·5·5·1·1
  · · ·4·4·5·5		Miner

  · · ·2·2·3·3
  ·0·0·2·2·3·3·1·1
  ·0·0·4·4·5·5·1·1
  · · ·4·4·5·5		Maxi-Miner

  · · ·2·2·3·3
  ·0·0·2·2·3·3·1·1
  ·0·0·4·4·5·5·1·1
  · · ·4·4·5·5		Ultra-Miner

  · · ·0·0·1·1
  · · ·0·0·1·1		Fuel Transport

  · ·0·0·1·1·2·2
  · ·0·0·1·1·2·2	Super-Fuel Xport

  · · · ·1·1
  · ·0·0·1·1·3·3
  · ·0·0·2·2·3·3
  · · · ·2·2		Mini Mine Layer

  · · ·1·1· · ·4·4
  ·0·0·1·1·3·3·4·4
  ·0·0·2·2·3·3·5·5
  · · ·2·2· · ·5·5	Super Mine Layer

  · 3·3
1·1·3·3·7·7
1·1·5·5·7·7·a·a
0·0·5·5·9·9·a·a·c·c
0·0·6·6·9·9·b·b·c·c
2·2·6·6·8·8·b·b
2·2·4·4·8·8
  · 4·4			Nubian

  · 5·5
  · 5·5·#·#·2·2
0·0·1·1·#·#·2·2·4·4
0·0·1·1·#·#·3·3·4·4
  · 6·6·#·#·3·3
  · 6·6			Mini Morph

  · 5·5
  · 5·5·#·#·2·2
0·0·1·1·#·#·2·2·4·4
0·0·1·1·#·#·3·3·4·4
  · 6·6·#·#·3·3
  · 6·6			Meta Morph

  · · · ·1·1
  · · · ·1·1
  · ·4·4·0·0·2·2
  · ·4·4·0·0·2·2
  · · · ·3·3
  · · · ·3·3		Orbital Fort

  · · · ·1·1
  · ·0·0·1·1·5·5
  · ·0·0· · ·5·5
  ·2·2· ·#·#· ·3·3
  ·2·2· ·#·#· ·3·3
  · ·7·7· · ·6·6
  · ·7·7·4·4·6·6
  · · · ·4·4		Space Dock

  · · 2·2·1·1
  · · 2·2·1·1
  · · · 8·8
9·9· · ·8·8· · ·b·b
9·9·0·0·#·#·a·a·b·b
4·4·0·0·#·#·a·a·3·3
4·4· · ·6·6· · ·3·3
  · · · 6·6
  · · 7·7·5·5
  · · 7·7·5·5		Space Station

  · · 7·7·e·e
  · · 7·7·e·e
  · d·d·0·0·5·5
c·c·d·d·0·0·5·5·9·9
c·c·2·2·#·#·6·6·9·9
1·1·2·2·#·#·6·6·3·3
1·1·4·4·a·a·b·b·3·3
  · 4·4·a·a·b·b
  · · 8·8·f·f
  · · 8·8·f·f		Ultra Station

  · 7·7· · ·e·e
  · 7·7·0·0·e·e
c·c·d·d·0·0·5·5·9·9
c·c·d·d· · ·5·5·9·9
 ·2·2· ·#·#· ·6·6
 ·2·2· ·#·#· ·6·6
1·1·4·4· · ·b·b·3·3
1·1·4·4·a·a·b·b·3·3
  · 8·8·a·a·f·f
  · 8·8· · ·f·f		Death Star




So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Possible new utility for creating testbeds Fri, 13 February 2009 16:16 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
Thanks for those, will save a lot of trial and error trying to find them out manually.
Just downloaded firefox to check why it wasn't showing the designs correctly, the layout is correct, it's the borders around the boxes that are missing, Firefox seems to ignore the border attribute on the stylesheet unless the unit is also added, ie 1px rather than 1.
I've fixed that now on my local copy, will probably wait to upload until tomorrow when I should hopefully have been able to complete it, it now looks the same in Firefox as it does in Chrome so I just need to look at why ie is messing the positions up slightly.

Report message to a moderator

Re: Possible new utility for creating testbeds Fri, 13 February 2009 16:54 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
PaulCr wrote on Fri, 13 February 2009 22:16

Thanks for those, will save a lot of trial and error trying to find them out manually.

You're welcome!

(Took me a few trials and errors too a couple years ago) Twisted Evil



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Possible new utility for creating testbeds Sat, 14 February 2009 11:48 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
The Ship designs are now complete on the website, I'll also include them in the zip file the next time I do an update to the app, it should make it much easier for anyone wanting to enter there own ship designs. I just need to create a printable list of the components now with there IDs which given I have them in a dataset shouldn't be that hard and then entering new designs might actually become almost simple.

The page works correctly ie IE7, Firefox and Chrome, IE by defaults puts the borders on the inside keeping the box the div the same size, the others put the border on the outside making the div 2 pixels bigger. I've got around this by including the doctype at the top and making it strict which seems to make everybody behave the same way so I'll probably use it all the time in future pages. It is a lot less forgiving though, when I first used it all the positioning disappeared completely because I hadn't include the units when originally positioning the divs.

Report message to a moderator

Re: Possible new utility for creating testbeds Sat, 14 February 2009 12:10 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
PaulCr wrote on Sat, 14 February 2009 17:48

The Ship designs are now complete on the website

For some reason, I see several of them mangled, particularly the starbases, though somewhat less mangled in IE6 than in FF2. Hit Computer



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Possible new utility for creating testbeds Sat, 14 February 2009 13:46 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
m.a@stars wrote on Sat, 14 February 2009 17:10

PaulCr wrote on Sat, 14 February 2009 17:48

The Ship designs are now complete on the website

For some reason, I see several of them mangled, particularly the starbases, though somewhat less mangled in IE6 than in FF2. Hit Computer


I have Firefox 3.0.1 and IE 7 as well as chrome and it looks fine in all 3, I've also just logged on to my server and used IE 6.0.3790.1830 from there and it looks fine and I've tried the validator on w3.org and that hasn't found any problems and I've just created another user account and downloaded Firefox 2.0.0.20 and it looks fine on there to me as well although with that the very first time it loaded I had to refresh the screen for it to display properly since the last starbase seemed to half of it missing.

Can you give me screenshots if they still show has faulty after refreshing along with the browser version number you are using and I'll try and look into it, I guess the other option would be to create a PDF instead.

Report message to a moderator

Re: Possible new utility for creating testbeds Sat, 14 February 2009 17:17 Go to previous messageGo to next message
gible

 
Commander

Messages: 1343
Registered: November 2002
Location: Wellington, New Zealand

I can confirm the Minimorph slots/quantities are correct. Also the Ultrastation and Deathstar seem to be missing then last(bottom-most then right-most) slot..both weapons iirc.

Report message to a moderator

Re: Possible new utility for creating testbeds Sat, 14 February 2009 18:49 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
That's what I'm getting too. It's as if the bottommost slots of the bigger hulls can't fit and just disappear. But in FF (2.0.0.20) some of the rightmost slots are also affected. Confused


So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Possible new utility for creating testbeds Sat, 14 February 2009 19:02 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
m.a@stars wrote on Sat, 14 February 2009 23:49

That's what I'm getting too. It's as if the bottommost slots of the bigger hulls can't fit and just disappear. But in FF (2.0.0.20) some of the rightmost slots are also affected. Confused

I'll put them into a PDF instead tomorrow, can't be bothered with any more messing around trying to get it working in multiple browser versions, at least PDF is standard, or at least supposed to be so there shouldn't be any problem with that. Maybe I should put them onto the old fashioned processed wood thingies I've heard about, I believe they never had problems of changing how they looked when someone else looked at them.

Report message to a moderator

Re: Possible new utility for creating testbeds Sun, 15 February 2009 01:02 Go to previous messageGo to next message
gible

 
Commander

Messages: 1343
Registered: November 2002
Location: Wellington, New Zealand

fwiw that was XP SP2 & Chrome 1.0.154.48 maximised at 1280x800

Report message to a moderator

Re: Possible new utility for creating testbeds Sun, 15 February 2009 06:26 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
gible wrote on Sun, 15 February 2009 06:02

fwiw that was XP SP2 & Chrome 1.0.154.48 maximised at 1280x800


I have a 23" Widescreen monitor with a Resolution of 1680x1050, without the positioning the boxes would all appear on a single line, maybe the problem is that the browsers in smaller resolutions aren't bothering to render the boxes that would be off screen without the positioning. I've done an update to the Death star only that starts a new line when a block would appear a full block under the first one in the previous line, ie the death star now has 3,4,3,5,2 blocks on each line rather than the original 17 which would have been around 1300 pixels across and that isn't including margins or scroll bars.

Report message to a moderator

Re: Possible new utility for creating testbeds Sun, 15 February 2009 13:05 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
PaulCr wrote on Sun, 15 February 2009 12:26

I've done an update to the Death star only that starts a new line when a block would appear a full block under the first one in the previous line, ie the death star now has 3,4,3,5,2 blocks on each line rather than the original 17 which would have been around 1300 pixels across and that isn't including margins or scroll bars.

That did it. The DeathStar now displays beautifully in FF2 and only very slightly misaligned in IE6. Cool

(processed wood thingies for teh win, yeah! Hit Computer)



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Possible new utility for creating testbeds Sun, 15 February 2009 14:57 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
m.a@stars wrote on Sun, 15 February 2009 18:05


That did it. The DeathStar now displays beautifully in FF2 and only very slightly misaligned in IE6. Cool

Done an update to the HTML file updating the starbases and the big warships, only changed the Meta morph of the cargo ships, hopefully the people that had problems should hopefully be OK now although the big cargo ships such as the Galleon and Rogue might be a little close to the limit for some people.

For anybody that is still having problems though I now also have a PDF on the website, hopefully there shouldn't be any display problems with that. I'm thinking of turning the PDF into a copy of the Technical Reference Manual since that is perfectly laid out already for adding the Item IDs to each item and the Category ID to the page title and for those who don't have the original technical manual it would be worth printing anyway. I find using it a lot easier then using the tech browser despite the occasional errors in it that I have written in corrections for.

Report message to a moderator

Re: Possible new utility for creating testbeds Mon, 16 February 2009 17: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
Most of the html displays ok now. Very Happy


So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Possible new utility for creating testbeds Sat, 21 February 2009 07:57 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
Just done an update to the zip file on the server that stops incomplete enemy designs in the m file from superceeding complete designs from the h file and damage is now applied to your own ships.

I'm not sure if anybody is actually using this other than me, given I've not received any request for improvements and the 2 problems I've fixed above would have probably shown up for anybody using it in a real game as they did for me after just 2 years then I can only assume nobody is.

I've included the ChangeLog.txt line for the new version below for anybody still interested.

21/2/09 v0.05 Unknown designs from m file no longer superceed full design in h file unless hull changes, damage is now included on your own ships, design.* files included showing slot designs in word, pdf & html

Report message to a moderator

Re: Possible new utility for creating testbeds Sat, 21 February 2009 12:29 Go to previous messageGo to next message
mlaub is currently offline mlaub

 
Lieutenant

Messages: 744
Registered: November 2003
Location: MN, USA
PaulCr wrote on Sat, 21 February 2009 06:57



I'm not sure if anybody is actually using this other than me, given I've not received any request for improvements




I have, but I just have not had the time to fully test it, and send feedback. Just loaded the glr2 universe, with no ship definitions. I'll see if I can dedicate some time to it.

Thanks!
-Matt



Global Warming - A climatic change eagerly awaited by most Minnesotans.

Report message to a moderator

Re: Possible new utility for creating testbeds Mon, 23 February 2009 12:56 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
I've just had a thought, I've not tested this yet but it should work. The app can take .h and .m files from multiple allies and merge them together although I'll have to add something to stop fully known planets being replaced by incomplete ones in a later m file in a similar way I've done for the designs.

With a minor amendment to the app to dump all known info to the initial .m files you should be able to load the resulting .m file and generate an history file containing all the planet/ship design and starbase info from all your various allies.

It should then be possible, at least in theory to copy that resulting h file back to your real game and be able to see that info in the real game. I'll have to check but I'm pretty certain fleets, minefields, packets, salvage etc aren't kept in the h file so they won't appear but you'd still see them in the generated m file.

Whilst looking into the autohost crashing problem I wrote something to strip certain blocks from the .hst files to narrow down the possible causes. I'm going to modify that to allow selected infomation to be removed from stars files which you can then pass onto your ally. It should have check boxes against each race to remove Race Design, Planets, Fleets, Ship Design, Starbase Designs, Minefields, Packets, Research, Battle Plans, Player Relations, Battles, Score and Messages belonging to the selected player. ie you could take out your own sensitive data, ie Planets, Fleets, Race design, Research etc but still leave in things like minefields and all your opponents data.

If you run it against your .h and .m file the resulting files would probably make a better transfer format then the existing planet & fleet files since they can load them into stars and see everything, if people are interested I could write something to merge multiple players h and m files together, along with the app to strip info out it should make information sharing between allies a lot simpler.

Edit: I'm also writing a stars to xml file dumper that uses the various structure definition files to create the resulting .xml which will make decoding the remaining data easier and should allow other programmers full access to what is contained in the file and hopefully get some new utilities developed. I'm also considering doing the reverse, ie generating stars files from xml although before that is made publicly available I'll have to do some testing to see what happens if you try to do invalid things in an x file, in all probability generating an x file will probably be limited, ie fleet movement shouldn't be a problem so a scouting bot could be written but waypoint orders, design changes or changing the production queue could be and therefore will need some experimentation to see what can be safely added.


[Updated on: Mon, 23 February 2009 13:13]

Report message to a moderator

Re: Possible new utility for creating testbeds Mon, 23 February 2009 15:05 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
PaulCr wrote on Mon, 23 February 2009 18:56

If you run it against your .h and .m file the resulting files would probably make a better transfer format then the existing planet & fleet files since they can load them into stars and see everything, if people are interested I could write something to merge multiple players h and m files together, along with the app to strip info out it should make information sharing between allies a lot simpler.

But plaintext reports are easier to generate and edit, and there's already utilities to merge them. Deal

While you're at it, it would be great if you could bash together some kind of infodumper that outputs as text report the things not normally reported, such as salvage, minefields, packets and design-by-design info on all fleets. Teleport


Quote:

I'm also considering doing the reverse, ie generating stars files from xml although before that is made publicly available I'll have to do some testing to see what happens if you try to do invalid things in an x file, in all probability generating an x file will probably be limited, ie fleet movement shouldn't be a problem so a scouting bot could be written but waypoint orders, design changes or changing the production queue could be and therefore will need some experimentation to see what can be safely added.

That would be soooooo cool! Cool But lots of bad things could happen. Confused

You should probably start with an x-file "sanitizer" that checks all orders against the master hst and reports, fixes or nuls the wrong ones. Whip

And even that could be hard... Boxing



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Possible new utility for creating testbeds Mon, 23 February 2009 16:01 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
m.a@stars wrote on Mon, 23 February 2009 20:05

PaulCr wrote on Mon, 23 February 2009 18:56

If you run it against your .h and .m file the resulting files would probably make a better transfer format then the existing planet & fleet files since they can load them into stars and see everything, if people are interested I could write something to merge multiple players h and m files together, along with the app to strip info out it should make information sharing between allies a lot simpler.

But plaintext reports are easier to generate and edit, and there's already utilities to merge them. Deal

While you're at it, it would be great if you could bash together some kind of infodumper that outputs as text report the things not normally reported, such as salvage, minefields, packets and design-by-design info on all fleets. Teleport


You'd need a different report for every single object, dumping out a single xml file is a lot easier then creating 45 different text files all formatted differently. The XML dumper is basically just parses the stars structure into it's constituant blocks and then looks up the accompanying StructureXX.xml file and uses the bytes attribute on the 1st level elements to pull the required number of bytes and set the value, if you look at some of the XML files on my server you'll see the bytes attribute can sometimes get a fairly complex expression in it referring to previous element values and running mathematical expressions on them to figure out the byte size for that particular value, the bytes attribute was placed there specifically to be machine understandable for the parser I intended to write and anybody else who might have wanted to use the info, anybody capable of using the files should be able to understand what it means, if I want to add a new block type or update a block type with new info then I just amend the structureXX.xml file for that type and it's automatically applied.

It shouldn't be that difficult to write something to go through the resulting XML file for the info you want and redump it in any format, any language should be able to do it even if it doesn't support XML, even a .vbs file could be written to process it as text. I'll put together a simple script later tonight or tomorrow to pull ship design from the resulting .xml file into a .csv and post it.

m.a@stars wrote on Mon, 23 February 2009 20:05


Quote:

I'm also considering doing the reverse, ie generating stars files from xml although before that is made publicly available I'll have to do some testing to see what happens if you try to do invalid things in an x file, in all probability generating an x file will probably be limited, ie fleet movement shouldn't be a problem so a scouting bot could be written but waypoint orders, design changes or changing the production queue could be and therefore will need some experimentation to see what can be safely added.

That would be soooooo cool! Cool But lots of bad things could happen. Confused

You should probably start with an x-file "sanitizer" that checks all orders against the master hst and reports, fixes or nuls the wrong ones. Whip

And even that could be hard... Boxing

Writing something to do reverse from the XML to a binary stars file would be quite easy, it would however need testing as I mentinoed, ship movements look impossible to exploit so the could be made available almost immediately allowing people to write a scouting bot or to manage multiple year travel to minimise fuel, decrease travel time or to try and get w6 travel in without increasing travel time for those with CE, everything else would need testing before I add it, ie playing with the production queue to set objects in it to 99% complete and see how stars responds to that, changing ship designs when you have ships of that design already built etc.

Writing something to compare an x file against the .hst and checking for things like changing the design when something in that slot is already built or partially built, unloading or loading cargo that doesn't exist etc shouldn't be that difficult, if I write
...

Report message to a moderator

Re: Possible new utility for creating testbeds Mon, 23 February 2009 17:19 Go to previous messageGo to next message
PaulCr

 
Chief Warrant Officer 3
Stars! V.I.P

Messages: 187
Registered: February 2007
Location: An Island that kinda look...
Here's a .vbs for pulling the battle plans from the resulting xml file, it could do with some tidying up but it should give a reasonable idea of how you can process the xml file if your language doesn't support it natively.

Edit:Looks like aoutohost is adding extra spaces to it but it should still be understandable, I'll post the script along with a sample xml file on my website tomorrow.

dim fso,file,Result
result="RaceID,BattlePlanID,PrimaryTarget,SecondaryTarg et,AttackWho,Name" &chr(13) & chr(10)
set fso=Createobject("Scripting.filesystemobject")
set file=fso.opentextfile("glr2.m1.xml")
txt=file.readall
file.close
a=1
while a>0
  Element=GetElement(txt,"Structure30",a,Attributes)
  b=1
  RaceID=GetElement(Element,"RaceID",b,RaceIDAttribu tes)
  BattlePlanID=GetElement(Element,"BattlePlanID",1,B attlePlanIDAttributes)
  PrimaryTarget=GetElement(Element,"PrimaryTarget",1 ,PrimaryTargetAttributes)
  SecondaryTarget=GetElement(Element,"SecondaryTarget& ;quo t;,1,SecondaryTargetAttributes)
  AttackWho=GetElement(Element,"AttackWho",1,AttackW hoAttributes)
  Name=GetElement(Element,"Name",1,NameAttributes)
  result=result & GetAttribute(RaceIDAttributes,"value") & ","
  result=result & GetAttribute(BattlePlanIDAttributes,"value") & ","
  result=result & GetAttribute(PrimaryTargetAttributes,"value") & ","
  result=result & GetAttribute(secondaryTargetAttributes,"value") & ","
  result=result  & GetAttribute(AttackWhoAttributes,"value") & ","
  result=result  & GetAttribute(NameAttributes,"value") & chr(13) & chr(10)
wend
set file=fso.createtextfile("output.csv")
file.write(result)
file.close
msgbox result

function GetAttribute(Attributes,Attribute)
  dim a,b
  a=instr(1,attributes,Attribute & "=""")
  if a>0 then
    b=instr(a+len(Attribute)+2,attributes,"""& ;quo t;)
    GetAttribute=mid(Attributes,a+len(Attribute)+2,b-a-len(attri bute)-2)
  else
    GetAttribute=""
  end if
end function

function GetElement(txt,ElementName,byref Start,Attributes)
dim a,b,c
  a=instr(start,txt,"<" & ElementName & ">") '<ElementName>...</Elementname>
  if a>0 then
    b=instr(a+1,txt,"</" & ElementName & ">")
    GetElement=mid(txt,a+2+len(ElementName),b-a-2-len(ElementNam e)) & chr(13) & chr(10)
    Start=b
  else
    a=instr(start,txt,"<" & ElementName & " ")
    if a>0 then '<ElementName attr></ElementName> or <ElementName attr/>
      c=instr(a+1,txt,"/>")
      d=instr(a+1,txt,">")
      if c>d and d<>0 then '<ElementName attr></ElementName>
        b=instr(d+1,txt,"</" & ElementName & ">")
        GetElement=mid(txt,d+1,5)
        'attributes=mid(txt,a+len(ElementName)+1,d-a-len(ElementName )-1)
        start=d
      else '<ElementName/>
        GetElement=""
        attributes=mid(txt,a+len(ElementName)+1,c-a-len(ElementName) -1)
        start=c
      end if
    else
      a=instr(start,txt,"<" & ElementName & "/>")
      if a>0 then
        GetElement=a & "," & b & c
        Start=-1
      else
        GetElement=a & "," & b & c
        Start=-1
      end if
    end if
  end if
end function


[Updated on: Mon, 23 February 2009 17:21]

Report message to a moderator

Re: Possible new utility for creating testbeds Mon, 23 February 2009 23: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
PaulCr wrote on Mon, 23 February 2009 23:19

Here's a .vbs for pulling the battle plans from the resulting xml file, it could do with some tidying up but it should give a reasonable idea of how you can process the xml file if your language doesn't support it natively.

And I thought C++ was ugly. Razz

But indeed that kind of output is just what I meant. It could be very useful to be able to check your own battleplans in this format. Cool



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Possible new utility for creating testbeds Mon, 23 February 2009 23:17 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
PaulCr wrote on Mon, 23 February 2009 22:01

It shouldn't be that difficult to write something to go through the resulting XML file for the info you want and redump it in any format, any language should be able to do it even if it doesn't support XML, even a .vbs file could be written to process it as text. I'll put together a simple script later tonight or tomorrow to pull ship design from the resulting .xml file into a .csv and post it.

Fair enough. Deal


Quote:

I was actually thinking of doing that and hosting it on my own server, I've even considered suggesting an anything goes game where people could use any cheat they like as long has they notified me when they did and exactly what they were doing. Basically it would turn it into a competition for me to close loopholes as quickly as possible in a real world setting rather than writing something that may never even be used and spending a hell of a long time generating test files to test it out.


Hmm, yeah, testing the thing could become the hardest part. But it should be doable. And fun as hell. Twisted Evil



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

trying to use it... Tue, 24 February 2009 13:14 Go to previous messageGo to previous message
Altruist is currently offline Altruist

 
Commander

Messages: 1068
Registered: August 2005
Location: Berlin
Hi Paul,
I've tried to use the tool but I am not sure how to.

GameData.xml
* I've changed the path and filenames to fit with the game I am playing in, eg:
<MFile file="c:\games\stars\sas1\hst\sas1.m3"/>

although I am not sure what to do with
<HSTFile file="c:\games\stars\sas1\hst\g.hst"/>
Will the hst-file be created because I, of course, haven't got the hst-file for the game?

* I've created some race-files and filled in the tech levels
* I've left the ship data as they are to see first what it looks like before experimenting further
* there are 2 more games mentioned which puzzles me (can the tool operate several games at the same time?)

I am saving the changes and start: DatasetEditor.exe
The program starts and I get an empty screen, mmh, am I supposed to manually load the xml-file?

Ok, so I choose FILE > OPEN: GameData.xml
which results in an error message: "could not find file". There are details about the error but they are quite long...

What now?

Report message to a moderator

Previous Topic: Revival of an interesting idea?
Next Topic: 0.2% Minimum Damage
Goto Forum:
  


Current Time: Fri Mar 29 07:40:50 EDT 2024