Ultimate Editor
Moderator: thunderchero
Re: Ultimate Editor
Floke,
After merging in your changes to my local, whenever I make any kind of save (even unrelated to my changes) I am getting the below error when I try to reopen stbof.res file
After merging in your changes to my local, whenever I make any kind of save (even unrelated to my changes) I am getting the below error when I try to reopen stbof.res file
- Flocke
- BORG Trouble Maker
- Posts: 3258
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: Ultimate Editor
I just gave it a try with my own build and changed some building stats, saved, closed and reopened stbof.res and all was fine, guess this came by the merge then, I'll have a look.
Further I had a glance on what UE is doing wrong.
First, if I remember correct it once just switched the sector map locations, but this is not what it does by now. Instead
it also changes the write order of the sectors so all sectors are now written in a sorted manner again, row by row and column by column. However the sectors are indexed by their storage order, and so all the references must be updated as well.
Analysing the source code for the main "Move" operation, which calls the "SwitchSectors" routine, UE applies the following:
- It swaps the map position of the two sectors in Sector.lst.
- It sorts the written sector list so the swapped are in order of their map position again - which very well might break any indexing to the previous sector if there are.
- For outposts of that sector in StarBaseInfo it mistakenly overwrites the outpostId by the new sectorId. (unless my wiki documentation is wrong) it computes a new outpostId, which is calculated based on the sector coordinates for not to conflict with other starbase ids, and updates sector.lst for the new id - with further analysis and testing I found no other references so I hope this will be fine
- It updates the outpost map position in StarBaseInfo, which is for image rendering I guess, see below
- It updates the stellar object map icon animation positions in StellInfo.
- It updates the system map positions in SystInfo for map.tga icon rendering.
- It updates the Fleet icon map positions in the GTForceList (current turn) and GWTForce (last turn) and thereby discards that the pervious turn the ships might have been positioned different.
- For the moved fleets and in case they were set to move to the previous sector location, which is likely not the currently moved sector, in OrderInfo it updates the targetSectorColumn and -Row to the new sector position.
I'll do some testing on that some other day.
edit: reviewed the outpost id change
Last edited by Flocke on Sun Apr 25, 2021 3:39 am, edited 1 time in total.
- Flocke
- BORG Trouble Maker
- Posts: 3258
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: Ultimate Editor
I can confirm this bug, I tested this by adding one name to the last unpatched naming group 61. But re-opening the saved file only fails with the changes you pushed, not with my previuos commit 9f9b983db3be6acea2b61a6fede2386314ed9ca2!
So I guess you have a hidden bug in your changes.
Further it would be great when you allowed to add more shipname groups even without having the exe patched! You really shouldn't enforce this, specially given the patch might change and then not be detected anymore even though the new format is supported if not required.
A notification or question whether it is really meant to change does perfectly fine. Users still can mess their files in so many ways, you'll never succeed to prevent them to corrupt their files if they wanted, you just hamper people who like me don''t have their exe patched.
However entering some numbers in some other menus I found a casting error that might be by my changes. But I will check on this another day.
Re: Ultimate Editor
Figured it out. For some reason, on my installation, it is not moving the stbof.tmp file and replacing the stbof.res file I am using (nor is it deleting the .tmp file)Flocke wrote: ↑Sun Apr 18, 2021 11:37 amI can confirm this bug, I tested this by adding one name to the last unpatched naming group 61. But re-opening the saved file only fails with the changes you pushed, not with my previuos commit 9f9b983db3be6acea2b61a6fede2386314ed9ca2!
So I guess you have a hidden bug in your changes.
Further it would be great when you allowed to add more shipname groups even without having the exe patched! You really shouldn't enforce this, specially given the patch might change and then not be detected anymore even though the new format is supported if not required.
A notification or question whether it is really meant to change does perfectly fine. Users still can mess their files in so many ways, you'll never succeed to prevent them to corrupt their files if they wanted, you just hamper people who like me don''t have their exe patched.
However entering some numbers in some other menus I found a casting error that might be by my changes. But I will check on this another day.
If I manually move the stbof.tmp file and rename it stbof.res, it works correctly within UE. So probably a bug in your code, Floke
- Flocke
- BORG Trouble Maker
- Posts: 3258
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: Ultimate Editor
Ah, I indeed can reproduce this with my former commit:
Code: Select all
Ultimate Editor 0.7.2dev5c - 16:44:55 19.04.2021
java.io.IOException: Failed to delete file: stbof.tmp
at ue.edit.res.Stbof$SaveTask.replaceStbofFile(Stbof.java:2491)
at ue.edit.res.Stbof$SaveTask.writeZipOutputStream(Stbof.java:2459)
at ue.edit.res.Stbof$SaveTask.doInBackground(Stbof.java:2393)
at ue.edit.res.Stbof$SaveTask.doInBackground(Stbof.java:2362)
at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
I will have a look.
- Flocke
- BORG Trouble Maker
- Posts: 3258
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: Ultimate Editor
Copying over the temp file should be fixed now.
When I cleaned up that code, I basically missed to close the target file prior to overwriting it...
Re: Ultimate Editor
Re: Ultimate Editor
Did QD ever give teh source code for EdificePatcher program?thunderchero wrote: ↑Thu Apr 15, 2021 2:23 pm nice work,
if you want one a little more challenging you could look at fixing extending shipname.bin UE issue.
this was started by Dcer but never completed
viewtopic.php?p=50935#p50935
one other project would be to add the EdificePatcher
UE would need to check if Edifice.bst is edited if so run patcher then when saving rerun patcher? (this might be easiest way)
it might also be possible to make major edits to how UE does Edifice.bst file (if structures above tech 10)
I know there are other edits if you are interested.
If that's not available, could you share which post has all the documentation I would need to see what the changes are to Edifice.bst file and Trek.exe?
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7963
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Ultimate Editor
Hi Lathon,
this will be a tough one QD never really post detailed info.
here is release of EdificePatcher and source code here is edifice.bst with and without patch. (from mirror universe mod) these files have completely different formats
I think I have all the trek.exe changes documented but some overlap with the tech patch.
Good luck, I am glad I still had a copy of the source code.
My file hording comes in handy sometimes
this will be a tough one QD never really post detailed info.
here is release of EdificePatcher and source code here is edifice.bst with and without patch. (from mirror universe mod) these files have completely different formats
I think I have all the trek.exe changes documented but some overlap with the tech patch.
Code: Select all
>> 0x0004f52b 89 d0 c1 e0 04 01 d0
<< 0x0004f52b 69 c2 80 00 00 00 90
>> 0x0004f538 c1 e0 02
>> 0x0004f543 44
>> 0x0004f546 59 5b c3 00 00 00
<< 0x0004f538 90 90 90
<< 0x0004f543 84
<< 0x0004f546 00 00 00 59 5b c3
>> 0x0004f51f 0b
>> 0x0004f545 44
>> 0x0004f822 0b
>> 0x0004fa5a f4 01
>> 0x000d0d1e 0b
>> 0x000d2c70 0b
>> 0x000d577a 0b
<< 0x0004f51f 15
<< 0x0004f545 6c
<< 0x0004f822 15
<< 0x0004fa5a 98 03
<< 0x000d0d1e 15
<< 0x000d2c70 15
<< 0x000d577a 15
>> 0xd5778 80 FB 0B
<< 0xd5778 80 FB 15
My file hording comes in handy sometimes
- Flocke
- BORG Trouble Maker
- Posts: 3258
- Joined: Sun Apr 27, 2008 2:00 am
- Location: Hamburg, Germany
- Contact:
Re: Ultimate Editor
From further testing, debugging and code investigation, this bug was limited to MaxPopOrBonGUI. In the UE log the error reads like this:
Code: Select all
Ultimate Editor 0.7.2dev5c - 23:51:20 20.04.2021
java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Float (java.lang.Double and java.lang.Float are in module java.base of loader 'bootstrap')
at ue.gui.stbof.MaxPopOrBonGUI.finalWarning(MaxPopOrBonGUI.java:306)
at ue.gui.MainWindow.showPanel(MainWindow.java:91)
at ue.gui.MainMenu$OpenEdit.actionPerformed(MainMenu.java:587)
But I fixed it now.
Cool!
With that project finished, I hope you don't mind me to review your changes and e.g. clean up the tab-space indention mess.
For code review btw it is best to work on a separate branch and issue a pull request in GitLab.
But a commit comparison, skipping the stbof save files I touched, works just as well this time:
https://gitlab.com/stbotf/ultimate-edit ... a0a9c42fa9
Regarding the code indention, as I've noticed it is messed in the whole UE project. When viewing the source in the web editor or some git compare, it often becomes quite hard to read when different tab indention is used. Best go either the tab or the space character route.
In UE it looks to be half way either route.
For myself I am used to use space characters, cause when ppl use different tab-indention, it always breaks when you write a second column of comments or the like. And for editor compatibility I don't like to switch tab indention when e.g. I include some library with a different indention.
I however needed to configure Eclipse for this in the Window-Preferences, and both change the Text-Editor indention and add a new Java Code Style: As you can see there are lots of other possible style configurations. I suggest we try to match it with what is mostly used in the UE source.
I havn't looked much into this yet though.
On the other hand I am thinking about switching to another IDE. Even though Eclipse is told to be the most used Java IDE, I rather prefer to code with "Visual Studio Code" or something. Not sure on it yet. Luckily with the gradle build tools it should not be much of an issue to work with multiple IDEs.
edit: Visual Code -> Visual Studio Code I meant
Last edited by Flocke on Thu Apr 22, 2021 1:28 am, edited 1 time in total.
Re: Ultimate Editor
Thanks! I'll start looking into it when I get some free time in the next couple weeks. Personal life/work started getting a little hectic....thunderchero wrote: ↑Tue Apr 20, 2021 9:57 pm Hi Lathon,
this will be a tough one QD never really post detailed info.
here is release of EdificePatcher and source code
EdificePatcher-130122-w32.zip
EdificePatcher-130122.tar.gz
here is edifice.bst with and without patch. (from mirror universe mod)
edifice.zip
these files have completely different formats
I think I have all the trek.exe changes documented but some overlap with the tech patch.
Good luck, I am glad I still had a copy of the source code.Code: Select all
>> 0x0004f52b 89 d0 c1 e0 04 01 d0 << 0x0004f52b 69 c2 80 00 00 00 90 >> 0x0004f538 c1 e0 02 >> 0x0004f543 44 >> 0x0004f546 59 5b c3 00 00 00 << 0x0004f538 90 90 90 << 0x0004f543 84 << 0x0004f546 00 00 00 59 5b c3 >> 0x0004f51f 0b >> 0x0004f545 44 >> 0x0004f822 0b >> 0x0004fa5a f4 01 >> 0x000d0d1e 0b >> 0x000d2c70 0b >> 0x000d577a 0b << 0x0004f51f 15 << 0x0004f545 6c << 0x0004f822 15 << 0x0004fa5a 98 03 << 0x000d0d1e 15 << 0x000d2c70 15 << 0x000d577a 15 >> 0xd5778 80 FB 0B << 0xd5778 80 FB 15
My file hording comes in handy sometimes
Re: Ultimate Editor
Ah good you found the issue with the casting. I haven't' had time to go look into it lately.Flocke wrote: ↑Wed Apr 21, 2021 1:36 amFrom further testing, debugging and code investigation, this bug was limited to MaxPopOrBonGUI. In the UE log the error reads like this:As I've found, this was not caused by a code change, but likely by the newer compiler or a change in the java.base library.Code: Select all
Ultimate Editor 0.7.2dev5c - 23:51:20 20.04.2021 java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Float (java.lang.Double and java.lang.Float are in module java.base of loader 'bootstrap') at ue.gui.stbof.MaxPopOrBonGUI.finalWarning(MaxPopOrBonGUI.java:306) at ue.gui.MainWindow.showPanel(MainWindow.java:91) at ue.gui.MainMenu$OpenEdit.actionPerformed(MainMenu.java:587)
But I fixed it now.
Cool!
With that project finished, I hope you don't mind me to review your changes and e.g. clean up the tab-space indention mess.
For code review btw it is best to work on a separate branch and issue a pull request in GitLab.
But a commit comparison, skipping the stbof save files I touched, works just as well this time:
https://gitlab.com/stbotf/ultimate-edit ... a0a9c42fa9
Regarding the code indention, as I've noticed it is messed in the whole UE project. When viewing the source in the web editor or some git compare, it often becomes quite hard to read when different tab indention is used. Best go either the tab or the space character route.
In UE it looks to be half way either route.
For myself I am used to use space characters, cause when ppl use different tab-indention, it always breaks when you write a second column of comments or the like. And for editor compatibility I don't like to switch tab indention when e.g. I include some library with a different indention.
I however needed to configure Eclipse for this in the Window-Preferences, and both change the Text-Editor indention and add a new Java Code Style:
eclipse_text_editor_indention.jpg
eclipse_java_style_indention.jpg
As you can see there are lots of other possible style configurations. I suggest we try to match it with what is mostly used in the UE source.
I havn't looked much into this yet though.
On the other hand I am thinking about switching to another IDE. Even though Eclipse is told to be the most used Java IDE, I rather prefer to code with "Visual Code" or something. Not sure on it yet. Luckily with the gradle build tools it should not be much of an issue to work with multiple IDEs.
Yeah go for it. the whole tab/space issue, it doesn't really matter to me. I've always used tabs in my professional life (we usually used tools within Eclipse to compare code, and its never really been an issue there). I'll set mine up for spaces.
I tried setting up Visual code for Java, but it didn't behave. but I only tried for a few minutes. If you want to try another IDE, Intellij has a community version of it's Java ide, and I've heard great things about it. I'm just too used to Eclipse, and don't want to make a switch
There's always Netbeans....but I always found it slow and cumbersome.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7963
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Ultimate Editor
no hurry take care of your personal life first.
one other thing that is part of this, is in edit/starting conditions/starting buildings and starting technology there is a dropdown menus that need to auto adjust to current tech levels (both are limited to level 9 currently)
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7963
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Ultimate Editor
one other request in map generation could we get a warning?
"warning; when editing on any version patched with a larger resolution
you Must run QD's Res_patch to complete code settings.
viewtopic.php?p=30780#p30780"
"warning; when editing on any version patched with a larger resolution
you Must run QD's Res_patch to complete code settings.
viewtopic.php?p=30780#p30780"
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7963
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Ultimate Editor
just an idea here,
in most cases when UE edits the trek.exe it is fine. but I would like to see an option when it asks to "update trek.exe"
to save trek.exe changes to file.
info in file, Hex location, current value, new value (reason for change would be great option also).
this way if any special code has been added the modder can set values to new location or in some cases discard changes.
in most cases when UE edits the trek.exe it is fine. but I would like to see an option when it asks to "update trek.exe"
to save trek.exe changes to file.
info in file, Hex location, current value, new value (reason for change would be great option also).
this way if any special code has been added the modder can set values to new location or in some cases discard changes.