An OnslaughtSpecials2 expansion request

Anything about UT2004 mapping, Uscripting & more
User avatar
Pegasus
Posts: 1085
Joined: Wed 4. Nov 2009, 23:37
Description: ONSWordFactory
Location: Greece

An OnslaughtSpecials2 expansion request

Postby Pegasus » Sun 16. Oct 2011, 19:12

I've been trying for a day now to extend ever so slightly Wormbo's OnslaughtSpecials2 package (OS2 from now on) to include that very crafty bit of extra visual info N included in his ONS-TreetopVillage map, i.e. the nodes' health being displayed on the radar (oddly not in the Map tab of the master menu, but still very helpful). It's such a small but clever li'l hack that I just can't figure out why nobody has ever remarked that this should really become a standardized part of ONS through some popular ONS-related code package (ONSPlus 2.0 hopefully whenever that happens - and it should).
Back to my attempts though, finding the relevant part of the code that should be changed to achieve this didn't take long and it only involves replacing the DrawRadarLabel simulated function in OS2's ONSPowerNodeSpecial class with the following:

Code: Select all

/**
Draws additional radar labels for this node.
The screen location of the node is available through the HUDLocation variable.
*/
simulated function DrawRadarLabel(Canvas C, ONSHUDOnslaught Hud)
{
   local string CountdownString;
   local float XL, YL;
   local float MAX_BAR_WIDTH;
   local float proportionOfNodeHealthRemaining;
   
   //N: Little Hack to draw node health Bars on the radar minimap
   MAX_BAR_WIDTH = 15.0;
   proportionOfNodeHealthRemaining = float(Health)/float(NodeHealth);
   if(proportionOfNodeHealthRemaining < 0.35){
      C.DrawColor = Hud.RedColor;   
   }else if(proportionOfNodeHealthRemaining < 0.70){
      C.DrawColor = Hud.GoldColor;      
   }else{
      C.DrawColor = Hud.GreenColor;
   }
   C.SetPos(HudLocation.X-MAX_BAR_WIDTH/2.0, HudLocation.Y-12.0);
   C.DrawHorizontal(HudLocation.Y-12.0, MAX_BAR_WIDTH*proportionOfNodeHealthRemaining);
   

   if (CoreStage != 0 || CountdownTime == 0)
      return;

   CountdownString = string(RemainingTime);
   C.Font = Hud.GetConsoleFont(C);
   C.StrLen(CountdownString, XL, YL);
   C.DrawColor = Hud.GoldColor;
   C.SetPos(HudLocation.X - 0.5 * XL, HudLocation.Y);
   C.DrawTextClipped(CountdownString);
}


N marks the part himself, couldn't be more obvious, yada, yada, yada. So far so good. Then the ambitious and unsuspecting "coder" considers it best to recompile the package under a slightly different name to indicate the addition, say OnslaughtSpecials2_RNH (radar nodes health) and all hell breaks loose: See, OS2 contains audio, textures, st.meshes and some other stuff that cannot be ucc batchexported, namely those damn 0x0 ConstantColor and MaterialSwitch assets in the texture section. All meta, no data, "cleverly" only mentioned in the xTeamMaterialSwitch class but not given any values to... what? Save space by having them as 0 byte texture info? I just don't know how to treat that stuff and it's created the perfect impass for me: the new package won't compile without those things added somehow as external resource files and there's no way for me to create/add 'em through UEd before the package is created. Defining the 4 constantcolors by hand in the class' script might be an option but only if I could find a damn example somewhere of how you feed the values to such a variable (and under what scope? inside a function or outside?) and I haven't been able to (should it even be a variable? should it be a const? should it be created as a "new" instance or just by a normal var definition? should it be of the awesome var() type? wtf does that last one actually do different to the normal var definition?). Lovely... This is just the latest in a long line of reasons why I've always stayed the hell away from any hands on work with this game and I think it's the perfect time/excuse to finally segue to a long-pending rant about this whole mess I've probably been harbouring for years. Enjoy:

Now I consider myself a sufficiently intelligent person, the extent of said quality constantly measured, reevaluated and weighed for years by the range of my abilities to understand and master various PC related "crafts" and fields like image/audio/video editing and transcoding; reverse engineering, streamlining, making portable, extracting from or minimally modifying OS resources, games and any other kind of interesting program/code and generally being able to achieve all that I set my mind to where others would prefer to treat these things as "black boxes" and just make do with what's given to them. I achieve what I set out to do 99% of the time and all without ever having to actively ask anyone else for help. I mean, why should anyone? Armed with perseverance and just average smarts, the vastness of knowledge on most of these fields on the 'net should be more than enough to help you achieve what you're aiming to without ever having to pester anyone about it.
Strangely, not so with UT-related crafts for me. Even though I have a comp. science background and have long been reading Uscript code and studied plenty of mapping tutorials (merely out of curiosity) as well as believe I boast a respectable working knowledge of how it all ties together, the active practice of those things always struck me as haphazard, achieved through a multitude of poorly cross-communicating, temperamental half-broken tools and, most of all, very, very poorly documented. I could always figure out what a prolific and prominent coder's work does down to a line-by-line breakdown level, but ask me to implement something similar myself and there's probably a million different, spectacular ways I'd fail at it with incorrect (syntactically, decleratively... surreally) code. Nobody ever learned Uscripting from any single, definitive and all-encompassing resource that clearly explains why a specific function's scope was defined the way it was and not another, for example, because such a thing simply doesn't exist; likewise for mapping too, it seems. Just a loose collection of wikis and msg boards that you always hope will contain the answer to your particular obstacle, but deep down you know exactly what the harsh probabilities against it actually are. Everyone seems to "get there" by putting their failures up on public display for all others to review (perhaps laugh at) and eventually help with, but how parading one's ignorance in front of others in hope of some "elder druid" deciding to reward you for the entertainment derived from your fumbling by divulging the right answer to just that specific problem and hoping to improve through such an experience not seemed as clearly both bad form and a bad idea to anyone else I'll never know. Sacrificing dignity for knowledge is simply an unacceptable tradeoff to me.

The only reason I'm appealing to others this time is, partly, to vent for the seemingly absurd and illogical conundrum I seemed to've found myself in through no fault of my own (if I just compile the package as OnslaughtSpecials2 everything works lovely, but what kind of long-term practice would labeling different code versions by the same name be?) and it's been pissing me off enough to want to rant about the current "status quo" of knowledge dissemination in the UT-related creative crafts field. It's exactly the kind of problem that's been preventing innovative thinkers from trying their own hand at implementing potentially groundbreaking ideas ever since the game came out and who knows how many ppl that's lost us.

Fffff, anyway, rant over. Any suggestions?
Image

User avatar
lilalurl
Posts: 121
Joined: Mon 30. Nov 2009, 02:57

Re: An OnslaughtSpecials2 expansion request

Postby lilalurl » Sun 16. Oct 2011, 20:27

Hmmmm, either ask Wormbo for the full sources of OS2 and to allow you to do a derivative build or to include himself _N_'s piece of code?

Zon3r
Posts: 575
Joined: Thu 7. Apr 2011, 07:46
Description: Don't shoot at me!

Re: An OnslaughtSpecials2 expansion request

Postby Zon3r » Tue 18. Oct 2011, 10:06

i've never seen a map like that so it took me some time to figure out how can the bots walk on ceiling :D
Image

User avatar
Crusha K. Rool
Posts: 103
Joined: Sun 28. Aug 2011, 23:14
Description: Coding Crocodile
Location: Germany

Re: An OnslaughtSpecials2 expansion request

Postby Crusha K. Rool » Tue 18. Oct 2011, 17:09

I would let Wormbo do that stuff, if he finds time (he told me he was waiting with some of his stuff for me to release the UltimateMappingTools first so he could make sure what I already did and so he could keep things more compatible with each other). He will also know how to make that feature one that can be set for each Node individually because honestly do those health bars on the radar really look ugly and distracting. I love to see them with all those additional infos and fancy visuals in the 3D view, but the radar map is already small enough and with trackable vehicles would it be way too cluttered.
And I don't want to automatically have that stuff whenever I use the OnslaughtSpecials2 because I need some of the other features of the Nodes.

Besides that there is still some replication bug with the Nodes (Standalone Node not visible on the radar until first capture) that Wormbo might attempt to fix anyway, so that's another reason why you should let him handle it himself, not even mentioning that he has the original texture package that is required for the compilation.

User avatar
Pegasus
Posts: 1085
Joined: Wed 4. Nov 2009, 23:37
Description: ONSWordFactory
Location: Greece

Re: An OnslaughtSpecials2 expansion request

Postby Pegasus » Thu 20. Oct 2011, 22:53

Zon3r wrote:i've never seen a map like that so it took me some time to figure out how can the bots walk on ceiling :D
They don't; it just appears that way with the 2 different rooms being normally oriented but each having a warpzone as their ceiling linked to the other. It's novel, crafty (certainly pulled off better than in ONS-Enigma which is a mess) and it works for all non-hitscan projectiles. But no bots walking on ceilings actually ;).

Crusha K. Rool wrote:I would let Wormbo do that stuff, if he finds time (he told me he was waiting with some of his stuff for me to release the UltimateMappingTools first so he could make sure what I already did and so he could keep things more compatible with each other).[...]
Letting Wormbo do it for me without attempting it myself first would defeat the whole point of learning to work with packages through trying though. Also, Wormbo's generally a pretty busy guy; if he decides to do something new for the game, I don't want to be the reason for him putting it down just to tend to my own tests' needs. If I try first and get stuck then I'd ask for help, assuming the goal was something worth wasting his time with, which was the case here.

Crusha K. Rool wrote:[...]He will also know how to make that feature one that can be set for each Node individually because honestly do those health bars on the radar really look ugly and distracting. I love to see them with all those additional infos and fancy visuals in the 3D view, but the radar map is already small enough and with trackable vehicles would it be way too cluttered.[...]
Riiiight. Because a discreet visual aid (no bigger than 15x2px) that could help you with an important strategic decision as to which node to attack/defend when pressed for time (and possibly with other nodes at risk of being cut off; think Mael) is much less appealing and useful than a bulky, floating sign informing you of a node's presence that its skybeam and map icon couldn't already alert you about... Aren't you being a bit hasty in your condemning here? Besides, even if this request were to prove as controversial as you're making it out to be, I honestly don't see why it couldn't be treated in the same manner as the node labels have been so far, i.e. be a toggleable feature for players to decide how they like it set (hell, you could assign it to the same key as the node labels toggle; in 5 presses max you can cycle through all possible combos). Baffling suggested feature persecution is baffling :/.

Crusha K. Rool wrote:[...]And I don't want to automatically have that stuff whenever I use the OnslaughtSpecials2 because I need some of the other features of the Nodes.

Besides that there is still some replication bug with the Nodes (Standalone Node not visible on the radar until first capture) that Wormbo might attempt to fix anyway, [...]
That's the very reason I was trying to fork it out with the _RNH notation so it wouldn't be forced on anyone nor be stepping on Wormbo's toes while he works on the next OS version.

Crusha K. Rool wrote:[...]so that's another reason why you should let him handle it himself, not even mentioning that he has the original texture package that is required for the compilation.
Moot point, it's done. Lemme know if it's not working right, folks.
Image

User avatar
lilalurl
Posts: 121
Joined: Mon 30. Nov 2009, 02:57

Re: An OnslaughtSpecials2 expansion request

Postby lilalurl » Fri 21. Oct 2011, 21:18

Seems to work fine

Image


Just to give my opinion, I like the radar map to be relatively simple and additions like node health or vehicle position I am not really interested in.

I prefer keeping things as a surprise (will I drive there, knowing that there might be a Goliath, but maybe not) or to reward thoroughness (I'd better spend some time to check all those locked nodes to see if there are at full health, this might help my team at one time or another).

But I can imagine why some people would like to have such info. features in a map.


To satisfy people like Crusha, perhaps you could put a boolean parameter in the nodes properties. This way if the mapper wants to disable the display of health above one or all the nodes, he could do it quite easily.

User avatar
Wormbo
Posts: 384
Joined: Sun 28. Aug 2011, 11:52
Description: Coding Dude

Re: An OnslaughtSpecials2 expansion request

Postby Wormbo » Fri 19. Oct 2012, 11:48

So, you rant about not being able to properly modify my code and compile it. Well, you could have just asked. As this one year gap suggests, I don't have much time to work on UT-related stuff, so I could have provided the source for you to improve. After you are done (and released a renamed version) you could send me your changes to be merged into the main development branch.

Here's the xTeamMaterialSwitch's code so you can see why I did it this way:

Code: Select all

/******************************************************************************
xTeamMaterialSwitch

Creation date: 2010-07-07 10:30
Last change: $Id$
Copyright © 2010, Wormbo
Website: http://www.koehler-homepage.de/Wormbo/
Feel free to reuse this code. Send me a note if you found it helpful or want
to report bugs/provide improvements.
Please ask for permission first, if you intend to make money off reused code.
******************************************************************************/

class xTeamMaterialSwitch extends xTeamBanner hidecategories(xTeamBanner);


//=============================================================================
// Properties
//=============================================================================

/** A MaterialSwitch with 4 materials: red, blue, neutral and disabled */
var() editconst editinline export MaterialSwitch MaterialSwitch; // editinline+export = create copy of subobject

/**
Combiners to apply the team symbols to.
The symbol material is applied to Material2.
*/
var() Combiner TeamSymbolCombiners[2];


simulated function PostBeginPlay()
{
   Super(Decoration).PostBeginPlay();
}


simulated function UpdateForTeam()
{
   MaterialSwitch.Current = Min(Team, MaterialSwitch.Materials.Length - 1);
   MaterialSwitch.Material = MaterialSwitch.Materials[MaterialSwitch.Current];
   
   if (GRI != None && Team < 2 && GRI.TeamSymbols[Team] != None && TeamSymbolCombiners[Team] != None)
      TeamSymbolCombiners[Team].Material2 = GRI.TeamSymbols[Team];
}


//=============================================================================
// Default values
//=============================================================================

defaultproperties
{
   DrawType       = DT_Sprite
   Texture        = Texture'Engine.S_MaterialTrigger'
   Mesh           = None
   bCollideActors = False
   bHidden        = True
   
   Begin Object Class=ConstantColor Name=RedTeamColor
      Color = (R=255,G=0,B=0,A=255)
   End Object
   
   Begin Object Class=ConstantColor Name=BlueTeamColor
      Color = (R=32,G=64,B=255,A=255)
   End Object
   
   Begin Object Class=ConstantColor Name=NeutralColor
      Color = (R=192,G=192,B=192,A=255)
   End Object
   
   Begin Object Class=ConstantColor Name=DisabledColor
      Color = (R=64,G=64,B=64,A=255)
   End Object
   
   Begin Object Class=MaterialSwitch Name=TeamSwitch
      Materials = (RedTeamColor,BlueTeamColor,NeutralColor,DisabledColor)
   End Object
   MaterialSwitch = MaterialSwitch'TeamSwitch'
}

The goal was to make it as easy to use for mappers as possible. The way I set it up causes UnrealEd to duplicate the MaterialSwitch with some predefined properties. The mapper can clearly see what the various materials are used for.

User avatar
Pegasus
Posts: 1085
Joined: Wed 4. Nov 2009, 23:37
Description: ONSWordFactory
Location: Greece

Re: An OnslaughtSpecials2 expansion request

Postby Pegasus » Fri 19. Oct 2012, 19:25

The purpose of my rant wasn't to single out how modification-friendly your code specifically may or may not have been, but had a broader scope instead; namely, my overall frustration about the lack of more robust and comprehensive Uscript online didactic/tutelage tools and options, such as comprehensive, bottom-up creation guides for vecs/weaps or mutator projects (i.e. the various archetypal stuff), books or even workshops available to less experienced coders so they could try to put together something their own way first, see where that fails and why, learn the various nuances from that as they go and get better at the craft, all without involving the active participation of other people whose time might be better spent elsewhere. Without any of that stuff but only through various community wikis comprised of narrow scoped entries instead, trying to learn how to make a compile-qualifying project (never mind something actually functional) was - to me, anyway - like trying to learn about a particular historic event on wikipedia where that specific page has been mysteriously deleted and one's only recourse is to hop around the various relevant actors' entries and hope to piece the whole picture together somehow or like trying to learn an alien language just by looking at tons of text. It's doable, but borderline masochistic. Studying a car taken completely apart in one's garage is a pretty inefficient way of becoming a mechanical engineer for most, in other words, so I can't help but wonder how many solitary but otherwise talented ppl might've been turned away from Uscript and a chance to pollinate the UT community with their own unique creations exactly due to the imposing height of this approachability obstacle that's been a reality for all these years.
Those issues, I felt, were long pending, I was experiencing 'em myself at the time and, therefore, were apropos to talk about. I didn't ask for help because being given the answer wouldn't've helped me learn anything for myself and I didn't even believe it was worth wasting either of our time just for the inclusion of 3 lines of code I hadn't even come up with myself. At any rate, it's been a year and my memory's a bit hazy right now as to how I solved it, but consulting my notes, it seems to've involved embedding a utx where I'd added the 0x0 ConstantColors one by one manually in the editor; arcane, backwards, unintuitive, but that's what worked. Oh, also it seems the "Meshes.PowerNodeShieldMesh.t3d" static mesh was never properly used in _RNH because fuck if I knew how to cram that in there (or whatever the problem was). [closeenough.jpg]

Anyway, thanks for responding on the package's anniversary, this rant's on the house.
Image

User avatar
Wormbo
Posts: 384
Joined: Sun 28. Aug 2011, 11:52
Description: Coding Dude

Re: An OnslaughtSpecials2 expansion request

Postby Wormbo » Fri 19. Oct 2012, 20:20

The shield mesh with the customized collision was originally loaded from a static mesh package. That package wasn't located in the StaticMeshes folder, but in the project base directory and happened to have the same name as the target package, i.e. OnslaughtSpecials2(.usx) - you'd have to modify the import statement to that to compile with a different project name. That's a limitation of the compiler's import directives.


Return to “The Creative Corner”



Who is online

Users browsing this forum: No registered users and 0 guests