track more variables for game panel in BD engine (e.g. for custom artwork)

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Flumminator, Zomis

Post Reply
ncrecc
Posts: 285
Joined: Thu Jul 12, 2018 12:59 am

track more variables for game panel in BD engine (e.g. for custom artwork)

Post by ncrecc »

just recently i wanted to make a custom panel for RnD-style BD levels that shows, among other things, how many lives the player currently has. then i realized the only way to show the player's lives is to show the level name (which has the lives appended onto it if playing with multiple lives). so at first this was just going to be a suggestion to let custom artwork show how many lives the player has, but then i figured i might as well mention the rest of the variables in GDash's status bar, as well as other variables that aren't in GDash's status bar but which custom artwork creators might want to show on the panel.

----

gdash has a second panel accessible if you hold left-shift (by default). it would be nice if the variables it tracks had corresponding fields in game.panel, even if the second panel itself isn't going to be implemented yet.
gdash_status_bar.png
gdash_status_bar.png (696 Bytes) Viewed 7012 times
it includes the following variables, from left to right (with relevant variables in the game's code included):
  • how many lives are remaining [game_bd.global_lives]
  • how many of BD key 1 is held [cave->key1]
  • how many of BD key 2 is held [cave->key2]
  • how many of BD key 3 is held [cave->key3]
  • the queued direction of gravity (the direction of the arrow; in gdash's status bar this just shows the current gravity if no gravity is queued) [cave->gravity_next_direction]
  • seconds until queued gravity change is applied (0 if currently active) [cave->gravity_will_change, though this variable is in milliseconds]
  • how many skeletons are held [cave->skeletons_collected]
in addition, it might be nice if the following variables were also available, for completeness (mostly analogous to what extra game_panel variables are available for RnD elements; sticking to things caused by elements being used/collected, and not internal variables or variables describing an unchanging state of the level):
  • the current direction of gravity [cave->gravity]
  • whether gravity is currently disabled [cave->gravity_disabled]
  • whether a sweet has been eaten [cave->sweet_eaten]
  • whether a pneumatic hammer is held [cave->got_pneumatic_hammer]
  • how many extra rockets are held [cave->rockets_collected]
  • whether infinite rockets are held [cave->infinite_rockets]
  • whether the diamond key has been collected (all trapped diamonds in the level, even newly created ones, will be converted to diamonds whenever possible) [cave->diamond_key_collected]
  • magic wall state (dormant, active, expired) [cave->magic_wall_state]
  • magic wall time remaining [cave->magic_wall_time]
  • whether creature direction switch is active [cave->creatures_backwards]
  • whether expanding wall switch is active [cave->expanding_wall_changed]
  • current biter delay (set by biter switch) [cave->biter_delay_frame]
  • whether replicators are active [cave->replicators_active]
  • whether conveyor belts are active [cave->conveyor_belts_active]
  • whether conveyor belt direction switch is active [cave->conveyor_belts_direction_changed]
User avatar
Holger
Site Admin
Posts: 4262
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: track more variables for game panel in BD engine (e.g. for custom artwork)

Post by Holger »

Absolutely right, this is still missing (and, to be honest, I simply forgot about it). :)

I think it makes a lot of sense to not only add the missing BD style engine values to be accessible in custom game panels, but to also add the second game panel for the BD engine. R'n'D is already prepared for this (well, sort of), as the EMC engine also already uses a normal and extended game panel. I could extend this for the BD engine so that the extended game panel would not simply be shown or hidden depending on the corresponding setup option, but to also dynamically show it while a configurable key is held down (just like in GDash). To make this work best, I could add screen offsets (configurable in the graphicsinfo.conf) for the game panel so that it is possible to show both game panels (normal/extended) side by side, or to replace the normal game panel with the extended game panel (like in GDash). Both solutions could be useful in different contexts (like BD engine and EMC engine, with players used to different game panel behavior)...
ncrecc
Posts: 285
Joined: Thu Jul 12, 2018 12:59 am

Re: track more variables for game panel in BD engine (e.g. for custom artwork)

Post by ncrecc »

do you plan to add support for a swappable second game panel to the RnD engine too? it would be nice for my tutorial (ncrtorial), where all the info you need that isn't in the default RnD panel (e.g. white keys, EMC keys) could be put on a second panel instead of being crammed into the only panel available
User avatar
Holger
Site Admin
Posts: 4262
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: track more variables for game panel in BD engine (e.g. for custom artwork)

Post by Holger »

That's what I thought of, yes.

In fact, it's already there, although a bit hidden in the game engine settings (under "Setup -> Game Engines -> Emerald Mine -> Show Dynamite and Keys"), and can be used by setting the ".class" attribute of a game panel item to "extra_panel_items" (and it is not exclusive to the EM engine).

However, the default setting for this setup value is "on", so it is enabled by default, while it should be disabled by default for the BD engine; that is, only show the standard game panel by default, and enable additional game panel items in the engine settings, or enable them on-the-fly during the game by pressing a certain key, like it is done in GDash when pressing the left "Shift" key.

By adding a few additional GIC (graphicsinfo.conf) attributes, like ".2nd_x/yoffset" (to be applied to the standard game panel items as soon as the second game panel is shown, and which is probably a bit confusing attribute name and should be named differently) and ".key_x/yoffset" (to be applied to the standard game panel items as soon as the "second game panel key" is pressed), interesting things could be achieved. For example (with the BD game panel in mind), the default panel could be one line, centered vertically (as it is now), the Y offset when pressing the configured key could either move it a bit up to make room for the second panel, or even completely remove it, to toggle between both sub-panels.

With regard to your example (show different panel items for different levels), this setup setting could even be made into a level configuration option, to show one selected panel of two panels during the levels of the same level set.

As usual, I will think about a generic and flexible solution (which fits enough purposes without being too complicated or over-engineered ... okay, many of R'n'D's configuration options are good examples for over-engineering, I'm afraid... ;-) )
User avatar
TheOnyxGuy
Posts: 637
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

track variables panel engine (custom)

Post by TheOnyxGuy »

Yeah, I basically had the same suggestion years ago for MM engine as well, because aside from Health, MM doesn't really have any more unique variables for it's UI. That being at least MM keys. I'm sorry for barging in with MM engine blabbering again, but MM keys still didn't get any kind of their own UI element, whether it's value or just an icon of it being available. I feel like that's at least one thing that could make a level be more convenient to play if you knew how many keys collected aside from just remembering that you did collect them originally. And you know, what? Another one, although less important and just more miscellaneous (like half of indicators R'n'D engine has available for lots of elements) - shooter state (active, inactive due to fuse, overloading and dead), which could also sort of add to the discussion about laser beam's warning indication.
Previously known as Eizzoux (boooo)
User avatar
Holger
Site Admin
Posts: 4262
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: track more variables for game panel in BD engine (e.g. for custom artwork)

Post by Holger »

Good point! In fact, I just forgot about panel values (and icons) for the MM engine as I did for the BD engine, while having lots of values available for the R'n'D engine. I had the impression that all these values are probably never used (besides in all those great R'n'D jue level sets, which are mostly custom element values, I think). But at least for the alternative game panel for the BD engine (when trying to imitate the one from GDash), a number of values from the BD engine are required, so why not just add everything else for the BD and MM engine, too. :)
User avatar
Holger
Site Admin
Posts: 4262
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: track more variables for game panel in BD engine (e.g. for custom artwork)

Post by Holger »

OK, support for the second BD game panel added, plus support for displaying all internal BD engine values as requested. :)

I think it's solved in a very flexible way now. There's no "second game panel", but a way to show "extra game panel items" (just as before, to add some values that might be interesting to know, but which were not displayed by the original game back then). To make things really flexible, there are additional x/y offset values that can be applied (a) to the standard panel items when the extra panel items are displayed, and (b) to the standard and extra panel items when a certain "toggle key" is pressed. This allows for the following nice (at least I think so) solution for the BD engine:

- old setup option (but moved away from "Emerald Mine" to the top): "Show Extra Panel Items: <on/off>"
- new setup option to define a key to toggle the extra panel items: "Toggle Extra Panel Items: <left shift>"

The result is as follows (using a modified, specially crafted graphics set for the BD game panel):

- by default, only the normal BD game panel is displayed, as usual
- when pressing "left shift" (or any configured key), the normal panel is replaced by the second panel
- when enabled in setup, both the normal (at the top) and second (at the bottom) game panel is displayed
- (in the last case, pressing the "toggle panel key" does nothing, as both panels are already displayed)

Hope that will do the job! :)

(And yes, I still have to add the MM engine values (mainly keys) as configurable game panel values. But that should be easy! :) )
User avatar
Holger
Site Admin
Posts: 4262
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: track more variables for game panel in BD engine (e.g. for custom artwork)

Post by Holger »

This feature is now available in version 4.4.0.4, together with the updated GDash level collection. :)
Post Reply