Author Topic: Updates for Outpost 2 1.3.7  (Read 39707 times)

Offline dave_erald

  • Sr. Member
  • ****
  • Posts: 262
Re: Updates for Outpost 2 1.3.7
« Reply #50 on: May 28, 2018, 07:11:42 PM »
Download 1.3.0.7 , delete 1.3.0.6 , put this one in and play, comes up with a Error box

Outpost 2 error

ConsoleModuleLoader.cpp, Line:95: A switch was expected but not found. Prefix switch name with '/' or '-'

Myself and two others are seeing this. I'm in windows 7, game still starts after acknowledging.

And INTERNET (TCP/IP) is showing my internal address, not my external. So something something something...
-David R.V.

-GMT400 fan
-OPU Influencer

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Updates for Outpost 2 1.3.7
« Reply #51 on: May 28, 2018, 07:22:14 PM »

Offline dave_erald

  • Sr. Member
  • ****
  • Posts: 262
Re: Updates for Outpost 2 1.3.7
« Reply #52 on: May 28, 2018, 07:24:22 PM »
that's the one
-David R.V.

-GMT400 fan
-OPU Influencer

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: Updates for Outpost 2 1.3.7
« Reply #53 on: May 29, 2018, 12:01:35 AM »
I was able to reproduce the Console Module Error message on my computer. It can be caused by having a space somewhere in the absolute path to Outpost2.exe.

We use this line of code to retrieve the attached console arguments on Outpost2.exe that would be used in loading a module via console (like multitek2):

Code: [Select]
std::string commandLine = GetCommandLine();

If the folder has a space in it somewhere, such as Big Test Folder 299 below, op2ext will assume the part before the first space is an incoming argument and cause an exception because it isn't formatted correctly:

"\"C:\\Users\\Brett\\Desktop\\Big Test Folder 299\\Outpost2-1.3.0.7-OPU\\Outpost2.exe\" "

The folder location below will not cause an exception:

"\"C:\\Users\\Brett\\Desktop\\Outpost2-1.3.0.7-OPU\\Outpost2.exe\" "

Dave,

Could you verify on your computer if the path to Outpost2.exe has a space in it or not? If it has a space, fixing this bug will fix your problem. I want to make sure we are not finding separate bugs though. You should be able to see the path by copying the top bar from Windows Explorer when you have Outpost2.exe highlighted.

If there is a space somewhere in the path, try moving Outpost 2 to an absolute folder that does not contain a space and see if the warning goes away.

Could you verify the attached screenshot is the screen where you are seeing the internal IP address? Also sense I am really dumb when it comes to networking, could you verify that with NetHelper loaded back in Outpost 2 1.3.6, you would see an external IP address here. If the problem is from NetHelper, I can devise a check to see if NetHelper is being loaded in release versions of Outpost 2 as a starting place for debugging.

Sorry for the poor workmanship on op2ext.

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Updates for Outpost 2 1.3.7
« Reply #54 on: May 29, 2018, 03:11:04 AM »
I'm noticing there wasn't much context with the error message, which can help people understand what went wrong, and possibly how to fix it. I think the error message can be improved to show what the game is seeing, along with the problem statement. Perhaps show the quoted components. A path parsing issue due to splitting on a space can become clear, and allow people to take action such as moving things to a folder without a space, or trying to put quotes around a string, or escapes in front of spaces.

In this case, it doesn't look like there is anything the user can do in terms of quoting or escaping. They'd only be able to move the folder.

It looks like the issue is the istream_iterator simply splits on spaces, and doesn't respect quoting or escaping. That's not too surprising for C++, which tends to have pretty basic facilities.

The Windows API method CommandLineToArgvW may be more appropriate. Ideally you want the command line argument parsing to match the standard way. That can be done by using the arguments from main (which you don't really have access to), or by calling the same standard method.



I believe the game always displayed the internal IP address. There's no way for the game to know the external IP address without being told by another machine, either the router itself through UPnP or similar (NetHelper), or by the game server or another client (NetFix).

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Updates for Outpost 2 1.3.7
« Reply #55 on: May 29, 2018, 03:27:03 AM »
I noticed an additional issue yesterday that seems rather specific to my environment. I just confirmed it now.

On Linux, when running the game in OllyDbg under Wine, there are two error dialog boxes that popup on startup. They do not prevent the game from loading or running, you just have to click through them. This only happens when running the game with OllyDbg. Running the game normally under Wine doesn't show any dialog boxes.

Quote
Bad or unknown format of 32-bit executable file 'C:\windows\system32\msvcr100.dll'
Quote
Bad or unknown format of 32-bit executable file 'C:\windows\system32\msvcp100.dll'

I noticed this when looking into the crash report for Evacuation Under Fire - Ply Campaign Scenario that affected the Garage storage view. I tried loading up the saved game that reproduces the issue in a debugger so I could see where the game crashed, and encountered the error messages while loading the game.


Edit:
After some googling around, these files are provided by the Visual C++ 2010 Redistributable package
MSVCR100.dll = C Runtime for Visual Studio 2010
MSVCP100.dll = C++ Runtime for Visual Studio 2010

Dependence on these DLLs is affected by project compile options:
 
  • Dynamic: /MD or /MDd  (DLL code is loaded and linked at runtime)
  • Static: /MT or /MTd  (Library code is compiled into the EXE)

The popups occur just after loading the NetHelper module. It might be worth checking the compile options for that project.
« Last Edit: May 29, 2018, 04:04:01 AM by Hooman »

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Updates for Outpost 2 1.3.7
« Reply #56 on: May 29, 2018, 05:49:10 PM »
It's as soon as I start the game. In my case there is a space in the directory path: "C:\Users\Leeor\Desktop\Outpost 2"

Offline dave_erald

  • Sr. Member
  • ****
  • Posts: 262
Re: Updates for Outpost 2 1.3.7
« Reply #57 on: May 29, 2018, 06:43:32 PM »
Brett -

    Yeah that corrected it, moved the folder from where it was to straight onto the desktop and it is fine that way.

And yes the png you loaded is correct. OP2 always showed the internal IP, but in Arklon's nethelper changelog it shows him correcting op2 to show the external IP. Not sure at what version of what or where it stopped doing this, but it's back to showing the internal, both in 1.3.0.7 and .6

(Changelog shows you need Upnp, my router has it and was enabled, maybe it's just my side, but more than just myself are seeing this so...)

I've been out of the forum for awhile, so maybe I missed where this was addressed. Or I'm doing something wrong somewhere...
« Last Edit: May 29, 2018, 06:47:35 PM by dave_erald »
-David R.V.

-GMT400 fan
-OPU Influencer

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: Updates for Outpost 2 1.3.7
« Reply #58 on: May 30, 2018, 02:00:58 AM »
Dave,

No worries about being out of the forums. I'm usually out of the chat room :) Thanks for the quick reply and test on the bug.

Glad to here we located the bug dealing with the command line switch. Curious that your IP address problem is fixed now. Would you mind attempting another check for me? Could you place Outpost2.exe back into a directory with a space in it. Then load it, get the error message caused by the space in the path, and see if your IP address shows incorrectly again. I want to test if somehow when this error occurs if it is keeping the .ini loaded mods from properly initializing.

If the previous test doesn't cause the internal IP address to show up, could you try opening and closing Outpost 2 a couple of times in a row and then seeing if the IP address still shows proper? It takes a long time for NetHelper to release all its assets. I wonder if attempting to open Outpost 2 before all resources are released could cause problems within NetHelper/Outpost 2 loading NetHelper.

Hooman,

Nice investigative work. I just checked the project settings as listed on GitHub. It is set to compile with Visual Studio 2010. It is also set as /MD (Multi Threaded DLL), which I believe means it relies on the Visual C++ 2010 runtime. That is assuming the settings on GitHub were used at compile time. This probably means in its current form, Visual C++ 2010 runtime should be installed for NetHelper to work properly.

Are you able to load Outpost 2 and NetHelper with OllyDbg attached on Outpost 2 1.3.6? Of course it would require switching the icon. If this is a NetHelper issue, it should manifest in both versions I would think?

I would be in favor of seeing NetHelper recompiled in /MT mode using VS2013 toolset. If we decide to recompile, one of NetHelper's dependencies requires a Visual Studio toolset pre VS2015. See http://forum.outpost2.net/index.php/topic,6067.msg86151.html for details. Not sure how Arklon feels about all this though.

Also, I realized that I failed to upload the version of op2ext we are using onto GitHub with the associated PDB files.  >:( I need to remember to upload this version after we recompile op2ext.

Looks like the following improvements have been identified so far:

 * Improve error message when an ill-formed switch is discovered.
 * Add support for spaces in paths within the Console Mod Loader.



-Brett

Offline dave_erald

  • Sr. Member
  • ****
  • Posts: 262
Re: Updates for Outpost 2 1.3.7
« Reply #59 on: May 30, 2018, 03:57:22 AM »
The IP address shows internal regardless of where the folder is, both in .6 and .7
-David R.V.

-GMT400 fan
-OPU Influencer

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Updates for Outpost 2 1.3.7
« Reply #60 on: May 30, 2018, 02:25:39 PM »
I've confirmed the error dialog boxes are present for the 1.3.6 release when loading the game in OllyDbg under Wine. Again, the dialog boxes popup after loading the NetHelper library, and before the game shell loads.

I believe compiling NetHelper with /MT will fix the issue. The toolset shouldn't matter too much, particularly with /MT. It can be upgraded if desired, though use what's convenient if there's an issue upgrading it.

Is there a way people can easily know if NetHelper loaded and is running? I'm wondering if a missing Visual Studio 2010 Redistributable package might cause the NetHelper to silently fail to load. There's a chance this could be affecting people on Windows and we just don't know it.

In particular, if someone is finding the NetHelper doesn't seem to be working for them (possibly evidenced by the displayed IP?), try googling for and installing the Visual Studio 2010 Redistributable Package. I'd be interested to know if that changes anything.


Sounds like you already have a plan for the other issue.

Offline dave_erald

  • Sr. Member
  • ****
  • Posts: 262
Re: Updates for Outpost 2 1.3.7
« Reply #61 on: May 30, 2018, 11:16:00 PM »
I got Visual Studio '15 loaded already. And trying to run this it just says I have a newer version and to piss off.

No dice
-David R.V.

-GMT400 fan
-OPU Influencer

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: Updates for Outpost 2 1.3.7
« Reply #62 on: June 01, 2018, 01:56:55 AM »
Dave, We would have to compile it using Visual Studio 2013 or earlier due to one of the dependencies requiring the older tool chain. Unless you change out the dependency, Visual Studio 2015 will not work. This weekend I'll look at coding fixes for the issues with op2ext and posting a hotfix. After that, I could take a crack at compiling NetHelper with VS2013 as I have it installed. I looked at it briefly and received a single compiler error but haven't researched it to see the feasibility of working around it in VS2013.

Once we solve these issues, we will need to decide how to release them. Do we want to bundle this all in Outpost 2 1.3.8 or do we want to call it Outpost 2 1.3.7a, or some other solution?

-Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Updates for Outpost 2 1.3.7
« Reply #63 on: June 02, 2018, 08:23:40 AM »
It's a small update, so I can see wanting to keep the same version number. Though it seems a bit improper to track changes with endless suffixes. Or at least if you do that, you're not following Semantic Versioning. Technically, our bigger updates should change the middle version number, and small bug fixes like this should be changing the last digit. We've just only ever changed the last digit. If you want to switch to a more proper release versioning scheme, I'm willing to support that, in which case the fix would be released as 1.3.8.

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: Updates for Outpost 2 1.3.7
« Reply #64 on: June 04, 2018, 02:34:50 AM »
Hey everyone,

I wrote and tested code re-allowing op2ext ConsoleModuleLoader to support paths with spaces in them. See https://github.com/OutpostUniverse/op2ext/pull/2 for the source code modifications and technical details. I'll leave this up for a bit to allow others to comment on the solution before posting the compiled dll here for testing.

I spent some more time trying to compile NetHelper with static dependencies. See the warning and error code below. I believe the problem is one or both dependencies of NetHelper are compiled as /MD (Multi Threaded DLL). In order to compile the NetHelper dll as /MT, I think you would probably need to get static compilations of both dependencies? Below is a link to an article discussing how to override the warning that may also fix the Error? Although I'm not sure this would be smart.

Warning   LNK4098   defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library   NetHelper   

https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-warning-lnk4098?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev15.query%3FappId%3DDev15IDEF1%26l%3DEN-US%26k%3Dk(LNK4098)%26rd%3Dtrue

Error LNK2005 _memmove already defined in LIBCMT.lib(memmove.obj) NetHelper C:\ . . . \NetHelper\src\MSVCRT.lib(MSVCR120.dll)

Anyways, I don't plan on changing out dependency versions. This is Arklon's wheelhouse.

Hooman, in regards to Outpost 2 versioning, I think it would be smart to switch to semantic versioning. If we end up messing with NetHelper, updating the internal version number of Outpost 2 seems like a must to me. This would prevent people from going through the woes of trying to create multiplayer scenarios with differing versions of NetHelper and op2ext.

The other part of that discussion is how we want to handle patch related releases as opposed to larger releases. This release will probably change about 3 files in the release which I suppose should be scanned for viruses and checked for reasonable compatibility with Wine.

Do we want to tag a new patch version in SVN and then commit a version of Outpost 2 with the older icon for OllyDbg use? Or we could just commit the changes to tag 1.3.7 and not support OllyDbg for the patch change. Besides the extra work, the downside of tagging each patch is we start to bloat the repository size (I think, maybe not???).

Dave, if you are still reading this long winded post, thank you for posting the bug in this thread as opposed to the news thread announcing the release. It makes for a much better official release thread to not be posting long bug related testing.

Thanks,
Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Updates for Outpost 2 1.3.7
« Reply #65 on: June 04, 2018, 12:02:16 PM »
We don't need to do the icon thing every little release.

Ideally we should find a way to get a nicer icon without having to edit the exe file. Maybe we could use a shortcut with an updated icon? That might reduce future work when creating releases.

An extra tag won't bloat the SVN repository, since it's just marked as a copy with a new name. There is no duplication of files on the server. However, the working copy will get bloated with extra files. It won't need to download all of them, since knowing they are a copy means they can be copied locally, but they still take up extra disk space, assuming you've done a full repository checkout. In short, don't worry about making new tags when making new tags is warranted.

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Updates for Outpost 2 1.3.7
« Reply #66 on: June 04, 2018, 06:23:12 PM »
I can accept including the new icon as a separate file and providing a shortcut with the new icon. Unless we can somehow pack it into the end of the exe file but I don't know if Windows would know to look there?

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: Updates for Outpost 2 1.3.7
« Reply #67 on: June 05, 2018, 02:36:57 AM »
Attached is the new op2ext hotfix and debug file. It allows placing Outpost 2 in a directory with a space in it without giving the error and disabling the console mod loader. I was hoping someone could test it out on Wine to make sure I didn't break Wine compatibility. I've already tested it on Windows 10 but if someone wants to test it on a different computer it wouldn't hurt.



I think we are moving backwards if the icon isn't included standard embedded within the executable. I would prefer it not be a shortcut only.

Perhaps a better solution is to leave the old icon in the repository and just inject the icon into the executable as part of the release cycle. This would allow OllyDbg to be used at any commit in the repo and the flexibility of the icon being imbedded in the release executable.

Perhaps we could write a batch script that automatically updates the icon when run to simplify the process. It might be possible to auto-inject a new version number inside Outpost 2 as well. But considering how infrequent the releases are it is probably more efficient to just manually update.

Hooman, thanks for clarifying on how tags works in SVN. That makes since that it is just a marker to a revision in history.

-Brett
« Last Edit: June 05, 2018, 02:41:32 AM by Vagabond »

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Updates for Outpost 2 1.3.7
« Reply #68 on: June 05, 2018, 11:19:07 AM »
Yes, "someone" ;)

I just confirmed the update works under Wine. I also confirmed it fixes the problem with launching the game with a space in the path under Wine.

There's still the outstanding issue of the error dialog boxes under OllyDbg, which is likely related to NetHelper compile options.



I'm curious why you feel so strongly about the icon being embedded in the exe. Is that how you normally launch the game?

Maybe there's a way to add the resource to a new section after the other sections.

I do rather like the idea of the release embedding tool, with possible version string update support. Though you're right, it'd be effort to make such a tool, and we don't release all that often. Might be best to just handle things manually for now.

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: Updates for Outpost 2 1.3.7
« Reply #69 on: June 09, 2018, 01:01:30 AM »
Hooman, thanks for testing. I can just ask you to test in the future. I keep expecting someone else with Linux to suddenly scoop you on testing something.  :P

I got around to checking out the external IP issue. When creating a TCP/IP game, I am seeing my internal IP address. This is despite having Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219 installed on my Windows 10 computer.

Although it would probably still be smart to install Visual C++ 2010 x86 Redistributable when using NetHelper as I don't know if it affects any other part of NetHelper.



I'll plan to push the new version of op2ext to the svn repository. Does anyone plan to work on NetHelper, Evacuation Under Fire's Garage Issue, or any other not yet mentioned item in the near future? If not, I will add a bug report to the change log for NetHelper and EvacuationUnderFire.



Hooman, yes normally launch the game by clicking on the executable. I would open the game is by searching for outpost in the lower left corner of my computer, but I typically have several versions milling around my computer and it would probably pick the wrong one. Maybe the shortcut would also show up there and maybe I am in the minority? It just seems to make sense to me to embed icons instead of linking to a separate file.

Thanks,
Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Updates for Outpost 2 1.3.7
« Reply #70 on: June 10, 2018, 12:40:07 PM »
I just figured most people would use a desktop shortcut, and the shortcut could get its own icon.

I don't use a desktop shortcut, but then I also have an unusual setup, with multiple copies of Outpost 2 to work on. Usually I open the game using the previously opened file list of OllyDbg, so I see it based on path rather than icon.



I checked the NetHelper source, and it does indeed have code to modify the IP address display and show the external IP address. I wasn't previously aware it did this.

As a side note, previous versions of the OP2 SDK used a custom C-RunTime to produce smaller DLLs. I think older versions of the compiler were worse at stripping out unused code when linking libraries, so even a do nothing DLL could end up being quite large. To compensate, the SDK used to be shipped with a minimal CRT library that allowed output DLLs to be about the same size as those shipped with the game. When we upgraded to a newer version of Visual Studio, the older CRT wasn't compatible, though the stripping of unused code was better, so we got rid of the custom CRT.

Sounds like the issue with the NetHelper dependency is similar. I'm a little rusty on the topic, but I remember there being some decent documentation about custom CRT libraries.



If Evacuation Under Fire's code was up on GitHub we could potentially open an issue for the project concerning the garage bug. That might be a decent way to track it.

I should take another look at that, now that I've documented more of the crash point.

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
Re: Updates for Outpost 2 1.3.7
« Reply #71 on: June 10, 2018, 08:02:14 PM »
Hooman,

I'm fine with migrating Evacuation Under Fire to GitHub. It would be the first actual mission file to make it out of SVN.

I do not have the skills to maintain the SVN commits when transferring to Git. If you want to do the work on this I don't mind. I could handle re-hooking the submodules to the scenario after uploaded. It also contains odasl.lib and I don't remember what the decision on whether we wanted that file on GitHub or not?

If people are wanting to go the icon shortcut route, maybe someone could post a modified exe that works with OllyDbg with a paired separate icon and we could play with it to see how it feels. I'm guessing Outpost2.exe would contain the embedded icon, so I'd assume this wouldn't get in the way of the shortcut's separate icon?

Thanks,
Brett

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Updates for Outpost 2 1.3.7
« Reply #72 on: June 11, 2018, 02:07:22 PM »
Perhaps I could dig up my old notes on the repo migration. I don't remember odasl.lib being a problem file, and it's probably not if it's an auto generated linker file.

The bug might actually be in Outpost 2 itself though.