• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
  • entries
    316
  • comments
    485
  • views
    321013

Hieroglyph 3 and Metro Apps

Sign in to follow this  
Followers 0
Jason Z

2016 views

Getting Started



My overall goal as mentioned in my last entry is to get Hieroglyph 3 operational in a Metro style app. In an ideal world, I would want to have the complete library running in both "Desktop" mode (i.e. Win32 applications) and also in "Metro" mode (i.e. WinRT applications). However, after my initial analysis, pulling this off will probably require changing the library to such an extent that it wouldn't be able to run on Windows 7 where the WinRT library functions aren't available. So at the moment, all of the changes that I make and describe in this mini-series of posts are done on a local copy of the Hieroglyph unless indicated otherwise. This may be the beginning of Hieroglyph 4, but if possible I would like to keep the main library in a single repository... We'll see how that goes sometime down the road.

The setup I am using for development is my netbook, which is a single core AMD Athlon II Neo @1.7GHz and with a AMD Radeon HD 4225. Since I'm targetting Metro style apps, I naturally am running on the Windows 8 Consumer Preview and using the Visual Studio 11 Beta, both of which you can get here.

Identifying What Needs To Be Done



Microsoft is doing a good job of making tutorials and samples available for the general public to get started on Metro development. However, the proof is in the pudding - the first step in converting Hieroglyph over to Metro capable is to get it to compile under VS11. On the first try, I just cloned the latest Hieroglyph 3 repository and loaded it up in VS11 and tried to compile. The first thing to notice is the six billion errors because of missing dependencies. Since Direct3D and all his friends are now part of the core Windows development setup, there is no DirectX SDK anymore.

In Visual Studio 2010, the specific directories that a project needs to include are inserted via a per-project property setting - typically using a system variable to identify where the DirectX SDK include files are. VS11 also has the same property setup, so I just changed the existing include references to point to the new location. On my machine, this was located in the {...} directory. After updating these, I tried compiling again, and had more of the files trying to compile - but still lots and lots of errors.

To determine everything that needs to be updated, I simply disabled and/or commented out the portions of the library that weren't compiling due to things that aren't available to Metro style apps. After about an hour of going through this process, I compiled the library successfully and produced quite a list of things that need to be updated. They can roughly be categorized into a few main topics, as described below:

  1. Shader Compilation / Reflection

  2. Texture Loading

  3. Matrix Functions

  4. Text Rendering

  5. Application Model

  6. Enumeration Updates


Each of these topics is going to take some time to get past, and I'll be writing about them as I go. However, I wanted to give a quick indication of what is behind each of these issues.

Shader Compilation / Reflection


For Metro style apps, you are not allowed to compile your shaders at runtime. This does indeed make sense, since the compilation of some shaders takes quite a bit of time, which can cause unnecessary delays to starting up your program and consuming power (which can become important in tablets / mobile devices). However, for the developer this kind of stinks - it more or less means that you have to pre-process your shaders, and if you are actively changing them to get them working, this may cause some problems. Even so, there are work arounds possible, which we will talk about in a dedicated post.

Texture Loading
In general, the super library D3DX has gone the way of the Dodo - it isn't available anymore for Metro apps. This has lots of implications, including the loss of its texture loading functions. Once again, all is not lost - there are other libraries available to do this, and we will talk about it in a future post. Specifically there is DirectXTex if you want to read ahead...

Matrix Functions
Also due to the removal of D3DX, many matrix functions that I used to use are not available anymore. Once again, there is a replacement library that can be used called DirectXMath.

Text Rendering


Hieroglyph 3 uses GDI+ for its glyph generation and text rendering solution. This library is apparently not available anymore for Metro apps, so I will finally have to bite the bullet and upgrade to Direct2D and DirectWrite... That will certainly be a topic for another day...

Application Model


Perhaps the most obvious area to update is the fact that Win32 isn't generally available to Metro apps. This includes the file IO, threading, and a few other areas which are inevitable to update when migrating to Metro compatibility.

Enumeration Updates


This final point appears to be the removal of some old enum values that were dual defined with both D3D10_XXX and generic D3D_XXX names. I checked the headers in the DXSDK, and the D3D_XXX versions were there already and I was just using the old names. This is probably due to the fact that I started on Hieroglyph 3 with the pre-release version of D3D11 and just never updated. So these corrections I will make in the main line of Hieroglyph 3 as well as my Metro port.


Wrapping Up



So with the library compiling, now it is time to fix and replace the items that I had to disable. It will be a long road to get something rendered into a window, but I am already having fun learning about all the new goodies that are available in Metro style apps. Once these areas have been addressed, we will also start exploring these new capabilities too. I hope you enjoy the ride as much as I am smile.png

0
Sign in to follow this  
Followers 0


4 Comments


Hi Jason

I just want to check, for those of us that have little or no interest in Metro style apps, are you still going to continue developing and enhancing the Win32 version of Hieroglyph, or will you be parking that and focusing purely on the Metro version in future?

Thanks
Ben
0

Share this comment


Link to comment
Hi Ben,

Actually it is quite the contrary - my research into the Metro side of things is actually driving me to improve the standard Win32 version. In fact, my statement above about creating Glyph4 was a little premature. After checking more into how the new APIs are structured, I think Metro is going to be more like just a different windowing framework for the engine.

In this form, the core D3D11 engine will remain one code base, and the Metro app code will be at the application level - much like the Win32 and MFC versions are already in the current engine.

Have no fear - Hieroglyph3 will most certainly continue to be developed and extended for Win32. Actually, that is what the desktop app (on Win8) setup will use anyways - so there is a clear need to support a variety of runtimes... I think this will help drive a cleaner design that allows for easier interchangability in the app side components.

Thanks for the question though - and I'm happy to hear that you are watching what is happening with Hieroglyph 3!
0

Share this comment


Link to comment
Nice work Jason, and an interesting read.

Glad to hear you can consider Metro just another windowing framework wrt engine design.

Hopefully we won't have too long to wait for D3D11 tablets - I'm itching to touch my shaders!
0

Share this comment


Link to comment
Right on about the tablets - I've been waiting since the //BUILD event to get my hands on a Win8 tablet. Hopefully the OEMs can come up with some worthy competitors to the iPad...

The Metro stuff is certainly different than Win32, but I think its possible to massage things enough to keep them mostly common. We'll see over time how right I am :)
0

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now