31

There's no "best" way. The game design in your case is intimately connected with the UI design. However, given your setup, I'll lay out (haha get it) some advice. You're right about the lower-level spells being on the most convenient keys can be a problem. I would recommend something along the lines of Diablo 2 and 3 where you assign spells to keys in an ...


23

Almo's advise to allow the player to assign spells to hotkeys according to their own preference is good. You can increase the number of spell slots if you allow modifier keys like Ctrl and Shift to access additional hotkey bars (but keep in mind that when the player has one hand on the keyboard in the typical WASD position and the other hand on the mouse, ...


12

Immediate mode in OpenGL consists of glBegin/glEnd calls, with one or more glVertex calls (the minimum legal number depending on the mode param of your glBegin call), and optionally other vertex attribute specification calls (glColor, glTexCoord, etc), between them. glBegin instructs the GL driver that you're starting to draw a point, line or polygon. ...


12

Here's a strategy for making arbitrarily bent UI: we'll render our UI into a texture (in realtime, not as a baking step), and then map that texture onto whatever mesh we want. Here's how I made this spherical example: Create a RenderTexture to store the UI. This needs to be quite high-res to get text looking crisp. I used 4096x2048 because I intend to map ...


12

Alright my dude. Welcome to the hell that is layout groups. Here's a few things you'll need to know first: If nothing is sizing the object, the layout group will not work as you expect (in fact it appears the opposite). Things that size the object include LayoutElement and ContentSizeFitter. For whatever reason the default rect transform sizings make the ...


9

In addition to the old classic, coming from fighter games - key combos. The better the spell, the longer the combo. This has the added benefit of feeling like casting, and a high level spell actually requires a bit more mental power. If the mouse is an option then Legend of Grimrock has a nice idea - a 4x4 or 5x5 square board (can't remember). The combos ...


8

Let's call the content you want to scroll content and the viewable area of that content viewPort. Your scrollbars will be at the sides of the viewport. The first step is to create a mask such that only parts within content which intersect with viewPort are visible. I can't answer exactly how to do this because it depends on your language and technologies. ...


7

There are many reasons a designer/programmer would want to draw the crosshair on the exact center of screen, or a little lower. A hybrid system may even be implemented, taking advantage of the properties of these two systems in a game fich of different weapons, vehicles, interactive spots, and so on. Drawing the crosshair centered or lowered can depend on ...


6

Take a look at Awesomium. I have integrated it to SDL before and the process was fast. The biggest thing you have to deal with is translating SDL events to Awesomium. Otherwise the rendering is really easy, you can just query pixel data from Awesomium into an SDL surface IIRC, and then render that to your game.


6

Hiding the player-character's (PCs) health actually got quite common in the FPS genre. Instead of showing a health number on the bottom of the screen, they represent the health state of the PC with a meta-interface. When the player is hurt, the screen gets a red tint or gets splattered with blood. This represent the pain the PC is experiencing. The idea ...


5

First you need to render you scene to a Frame Buffer Object (here is a good course on FBO: https://learnopengl.com/#!Advanced-OpenGL/Framebuffers) After that you will end up with a Texture (of type GLuint) containing your rendered scene. To print it into Dear imGUI, just call a Draw Image Command. EDIT New (simpler) Example: ImGui::Begin("GameWindow&...


5

I've been trying to figure out in what ways this can be a performance problem. I have been unable to replicate the problem. Yet, let us see what I can do. First a couple notes on what happens internally: Godot timer will internally use the equivalent of _process or _physics_process depending on process_mode and will update time_left using delta. Which ...


4

I don't know the exact approach used in games like Diablo, but this problem is actually interesting enough to be given its own name (Automatic Label Placement), for which the general problem is NP-Hard. This means that there's copious amounts of material online, like this paper for example. It's a problem that occurs a lot in map labelling, so you may find ...


4

Humans are usually far better at spotting something of a different color than something of a different shape. Here is an example of an image with some blue pentagons: Among them is a red pentagon and a blue square. Which one do you spot first? In most RTS games it is usually far more important to be able to tell what faction something belongs to than what ...


4

Make two batches, one for the buttons (texture) and one for the labels (bitmap font). That is also why you normally batch draw-calls. Group the things using the same resources to reduce draw calls and expensive unbinding/binding of textures and shader-programs.


4

Here is a quick proof of concept of how I would do this: Wrap each text bubble in another object which has the width of the whole chat box. The ChatBox has a Vertical Layout Group with "Force Child Expand" on. This causes the "Wrapper" child objects to always have the width of the full chat box. The "Wrapper" child objects is solely responsible for ...


3

A scroll bar is like a 2D camera control that controls the scroll area's viewport's contents. I will assume you know how to render your gui in its entirety. I also strongly advice against making a gui that is complex unless it truly contributes to ux. This could lead to a mediocre gaming experience. I also strongly urge you to use a UI library. In abstract ...


3

Based on your description, you might have better luck using a Text Mesh, which will be treated more in line with the other Components that the rest of Unity uses (rather than delving into the Canvas system). You could create GameObjects with Text Mesh components, and make them children of the enemies, with the y-component of the transform offest so they'd ...


3

When you resize your game resolution you need to update every single rectangle in your game (every button, etc) and multiply it by a proper scale, so that the "hitboxes" would work, which would be a lot of work. So, a smarter way of achieving the same result is simply by multiplying your mouse position by a Vector2 scale = new Vector2(originalWidth / width, ...


3

I have implemented Android-like toast for my project and decided to share it with you! Enjoy: Toast LibGDX (GitHub). Easy to use: Include Toast in your LibGDX project Create ToastFactory for your toasts (using Builder): Toast.ToastFactory toastFactory = new Toast.ToastFactory.Builder() .font(font) .build(); Create toast: Toast toast = ...


3

Use colours for team identification and shapes and sizes for individual unit type differentiation. This means enemies and friendlies are instantly distinguishable, and unit types look distinct whilst having a degree of consistency from team to team. e.g red triangle is an angry enemy beserker, blue square is a happy allied collector.


3

I've dealt with this before, and the simplest solution (which is also kind of a hack, so beware) was to scale the text transforms by the inverse of the maximum zoom, and multiply their font size by the maximum zoom. This will cause Unity to render a higher-resolution font texture that will look better when zoomed in. Example: Your maximum zoom amount is 3x. ...


3

ScrollView by default has an Image component with a RaycastTarget enabled like on the image below. In order to detect touch and clicks, UI elements need to have at least one component with RaycastTarget enabled. Your ScrollView doesn't have the default Image background so it doesn't respond to clicks. Add Image component to your ScrollView so it looks ...


3

This answer might not be the one you want but I would suggest that you reduce the number of available spells to a number which can be bound to a your available hotkeys. Whats the point in having 100 spells which aren't any different from another? If you have a fireball which costs 5 mana (or whatever ressource you use) and deals 10 damage or a magic ...


3

I've played a fair share of multi spell games where you have to be selective out of the roughly hundred spells to your availability. For keyboard only control, I would have LOVED a sort of windows tab system where I can quickly scroll through my preset combos, defence, repair, press alt tab, click on window or alt tab through it. In games like diablo and ...


3

The default solution (most used, most widespread, most known to players) is a spell slot system. You have a series of visible slots on the UI (between 2 and 10), which are assigned to default keys. In a game dialog the user can select which abilities are assigned to which slot. That game dialog always looks more integrated into the game than the Settings ...


Only top voted, non community-wiki answers of a minimum length are eligible