• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How to set up a screen layout used in old RPG games

w0rm

Member
Hi,

What would be the best way to achieve a screen layout of the old RPGs like Ultima 5 shown below? More specifically how to set up a screen with 1) view to room which shows part of the room containing the game map which can be scrolled and 2) other GUI elements? What I tried was to just set up a view normally following the player object and then overlaying an image with trasparent area on other layer which draws the other elements on top of everything. However, this makes it difficult to scroll the map view correctly with the player as the view thinks it's actually larger than it is.

Ultima V - Warriors of Destiny_2.png
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Personally, I'd just do what you say... have a single view and then draw everything over it with the GUI using a little maths to offset it correctly. However there are multiple alternatives... One method would be to use TWO cameras and view ports. So, camera 2 would have a view port the size of the screen/window, and would be used to render the GUI stuff. Camera 1 would have a square viewport positioned within the port of camera 2. This would then require that you wrap draw command in a check of the view_current variable so you're only drawing things when the correct view is active, but it should work. Another alternative is to simply disable automatically drawing the application surface and then in the Draw GUI event, use draw_surface_part() to draw the part of the application surface that you require along with the rest og the GUI elements. This is REALLY easy to do, and probably how I'd do it, as it allows you to keep the game camera and stuff following the player just the same as always. The down side to this approach is that it would mean that if you expect any mouse input from the world map area, then you'll have to offset all the input checks to they are relative to where things are now being drawn, but that's just a simple case of arithmetic.
 

w0rm

Member
Thx! Okay, so my initial thinking wasn't complete stupid then :) The good thing with this option is of course that it makes it a bit easier to work with screen/world coordinates.

Another option I was tinkering today is to make the tilemap invisible and then drawing drawing it manually and positining and limiting the area drawn as needed. But this leads to the issue with screen/world coordinates.
 

TheouAegis

Member
You can make the application surface the size of your view and the window the size if the GUI. No need to use draw_surface_part() and no reason to calculate mouse coordinates outside of mouse_x and mouse_y at best, mouse_x-camera_get_view_x() and mouse_y-camera_get_view_y() at worst.

Another method is to just draw the UI onto the application_surface in the Draw End event and mess with the camera settings so the player is always centered in the left side of the view.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
You can make the application surface the size of your view and the window the size if the GUI. No need to use draw_surface_part() and no reason to calculate mouse coordinates outside of mouse_x and mouse_y at best, mouse_x-camera_get_view_x() and mouse_y-camera_get_view_y() at worst.
That's a really interesting approach that had never occurred to me... However I'm not sure how you'd make that work? I'm assuming you would then draw the app surface manually? By default it will be stretched to occupy the window size, so I'm not sure how using this would negate having to offset input positions or make things easier?
 
Top