@Richard: Just for you - UI design 101

Eagle Day to Bombing of the Reich is a improved and enhanced edition of Talonsoft's older Battle of Britain and Bombing the Reich. This updated version represents the best simulation of the air war over Britain and the strategic bombing campaign over Europe that has ever been made.

Moderators: Joel Billings, simovitch, harley, warshipbuilder

Post Reply
MarkShot
Posts: 7444
Joined: Sat Mar 29, 2003 6:04 am

@Richard: Just for you - UI design 101

Post by MarkShot »

The game's UI needs a power user interface.

Most shortcut schemes are based mnemonics like [S]weep, [R]econ ... That is not going to work here, since there are just too many buttons.

This has nothing to do with knowing AHK; we are talking abstract design concepts. It can be done in C or C++ or C#.

Take a look at these two screen shots.
20220814 195241.jpg
20220814 195241.jpg (96.75 KiB) Viewed 529 times
20220814 195455.jpg
20220814 195455.jpg (71.88 KiB) Viewed 529 times
Okay, what do we see above? Logically, there is absolutely no correspondence between the functionality of the buttons. Yet, you cannot help to notice the fairly identical grid pattern.

Furthermore, I have mapped the 4 groups with bounding colors (even when buttons are missing) so we can think of them not as mnemonics, but an addressing scheme.

Now, let's take a look at Logitech gaming keyboard. But I am only going to call your attention to the standard USA keyboard layout; not of the extra programmable keys. (Those are really just icing on the cake, but not essential to this approach.)
20220814 195556.jpg
20220814 195556.jpg (209.71 KiB) Viewed 529 times
You will notice that I matched each block to an easily identifiable set of keys by the use of color outlines. Just like learning to type or using WASD, the user will naturally accommodate to this in a few days.

Additionally, your right side margin of the map display keys may also be seen as an addressable list of keys. Now, I have highlighted 10 keys, but I think the side bar may use up to 15, but we can we can easily get a block of 15 out of the numpad.

So, Richard are you able to see the game's UI not a mnemonics to memorize, but rather a set of addresses which will become muscle memory just like the brake pedal and the accelerator?

Let me know.
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
User avatar
simovitch
Posts: 5873
Joined: Tue Feb 14, 2006 7:01 pm

Re: @Richard: Just for you - UI design 101

Post by simovitch »

Hi Mark - OK I see what you are proposing. For some reason I thought you were able to do this already with a dll injector or something like that.
simovitch

MarkShot
Posts: 7444
Joined: Sat Mar 29, 2003 6:04 am

Re: @Richard: Just for you - UI design 101

Post by MarkShot »

I am able to do this already with AHK. Because the buttons are in a fix location. So, AHK code looks like this. I am using the CAPLOCKS as stick modal change. Some sample code ...

F1::
State:=GetKeyState("CapsLock", "T")
If State
{
MouseGetPos, OutputVarX, OutputVarY,
Sleep, 250
MouseMove,1927,8,0,
Click
Sleep, 250
MouseMove, %OutputVarX%+1920, %OutputVarY%,
}
Else
{
Send {F1}
}
Return

F2::
MouseGetPos, OutputVarX, OutputVarY,
Sleep, 250
State:=GetKeyState("CapsLock", "T")
If State
{
MouseMove,1927,23,0,
}
Else
{
MouseMove,2374,23,0,
}
Click
Sleep, 250
MouseMove, %OutputVarX%+1920, %OutputVarY%,
Return

F3::
MouseGetPos, OutputVarX, OutputVarY,
Sleep, 250
State:=GetKeyState("CapsLock", "T")
If State
{
MouseMove,1927,39,0,
}
Else
{
MouseMove,2393,23,0,
}
Click
Sleep, 250
MouseMove, %OutputVarX%+1920, %OutputVarY%,
Return

Now, here is some really cool code. Can you figure it out? Think before scrolling down the message.

WheelDown::
Send x
Return

WheelUp::
Send z
Return















Makes the mouse wheel zoom! :)
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
User avatar
simovitch
Posts: 5873
Joined: Tue Feb 14, 2006 7:01 pm

Re: @Richard: Just for you - UI design 101

Post by simovitch »

OK, I started writing some beginner scripts in AHK and the potential is quite fascinating for a free bit of software. And it can track the x,y of your mouse on the screen and recognize the mouse wheel. I will be diving into this for sure.
simovitch

MarkShot
Posts: 7444
Joined: Sat Mar 29, 2003 6:04 am

Re: @Richard: Just for you - UI design 101

Post by MarkShot »

Richard,

Don't knock free. Free <> poor quality. Linux runs the Internet and it is free and open source. AHK is an extremely powerful general purpose language for with Windows UI specialization and process control.

I have done totally amazing things with it. Remember OFP (Operation Flash Point) ... one of the best FPS ever made? But it had a UI that only an Orthopedic Surgeon could love. I never played because of that. 15 years after OFP's release I am looking at how ARMA 2/3 handle body movements and shooting ... totally intuitive and no strain to play hours. After about an hour I saw with a Logitech gaming keyboard and AHK, I could graft the ARMA UI on top of the ancient OFP UI. I did and played 3 years without any strain even though I was much, much older. What retired me were nerve tremors; not strain; hard to snipe when you cannot keep the rifle steady.

I gave you 6 lines of code to make the mouse wheel zoom in this GG classic. That took 1 minute to code and 4 to get running. Now, I ask you with C++ and the source could you have done it faster?

Price is something managers worry about when doing budgets. Engineers evaluate functionality and performance. AHK puts a smile on everyone's face.

Once you know AHK, you will be enhancing your games right and left. BTW, I have also done the same to commercial software packages lacking necessary functionality as well.

If you need any help, just ask.

You want your code to begin like this if not pre-bound via a programmable keyboard:

#IfWinActive, Bombing the Reich,

; PrintScreen Alternate (Snagit)
PrintScreen::!v

WheelDown::
Send x
Return

WheelUp::
Send z
Return

This means that any code below this point is only active when BTR.EXE has focus. Otherwise, strange things will happen in NOTEPAD.EXE.

Here is another handy idiom. What this does is only run when the game is loaded. It shuts itself down automatically. It is creating a thread whose sole purpose is to look for the game which wakes up every 50 milliseconds.

Game01 = Bombing the Reich

TimerInterval = 50

SetTitleMatchMode 1

Sleep, 30000
SetTimer, ScriptDone, %TimerInterval%
return

ScriptDone:

IfWinNotExist,%Game01%,
ExitApp

Return


Here is some code I did for the Panther utility that added hot spot maps to the game map. As scenarios are longish, you wanted those hotspots to persist between game sessions. Read and write to a private INI file on disk.

Well, just completed the first semester of AHK for gamers! :)

IniRead, F01X, PGE.INI, HotSpots, F01X, 0
IniRead, F01Y, PGE.INI, HotSpots, F01Y, 0
IniRead, F01Z, PGE.INI, HotSpots, F01Z, 0

IniWrite, %F01X%, PGE.INI, HotSpots, F01X
IniWrite, %F01Y%, PGE.INI, HotSpots, F01Y
IniWrite, %F01Z%, PGE.INI, HotSpots, F01Z
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
Post Reply

Return to “Gary Grigsby's Eagle Day to Bombing the Reich”