Help with a roguelike menu creation

Hello, I trying to make a game where there is 20 different upgrades. I wanted to make a menu where every time you level up 3 random upgrades of these 20 show on screen. If you select one of the 3, you can no longer choose it again, so now you have 19 total upgrades. Also, when you choose, the menu disappears. How do I implement something like this? Do I make 20 widgets? How do I choose 3 random from the 20 total? How do I make sure they don’t appear above the other and there is no repetition?

Games that implement this: vampire survivors, rogue tower, brotato.

You make 1 widget. You show 3 instances of that widget, each with different data.

How do I choose 3 random from the 20 total?

  • keep abilities in an array
  • shuffle, grab the first three
  • make widgets, show the abilities
  • remove the chosen one from the pool once it has been selected

Pseudoscript:


Games that implement this: vampire survivors, rogue tower, brotato.

Disclaimer: going by the description, no clue how those games work, only heard about the 1st one. Brotato sounds catchy, though!

I not understanding how I can make one widget show different information. Is too dumb to make one widget to each skill ? This way I put then inside a array and choose 3 random ones and show then inside a container. Here’s my widget.

i wouldn’t call it dumb. Just very inefficient, impossible to maintain, prone to errors; a little debugging nightmare going against established design paradigms. A rookie mistake.

Imagine you want to change the colour of the text. If you follow your method, you’d need to do it 20 times…


How about this in the widget:

When you create a new widget, you can provide text:

image

This way a widget can display any text and you only have 1 widget to deal with. In my example, I am doing it with the entire ability.

What about the ‘select’ button? Below the description there is a clickable button that if the player press it, it does what the description says. I can change the text of the description but how do I change the button to match the text?

If you have 2 text block, expose 2 variables:


Do note it might be easier to pass the entire Ability to the widget, the widget can take it apart, extract what is needed and show it. Not sure how you are managing the abilities in the first place…

An ability system like this could be done with Actor Components, or even GAS:

But the latter is somewhat advanced, you may want to stay from it for a while.

The abilities supposed to work like this: description “increase shotgun damage”. Below the text there is a button, if pressed it, it take the a Boolean variable called ‘upgrade 1’ and sets to true. If I change the description to “increase pistol damage” the button below it should make the boolean variable ‘upgrade 2’ true. My question is how I’m gonna change the buttons (not the text) to match each description. Not sure if the question is clear now.

It was clear from the beginning, no worries. If you have a look at the original pic I posted, you’ll notice an Event Dispatcher sending data back to the actor (it could be your pawn). This is how you can identify which button was clicked.

But again, having 20 boolean flags is not the way to go about this.

If you are looking for a truly basic yet flexible approach, have an enumerator in the widget and send that back.


Now that we’re talking about it, I actually helped someone made a prototype for something similar:

The abilities fire automatically on their own afair, they can be upgraded if you select the same one more than once. Actor Components worked really well here.

1 Like

Yes, it supposed to look like the video, except without the lvl up on a existing skill. (once the skill is chosen it’s gone). Is there a video tutorial on this? I can pay you with a Steam game.

Hold on, @Th3Moron Did you ever manage to push it any further?


Is there a video tutorial on this?

Not sure, did you search? May sound harsh… but if you need a tutorial to make a game, you’re not ready to make a game. If I were you, I’d focus on understanding how the small pieces work instead, and eventually you can glue them together into something bigger, cohesive.

Otherwise, be prepared for A LOT of frustration and wasting time. Buy hey, we’re all different, right.

1 Like

I’ve found a tutorial on making a roguelike deckbuilder that implements this, but not sure if it’s covered well and it’s costs 50 dollars, and since I live in a third world country it quite expensive, so not sure it’s worthy just for the menu. Actually this menu supposed to be a small part of the game, not the whole thing.

I cannot provide a full tutorial for several game systems - that’d be quite the commitment. So far I feel I’ve answered the questions you had, though. If you have more, or struggle with implementing the suggestions, do keep them coming.

I’ve looked into the question @Th3Moron made, and it’s exactly what I’m talking about, however I’m not understanding how to implement… :frowning: maybe he can shad some light.

I mean, I had an entire private thread with him where we discussed it and I made him a template. It was pretty basic (as seen in the vid). I still have it in its original early state, I was hoping he developed it further so he could fix you up with something more complete. Not sure if he’s around.


I could send the template to you, it’s documented. However, if you’re unable to implemented the basic snippet I posted above, you will absolutely hate the stuff in there as it’s way more advanced. Nothing will make sense.

It’s a bunch of dynamic inherited components and list view widgets. And they work very differently. Everything is wrapped in functions and encapsulated reusable objects.


Please do reconsider my suggestion and try to get the basics right, first. You have pseudoscript up there that, if hooked up, actually work. You’d, of course, need more stuff.

In the original picture, the ‘Abilities’ is a widget array?

In the ‘Create W ability Widget’ it has a ‘ability’ in it, how do I make that?

I’ve made a widget called ‘skillsWidget’ it has a text variable of a description that is set to ‘instance editable’ and ‘expose on spawn’. Also has a button, that once pressed it does what is described. Also made a panel widget and added a horizontal box to it.

Please send me the template to me.

No. I assumed you already have Abilities working; this array would be the pool of abilities. Either objects with data, actors, actors components. There are many ways to do it. I would not make the abilities widgets.

In the ‘Create W ability Widget’ it has a ‘ability’ in it, how do I make that?

By exposing variables in the widget as show in the screenshots that pipe in text.

Please send me the template to me.

Sent.

What I had in mind is the abilities are just booleans that I set to true if unlocked. For example, one ability would be ‘increase pistol damage’. If this is selected, then I set the global variable ‘pistolDmgUp’ to true. In this case should I make an array of booleans? Or this won’t work?

This template seems very difficult for me, I think I should stick with the simplest thing possible.

1 Like

As mentioned above, avoid using booleans for this. I feel you’ll immediately hate it. :innocent: Look into how enumeration works. When the player receives a callback (look into dispatchers) from the chosen ability widget, they can do something along the lines of:

image

And you can then add damage to the gun, or increase grenade limit.


If you MUST use booleans, sure it can be done. Declare one in the widget - but then you need to develop an ID system to know which button is sending which boolean. And if you cannot / don’t want to have an ID system, you must make 20 widgets, and we’ve made a full circle.

I saw a video tutorial and made a enumerator with ‘upgradeRifleDmg’ ‘upgradeShotgunDmg’ and ‘upgradeGrenadeDmg’. What’s the next step?

1 Like

Add a variable of that enumerator type to the widget and expose it. Add a dispatcher to the widget.

  • so when you create widgets, you can:

image

  • when button inside the widget is clicked:

  • and when the player receives the delegated click they will know what needs to be done: