• 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.
Sign in to follow this  
Followers 0
Ansou

Display mode advice needed

8 posts in this topic

I am currently working on a 2D top-view game in Java and need som advices regarding display modes.
What is the best and most proffesional way to handle them? Should I use a fixed display mode like 800x600 or should I have a drop down menu to choose between all avaible DMs? And also (if the second option), what should happen when the mode is changed? I tried to make the images fit to a 1920x1080 screen and put them in a buffered image which I resized to the current display mode, but everything looked so compressed when I ran it on my 1440x900 screen... [img]http://public.gamedev.net//public/style_emoticons/default/ohmy.png[/img]
0

Share this post


Link to post
Share on other sites
Obviously you should query the display driver to know all the resolutions it supports, and gracefully scale your game to the proper dimensions and aspect ratio. Nothing infuriates me more than finding a game that stops at 1280x720 for some reason because the developers couldn't be bothered asking the display driver what the possible resolutions were and just hardcoded some in.

And when the mode is changed you need to make sure your graphics code is flexible when it comes to resolution changes, so you can just change two variables (width and height) and update your graphics states. Normally game logic should not change, since you're normalizing coordinates, right? (between (-1, -1) and (+1, +1) regardless of the resolution).

EDIT: unless you're writing a really retro type game which would benefit from a low resolution (for the "retro" pixelated feel) - but then again running 800x600 on a 1920x1080 monitor is an eyesore.
0

Share this post


Link to post
Share on other sites
I start at the current resolution. As I have no AAA game to run, I typically have plenty of hardware power to fill a screen.
0

Share this post


Link to post
Share on other sites
[quote name='Bacterius' timestamp='1332451939' post='4924439']
And when the mode is changed you need to make sure your graphics code is flexible when it comes to resolution changes, so you can just change two variables (width and height) and update your graphics states. Normally game logic should not change, since you're normalizing coordinates, right? (between (-1, -1) and (+1, +1) regardless of the resolution).
[/quote]
Any idea on how to do this? Cuz as I said, I tried to do this by drawing everything to a buffered image which I then resized, but I get problems with mouse inputs then...
0

Share this post


Link to post
Share on other sites
[quote]Any idea on how to do this? Cuz as I said, I tried to do this by drawing everything to a buffered image which I then resized, but I get problems with mouse inputs then...[/quote]
Na you pretty much recreate all of your graphics state related to output size (i.e. backbuffer, depth buffer, etc...) to accomodate the new resolution. If you're doing a 2D game you should normally get away with simply resizing your output image to the correct resolution - assuming you've coded the rest of your program to be resolution-agnostic (i.e. working in normalized coordinates) it will work flawlessly.
0

Share this post


Link to post
Share on other sites
First have a default mode saved in a file. You still need to query the graphics device to make sure that the mode is available. Then allow the option for the player to change the mode in an options menu. When you queried the graphics device you can save all of the available modes and allow the player to select one. Then save that in your settings file and use it for next time.
0

Share this post


Link to post
Share on other sites
[quote name='Bacterius' timestamp='1333755596' post='4928933']
assuming you've coded the rest of your program to be resolution-agnostic (i.e. working in normalized coordinates) it will work flawlessly.
[/quote]
But how do I do that? :o
0

Share this post


Link to post
Share on other sites
[quote]But how do I do that?[/quote]
You just divide all the coordinates you use by the current resolution's dimensions. This will give you coordinates between 0 and 1. Then you can multiply by two and subtract one if you want a range between -1 and 1 (more convenient). By doing this you basically abstract resolution from your game. Then you simply store resolution in one place and use it to convert back from your normalized coordinates back to actual screen pixels, which should only happen at the very end of your rendering pipeline (i.e. display to the screen). In fact 3D API's such as DirectX or OpenGL do it automatically for you (but you still gotta give them the resolution you want at the start, of course).

The idea is that instead of dealing with screen pixel coordinates everywhere and having to change them all the time to accomodate different resolutions, you just provide normalized coordinates instead which will naturally scale with the resolution of the screen you're working with. The actual conversions are done "behind the scenes" automatically which simplifies stuff a lot.

For instance if you need to draw a square between (200, 200) and (400, 400) on a 800x600 resolution, then you just use the coordinates:

(200 / 800, 200 / 600) to (400 / 800, 400 / 600) => (0.25, 0.3333) to (0.5, 0.6666)

Now assume you run your modified game on a 1600x1200 screen. You don't need to update the coordinates at all! Indeed, they can be derived from the normalized coordinates:

(0.25 * 1600, 0.3333 * 1200) to (0.5 * 1600, 0.6666 * 1200) => (400, 400) to (800, 800)

(this example assumes coordinates between 0 and 1, in general it's often more useful to have them between -1 and 1 but the concept is the same).

This works regardless of the screen's resolution (obviously you'll get stretching if you use a different aspect ratio, but you can account for this by correcting your coordinates for aspect ratio, i.e. basically multiplying the X coordinate by Width/Height, which will cause you to see more of the screen on the sides).
1

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0