Author Topic: Advanced HUD Objects  (Read 2580 times)

0 Members and 1 Guest are viewing this topic.

Offline MovGP0

  • 23
Advanced HUD Objects
I don't know about the code internals (so excuse me if something I posted here is already existing in one way or another), but it looks to me that the way the HUD-Elements are drawn is not very flexible.
  • Mods seeming to me to take the same HUD Elements over and over.
  • No real RGB colored HUD Elements if wanted.
  • No use of HUD Elements by clicking on it with the Mouse as in Freelancer.
    (needs also a change in the input behavior - see my previous posting)
I think this requirements should be solved by introducing an more advanced HudElementClass Prototype with supports:
  • Interface for drawing itself/get size -- even on:
[list=a]
  • an 3D Projection for 3D-Cockpits
  • for Target Highliting
  • providing Tooltips when selecting objects with mouse (targets from radar; Subtargets from an 3D picture of the target)
  • Interface for default-color(s)
multible RGB and Alpha
  • Interface for changing the position (and size) of the element in "HUD Designer"
  • Chain-of-Responsibility Pattern (instead of/additional to the common global Table Method) for Handling Keyboard/Mouse Events
selecting Targets by Mouse from a menu or even from a 3D Radar rather than selecting target-by-target
  • Singleton for a List of Position/Type of Targets[Subtargets]
List and 3D-Radar for Ships/Rockets/Mines/...; Friend/Enemy Highlighting; etc.
  • Interface for "Smarttags" to introduce control-Specific behavior in HUD-Designer
ie. select between different types of Radar [list=a]
  • 3D spheric (current)
  • 3D Discus (like in X)
  • 2D-circular (WingCommander3/4)
  • Arrows at ScreenBorder (Freelancer)
[/list](The the HUD itself should be presented by a kind of Builder/Strategy Pattern to take use of the above described object.)

-- please give rich feedback to my conceptions - thx

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
The biggest problem is user customization of the HUD, ie modding. I was working on a system to greatly improve it, but the scripting aspect was driving me insane. What's really necessary is an object-oriented arithmetic system. So for example:

Code: [Select]
$Text: self.target.name

The problem comes when you do something like:

Code: [Select]
$Text: 100 * (self.target.current_hull_strength / self.target.initial_hull_strength)
-C

 

Offline MovGP0

  • 23
Why are u should using an special scripting engine?

Wouldn't it be better to use partially managed C++ Classes to be able to use any Language of choise like VB, C#; C++; Java; PHP; ...

This would solve you're Prolbem if the scripting-language-syntax is not enought; make scripts executed instead of interpreted - and therefore faster; and last but not least would make it be possible to let a lot of programmers from other languages to work for you.

Also there should be standardisized XML based config-files because there are very easily to extend for own extensions.

 
The problem is more with getting FSO to understand the scripting, and making sure the right values are used (for example, hullstrength has to be supplied by the game), than designing the langauge.

This is AFAIK, I'm not a coder.
just another newbie without any modding, FREDding or real programming experience

you haven't learned masochism until you've tried to read a Microsoft help file.  -- Goober5000
I've got 2 drug-addict syblings and one alcoholic whore. And I'm a ****ing sociopath --an0n
You cannot defeat Windows through strength alone. Only patience, a lot of good luck, and a sledgehammer will do the job. --StratComm

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Pretty much what kasperl said.

A scripting language could be used for other stuff (mission scripting comes to mind) but really, that's getting into an area that Ferrium should use. Trying to make missions scriptable with, say, Python while still retaining backwards compatibility sounds like a nightmare.

Depending on the language, it also opens the possiblity of security problems, ie viruses - mainly why I haven't made it possible to do things with a DLL.

If there's a scripting language that basically works mostly like C++ but lets you define the functions/globals, that'd be perfect, though (As long as it's easily integratable and doesn't need a lot of learning to use it).

And I hate "XML". I've heard so many people talking about how XML is great and mighty, but it isn't. AFAIK, it's just fancy HTML tags :rolleyes:. Not to mention the god-awful mess XML seems to make of website code. There's not much it has on the FS2 table format except it's more easily parsable by programs that were never meant to be reading the files in the first place, takes longer to edit with in Notepad, would take up more space, would probably require the inclusion of *another* library into FS2Open to do things properly, and not have as good a comment syntax.

Now that Microsoft Visual C's project files are in this awesome new language, I can't edit the damn things with anything but that version of MSVC. :doubt: Goodbye, fixing ****ed-up project files.

So - I have yet to see some concrete benefit come out of using "XML", so I've been planning on sticking with the usual table syntax.
-C

 

Offline MovGP0

  • 23
The best thing on XML is that it is extensible (as the acronym said)
It is also possible to access each other resource like it would be an XML File - independend of the true filetype - therefore learning how to bind code to XML can't be false
-> I think it's also dependend on the programming language/framework if you love or hate it
(Note: HTML is a kind of XML - not otherwise)

Also I don't think that it is not so hard to keep backward-compatibility while introducing a new way of binding external code - it mostly depends if you choose the right design-patterns.

And true, my issure is a C++ developer task - not a scripting one
-- but isn't ferritum superseeded by the SCP?

 

Offline MovGP0

  • 23
btw - For the Python-Scripter's out there:
http://www.zope.org/Members/Brian/PythonNet

 
XML is a fancy way to parse text. I'm not saying it's bad, it is good to send text over processes telling when a section starts and ends at the user level, so to speak.
But, it requires the programmer/developer to do the parsing, security checks, etc.
And it's unsecure, if you have to send it over the net.
Yes, there are libraries for XML. Not for perl, I think. And a call to an external program doesn't look good for a game.

FS2Open has its own parsing code and has been designed (always speaking from what I think the case is) for missions creation. Not for "whole thing" modding. Well, not the HUD, at least.

I think FS2 code as it is now would require a lot of recoding just for this kind of modding you're suggesting. A parsing and the renderer codes for the HUD, if you will, and only for the HUD.
Ferrium, if I'm not mistaken (because I'm not following there for quite some time), will/would be able to do that.

WMC, after I'm done with the IRC, I'd like to give you a hand with the HUD if you wish :)

Oh, if I'm mistaken with anything, let me know :)

 

Offline MovGP0

  • 23
XML
I didn't thought about sending XML over the net (SOAP is not effective enought for realtime) - but for storing data like position/color/settings of HUD-Elements and the like, because I think it would be easy to handle and extend for custom Controls. For security there's encryption.
-- but that is only my personal view; I understand also your'e arguments and agree.

Recoding
Yes it is. This suggestion will need change the HUD into an UI like the ones of 3D strategy games like in Warcraft 3 to get every unit (ie. ships) and HUD elements clickable rather than a "simple" presentation. Parsing alone will not help

give you a hand
Sry - I'm primary a hobby coder in C# [1];
Even I can also read ASM, C++; UML (design-patterns) and the like, I'm not well trained[2], have not to much freetime and I'm just starting to learn "managed D3D" witch will consume the rest

reading the source would be currently overkill to me...[3]

[1] WindowsForms/Avalon; ASP.Net; ADO.Net; XML for .Net; ...
[2] HW-Technican not an SW-Developer
[3] would have to loose my job first - but don't wana do that ;)

 

Offline MovGP0

  • 23
btw - solving the Mouse Issures is more important.

 

Offline Lynx

  • 211
Moving some of the HUD components is already possible, though they are very few(radar, shield counters, mini shield icon if I'm not mistaken). It'd be cool to have all the components moveable(sans reticle since that's the only thing that needs to stay where it is:) ) and multicolored HUD displays..mybe it's something personal but monochromatic HUDs are really ugly. Even if it's purely functional, it should look nice at least.
Give a man fire and he'll be warm for a day, but set fire to him and he'll be warm for the rest of his life.

  

Offline Woolie Wool

  • 211
  • Fire main batteries
How about the ability to script in a score display for a bonus game mission?
16:46   Quanto   ****, a mosquito somehow managed to bite the side of my palm
16:46   Quanto   it itches like hell
16:46   Woolie   !8ball does Quanto have malaria
16:46   BotenAnna   Woolie: The outlook is good.
16:47   Quanto   D:

"did they use anesthetic when they removed your sense of humor or did you have to weep and struggle like a tiny baby"
--General Battuta