aliens

Author Topic: [RESOLVED] UFOPedia bug in more recent nightly  (Read 8152 times)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
[RESOLVED] UFOPedia bug in more recent nightly
« on: July 02, 2017, 11:21:12 pm »
When I updated my version of openxcom to 2017-02-09, it changed the way the UFOPedia calls up entries. The ruleset doesn't implicitly state how exactly an entry works. If I have two entries with different names but which require the same technology, the ruleset doesn't define what item they are to pull the stats from. The old method seems to have been to use the name of the entry, but it's been changed to in some cases pull from the name and in other cases pull from the technology requirement--or so I am guessing. I can't see the code so all I have to go on is how it functions.

What this does is make odd crashes in UFOPedia entries that previously worked fine. For instance, I had an aircraft called Sparrow which required Elerium-115 and UFO Power Source. Previously, the entry worked fine and caused no issues. The entry itself pulled attributes from the craft called STR_SPARROW while the Elerium entry pulled data (just an image) from the item STR_ELERIUM_115. But with the change to UFOPedia functionality, trying to access the Elerium UFOPedia entry caused the game to crash when it erroneously attempted to link it to the item STR_SPARROW, which did not exist. I had a similar error with the Plasma Assault Cannon, which required Heavy Plasma to use. Depending how you approach the Plasma Assault Cannon in the UFOPedia (click on it from menu or scroll through entries to get to it), it would determine whether the entry showed all attributes from the item STR_PLASMA_ASSAULT_CANNON or spliced in some attributes from STR_HEAVY_PLASMA. And it got even weirder when it tried to show which clip belonged with the weapon in the entry, sometimes leading to a crash.

I was able to get around it by creating separate technologies for each item that had a separate UFOPedia entry, but that's potentially a lot of work rewriting all of my research. Entries that didn't encounter any problems were those in which the technology name was different from any UFOPedia entry that required it. For instance, both my Laser Pistol//STR_LASER_PISTOL and Laser Rifle//STR_LASER_RIFLE require Laser Weapons//STR_LASER_WEAPONS, but there's no UFOPedia entry called Laser Weapons//STR_LASER_WEAPONS_UFOPEDIA.

I make this comment purely to discuss the issue, and I hold no opinion on how it should be handled or resolved.
« Last Edit: July 08, 2017, 04:43:37 pm by The Reaver of Darkness »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8954
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #1 on: July 02, 2017, 11:42:53 pm »
9th February 2017 isn't really recent... which version did you mean exactly?

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #2 on: July 03, 2017, 12:14:54 am »
I meant 9 Feb 2017. That's the version I'm currently using and it's the first version in which I have encountered this issue. I was hesitant to report on it until I had investigated it thoroughly and was certain not only that the bug was happening due to a fundamental change, but also that I understood how it was happening.

It took a while because I haven't spent a lot of time in the UFOPedia while writing my mod.


edit: it's pretty recent in terms of breaking existing mods.
« Last Edit: July 03, 2017, 12:16:39 am by The Reaver of Darkness »

Offline hellrazor

  • Commander
  • *****
  • Posts: 2025
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: UFOPedia bug in more recent nightly
« Reply #3 on: July 03, 2017, 01:40:45 am »
You should really update towards the most current Version.
If you run vanilla OpenXcom only i would always recommend using the newest available Version.

I presume you run on this Version here: https://github.com/SupSuper/OpenXcom/commit/270768881c970bef7e1a310d7250d56411997d2d

Thats 95 commits and codechanges since then.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #4 on: July 04, 2017, 01:56:47 am »
I don't like to update it very often because it's a big hassle, especially with MapView which seems to break and need a complete reinstall every time I update openxcom.

My version really isn't that old. Are you guys trying to say that newer versions went back to the old way UFOPedia accesses entries, and that the bugs I mentioned won't occur in the newer versions?

Offline hellrazor

  • Commander
  • *****
  • Posts: 2025
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: UFOPedia bug in more recent nightly
« Reply #5 on: July 04, 2017, 08:07:21 am »
I don't like to update it very often because it's a big hassle, especially with MapView which seems to break and need a complete reinstall every time I update openxcom.

I do not know how you update openxcom, but i never do have problems with my MapView install. I can even run MapView if there is no OpenXcom installed. Maybe we can assist you with this issue?

My version really isn't that old. Are you guys trying to say that newer versions went back to the old way UFOPedia accesses entries, and that the bugs I mentioned won't occur in the newer versions?

There is no old way of accessing UfoPaedia articles, there is only the way. If you are interested in the changes since Februaury in the code base, take a look here: https://github.com/SupSuper/OpenXcom/commits/master

Also the error you encountered, sounds familar to me. I reported something similar to SupSuper a while ago, which was then actually fixed here:
https://github.com/SupSuper/OpenXcom/commit/6992ae78b2b7fafa872de71db9d19d9c62891324
https://github.com/SupSuper/OpenXcom/commit/e12e51f9d29ec698230a94199276726cb976d139

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #6 on: July 04, 2017, 01:17:08 pm »
How do I install it quickly and easily? What I've been doing is put the new openxcom into a new folder and manually transfer all of the game files over to the new folder. I do it this way because last time I tried to put the files into the existing folder, it made a large number of duplicates due to a complete rearrangement of the ruleset. The ruleset was divided in a completely different fashion from before, leading explorer to not detect the duplicates. And there were other problems as well, I don't remember what they all were. I gave up trying to manually sort through the game files and I just started over in a fresh folder.

When I start in a fresh folder, MapView can't find the game files anymore, even if I run the paths editor or set the paths manually. The only way I was able to get it to work again was to completely delete MapView along with all of its settings files, and reinstall it from scratch. It seems to have some poorly functioning pathing code that I don't have access to in the settings files, which makes mistakes I can't fix.

I also had to manually transfer the map files from Luke's UFOs into the main game folder because the mod isn't set up correctly, though in retrospect I now know how to set it up myself and could fix this.

Also, how do I use github? The links to github pages are completely alien to me. I don't see anything like what I'm looking for, and I can't identify what I'm looking at. I can't find any download links, I don't know what I'm looking at, and none of the buttons make any sense. What do I do, what am I being pointed to, what is it? The links I see: features, business, explore, marketplace, pricing, watch, star, fork, code, pull requests, projects, insights. What I understand out of that: watch, star. Missing links: download, files, description, instructions.
« Last Edit: July 04, 2017, 01:20:13 pm by The Reaver of Darkness »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8954
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #7 on: July 04, 2017, 01:23:41 pm »
How do I install it quickly and easily?

0/ if you have openxcom 1.0 somewhere, DELETE IT! (especially from your user folder)

1/ download nightly
2/ extract it into a new directory (e.g. on your desktop)
3/ copy original UFO/TFTD files into UFO/TFTD subdirectories
4/ run openxcom.exe

There are no other steps necessary.


Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #8 on: July 04, 2017, 01:38:56 pm »
0/ if you have openxcom 1.0 somewhere, DELETE IT! (especially from your user folder)
I haven't had openxcom 1.0 for years now.

There are no other steps necessary.
But that breaks MapView and possibly other things I haven't discovered yet.

I'm currently struggling with a strange MapView bug in which a .MCD was working and I made no changes to it and it stopped working while I was away. I have confirmed the maps work fine with a different MCD but they won't work with that one. I even deleted it and re-made it from scratch from one that does work but it still doesn't work, which might indicate that the name is bad, but I tried re-naming it to something 8 characters long in all caps, which can't be a bad name. It still won't work. It's like it is okay with one set of wall pieces, but doesn't like another nearly identical set of wall pieces to exist within the MCD. I can't figure out what problem it could possibly have with this MCD.

The error message it gives is: the given key was not present in the dictionary. Normally I only see this error message in MapView when the MCD being called for isn't present at all in the TERRAIN folder, but I've been very careful to check that I have it in there correctly and all the spelling is correct.
« Last Edit: July 04, 2017, 01:49:57 pm by The Reaver of Darkness »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8954
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #9 on: July 04, 2017, 03:02:14 pm »
But that breaks MapView and possibly other things I haven't discovered yet.

OpenXcom and MapView are two completely different programs, they don't share anything.
Installing OpenXcom cannot in any possible way break MapView and vice versa.

Only thing I can think of is that you access the same data (i.e. maps) with both programs... and if you install openxcom with non-admin rights (=you copy files manually into protected directories without admin rights), the files might actually get installed/copied somewhere else than you think they are.
My recommendations:
1. install/copy into non-protected location (e.g. Desktop or Documents or anything else than "Program Files")
2. don't use the same files/directory to play and to mod... or at least don't mod/modify files in protected directories directly, that's asking for trouble


As for all the other "strange stuff" you reported, my guess is that the files are not actually where you think they are... you have put them into protected directories without admin rights.... and Windows put them into "virtual storage" for you instead.

Same as this: https://openxcom.org/forum/index.php/topic,5031.msg74024.html#msg74024
« Last Edit: July 04, 2017, 03:13:00 pm by Meridian »

Offline SteamXCOM

  • Colonel
  • ****
  • Posts: 150
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #10 on: July 04, 2017, 09:54:46 pm »
Quote
REAVER ==>But that breaks MapView and possibly other things I haven't discovered yet.

Quote
Meridian==>you copy files manually into protected directories without admin rights...

Yes, all my installs now go into created directories  c:/games or c:/applications NOT default C:/program files since Windows VISTA and above cause mods to do funny things without administration tinkering with those folders.

I just clone my install and rename the OpenXcom folder before I run a new nightly.
Once I understood the .exe nightly is a "full install," sans xcom files; life was easier

IE (long version with example)
In the past, I have created the install location "c:/games/Openxcom"
I Rename the directory Openxcom to OpenxcomOldjune6_2017 (I have renamed original directory)
---
I get latest nightly and run its install process;
--original files  are auto copied from UFO directory of where  installed "Xcom UFO Defense" is
--let all patches download
I now have again a fresh new Openxcom in location c:/games.
---zip up a copy of above for backup and hoarding purposes

If I previously did a portable install   user directories from OpenxcomOldjune6_2017 are copied  to my new Openxcom directory and let it rewrite. This to get  mods reloaded again. 
If no previous portable install; the new install should find it to reload all mods and settings.

Other custom content might be more tricky but modding I usually can check for them in the terrain, routes and routes folder or can copy them back from the "in process" Mod folder that I have been working on. The Patch may have been updated some maps or other files in the meantime and Nightlies may alter some of the rul files, so that is why I may not want to simply copy the whole UFO folder from the previous install.

Mapview and other utilities will still look for  c:/games/Openxcom  so when it is backed it up/ renamed and newly installed , these utilities are still looking for c:/games/Openxcom not realizing it is a new install.

Unless I missed copying something back into the terrain/maps or other directory;  the MapView stuff loads up fine.  If there is a bolo, then the previous OpenxcomOldjune6_2017 is still there and can be referenced if needed.

Updating OPENXCOM this way has not been a problem unless I actually move the directory to a different location on my hard drive.

Openxcom has such a small footprint compared to other games these days;  unless you are really scraping for disk space, you can have multiple backups and installs under different nightlies if needed.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #11 on: July 06, 2017, 01:46:46 am »
Well I updated my X-Com but it'll be quite a long time before I know much about how well the update went, given there's so many ways for it to have broken and I can't know how to check them all.

One of these days I'll discuss what's wrong with my copy and you'll tell me my copy is old and I should update it, and I'll remind you of what was said here.

I think this would all be easier on everyone if there was a more recent milestone release. I feel like we should have a fresh milestone at least once a year, and bug-fixes can be made to the milestone for maybe a month after release but no feature changes will be made. That way people can agree on a stable copy to use.
« Last Edit: July 06, 2017, 01:48:50 am by The Reaver of Darkness »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8954
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #12 on: July 06, 2017, 09:14:21 am »
I 100% agree with you that there should be a more recent milestone.

However, that won't help you with the issue you're having, you will have exactly the same problems with it if you'll try to modify files in protected locations.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: UFOPedia bug in more recent nightly
« Reply #13 on: July 06, 2017, 12:10:57 pm »
However, that won't help you with the issue you're having, you will have exactly the same problems with it if you'll try to modify files in protected locations.

I'm not having that issue, as I have the game saved in E:\Games\. Windows 7 has major problems with administrator access but as I am an administrator, it usually prompts me when I try to save a file to an admin location. I don't think it would save the file to a separate location if I did put it in C:\Program Files\, but it might explain why some of the programs I have will ask permission to run every time I start them, and I can never give full access for good.

MapView specifically has issues with pathing because it isn't scripted to fix its own pathing errors and the interface doesn't show all of the paths it has recorded.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11651
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: UFOPedia bug in more recent nightly
« Reply #14 on: July 06, 2017, 08:15:38 pm »
I don't understand this issue... MapView stores the path in \MapView\settings\Paths.pth, which is a normal text file. It does not modify itself. Why would it stop working?
Granted, I haven't tested this, since I have a separate folder for maps and terrain (using the ones in the installation folder would be way more trouble than it's useful, mainly because of no backup). But I wouldn't expect problems.