Customizable User Interfaces
Third post this week, let’s go!
In most games, units (and buildings) have a user interface to present the control options you have for that entity, for example in Age of Empires you have the following UI for units.
You have options for how the units move, how the units behave when presented with an enemy and a patrol system. For building you have the units you can create or the upgrades you can purchase.
With Kikai it’s vital we allow the player to create customized interfaces similar to the ones above for the units they customize but we don’t know in advance what they are gonna want. I want simple interfaces to be simple with the ability to create complex debugging and interactive interfaces when needed.
My current idea is to offer two different devices to output this information. Names are of course not definitive but let’s call these two devices EzGui 3000
and ASPD mkII
(or Advanced Screen and Presentation Device Mark II).
EzGui 3000
This device is perfect for most units, low CPU consumption, quick and simple drawing with some basic primitives. This device would offer a immediate-mode-like GUI experience. A simple coding mockup could look something like this
@on-interface-draw
.Params/stance ;stance-button-str BUTTON ?{ ( code to switch stances ) }
.Params/patrol ;patrol-button-str BUTTON ?{ ( code to setup patrol ) }
BRK
Which basically creates two buttons that control the stance and patrol params and when clicked run what is inside of the ?{}
anonymous block.
Another option is to replace the blocks with vectors as well, for current purposes this doesn’t matter too much.
This would render something like this:
This device would offer some simple, ready-made UI elements that you can mix and match and in a few lines of code have a fully functional UI to control your internal parameters. This UI is limited when offering debug output to outputing a few strings maybe, some checkboxes and buttons and that’s it, but for most needs this should be enough.
For more advanced and customized UIs you could use the
ASDP mkII
This would behave a lot more like a framebuffer, the device would take a color, x, y arguments and paint a framebuffer pixel by pixel. This enables basically infinite possibilities, you could create menus, submenus, even a 2048 clone inside the system to kill the time if you get bored. It woulda allow you to display arbitrary information and systems. This is basically equivalent to the Screen device of the Varvara computer system that runs Uxntal.
Some ideas could be:
- Create a standard OS for all your units with a live repl, memory debugging and a live visualization of what the unit sees.
- Display radio data (thanks Aslogd!) in order for the player to attempt to decypher the radio stream of the enemy.
- Have a coordinating unit display a live map of all swarm units in their vicinity. (Maybe by having two antenas and triangulating the time it takes to arrive?
- Have buildings display menus to assemble custom units on the fly.
Limitations and Concerns
My idea is that UI code does not consume the CPU budget of the unit (only a single unit can be represented at a single time in the end). It would still consume RAM though and we’d need to limit the execution time so we don’t get infinite loops. This however makes computing in the UI code a very interesting strategy, so maybe this needs to be limited somehow.
Another problem that would need to be solved is what happens when you have multiple units selected, in the case of the EzGui 3000
and if all the units have the same ROM you could present it and then run the callbacks for every unit selected, for the ASDP mkII
things get more complicated and I believe there is no solution that would allow you to do that and you’d have to inspect each one individually (or have a change in one unit send the change to all the other ones through radio!)
Kikai
A Programmable RTS
More posts
- Fully Featured Unit Development & Radio Device5 days ago
- In-Game Editor & Unit Persistence6 days ago
- Assembling and Rewriting Units8 days ago
- Kikai, Uxn & Debugger9 days ago
Comments
Log in with itch.io to leave a comment.
In my opinion it would be equally important allowing the user to interact with the unit using shortcuts. At least in games like starcraft I think the UI was important to provide feedback, but most actions would be performed using the keyboard.
Makes sense. Would this be an option that the player can make (i.e. it could affect the cost of the unit)? or would the devices be always available and it's just a matter of complexity?
Depending on how hardcore you want to go, maybe the minimap is something the user has to create using the units' visibility and radio capabilities haha
I think this poses an important question. In other games there are a limited number of units that behave the same way, so the user can perform actions in all of them easily. In Kikai it seems like all units could be unique. Maybe it would be responsibility of the player to define an interface between them and the units to interact in a way that makes sense (for example, attacking is the same "command" for all units). Anyway, I think this is something important to figure out and helping the player to define.
Absolutely, the devices are still being explored, but currently there is a
Command
device that all units have that is the interface between the user actions and the unit, move and attack commands, keyboard shortcuts and other stuff like this would be configured through that device.I expect this to be slightly different in Kikai, although I see the need for it of course. The end goal is to automate a lot of the army so I think the need for fast shortcuts and a lot of micro diminishes. Although I guess it depends on the player, so it’s good to have!
I’m unsure yet, the same way that I want to remove the CPU cost of drawing UI my intuition tells me I should make these two devices free but this is absolutely undecided. Being able to provide custom information like what the ASDP mkII provides may be invaluable in some cases. So maybe the base EzGui 3000 would be free, but ASDP would cost resources. I have no idea yet! What do you think?
This game is definitely an exercise in restraint to not overcomplicate everything, but as with the base army, if a basic minimap is provided and the user wants to update it, that’s good as well so this is in the realm of possibility for this game, yes.
As it is right now there are two basic commands that are common for all units (but that they may decide to ignore of course)
These are two specific vectors (callbacks) that all units will respond to. One thing that may be interesting is to offer the capability to write customized devices using Uxntal as well, that offer unified command interfaces for what the user wants to do.
Makes a lot of sense. As you said, the game could be infinitely complex, but it makes sense to take some of the complexity and hide it away with proper defaults. I think having the easy one for free makes it better. If as a player you had the option to not include it for optimization, then it could get frustrating having to deal with those units. Removing all the complexity that is not fun will be an important part of the design.