• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Fullscreen inventory/UI system during gameplay

Status
Not open for further replies.
Level 25
Joined
Feb 2, 2006
Messages
1,689
I was looking for a fullscreen inventory or more generic UI system which updates the UI elements dynamically depending on the current camera view of the player.

I thought I've already seen a system like that in the past but couldn't find it. I don't want to use SharpCraft, only vJass.

As far as I've seen it in another system and read on Hive they use destructables with a z value for the icons and background images using the replaceable texture in the destructable, to be able to use the same model for every icon destructable.

Since there is no selection event for destructables you can either use a unit or trackables.

Now, if I want to create a system without trackables (since they cannot be moved around or deleted) which is shown depending on the current camera position I would use units for the selection which are invisible but can be selected and have the same size as the destructables.

I would use a model with billboarded texture like the silence effect which always is seen by the player no matter which camera perspective he has.

My goal is to provide more icons than the 12 + hero icons + inventory slots. Of course the shortcuts would not work but I still would have more icons for spells or other actions.

Is there any such system? Is it even possible the way I described it?

I guess the hardest part would be to calculate the X, Y and Z values depending on the camera position and view to map them to the 2D screen via some projection.
Of course I would have to create a destructable per icon but that's how the other fullscreen inventory system works, too.

I don't need trackables although it would have been cool to have a track event to offer a tooltip. I guess this is not possible. Even when you create many trackables in the beginning on the map (one per cell) it would not work with a dynamic UI system, I guess.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
lol, it is outdated as it uses features that are illegal now.
So yea, you cant compile it.

I only took a look at it when I was building my ChatBox lib to get an idea of how they deal with camera perspective and such.
Didnt use anything from it at the end though.
 
DGUI had an interesting approach, however, it is not possible to replicate a working DGUI for a multiplayer map, hence why nobody bothered remaking the system.

The two problems that disqualify DGUI (or any system attempting to recreate it) in multiplayer are as follows:
- GetCameraPosition is asynchronous, which means we need a fast method to synchronize coordinates to move our selectable units around; add the synchronization delay to the already present delay of selecting units and you got yourself a super slow and annoying system
- GetCameraPosition updates at a lower frequency in multiplayer (~14-16 fps instead of >32 fps in singleplayer), god knows why, as it is asynchronous anway

There is only one way to solve these two problems at the same time:
By making the requirement of a locked camera, so that you always have implicit knowledge of the camera position. For example, a permanently unit-locked camera would work (with the usual controls to sway/turn the camera, of course).
That way, you can get around using GetCameraPosition and can get rid of the issues that come with it.

Of course, if you just want to show stuff for the player and don't care about interactivity (so no clicking elements), then the unit selection thing is a non-issue.


Tbh, it's not worth the trouble imho. People don't like locked cameras.
 
With locked camera you mean one single camera position on the map? I've also thought about the problem with asynchronous values. Is the SyncInteger function that slow (should work with reals as well?)?
I meant cameras that are locked (in other words follow) on units or specific points of interest.
SyncInteger and SyncReal are not fast enough, no. And even if they were, you'd still be limited to the default refresh rate of the GetCameraPosition() natives.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Try this map.
It almost completely supports multiplayer.
There is a very very rare occasion where it desyncs... as in... 1 in a thousand left clicks.
(Tested with the multiplayer simulator, not via the actual internet so i didnt test with any latency.)
 

Attachments

  • ChatBox 0.3.w3x
    73.9 KB · Views: 82
Turns out it's completely feasible in multiplayer maps. You don't need to sync the camera positions at all.

It even works without a locked camera but it looks ugly as it flickers when you move the camera too fast.

There are now a few systems in the spells section which demonstrate how it's possible:

User Interface v1.0.2
Panel System v1.31
 
Status
Not open for further replies.
Top