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 |
|
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.
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 |
|
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.
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.
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.
So many Stars, so few Missiles!
In space no one can hear you scheme! Report message to a moderator
|
|
| |
Re: Possible new utility for creating testbeds |
Fri, 13 February 2009 16:16 |
|
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 |
Sat, 14 February 2009 11:48 |
|
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 17:17 |
|
|
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 |
Sun, 15 February 2009 01:02 |
|
|
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 |
|
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 |
Sat, 21 February 2009 07:57 |
|
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 |
Mon, 23 February 2009 12:56 |
|
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 |
|
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.
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.
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! But lots of bad things could happen.
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.
And even that could be hard...
So many Stars, so few Missiles!
In space no one can hear you scheme! Report message to a moderator
|
|
|
Re: Possible new utility for creating testbeds |
Mon, 23 February 2009 16:01 |
|
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.
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.
|
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! But lots of bad things could happen.
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.
And even that could be hard...
|
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 |
|
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
|
|
| | |
trying to use it... |
Tue, 24 February 2009 13:14 |
|
|
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
|
|
|
Goto Forum:
Current Time: Thu May 02 16:40:45 EDT 2024
|