Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: MovGP0 on March 19, 2005, 01:54:32 pm

Title: Advanced HUD Objects
Post by: MovGP0 on March 19, 2005, 01:54:32 pm
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.
I think this requirements should be solved by introducing an more advanced HudElementClass Prototype with supports:
[list=a]multible RGB and Alpha
selecting Targets by Mouse from a menu or even from a 3D Radar rather than selecting target-by-target
List and 3D-Radar for Ships/Rockets/Mines/...; Friend/Enemy Highlighting; etc.
ie. select between different types of Radar [list=a][/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
Title: Advanced HUD Objects
Post by: WMCoolmon on March 19, 2005, 03:36:55 pm
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)
Title: Advanced HUD Objects
Post by: MovGP0 on March 20, 2005, 03:23:17 am
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.
Title: Advanced HUD Objects
Post by: kasperl on March 20, 2005, 03:28:33 am
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.
Title: Advanced HUD Objects
Post by: WMCoolmon on March 20, 2005, 03:43:05 am
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.
Title: Advanced HUD Objects
Post by: MovGP0 on March 20, 2005, 04:55:54 am
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?
Title: Advanced HUD Objects
Post by: MovGP0 on March 20, 2005, 05:04:54 am
btw - For the Python-Scripter's out there:
http://www.zope.org/Members/Brian/PythonNet
Title: Advanced HUD Objects
Post by: mrduckman on March 20, 2005, 01:05:23 pm
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 :)
Title: Advanced HUD Objects
Post by: MovGP0 on March 20, 2005, 02:39:01 pm
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 ;)
Title: Advanced HUD Objects
Post by: MovGP0 on March 20, 2005, 02:53:18 pm
btw - solving the Mouse Issures ("ttp://dynamic4.gamespy.com/~freespace/forums/showthread.php?s=&threadid=30956&goto=nextoldest") is more important.
Title: Advanced HUD Objects
Post by: Lynx on March 20, 2005, 04:46:48 pm
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.
Title: Advanced HUD Objects
Post by: Woolie Wool on March 22, 2005, 12:55:28 pm
How about the ability to script in a score display for a bonus game mission?