News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

Windows 10 and Visual Studio 2015

Started by jamespetts, July 28, 2015, 10:05:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

May I ask whether there are any particular issues that have been identified in relation to using and/or developing Simutrans on the next version of the Windows operating system, due to be released to-morrow? For anyone who does upgrade to Windows 10, it would be useful to know their experiences with using/developing Simutrans using that operating system.

On the development side, will we have to upgrade to Visual Studio Community 2015 (which was released last week) to develop in Windows 10, or will the 2012/2013 editions still work? Is it worthwhile upgrading to 2015 even if older versions do continue to work? Is there anyone here who has experience of the Windows 10 beta and has any idea of what to expect for developers?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

The mostly belongs on the programmer board, not the gaming board.

Though I intended to, I haven't tried running Simutrans on the Windows 10 previews, as Windows 10 and VirtualBox haven't been the best of friends.

There is no need to upgrade to a newer Visual Studio unless you want to use new features in Windows 10. In fact, there is no need to use Visual Studio at all. Windows 10 shall still be able to run programs compiled on and for Windows 95. (As far as I know, even Windows 3.1 programs should work, though only on 32-bit Windows 10.) There might be bugs in this backwards compatibility, though, and some applications that should not have worked in the first place, might suddenly fail like they should have from the start.

DrSuperGood

QuoteIs it worthwhile upgrading to 2015 even if older versions do continue to work?
Based on the release notes it is a good idea. Even a re-build using 2015 could (no promises) result in potentially faster code. Like with 2013, the community edition is available for free which is the full 2015 package usable by private people to create commercial programs.

Simutrans should still work on Windows 10. There is no reason it should not seeing how Microsoft generally does a good job with compatibility.

If you want to build programs specifically targeting Windows 10 (eg using Direct3D 12) then 2013 will probably need some patch to add the Windows 10 SDK. 2015 should come bundled with the Windows 10 SDK although that was disabled until today as part of Microsofts Windows 10 release plan.

Isaac Eiland-Hall

I've been running the Windows 10 Previews on my desktop and laptop for a couple of months, and have played Simutrans with no difficulties at all, though I haven't played very much.

Ters

Quote from: DrSuperGood on July 29, 2015, 01:57:42 PM
2015 should come bundled with the Windows 10 SDK although that was disabled until today as part of Microsofts Windows 10 release plan.

That's a bit odd. Why don't they want third-party "launch titles"? I've also read that the separation between Visual Studio and Windows SDK has been changed now, so that the SDK no longer is a stand-alone product.

DrSuperGood

QuoteThat's a bit odd. Why don't they want third-party "launch titles"? I've also read that the separation between Visual Studio and Windows SDK has been changed now, so that the SDK no longer is a stand-alone product.
Windows 10 SDK worked fine in the 2015 developer preview which is what was used to develop launch titles for Windows 10. Microsoft even recommended you hold off migrating from developer preview to release if you are in the middle of a Windows 10 project until Windows 10 is released. Not that any of this matters anymore as the SDK should now be enabled.

The SDK is offered stand alone, however it is much bigger than it used to be several years ago and is included with MSVC during installation. In the old days you needed to manually install the SDK after installing MSVC and also there were several SDKs to choose from such as DirectX SDK (now part of Windows SDK).

jamespetts

I did give some thought to which was the correct board for this, and did consider Programmers' Corner, but that seems to be for specific projects, and is limited in who may post, so I though that a general board might be more appropriate. Forgive me if I made the wrong decision in that connexion.

Thank you for your various thoughts. One very small thing: am I correct in understanding that Windows 8 and 10 have larger icons for programs than Windows 7 and earlier? If this is so, what version of Visual Studio is necessary to produce these larger icons, and how would one go about setting that up? It would be unfortunate if our icon were to look too pixellated, making the game look out of date.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

QuoteThank you for your various thoughts. One very small thing: am I correct in understanding that Windows 8 and 10 have larger icons for programs than Windows 7 and earlier? If this is so, what version of Visual Studio is necessary to produce these larger icons, and how would one go about setting that up? It would be unfortunate if our icon were to look too pixellated, making the game look out of date.
I do not think people care much. If you really have to know you can probably find out reading 2015's documentation about how to make an app as it will likely explain icon specifics in there somewhere. From what I have read it is likely the same as it always has been. For high resolution icons you simply added higher resolution icon resources. The OS should then select the most appropriate one for your DPI and intended size or scale the closest available icon.

Here is what 2015 brings for C++ development (relevant).

Ters

Quote from: DrSuperGood on July 29, 2015, 08:07:00 PM
In the old days you needed to manually install the SDK after installing MSVC and also there were several SDKs to choose from such as DirectX SDK (now part of Windows SDK).

I was thinking the other way around. Before, one could just install the SDK and develop Windows application. That's not possible anymore from what I understand, one must now install Visual Studio in order to develop applications. The SDK is nothing on its own (except very dry reading material).

Quote from: jamespetts on July 29, 2015, 09:51:48 PM
One very small thing: am I correct in understanding that Windows 8 and 10 have larger icons for programs than Windows 7 and earlier? If this is so, what version of Visual Studio is necessary to produce these larger icons, and how would one go about setting that up? It would be unfortunate if our icon were to look too pixellated, making the game look out of date.

Microsoft's icon guideline doesn't mention any changes to icons since Windows Vista introduced 256x256 pixel icons. Such high-res icons might be more commonly used in a tile environment than on the desktop, though. Unless there is some new concept hidden somewhere else that I can't find, MSVC must lag seriously behind in icon support if you need to upgrade to 2015.

prissi

At least the icons in the taskbar have become smaller, and look dead ugly in the today release. (Actually, the visual appearance gets again closer to the 16 color Windoiws 3.11 look.)

Ters

The default black and white theme, plus the snapping that makes it easy to tile windows, made me think of Windows 1.0, which was monochrome and didn't support overlapping windows.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

Waiting to see if Windows 10 ever does download lol. I know I could force it with some command hackery but I want to see if it eventually downloads or not.

Reasons to use Windows 10 are more technical than practical. Specifically DirectX 12 which will be used and required by pretty much all games in the coming years (as it mirrors the console APIs largely).

I wonder if Direct3D 12 could be used to make Simutrans graphics faster. It is a different approach to graphics which may or may not be more compatible with simutrans than previous OpenGL/Direct3D versions.

jamespetts

I think that the rollout for people who had pre-subscribed for a free upgrade will be measured in weeks rather than hours.

As to Direct3D 12, are the differences likely to make it easier to convert Simutrans? This will not be very cross-platform compatible, though, I imagine; or would the idea be to accelerate graphics in Windows and leave them as they are on other platforms? Is graphics speed really a problem now that they run in their own thread?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

Quote from: DrSuperGood on July 30, 2015, 10:55:06 PM
I wonder if Direct3D 12 could be used to make Simutrans graphics faster. It is a different approach to graphics which may or may not be more compatible with simutrans than previous OpenGL/Direct3D versions.

As long as there is a 3D in it, I doubt it. Direct2D might be more suited, but Mingw doesn't do anything higher than DirectX 7 (perhaps a little bit of 8).

Quote from: jamespetts on July 30, 2015, 11:00:18 PM
I think that the rollout for people who had pre-subscribed for a free upgrade will be measured in weeks rather than hours.

I've heard that someone had read that Windows 10 is rolled out to Insider members first, and then to other users once enough other users with a similar set-up to them had run Windows 10 successfully for a while. I haven't even installed the updates that will perform the installation. To have an escape route, I'll make a complete backup of my c: partition first. That is time consuming, and leaves me without a usable computer while it's happening, so I'm waiting for summer to come, when I can just daze in the sun. (However, it looks like summer may not come until next year.)

prissi

The computer I got window 8 first was a computer sitting in a lap with an extremely bad WiFi connection (one bar, dropping after 5 minutes). Still Yesterday it had WIndows 10 ready to install (I reserved it there a month ago though).

Ters

According to co-workers more eager for Windows 10 than me, the download started well ahead of the offical launch date.

Isaac Eiland-Hall

I read articles saying that the download would happen before the release date.

In my case, it's not prompted me to upgrade on either computer; I have the "reservation" on both. :shrug:

I'm actually good with that - I bought a Windows key for 8.1 that I realize now was someone reselling Technet keys - because they said "single activation only".... so... I'll probably have to get new keys for 10. :|

An_dz

I'm not upgrading yet as the OneDrive app is not that good as in Win8.1 and I could not find yet a way to stop all updates from downloading, just some.

Quote from: jamespetts on July 30, 2015, 11:00:18 PM
As to Direct3D 12, are the differences likely to make it easier to convert Simutrans? This will not be very cross-platform compatible, though, I imagine; or would the idea be to accelerate graphics in Windows and leave them as they are on other platforms?
Convert for the Windows Store? If so I believe it will since Windows Phone and Xbox have DirectX integrated. It would be, anyway, not cross-platform since DirectX is Windows only, on other systems SDL would stay. Right now we already have GDI that's also Windows only so a DirectX version could replace the GDI.

Ters

Quote from: An_dz on July 31, 2015, 10:08:48 PM
I could not find yet a way to stop all updates from downloading, just some.

Buy the Enterprise edition. Home editions can not be configured. Users not patching their Windows is too big a problem for the Internet I guess, so Microsoft won't give them a choice anymore. This is my biggest concern about upgrading. How well will Windows install updates when I unplug the computer before leaving for work?

Quote from: An_dz on July 31, 2015, 10:08:48 PM
Convert for the Windows Store? If so I believe it will since Windows Phone and Xbox have DirectX integrated. It would be, anyway, not cross-platform since DirectX is Windows only, on other systems SDL would stay. Right now we already have GDI that's also Windows only so a DirectX version could replace the GDI.

I have made a DirectSound8 backend to replace the Windows Multimedia API backend. Music is a different matter, as I'm not sure there is any replacement API for MIDI. Xbox and Windows Phone probably doesn't do MIDI at all.

As for the new graphics APIs, they seems to be massive beasts, requiring a lot of code to set up.

DrSuperGood

QuoteAs long as there is a 3D in it, I doubt it. Direct2D might be more suited, but Mingw doesn't do anything higher than DirectX 7 (perhaps a little bit of 8).
Direct2D is nothing more than a legacy wrapper for Direct3D which exists for convenience. In the old days it was aimed at 2D hardware acceleration but since most GPUs sold now support 3D acceleration it acts as a wrapper for Direct 3D with some pre-configured and standardized sharders. Direct3D represents an API to access GPU resources for the production of visual graphics. DirectCompute represents an API to access GPU resources for the purpose of GPU offloading non-graphic calculations which need similar computations to graphics.

The only reason I mention Direct3D 12 is that people have made previous attempts at hardware acceleration of graphics. These attempts were deemed too inefficient due to the APIs available to the point that single threaded graphics was still faster. Direct3D 12 offers new APIs that are lower level and faster so might be more compatible with how Simutrans does graphics.

Do note that OpenGL is also meant to be getting a revision that does something similar to Direct3D 12 by trying to make the API lower level. Unlike Direct3D 12 this should be available on both Linux and Mac systems. Chances are it still will need Windows 10 for windows users however.

An_dz

Quote from: Ters on July 31, 2015, 11:14:42 PMBuy the Enterprise edition. Home editions can not be configured.
I have the Pro version and I can stop most updates but I've read security updates still download and I don't want them downloading when I'm using my phone internet.

Quote from: Ters on July 31, 2015, 11:14:42 PM
As for the new graphics APIs, they seems to be massive beasts, requiring a lot of code to set up.
I think DirectX has a compatibility layer for GDI+. I have no idea if this makes anything easier.

Ters

Quote from: DrSuperGood on August 01, 2015, 12:24:30 AM
Direct2D is nothing more than a legacy wrapper for Direct3D which exists for convenience.

It's not a legacy wrapper. It's almost brand new.

Quote from: DrSuperGood on August 01, 2015, 12:24:30 AM
The only reason I mention Direct3D 12 is that people have made previous attempts at hardware acceleration of graphics. These attempts were deemed too inefficient due to the APIs available to the point that single threaded graphics was still faster. Direct3D 12 offers new APIs that are lower level and faster so might be more compatible with how Simutrans does graphics.

The key isssue is whether the API allows you to do simple blitting directly. If one has to send verticies with world coordinates and texture coordinates, sending that is more data to send across the bus than just doing it software like Simutrans does now. It is also problematic if changing source image is expensive, because Simutrans hardly ever draws the same image twice. Looking at the preliminary Direct3D 12 documentation, it looks insanely cryptic.

Quote from: An_dz on August 01, 2015, 12:38:24 AM
I think DirectX has a compatibility layer for GDI+. I have no idea if this makes anything easier.

That's likely the other way around. You first set up Direct3D, then you can do something that let's you use GDI+ to draw to it's textures.

DrSuperGood

QuoteIt's not a legacy wrapper. It's almost brand new.
Although dated here is my reference.
QuoteDirect2D is a user-mode library that is built using the Direct3D 10.1 API. This means that Direct2D applications benefit from hardware-accelerated rendering on modern mainstream GPUs. Hardware acceleration is also achieved on earlier Direct3D 9 hardware by using Direct3D 10-level-9 rendering. This combination provides excellent performance on graphics hardware on existing Windows PCs.
It is nothing more than a wrapper of Direct3D. Although I do admit I was confusing it with DirectDraw (I am sorry but one forgets) so you are right that it is pretty new.

Direct3D 12 allows the use of a resource table (among many other features). This is meant to allow more resources to be cached and efficiently used than the previous API (greatly reducing I/O and driver overhead). For example current generations of video games can see astounding performance enhancements (as much as 40% some developers have reported) from the same hardware. However if this would help Simutrans at all is entirely another question as from what I can tell Simutran's graphics were designed for software rendering (graphic code mixed with state code). I would imagine the lighter weight drivers and faster resource API would speed up the sort of graphics Simutrans uses.

Ters

Quote from: DrSuperGood on August 01, 2015, 05:17:44 PM
It is nothing more than a wrapper of Direct3D.

I think it's a little bit more than just a wrapper, but definately higher level than Direct3D, maybe with some backdoors down to the driver or maybe not.

Quote from: DrSuperGood on August 01, 2015, 05:17:44 PM
However if this would help Simutrans at all is entirely another question as from what I can tell Simutran's graphics were designed for software rendering (graphic code mixed with state code). I would imagine the lighter weight drivers and faster resource API would speed up the sort of graphics Simutrans uses.

The intermingling of state and presentation is at the core of what makes porting Simutrans to Direct3D and OpenGL difficult. In order to make use of GPUs, Simutrans needs to maintain most of the instuctions for drawing the world in VRAM from frame to frame, and only update it with visible deltas between frames. Simutrans lacks a way for getting notified that the world has changed, it happens from all over the place more or less directly into the low level data. The renderer just loops over everything, figuring what to draw from scratch every frame. Only which part of the resulting image has changed is tracked, and used to send only the parts of the screen that has changed from RAM to VRAM.

If a Direct3D/OpenGL based renderer is to simply send instructions to the GPU equalling the function calls in Simutrans renderer interface, that becomes pretty much the same amount of data to send over the bus (even more when zooming out, less when zooming in), than with the current software renderer. The other problem is that the way Simutrans draws the world, means that one has to constantly switch which image to draw. Pre-Direct3D 12 at least, such switching requires flushing the instruction stream, setting the new texture out-of-band, and then sending new instructions. This is exactly what one wants to do to get poor performance. If Direct3D 12 can do texture switches in the middle of an instruction stream, that might be a benefit, unless this still causes GPU stalls. Gathering individual images in mega-textures could reduce texture switches, but you have to find a way to make sure images drawn after each other is in the same mega-texture, which might not even be possible. As long as the 64k image limit was in place, pak64 had a hope of fitting in a single mega-texture on modern hardware. With that limit gone, the hope of avoiding texture switches was busted. At this point, it became too much for me.

jamespetts

Is Simutrans' graphics engine really so slow to be worth any non-trivial amount of work in making it faster? It seems responsive enough to me.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

Quote from: jamespetts on August 01, 2015, 06:34:51 PM
Is Simutrans' graphics engine really so slow to be worth any non-trivial amount of work in making it faster? It seems responsive enough to me.

High-DPI displays may prove a problem. If one still want pak128 to be pak128 and not the new pak64 (or even pak32), a possible solution might be to just scale the image up in hardware after having rendered it in software.

jamespetts

Or maybe just have more zoom levels?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

Quote from: jamespetts on August 01, 2015, 07:20:48 PM
Or maybe just have more zoom levels?

What do you mean that's good for? The problem is that it might be impossible to draw 8847360 (this is independent of zoom) in software and copy it from RAM for VRAM fast enough for the human eye to perceive it as motion. Currently, Simutrans is know to do 2073600 pixels fast enough, at least on some computers.

jamespetts

Ahh, I think that I had misunderstood - you mean that the problems are likely to be when the player zooms out, not in? More levels of zooming in will help with things looking too small (they can look larger in a lower resolution), but not with having to do too much work zoomed out.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

Quote from: jamespetts on August 01, 2015, 08:26:30 PM
Ahh, I think that I had misunderstood - you mean that the problems are likely to be when the player zooms out, not in? More levels of zooming in will help with things looking too small (they can look larger in a lower resolution), but not with having to do too much work zoomed out.

That depends on what you were replying to. For Direct3D/OpenGL, zooming out makes thing worse (more things to draw), and zooming in makes it somewhat better (less things to draw). For High-DPI, the suspected performance problem with Simutrans' current renderer will be unrelated to zoom (for the most part at least).

Ters

Having taken a look at Visual Studio 2015, it looks like Microsoft have settled on a very deviant form of C++, and it seems that this is required for Windows Store apps. I guess this is what used to be called C++/CLI, based on the keywords and operators in the example code, but they are apparently no longer bother to state whether it is CLI or not. When also considering how the program entry point is in Windows Runtime is even more different from Win32 than Win32 is from POSIX, making Simutrans Windows Store compatible is no small feat. Other possible points of conflict with the Windows Store Policies are the user interface and the way users are pretty much expected to tinker with stuff inside the installation and/or user directory. (I'm actually surprised that the latter hasn't been much of an issue on Macs.)

jamespetts

Does any of this represent a problem for developing Simutrans on VS 2015 as a Win32 application?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

Not that I'm aware of, yet. Except that it might be difficult to keep C++ and C++ apart. However, I couldn't see any pressing reason to upgrade either. Most of the effort seems to be target towards mobile development, with VS2015 even boasting that it can develop iOS and Android apps as well. (Surprising amount of 3rd part stuff bundled or supported.)

Edit: Just noticed that the debugger has gotten some graphs since 2010.

Combuijs

Quote from: Ters on August 11, 2015, 01:10:22 PM
Except that it might be difficult to keep C++ and C++ apart.

It is indeed hard to see the difference  ;D ...
Bob Marley: No woman, no cry

Programmer: No user, no bugs