Categories
Uncategorized

How to do manual torpedo targetting in Silent Hunter 4: Wolves of the Pacific

Torpedo targeting in Silent Hunter 4: Wolves of the Pacific is very hard. The manual doesn’t correctly explain it and the online videos I saw are incorrect and incomplete.

1. Bring up your periscope and look at the target
2. Press L to lock the target. This way the periscope keeps looking at the target.
3. Press N to bring up the target recognition manual.
4. (In hard you can do this, but not realistic) Press Less than and Greater than to look at your target with the free camera. This makes identifying it easier.
5. Find the target in the target recognition manual, and press the checkmark in the upper right.
6. In the mid-left and upper right will be slider tabs. Press both of them to expand new windows.
7. In the upper right slider tab, press the button for target distance estimation. This is as described in the manual.
8. Drag down the mirrored target until the waterline of the mirrored version reaches the top of the mast of the real version.
9. Wait 5 seconds or more. The longer the better. The manual incorrectly tells you to press the clock button twice. During this time, I adjust the torpedo settings in the left slider window. Always set the torpedo to fast (I’m not sure why this is not the default). If you set the depth according to the target recognition manual you will shoot under the target. I’m not sure why. I’d just go by the manual, 20 feet for battleships, 12 for cruisers and large merchants, 10 for light cruisers and small merchants, and 6 for destroyers.
10. Do step 8 again.
11. Switch to the speed estimation tab (as per the manual)
12. Press the clock button. You will get a speed and bearing estimate. The manual is wrong about this, instead telling you to press the clock button twice. The online videos do not do this. Instead, they just guess at the speed. Anyway, the speed will be set automatically when you press the clock button using this method.
13. Press the red button to enter the speed into the TDC
14. I haven’t found a better way to do this, but you need the angle between the front of their ship and your submarine. As the online videos do, go to the navigation map and use the triangle. Click in front of their ship, online the bearing. Click on their ship. Then click on your submarine.
15. Quickly enter this angle back at the periscope screen. Then press the red position finder button. If it was already on, turn it off then on again. This locks the angle at your periscope, and updates the position according to the speed and angle entered previously. If you turn it on too early, as they do in the youtube videos, the the angle from you to the target will be when you first pressed it, using the default target speed of 0. So it will fire at an angle behind the target. When the position keeper is on, the point to shoot at will move as your sub moves, and will also move using the speed and angle values you entered in step 13 and 14.
16. If you are in hard rather than realistic difficulty, you should go to the attack map and check your work. The white X should be on top of your target. THe line from the X should match the bearing of your target. The most probable error is that the range is wrong.
17. Mathematically, the distance to the target doesn’t matter if they are directly in-line with your sub (0 degrees ahead for forward tubes, 180 for rear). So if you fire closer to these angles, then distance estimation errors hurt you less. But generally, you will need to correct the range to be quite accurate if you want any chance of hitting.
18. Adjust the spread, and fire a torpedo. You can also adjust the spread to compensate for errors – if the range estimate is too long, then your shot will go behind the target. You need to adjust the spread for each torpedo. For whatever reason, the speed and depth is saved per-torpedo but the spread is not.

Categories
Uncategorized

Disappointed in neatworks

I bought a Neatworks scanner to make my office paperless. After using it for 9 months, I’m pretty disappointed in it, mostly due to poor software.

1. You can scan multiple pages in order, but they are processed out of order, meaning you have to manually reorder them. After complaining about this to the good customer service, they released a patch that only fixed it if you use quick scan center, and then the pages are still in reverse order. Using the regular scan center it’s still out of order.
2. The stored document quality is very bad, almost unreadable, with white backgrounds turning grey, and the overall quality degraded.
3. The OCR accuracy is bad. I don’t know the exact percentage of the time it fails, but it’s definitely the majority of the time.
4. The UI is bad overall, making the software very tedious to use. For example, if I scan 100 receipts all in the same tax category, I have to manually select the tax category for each one through a huge drop down list. You can’t even type to narrow down the category unless you type exactly the category as it is spelled, with punctuation and multiple spaces.
5. Scans are often off-center because there are no guideposts to ensure your documents scan in straight. This is true of both receipts and regular 8.5 x 11 documents.
6. You can export to pdf only, and then only immediately after scanning a document. Once you archive it you can no longer do so, nor can you modify the document, such as fixing the page order.

Categories
Uncategorized

GPL just means your code probably won’t be used

I ran into a guy recently who was well qualified for a contract I was offering and even already had code to do it. The only thing preventing me from hiring him was that his code was under the GPL. When asked if he would do a dual license, he flatly refused at any price.

I appreciate what the GPL stands for, which is that source code should be available. But as a practical matter the best code generally comes from people who are paid, and businesses able to pay for code tend to want to maximize profits on what they have done. And one possible tool to maximize profit is to not have the software open-source.

RakNet is open-source because it helps me make money. More users, fewer support costs, contributions from users, and market appeal count among the benefits of being open-source. I’m not worried about theft because the businesses capable of paying license fees have so much to lose were they to violate copyright that it doesn’t make financial sense for them to not pay.

On the other hand, if I were to make a commercial game, open source means I’d be unable to discourage piracy. People would release for free games based on my source which would compete with my own sales. While it’s relatively easy to enforce copyright against major companies, that’s not true against the entire internet.

In the game industry you’re basically forbidden from using any GPL code. From time to time this means I haven’t used code I otherwise would. It’s never been the case, nor do I expect it to be, that because I used a GPL component I was forced to release my source where I wouldn’t have otherwise. It just means I won’t use the GPL code to begin with.

Categories
Uncategorized

How to build QWT-5.2 with Visual Studio 2005

I posted instructions here

In case it’s deleted or lost:

1. Make sure that Qt\2009.03\bin is in your PATH environment settings. %QTDIR%\bin\ was already in my path, but didn’t work, so I also added C:\Qt\2009.03\qt\bin
2. Edit qwt-5.2/qwtconfig.pri to build both release and debug, and you probably also want it not to build a dll
3. Open Start / All Programs / Microsoft Visual Studio 2005 / Visual Studio Tools / Visual Studio 2005 Command Prompt
4. Go to qwt-5.2/qwtconfig.pri
5. Type qmake qwt.pro
6. Type nmake
7. The static libraries will be in qwt-5.2\lib . Link these into your Visual Studio project
8. Header files are in qwt-5.2\src . Add this path to your Visual Studio project
9. Copy qwt-5.2\designer\plugins\designer\qwt_designer_plugin5 .dll to Qt\2009.03\qt\plugins\designer
10. Copy qwt-5.2\designer\plugins\designer\qwt_designer_plugin5 .exp to Qt\2009.03\qt\plugins\designer
11. Copy qwt-5.2\designer\plugins\designer\qwt_designer_plugin5 .lib to Qt\2009.03\qt\plugins\designer
12. Run Qt Designer
13. Click Help / About Plugins
14. Make sure qwt_designer_plugin5.dll is listed there

Categories
Uncategorized

Just saved $5,000

I had a project I was sending out to potential contractors, to display a 320×200 video feed based off images from SQL. My performance requirement was 30 FPS for 4 videos, 15 FPS for 8. One company wrote:

“For $5000, we can
implement the proof of concept suggested by my senior engineers (see below)…

For example, I had two of my senior engineers review the RFP. They both zeroed in on a possible bottleneck between animating the user interface at 30fps vs. retrieval from the database. It is their recommendation that a *proof of concept* be implemented that indentified the bottleneck (if any) so that the appropriate infrastructure could be implemented to achieve your performance goals.”

Up until that point, I had only used QT for a few days, had never written OpenGL before. I’m not a graphics programmer.

I did it myself, in a day, by reading the SQL in a thread, buffering multiple rows at a time, bypassing the QT calls to skip code that doesn’t apply for single frame videos, and using glTexImage2D to generate the texture and glTexSubImage2D to update the texture.

I didn’t have to modify the QT source, or come up with new data structures, or call an expert. Just pick the low hanging fruit. For all I know it could be twice as fast again if I really knew what I was doing.

Take it as a word of warning when dealing with fat contracting firms, more used to dealing with Cisco than small businesses. These guys think nothing of asking for 2K a day, spending a week on what would take a motivated hungry programmer a few hours. Meeting after meeting, week after week, charging you for that time, just to come up with a price you’d reject out of hand.

Categories
Uncategorized

How to get a callback on button press from QT designer

Right click on the body of the form.
Click Change Signals / Slots
Under slots, press the + key. Add the name of the callback that you want.
Link it with the signal/slot editor
Now your generated file of the same name will have a callback of the name of the slot you added
Derive from your generated file
Use public slots: to implement, as per the manual

—EDIT—

Found an easier way
Derive from the autogenerated class
Write something like
public slots:
void on_actionSQL_Query_activated();

Replace actionSQL with the name of your object. Replace activated with the name of the signal that is sent.

Categories
Uncategorized

How to add a new window with QT and Visual Studio integration

Took me a long time to figure this out, but got the answer on Stack Overflow

“In Visual Studio, the workflow I use when I want to design a new window is to add a Qt GUI class with Project->Add Class…->Qt4 Classes->Qt4GuiClass.

Then, fill out the form as necessary and the VS add-in will add the appropriate ui and moc files. Double clicking on the ui file will bring up Qt Designer, which you can use to lay your window out.”

Categories
Uncategorized

QT Visual Studio integration doesn’t work / how to fix

I downloaded the SDK for Windows
https://qt.nokia.com/downloads/sdk-windows-cpp

Then the Visual Studio Add-In
https://qt.nokia.com/downloads/visual-studio-add-in

Installed both. Now the 4th or so option in Visual Studio is “QT”

You can click create project / QT / QT Application.

However, it doesn’t work

I read a forum post to click in the file menu QT / QT Options. However, if you click add, the OK button to select a file is always disabled.

Forum Post where others give the answer. You have to set two environment variables, and build with mingw

Building QT in MinGW is pretty hard to figure out. So I found a YouTube video on how to do it
QT + Visual Studio 2005 Part 1/5

And it doesn’t build without errors
Unresolved externals

It’s great that they give this out for free under the LGPL, but from a sales standpoint this is an Epic Fail. It doesn’t work out of the box, there is no documentation or support on why, and the price is very high. $4000 for a license and $2000 for 10 support incidents.

Categories
Uncategorized

Getting bids on a new project

I have a new project I’m working on. I wrote a 15 page detailed design document. I then decided to spend a week finding bids.

Roughly:

5 companies didn’t respond at all
5 responded with they couldn’t do it
2 responded, but mentioned they charge $2000 a day
1 responded with a rough estimate, and a high price, and asked me if I wanted to continue
3 Signed the NDA and came back with a quote, without further communication
1 Signed the NDA, actually spoke to me by email over several days to clarify it, and came back with a quote
3 got the requirements document, but I never heard back again. They are probably studying it, unaware that spending more than a couple of days to answer means they lost the bid.
2 were extremely slow to respond, where it took the whole week to even sign the NDA
1 immediately wanted a phone meeting, without even looking at the requirements document. After sending the requirements document, they wanted a meeting again, without stating why.

The company that clarified the requirements document was my first choice, but couldn’t do it for various reasons. So I’m going to go with one of the companies that just placed a bid. Payment is for completed work only, so there’s no risk or cost to me other than wasted time.

Generally, the small companies were the ones that came back with bids or comments. The large companies were slow to respond, and either wanted a meeting or were so slow to respond I haven’t heard from them by now, and won’t wait any longer.

Is it unreasonable to expect to get a quote within a week’s time?

Categories
Uncategorized

Scaleform partnership for a lobby integration

Whenever a customer has difficulty with RakNet, or a feature of RakNet, I reflect on what I could have done better to help them. So when Stardock, used RakNet as part of their lobby system, I noted that it took them an alarming amount of time and resources relative to my expectations. Part of this was that RakNet’s NAT punchthrough feature was not as sophisticated as it is now. And part of it is just the magnitude of this feature, involving:

  • Remote server hosting
  • Proxy server hosting
  • UPNP
  • Handling difficult to handle failure conditions

The only way to help the customer get around this is to do it for them, which involves lobby and UI code.

Scaleform by far has the best cross-platform solution for UI. So I negotiated a partnership with them, allowing Jenkins Software LLC to use and release Scaleform integration code to our customers. This was done for the Autopatcher. And I’m now having our own Lobby system made. This is a huge feature, but when done can encompass things such as user registration, game rankings, clans, friends, emails, rooms, and NAT punchthrough. All the end user would need to do is license Scaleform and skin the UI that RakNet provides. From a competitive standpoint, this puts us on par with other major middleware providers and eliminates the last reason any developer may have to use their services rather than RakNet.

It’s a pretty big deal, and when done, I believe will be a huge boost to sales and a serious threat to the competition.