#blueprint
1 messages · Page 398 of 1
so it was working when you had it bound to a different button?
i was using completed for turning it false
yep
changing the button shouldn't affect how it works. im guessing you're deflecting the stick when you push the stick button and your dot product check is failing out
you need to debug that logic to figure it out, we cant tell you by just looking at it
i removed the dot product to see if it was the issue but it wasn't
where does the execution stop? put a breakpoint on the input node and follow it
All that your sprinting input should do is signal your INTENT to sprint. Just set bWantsToSprint true and false
that too
your tick should use that as part of the calculation as to whether you are sprinting or not, setting whatever speed and whatever other variables
i dont follow you
https://dev.epicgames.com/documentation/unreal-engine/blueprint-debugging-example-in-unreal-engine?lang=en-US you sould read it all, but jump to breakpoitns for the specifics
Anyone here use Rama's Victory Plugin 4.27? I can't get "Get Sound Wave From File" to work. The file is an ogg, the resulting sound wave "is valid" and has the correct duration etc, but doesn't actually play
Output log says "LPCM data failed to load" but idk if that's an export option in OGG or what
Does anyone have a simple method to either bind variables to a UMG widget or disable the updating per frame? I know there are a few ways, but they seem rather complex and some include custom C++ code.
-
Have event dispatchers available that your widgets can bind to, and be sure to call the relevant ones when you make changes to variables within an actor/actor component. Your UI will need a reference to the object that contains the dispatcher so it can bind to it.
-
Use something like the GameplayMessagingSystem that is present in the Lyra Example. This is a means of generically sending a message on a "channel" (a gameplay tag) and anything that wants to listen to that channel can then respond to the message as it needs. It can also use varying structures as payloads to pass along data. Your UI would just need to listen to the appropriate channel. This doesn't require C++ coding, and I think there are people who have packaged it in a plugin so you don't have to try and strip it out yourself from Lyra.
That is correct, but everything I have ever seen on this is missing key information or examples. This image illustrates a basic example. The actual core problem comes from using the UMG widget itself.
What needs to be understood at a more basic level is that all the rules change when doing this. Thus everything you may have normally done is out the window. Such as how to update variables or access them. It's kind of like how rules change from an Event Custom function to a created function. There are "hidden" changes that need to be learned.
In this case it is in fact referencing the text object inside the UMG widget. That's not how I manage any of the data in the entire game. That's where the real problem occurs. Understanding the "hidden changes/rules".
When you know the solution and how it works it may appear simple. This is a different manner of updating variables than saving, binding, calling, and general management. It does not follow the standard rules and seems wrong because it's applied differently.
Your UI should be reading values from other game objects it cares about. The only variables that should exist in the UI are things that the UI itself needs to manage, but the game should be able to function entirely without the UI being present.
This is also another huge part of the problem. You can't type Set Text or drag and do set text There are many text block options including rich text block etc.
In that example when I dragged from the object I go the hover text by typing set text.
Regardless that should be working I'll do a simple randomizer to verify it.
The "Weapon Name" is a "Text" object type that pertains to your widget. That "Text" object has various exposed functions that allow you to set and the read the values it contains. So, when you're doing the "SetText (Text)" call, you're setting the variable within the "Weapon Name" "Text" object to that value (which could be displayed in your UI)
Taking "Weapon Name" and doing a "To Text (Object)" I believe would retrieve the actual object name and return the text of that string, which would probably be something like WeaponName_C0 or something weird like that.
Also note in many cases it will be expected to update the information, but not always. In those cases simply updating the object reference on even begin play or construct should work I presume.
The to text object is something that is auto populated on many of the selections.
It's automatically created in that case when referencing the hover.
If you drag off of Weapon Name, what do you type to get the correct node? Because it's not Set Text
If it's even possible without already knowing the answer and mnaually selecting it
There are roughly 100 options when typing set text. That's part of the issue. Especially if you don't already know what is correct.
The name of the node is at the top of the node itself. That said, even typing "Set Text" from a Text reference gives me this attached screenshot. The one to use is the one at the bottom SetText (Text).
Looks like there is a bug regarding that. If you do the search while context sensative is highlighted and then uncheck it you will get that. You need to uncheck it and then do the search again. It won't update properly without that "refresh"
What version of Unreal are you on?
5.7
Might be even buggier then that. I got the menu you displayed one time only.
It might be the other nodes interferecing or cashed data maybe?
Expand the Context Sensitive Arrow at the top right. Can you screenshot what you ahve selected there?
Interesting.
I have Pin Type Class on, and when I turn it off, I see kind of what you see.
Not sure why that would be disabled for you.
I'm on 5.2, but I don't think that would change this functionality.
Ummm now I every time I bring it up the pin type is checked ! lol
I'll do some testing and updating to reflect the changes and prevent the unnecessary spamming of updating variables when it's not needed. Thanks for your time.
Well, here's an example of an event dispatcher setup in an actor component. This example is assuming the health component would be attached to the player's pawn by the time the widget is created. This would make it so the bound event in the widget trigger whenever "ChangeHealth" is called on the Player Pawn's health component. This would eliminate the need for the UI to constantly ping the health component for the value.
The only trouble with this setup, is that by the time the widget is created the player may not be possessing a pawn, or if their pawn changes mid-game, then it would remain looking at the bound pawn's value. Takes a bit more setup to account for everything, but this is an example of how something like this can work.
Realistically bindings should simply have an option to disable updating. The UMG's are a core component of creating inventory, HUD, menu's etc. While it's not apparent and hasn't shown to many signs of slow down, it feels like a massive hidden problem.
That is explained well in some videos regarding the matter, but what you really need is a randomization on every bound variable to really see how much spam is created.
The point being almost all menu's should have this revoked. Which means losing the true value of binding. A clean and easy way to design these systems. For health, stamina, etc the updates may be needed, but otherwise most values won't.
You can also bind to the Pawn OnDestroyed or OnUnpossesed (I think it exists, but not sure, I used OnPossesed though so it should) if you need to clean up or change something.
Or shift the creation and bindings of the widget to something on the character, like a UI Manager Component and reconnect the widget when OnPossesed is triggered or some other event
I'm building out the menu, but it does appear to be working and correctly with the values and lack of upddating per frame.
The view button simply toggles the visibility of the right hand panel. That actually calls other user widgets for the data which is used by the items index. It's just a simple function that updates the data when called. Since the user widgets are linked they can reference each other.
This is needed due to the nesting of UMG widgets
It's a lot of information to extract and I know it's the result I'm looking for. However, everything about it feels wrong. The association between bindings makes a clean and well established system. Instead I'm taking all the nodes from the bindings and creating them in an unlinked environment which is a lot less organized.
I could create multiple functions to organize the nodes a little better, but it's a complete downgrade vs the binding system. A much better solution would be an option to stop the frame updating or change it. That is an option on the UMG widgets, but it does not apply to bindings.
<@&213101288538374145>
As an FYI, the property bindings in UMG is a legacy feature. Epic would remove it if it didn't break older projects. There's actually an option in the project settings to disallow it altogether.
As for an approach to you issue, using custom uobjects for data can make things like this easier. For example, each item would be its own uobject and contains its data. The item entry widget would be passed the uobject and the widget would update itself accordingly, extracting the information from the uobject.
Having an event dispatcher on the item entry widget for when the view button is clicked also simplifies things. When clicked, it would call the 'OnItemEntryClicked' event dispatcher and pass through the uobject that was assigned to itself.
In the main widget that the item entries are placed, you can bulk bind to the on item entry clicked event and have all of them call the same function. In this function you would get the details widget and pass in the new uobject that was passed through. The details panel would then extract the relevant data it needs from the uobject and update itself accordingly.
I get most of what you are saying, but it's nearly impossible to match the bindings. They are built into the menu, give drop options for the functions, but also include direct links to the function and separation for things like visibility, color, text.
The way I'm setting it up isn't necessary bad, it's just that everything would in a way be inferior to something that was specifically designed for the widget.
In the example I used it does only update the necessary information. Which in that specific case is all the information on the right hand panel. Including some calculations such as exp progress, and next requirement for level up. When you click view you are essentially viewing a different item so nearly all the data will change.
It sounds like you might need to rethink and rebuild how you assemble you're UI. The vast majority of information in the UI only needs to be updated when first displayed or when something changes. Blindly re-pulling and applying is a waste of resources.
UI should be responsive to game events or player input so these are your trigger points.
That is how things are being constructed. Essentially removing the bindings. That menu is different in that it's actually a list view which works differently and already does that.
In that example though that's exactly how it works. When the player clicks view that triggers the update to view the item which they clicked on for more specific details. It's also used in other menu's as a better version of hover text.
So if you want details on what a stat does for example you can click on it and get the information on it from the "detail panel".
The UMG widgets are also stacked together for better utilization. Such as the Header (Drop down menu so it can be inserted into multiple menu's). The main menu isn't actually updating in that example. The right hand "Details panel" is it's own Widget placed in the main menu. Thus it's just updating the right hand side by calling a function on that widget which pulls only the data for the change. Thank you for the input though. I believe it's all being done correctly.
The main issue was previously it used a lot of bindings. And while it looked fine behind the scenes it was spamming all the time.
I need to work on it and clean it up a bit more, but so far
Wrong channel, it should be posted here. #hire-a-freelancer
Hi guys. I'm really struggling with something here - I've got a "bomb" which is a sphere collision which is set to overlap as it's large , on overlap I apply damage set collision , set simulate physics and then add impulse to overlap/hit components/bone name etc, but the characters just flop over from the damage I applied and do NOT get hit by the impulse I've added. Any help please.
what kind of modifiers did you do for this? I assume swizzle but i can't be sure (i might jsut be stupid i am tired rn)
Swizzle and negate. Mine is set up for +Y forward by default. Which is actually right in Unreal. Negate and Swizzle settings are all default, and Triggers are Down.
epic
So in this case my W swizzles to change my +Y to +X, etc etc.
ye
you are awesome thanks so much
I'm just trying to set up my controls beforehand so i don't hve to go back through once everythign is done and add a bunch of inpout action events and stuff
Until you need to rebind and you're going back through to add PlayerMappableKeySettings for the options menu. 😄 But yeah I hear ya.
heh
yeah
that'll be a problem for later though lol
for now i just want to ahve the access there at all
just making sure i ahve this all setup right, this is it yea?
-# Probably would help if the IA wasn't a boolean type
lol
oh yeah it workin
just uh
not the way i needc it to lmao
anyway ig it's time to trial and error
I think I'm experiencing an engine bug, but can't find any other reports of anyone running into this problem.
I have two events in my blueprint interface both passing the same reference to and from the same places the same way. one of these events returns the reference fine, but the other one always returns invalid. I have never experienced this before. I'm using Unreal 5.3.2.
Child classes? My initial assumption is that WasHit is on a child, and isn't passing the data to the parent call?
unfortunately not, this is the highest parent of this class
i've rebuilt the same set of variables inside of "test event" and it works exactly the way "washit" should, so the problem is technically solved, but i wanted to make sure there wasn't anything im overlooking before chalking this up to an engine bug
Wild. 😄 I don't use interfaces. I'm curious if you see a valid object before the call? Like I'm assuming that your line on the bottom is the same thing and you're not somehow randomizing from a list or something. But I can't come up with anything that can cause that besides a child class messing with the virtual call chain.
yep. it's valid going in but invalid coming out
also nope, it's a reference to an animation notify state object
Anyone here has experience with Instanced Structs? I'm trying to create an entity database where every entity has a guid and an array of instanced structs. Then i would add structs for inventory, health, etc. This works well for the initial setup but it seems impossible to retrieve and update these values. For example, when i click save i need to get every interactable actor's transform and update the database. Is that even possible?
I'm not sure if Blueprint has a by ref getter for instanced structs. You might be in the same boat as maps there where you need to make the copy, set data in it and just write the whole struct back.
But how do you retrieve the data from an instanced struct? For example, let's say that i want to find an entity that has the Actor struct. I can loop the database and get the struct array from every entity, but how do i check if it has the struct that i want?
You're kind of stuck doing it like this in BP. Get it(Only valid here if the output matches the struct), copy the value, modify the value, pass the modified value back to the same spot.
The map part also complicates that a little. What is your map of? Guid/Struct, or?
It's a guid
So more like this. For each key(guid) in the map, get the associated struct's value. Modify a copy. Add that to the map with the same GUID which acts like an overwrite.
Replace Transform here with whatever your struct was. If you have different structs per guid then you need that chaining NotValid thing I did above.
Wait, how do you get a make struct node? I managed to get a break node by creating a variable with the type of the struct
There should be a Make ST Actor node too. They're auto generated per USTRUCT
Something I noticed in that screenshot that you might want to know about: The engine's built-in For Each Loop is just a regular blueprint macro, and inside it uses a Copy version of the GET node, so trying to set it by ref won't work off the Array Element pin of the For Each Loop
I can't do a make of any struct in my project
It's mine, just a simple struct
Now I want to experiment with Instanced Structs and passing by ref to see what's possible 
Can you just right click in your blueprint and find a make struct node?
I can find Make Transform, but i can't do it with any of my structs
I copied your structs here.
O.o That's odd. Engine restart maybe?
Either way. This is essentially what you're after for at least setting STActor's data.
Once you start adding more type it's just chaining the notvalids here.
Your STActor looks like this, yeah?
If so, see if restarting the engine fixes your Make search. Bit odd that's missing. O.o
Yeah, just like that
Restarting didn't help
How did you get the Break STActor? Did you just right click in your blueprint?
I can get a break node, but only if i create a variable with the same type as the struct, and then drag from it
Either that or drag off of the wildcard.
Dragging it off from the wildcard doesn't work for me
Also, i noticed that mine says (by ref) when i drag it off from the make instanced struct node, while yours doesn't
Shouldn't matter in this case. Right clicking on the graph should get you the same thing. 🤔
Two thoughts. Can you add a boolean to the STActor. Save it. And then remove it and save again?
Done, nothing changed
Your Class is Actor type, yeah? Not some other BP actor class?
In the STActor struct I mean
Wait, i found the problem. My struct is named ST_Actor but it only shows up if type ST Actor, with a space instead of an underline
How Unreal™
Good luck. 😄 Funny enough I'm writing my own savegame stuff atm.
My gameplay logic was working fine but i wasn't being able to save it properly, now i'm trying to find a way to store everything in a single place and use it for both gameplay and save logic
I'm a bit puzzled. Usually when my character steps onto the stairs, the Capsule position is where it should be, but sometimes, it shifts downward by the same amount as the difference between the Standing and Crouching Capsule Half-Heights, despite both the built in and my own addtional Crouching variables returning false.
I placed a few UnCrouch nodes at various key points but it still seems to happen sometimes. I noticed it works fine if he has to walk a short distance before stepping down on the stairs; usually when the capsule shift happens, it was when he was at just the right spot to start climbing down without walking to the Stair Top. It does involve pressing Down, which crouches when not near stairs, but still.
Hi guys I'm facing a weird freeze when the character collide with other actors, I can't identify the issue cause it doesn't seems to generate the crash log or anything inside the output. Any idea on how to debug this?
The issue only happens if I use physics on the character mesh
Do you have any overlap or hit event on either the player or other actors?
I tried disabling all the logic inside the actors but it still hang
I also tried in a new empty level with just one actor and this time, during the overlap. the character is being teleported at 0 location and his body bones looks wrong
still can't find what happens
You could try starting a profile before testing. It might show the function call it stalls on.
Oh I forgot I could trace, thanks! I'm gonna give a try
hey guys how do I check for when a variable changes? I'm working on a wall-run system and want to do some special thing when they chain multiple wall-runs together (like right wall, left wall, right wall, etc)
so far I have a variable that gets set to either 0 (floor), 1 (right) , 2 (left) , depending on the last surface they touched, and I want to execute some code when it changes from either 1 -> 2 or 2 -> 1, but NOT the other types of changes (0->1, 0->2, 1->0, 2->0)
this is kind of a weird question because you would sort of know when a variable changes when you change it... If you want something to happen every time the variable is set then you could make a setter function. Basically call a function that sets the variable and then does whatever check you need it to do after
alternatively I have seen some people use the built in repnotify condition to automatically call a function whenever a variable has been set. It is traditionally used for multiplayer purposes but you could use it for single player too, it's just a little weird
oh yeah I think i kinda get it , so like put the branch checking thing inside the part where the variable gets set?
exactly
just make sure anytime the variable is going to be changed you call that function to change the variable
It's good practice to always do this. You don't really want to be setting variables all over the place all willy nilly
you could replace that switch with a branch or whatever you need to check
ideally enum or gameplay tag for state.
Question
I created a spline BP for our level designer, and he's telling me that he experienced a lot of lag with it, and I'm quite uncertain what the problem may be. Do you have any ideas on what I should do to fix it?
on my computer it runs smoothly with a little bit of drop of FPS and lag will only happen after the spline is way longer
https://youtu.be/rlBt7oBVQyk
This is the spline:
https://www.youtube.com/watch?v=l5W8KdQYI7k
Today we look at a simple setup to make a spline that creates a mesh that you can easily edit for your games. for this exactly we'll use a rail track but you can use this for roads, pipes, or anything you want really!
get the project files here : https://www.patreon.com/posts/mesh-on-spline-86182540
Join the discord for any help you need! : ht...
I commonly use setter functions like this. I tend to use an event dispatcher so you can have multiple things listening and do their own thing. This prevents the setter function from getting bloated.
It'll also be a good idea to set the variable to private so it can't be changed from other blueprints without using the function.
It has to do with the editor selecting the spline component in the details panel. I assume the lag is caused by the details panel having to update the spline point values being displayed since the lag doesn't happen when the spline component isn't what's selected in the details panel.
The fix is to use this command
Editor.ComponentVisualizer.AutoSelectComponent false
or add this in DefaultEngine.ini
Editor.ComponentVisualizer.AutoSelectComponent=false```
The editor didn't auto select the component until a few engine versions ago which is why most tutorials don't have this issue
Note: the command only works for the current editor session, and will reset the next time you load up the editor. So you probably want to add it to the DefaultEngine.ini
I tried the command but it's still lagging 🫠
Make sure the spline component isn't already selected in the details panel. After using the command you might have to select a different actor first, then go back to the actor with the spline
Basically, in the details panel component hierarchy you want it to not have the spline highlighted
I sent the command while the spine was not highlighted I pressed on other actor and back to the spine and it seems to still be lagging a lot
Then my only other guess is you're maybe adding way too many spline meshes
It's worth noting that it's lagging even in that guy's video. What you really want to do is not run the construction script while moving the spline, only after. There's a checkbox for it in the actor settings.
Recreating the spline meshes literally every mouse movement is... yikes.
That would help too, unless you really need it to update during the drag
Since it's using the bounding box size you want to make sure the mesh you're using isn't too small or else it'll be adding a lot of spline meshes causing the lag
@maiden wadi @marble tusk That's a great idea, thank you very much. By the way, I'm not familiar with a checkbox to stop construction script, and I just did a custom boolean but I would love to know where I would find it❤️
Uncheck this here.
The "On Drag" one.
Counts for moving the actor, or components within it like splines or their points. Only calls the cosntruction script again once you release the mouse.
Hi, I have a problem with my Saving/Loading system. 💾 🔃
It fails to work only on the Initialize of this widget. 🖱️
I have a pure function, and an un-pure function, but they're both the same thing.
The variable that fails to save is this one... ❌
When I declare the Locked to True, then the next time I initialize that will not be properly saved at all.
Oh, and this is how im saving it btw... 🔴 Current status here: Checked to True✅ ... 💾
But on the Initialize... ⌛ ❌ it will be forgotten. 🫤👎
Hellu hellu, Ive come with a weird question. Ive purchased a simple combo pack to analyze the blueprints and learn from them. The combat is where light attacks stagger the enemy lightly and heavy attacks make the enemy fly up. Just curious, where would I find normally find such indicators, for example, if I wanted to switch that the light attack life the enemy and heavy attacks lightly stagger ? Ive found animation montage relations in the blueprint but they dont really go to any values or indicators
Usually you should start tracing from the inputs. Look for input actions related to attacks inside the player character, player controller, or any components that are attached to them and go from there
Its a bit interestingly made, ive kinda expected it to go from Enchanced input. but all light and heavy attacks and skills start from custom events
and then the animations are added as variables
from the character blueprint:
Looks like it was made with the Gameplay Ability System. I myself don't know much about it, maybe someone else will chime in
thats fine, thanks for it anyways !
Which node allows you to set the image location in a UMG widget? This is an image object
It was from texture, got it.
I have attack and interact animations and the first time i trigger them they work fine, but if i start them again they freeze at the first frame
Your widget must be inside of a canvas panel to make it move. Then you can call "Slot as Canvas Slot" and "Set Position" nodes
If it is stateful, make a repnotify variable on the player controller/character.
If it is a message of some kind, yeah, rpc
It's a different issue. I'm assigning the value of the variables manually to avoid the binding updates.
The short answer, you don't.
The longer answer, state doesn't belong on the GameMode. There's a GameState, PlayerState, and Pawns, and whatever else that can have their own state. If it's game wide, it goes on a GameState, if it's related to a player globally, it goes on their PlayerState, if it's a sort of transient gameplay value related to their pawn it goes on their pawn.
You UI then binds and listens to delegates or polls on tick to update the client's version of the state. The actor holding the state replicates it and broadcasts delegates when it changes.
Where is the data stored initially?
Sounds like a repeat of anti pattern again.
You should just update the variable, and have HUD or anything that need to respond to it, listen to it.
The extra step is the rpc to client.
The noob way 🙂
Client can just update on OnRep.
Take it or shoot your own foot.
Hi! im trying to make a simple enemy spawner that spawns a cube that moves in a straight line then gets destroyed after a set amount of time but Im a little stumped on where to set up the logic and stuck on which way to make the enemies move. Currently I have an enemy spawner that spawns the enemy in a set range. Should I build the movement logic in the enemy BP itself? also is there away to add movement to something or should I set up an on tick event that updates the location every tick?
@peak trail you relaised the variable only get send when the value changes rite?
You r sending rpc anyway. Thats extra. Making it reliable will cost your reliable buffer, marking it not reliable will be unreliable.
I would suggest Behavior Tree / State trees but I never use state trees my self.
That and followed by EQS if the A.I need to be environmentally aware (which in most cases are).
Totally honest I dont know what those are yet im super new. im working on a game where shapes come at you and you have to hit them before they get behind you. theyre barely gonna be AI and more or less be a moving collison box
Whats the difference between setting an actors location and setting its relative location?
Relative location will offset from relative object (e.g parent).
Where set actor location is world coordinate.
This is how I have it setup right now and my cube is floating diagonally left
Where do you want to move it? If you want to alwags move the cube forward, use the forward vector.
@lilac mountain cant avoid vector math here. Dive in a little and you can make wonders.
This is the gameplay screen, you can move lfet and right and click to shoot. im trying to get the cubes to come at the player
If your cube is like projectile, i would just use the projectile movement comp.
okok
Come at the player in what way? Like space invader? Again if it only shoot forward then use the forward vector.
Yea exactly like that. Im trying to escape tutorial hell by just spam making mini games
Look into projectile movement component.
Read the doc、there should be one.
Pjm comes with more flavours as such CCD.
Helps with fast moving projectile which would have been missed if you just lerp the actor.
Nu uh, no need physich for that.
I used projectile movement for my shooting and that worked fine but the enemy actor just goes straight through the floor when its spawned
Optional
sim phys is off too
Yes, yes. Overlapalldynamic
There shouldnt be any gravity changing its height tho
Ya it still goes through the floor
I didnt have that setup
now they dont fall through the floor but I also cant resize my collider now
Ye the boxes clip through the ground now and I cant pick it up in the viewport
The projectile movement seems to be moving it downwards and I cant find anything to change its direction in the projectile movement component. When I added the pjm comp to my shooting projectile it went out straight just fine
those spheres are all projectiles that move fine
Does anyone have a project idea or an active project in progress?
If you need a developer, feel free to reach out.
Im pretty sure this allowed the cube to be affected by gravity now. Ive tried turning off all gravity physics and change the velocity in the pjm to be on the X<Y and Z and they all still fall straight to the ground
i have a cool idea . gta but it's better
Hello guys, I have a question regarding Gameplay Tags.
Unless I'm mistaken a gameplay container carries all tags we set up in the game. So weapons would have tags for AI logic also.
Isn't that too wasteful? Wouldn't structs work best or at least do the same job in a more organized way?
People hype tags so much I feel I'm missing something.
Thanks in advance.
GameplayTagContainer carries only the tags you put inside of it
Tags themselves are defined in a singular project file somewhere
The biggest advantage of tags is usability. You don't have to type manually each time you want to assign some property, you just choose a tag
Hummm understood, so a missing tag would be the boolean false version.
Uh... what missing tag
For example Ai.Action.Attacking
A tag not present in the container can be considered that the container is "false" for that tag.
if this tag is not in the container than its not attacking
I see. I thought it was a big list of booleans
In a way... it is XD
Yeah right? Thank you guys!
Anything agains me using structs instead? or Gameplay tags has secret optimization or something like that?
They're different tools for different things.
Structs are for containerizing data.
GameplayTags are useful for state/flagging things.
I see, I`ll keep it in mind, thank you so much for your time guys.
A tag is basically you writing a post it note and slapping it on something
Everything else can see this note and then decide what to do with it
I think I'm getting it. Gameplay tags won't sent data around, its in the actor. A struct would actually have to be sent to the other entity
Tags are very useful for anything you could think of as "category". You can slap a tag onto something with Item.Consumable.Food.Cooked. And this simple line lets you know that it is an item, a food, and a cooked one. Each stage can be compared depending what you want.
Inventory might care only if the thing has Item tag. A UseComponent will check for Item.Consumable. Fridge will only accept Item.Consumable.Food. And you will get a bigger buff from eating an Item.Consumable.Food.Cooked rather than [...].Raw
It all depends on project needs though
GameplayTags are a variable type.
Structures are also a variable type, but it holds different variable types within it in a package.
Neither of them have anything to do with sending data around.
I mean ....
If you send a struct your sending the data in the struct
if you want to pedantic even the tag is data
If you send a gamelpaytag you're sending the data in the gameplaytag variable <_<
But strictly they don't have anything specific about them relating to moving data around.
They can be moved around regardless.
Yeah I couldve worded better
I'm trying to find a way to track an action between a state tree and a AI character BP
I want to avoid having code all over
so I wanted to handle everything inside the BP and just send a message to the State Tree task if its complete, ongoing or interrupted
and some tutorials recommended tags but i got confused on why do that, when structs or enums seem neater.
So I wanted to pick your guys brains.
A component
You put a component on your actor, lets say you want to see if your character is jumping
You put a variable(bool) in your component "is jumping", in your character whenever it jumps you set that bool in the component to true.
In your anim bp get owner - get component by class(ai component) - get is jumping
You can also use a base class without component, you put is jumping directly in the character and set it there
In your anim bp get owner - cast to base class - get is jumping
I would bet this is possible, but how?
Each map had a unique String or Text which consists of only 0 and 1's.
A event ID checks that maps variable, but is assigned a specific digit.
So what's needed is to find the value of digit 16 for example.
You get the sixteenth element and read its value ?
GameplayTags are very much like named booleans, a GameplayTag variable can only contain one of those named booleans at a time, but utilizes a heirarchy, allowing you to have something like mentioned before:
Item.Consumable.Food --- If you had this stored in a GameplayTag variable, then you know that it contains an Item, that is Consumable, and is Food, therefore you can check for these kinds of things.
GameplayTagContainers can contain multiple GameplayTag values, essentially allowing you to store many states that are also hierarchal. So you could have Item.Consumable.Food and Item.HealthGranting within the same GameplayTagContainer and this lets you know that the item is food and grants health and use your logic with that as you need.
Enumerators are roughly the same thing as GameplayTags, but you're limited to 255 options within an Enumerator as they are stored as 1 byte values, and there is no hierarchy. It can only ever contain a single value. In order to get close to the same function as GameplayTagContainers, you'd have to use an array which is less efficient for looking up and more difficult to manage.
Structures contain multiple variables. So you could have it store a GameplayTag, a Boolean, an GameplayTagContainer and an Enumerator all at once. It doesn't really do much else other than this.
Correct.
Well there you go
Structures are basically like a backpack for variables
Get substring, and subtract 1 index?
You just get the sixteenth element
Oh I see. For items it really is powerful.
I'm not sure what you mean? It's not an array. The array would be each map name. To condense the information all the events would be each position in the string. (Assuming it's a string)
Or how do you extract the 16th "element" from a string? Besides what was mentioned the sub string index.
Appreciate all you guys insights. I'm still unsure how to deal with my problem but cons for gameplay tags is much clearer now.
I have all the info to make a decision now. Cheers
If all you're doing is trying to manage a 3-phase state, then an enumerator is probably the way to go. Easy to set up. You know that it can only ever be one of those 3 states, and no need to worry about anything else polluting a GameplayTag/GameplayTagContainer. If you want to contain all the potential states of an AI in one variable, then a GameplayTagContainer with appropriate GameplayTags can handle that.
Sounds like you mean just create a struct with Value 1, Value 2, Value 3 etc. Then find the corresponding struct value?
No
You have a key and you have a value
You can search for the key at index 16
get its value
Thanks. It's probably unnecessary though. I think I will create a few Game Tag - Struct Arrays for it. Saved, Quests, Events etc. So additional information can be added (stage progress for example or unlocked). As well as simple booleans.
The value searching is one of the highest level consensning, but probably not needed today.
Lets say you have a map with
Test1 ---1
Test2 ---2
Test3 ---3
And a event id comes in
If event id is 3
you get value of Test3
That makes sense. I was thinking of it as
001 and pulling the 3rd digit.
Sorting it out. I think it will just be an array of structs. So for example a "mini quest" isn't really a quest in the traditional sense, but it works for this. The struct will allow for a unique ID, progress stage, Boolean.
In game: Pull lever, unlocks door, grants access to point A which after defeating x mob allows access to door B.
That should allow for customizing on the developer side also. Such as "pathway quest" description to help keep track.
Your answer was correct though for what I had originally asked, thanks.
An array of bp structs?
Cya in a few days when it breaks 😄
-# he's hardcore exaggerating but yeah it's way more reliable to make structs and enums in c++
If its breaking that commonly for you that often then you might be doing something wrong boss
And then it wont even give proper error messages noooo it just spills out some gargle and you have to whip out a crytal ball to find where it broke
Its always been a simple process for me. Anytime you make changes to a blueprint struct its best to recompile everything that uses that struct because sometimes the engine (for some reason) doesn't always catch it for you.
In the case that the engine doesn't catch it and prompt you to resave and recompile, then you'll get some pretty weird nonsense issues for sure. But in the last 7 years I think ive only experienced one genuine struct corruption and that was when I used a plugin
Yee.... untill your editor crashes, you boot it up again compile - editor crashes - you boot it up again - rename struct - ohh cant believe that fixed it - you hit paly 400000 errors during play, error messages dont tell you anything
Granted i havent used a bp struct in a while i started to just do them in c++ and be at peace with my life 😄
In 7 years thats never happened to me. And ive worked on too many blueprint only games lol
Your very lucky then, its a common issue as i found out when i tried to find a solution for it
From unreal engine 4.20 to 5.7 I've been coding in both blueprints and c++. upgrading project versions, downgrading project versions, shipping projects, diffing blueprints, ripping blueprints, and packaging gives and solving packaging errors. To say that it's luck that I haven't run into this struct problem of doom is a little silly especially when I have a project that has been live service for 5+ years and is filled with them
I think it depends how you use them in the graph or something.
When you change them
Yeah, for me I try my best not to make changes to blueprint structs depending on how big they are and how used they are around the project. Sometimes you have no choice but to edit them though, and in those cases. You simply just need to not rely on the engine and recompile everything that touches it manually
I'm all for pushing people to use c++ structs though, they're better in every way and almost makes this problem obsolete
it's takes 2 seconds to make c++ structs and it's not that hard to learn how to do it
Right. I only had it happen when I was new and wasn't aware of it. But following the method I mentioned stopped it from happening
Ofc c++ is better too
It's a little bogus that we had to learn these do's and don'ts with blueprint structs though haha
I don't really understand why they don't put more effort into solving the quirks
everyone engine has a few quirks and issues that need to be learned to avoid though, it's unavoidable
Hey Moxie.
What if I told you there's an easy 2 minutes way so you don't have to recompile them manually? 😉
I'd think you're selling me pixy dust. Unless there's some cool utility widget stuff that I don't know about
utility widget's have some really good stuff that I wish they would talk about more
For just 199.99$ he will tell you
Yup, it's one I made 😉
Check it out, and tell me if it actually works for you ❤️
https://www.youtube.com/watch?v=IqsSOiKnijE
We got "Fix unknown struct" before GTA6..... what a world.
My FREE Plugin: https://www.fab.com/listings/fa599c9d-6c92-4917-ae4e-7a506f5e97a5
"""Support""": https://discord.gg/aaQv8bhbFy
Forums Post: https://forums.unrealengine.com/t/unknown-structure-fixer-plugin-tool/2715731
(Make sure to check it out, it has all information you'll need.)
The...
It's free 😉
unironically I was waiting for it too 💀
wow free, I'll definitely give it a try that's awesome
I'll just first have to wait for one of my structs to break
And hey, if there's anything wrong with it, feel free to ping me here, or DM me directly. 
Mhmmm yup, though I'm not using any ""custom"" code.
It's all engine functions.
not to say that your work isn't awesome yeah
I can see you are doing something quite interesting and clever
can we crossfade between two material instances?
here's how I would do it. load MI as assets, fetch their parameters, store to struct.
drive a "main" MID with the struct.. crossfade between the values of 2 structs at once.
Is there a better way?
can you actually fetch the params from an MI?
I got a pretty dense material that I like to animate as if the parameters were synth parameters.. but turns out it takes forever to map everything.. it would be easier to just create a bunch of presets, one MI each
that's what makes me think I should crossfade MI
I need to create subsystems for my game but i don't want to use cpp. Is it ok if i just create all my functions and variables at the game instance and organize everything or there would be some kind of consequence later on?
You can just create an actor that spawns on beginplay from the gamemode
You would usually do this for managers or beacons
If you really wanted to use gameinstance you could but thats not really what its for. The only consequence would be bloat eventually
Yeah, i think i'm gonna use actors. They don't hold data, i just need to be able to cast to them anytime and everywhere
I tried with objects first but plugging world context everywhere looks really bad
I would suggest/ prefer a component.
No need to do any GAAOC, or some direct var.
(granted, not like those would make or break a game)
But i need to run logic on entities that aren't actors
Wut?
how are you gonna do that ?
Are the entities objects atleast ?
No, just structs identified by a guid. This is why i need subsystems/managers
is there a reason why you dont just turn em in uobjects ?
The data is stored in a database, and the logic would run in a subsystem. So the uobject would be empty.
I'm trying something similar to a mass entity system
Is this a legitimate alternative to doing a while loop to search for an item?
Nope.
Does it even work? Or is it just a poor way to code it?
It did work with a MAP (String - Int)
Well it wasn't a struct in that case so it wasn't breaking down that part, but it did function.
The find would look for a struct with the exact values for all properties as you have listed on the node.
So you mean Event ID 0 for example would always result
You could use a MAP which has the Quest Name as the key and the struct as the value
Yep and the completed bool being false and the Map Id being empty.
That was what was orignally created except it used just a int value instead of struct. That may be what I need though
The errors are only due to the changes in variable types. Otherwise it would like more like this
I find using custom uobjects for quest systems much nicer than structs.
Or even data assets with a custom uobject for runtime data.
You can use soft class references as the keys and makes it easier to identify what quest something is. Regardless of it's names.
I keep looking up uobjects, but the examples don't seem to convince me.
The map text or string to struct should provide all the infomation needed. I'm not sure what else would even be missing. The struct would allow for special additions such as a boolean for complete status or any other variable type.
Also a compiling question. Changing the variable types can cause a lot of errors in blueprints. Most of them will be auto found. However, in this case everything froze up and I wasn't sure why. I think it's because the specific map I tried to switch to had blueprints with errors. When the map tried to load it then locked up everything. Because switching maps saves the player data including the map it couldn't play at all after that.
How would I do a more universal find for blueprint errors?
Wait till the scope changes and you need to refactor the whole system because you needed an additional property for a handful of quests. 😉
Also the quest manager would end up bloated handling the logic for Every type of quest. Using a custom uobject allows you to offload some of this logic specific to the quest. Normally of which is just binding to event listeners and notifying the quest manager when all tasks have been complete.
But what about the overhead?
I DONT CARE ABOUT THE 10 KB OVERHEAD FFS
A lot of that data is being off loaded to instanced BP's. For example a Sliding Door BP. Each placement is it's own instance. The requirements for opening the door, display messages, etc are maintained on exposed variables for that instance.
I just got basic implementation of my quest system working earlier this week. My quest manager is a Uobject. I use data assets as my design tool for my quests which is just a few structs that I fill values of. Those I put into a SETs. On begin play I do a for loop and copy those structs from the data assets in the SET into the relevant quest maps of quest name and strut and boom all my quests then have their default values in the system
The quest system shouldn't be a part of your game world. It should sit on top of it observing.
Ultimately, bar giving or taking away a quest, nothing should really know it exists.
The "quests" I'm using are not traditional although it should work for all. Such as can you go through through portal? And what the requirements are. Those requirements and portal function exist on that instance. Where it ports to, and can you use it.
For saving purposes on permanent progress I simply need to save a minor amount of data which is what this is regarding.
My quest system doesn't have any references to any actors by design. I have my objects and interactables in the world get reference to the quest manager only if they are an objective object, and then just do the update function from it with revelant information, so it's all very self contained
Any reason why you should not just slap it in a component attached to the player ?
Also for more complex tracking, but still condensed into a single INT for example. Such as multiple switch/level positions resulting in various results. In which the BP instance would control the event. Such as the wall pathway is removed so you can down a path IF the levers are positioned in a specifc manner.
Id go with player controller or player state. 🙃 Game state if you have shared quests? 😅
My quest manager gets constructed by the game instance since mine is single player, player state is a good option if multiplayer
My only concern with using the game instance would be with it persisting across levels. Have you run into any issues when you change levels?
I'm using instanced levels so that's not an issue
I think I get what you are saying but in this case quest/event/tracking are kind of the same. I don't see much issue except for lookup putting the data on instances.
If I have 60 portals in the game it seems to make sense that each instance contains it's own data. Regarding use and where it goes. In the same manner a door may display a "hint" if you can't open it. It makes sense for that hint to be a simple text variable that is set on only that door.
If it was a c++ project I'd probably just make a player subsystem for it.
I wish they'd add a way to make them in BP.
Don't get me wrong constructing a Uobject is pretty simple but then you also need to either implement interfaces or cast and possibly pass around the reference if needed. If it was subsystem wouldn't need that extra layer of logic to do
I'm not saying it wouldn't work, just not a good way to handle it. Scalability wise it can become a pain quickly when the scope changes.
Portals should function without a quest system.
I tend to use hierarchy. I've also split quests into tasks and listener objects for reusability.
"Quest system" may be confusing the issue. It's more about a simplistic relationship between control variables and game design. For example a portal may require you have to completed a quest, or player level, etc. It's a simple validation process rather than a "quest system". Even if the data was maintained in a struct named event or quest.
That's fair. I just have objects check their data asset if they are an objective item, if true then it gets the quest manager reference from function in my BFL
Whats wrong with casting to a single object? 😄
Well the cast is also doing is valid check aswell which in this case wouldn't be necessary
Id just have an 'active' state in the portal. When the relevant quest is completed, it (the quest) sets it to true. The portal would never know about the quest, whatever it would be.
The quest quest could be for reaching X level, jumping 10 times or standing in a specific spot for X seconds, the portal shouldn't actually care.
Cast, cast and cast away. If you have issues structure your stuff better. 😅
I'm sure many of us want to do that sometimes with Unreal Engine lol
Cast to Motivation
ERROR:Accessed None trying to read property: WillToLive
I wouldn't do this, but as an example. The 60 portals all have different level requirements. When you level up wouldn't an entire data table / loop / or some method be needed to validate every area you might have access to?
silly question but when I spawn the character hes always halfway in the ground, is there any way to move it all up? capsule component is root but I don't really want to copy everything over to a different bp ;-;
Is it Shift + End or CTRL End to place on ground? Could be your placement of the object in the game.
I was literally about to ask where in the world the spawn location is
it does work but any child actors don't for some reason?
child v parent lol
moreso worried when I try to spawn them in... I could add 90 to their spawn transforms but I'm worried if that would cause issues
Drag up the right actor and press the END key should place it on the floor. A good spawner comes with a box placement. Which does multiple things including ensuring they are on the ground. Random location within box etc also.
Its weird that it even lets you spawn it in like that tbh ...
No, that would be the role of the relevant quest.
'Hey, the players have done these things, I should go set these portals to active.'
The portal then only worries about its active state.
oh I see ty, ctrl+end does work! If I'm spawning it with SpawnActor is there an equivalent? Or should I just add 90 to the transform
I got rid of the original code, but it was something like this. Just look up a spawner video for it. It's about placing the spawn at a location and determing the height to prevent that issue.
ooh smart thanks!
Find the floor. It will draw a trace up to -3000 in that case until it collides with the floor. I use that for the z axis for skills that I want to display on the ground for example.
probably a good idea to have this anyways lol seems more accurate to double check
tysm!
Spawns a niagara effect on the ground, Modified +20 in this case since the effect doesn't belong exactly at 0.
The socket is just the x/y coordinates to match the player. That z location is the height.
Personally, whenever I spawn a character in, I tend to add the capsule half height + 1 to the z location. (Assuming it's on the floor) It can help prevent them falling through the floor.
That's not accurate for that example. In the example the player level is dictating whether the player can use it or not. In all examples that data resides on the BP instance. The only thing being addressed is the validation.
In your example the validation would occur when the player levels up. Because in the example that is the requisite. Thus in order to toggle each access the level up process would need to chain through every possible enabling every level up.
It would then "enable the portal variable", but it would need to do that every time as that would be the only correlation.
While I'm suggesting when you go to use the portal it simply checks the player level vs the instances level requirement.
Another example is bashing a wall down. It would take the instance value requirement and check your Bash Mastery + (Str/12) to determine if you meet the requirements to successfully break down the wall. I know that's going outside the scope of "quest", but those are real examples.
Also one last thing. What you made makes sense, but I'm sure the separation is really possible. The main issue is saving the data. Which means it needs to be maintained in some type of array/struct. Not an individual variable pertaining to that instance.
Thus it's not really possible to separate them. Regardless of where it's assigned the instance would need to validate the stored information. So it's going to some saved structure either way.
Meaning the entire structure would be the same and the only point would be trying to separate them via when they are updated/validated.
Actually they are tied together more then that. The "quest" may already be the updating location. For example an INT that tracks stages. In which case multiple events use that INT to determine outcomes. If the progress is 4+ then (x door opens).
In that case it's not about relating it to that event as "grant access". It's a simple INT value that could effect 12 locations, but only using 1 variable to do so. Which is also natural progression for a quest. If > 6 then (event is available to move to 7)
Also things like quest text changes depending on the INT value. While all of these things are tied to a single Quest/Event variable inside the struct. The NPC in this case also doesn't need any updating. It simply uses the same validation of the INT value to determine possibly multiple responses.
And maybe a data table or excel sheet if deemed necessary for tracking. Such as Value: 4 - Opens West door Value - 6 Changes NPC Yuri text. Or in the struct itself. If there is an easy way to read the info from the editor. I'm not sure structs would do that without making nodes to print the output.
If 1 portal activated - get quest component
As quest component - int++,
if int >= 3 && stage 3 - complete quest
From what you've described it seems like you have multiple potential systems in play.
Quests and Stats jump to mind. These would save/load their own data and other actors can query the individual systems.
GetQuestManager -> QuestCompleted
GetStatsSystem -> GetCurrentLevel
As requirements get more complex, it can be better to bundle it into a single quest. It doesn't even need to be player facing. (Doesn't appear in any UI)
This can be nice because other systems can also utilize the same thing where the quest system becomes more of a global state validator.
In this case it's not really a "quest component". It's just store value. The instance can update the variable.
To me it seems like your overcomplicating things .... maybe i just dont understand what your trying to do ....
It is essentially globally accessible because the main array exists on the player. Thus any event can pull the data it needs to validate, update, determine outcomes.
The stat vs quest doesn't really have to be separated in that manner. That feels almost 100% game design related. For example, to help show the player they can break through walls they will do so in a starter map. That doesn't save, it is put into an event array though.
It's more of old school hidden areas and metroid/zelda unlock content via progression. In that case it's only temporarily saved the instance knows whether to make the wall visible and collision.
However, some could rely on a quest which is more of a scramble. Talk to X NPC, kill x, get x item, Unlock X door, Talk to Y.
@narrow kite
Is this what you want to say in essence ?
I think the quest state should be saved centrally, for example as an integer or struct.
Then doors, NPCs, and events can check that value when needed.
For example:
Progress >= 4 opens the west door.
Progress >= 6 changes Yuri’s dialogue.
Progress >= 7 unlocks the next event.
So I’m not sure it makes sense to fully separate quest progress from world events, because they often depend on the same saved state.
I think the main thing to emphasize though is utilizing a single INT variable to control 40+ events while only saving 1 single value. And stemming everything off that. Instead of a mash of variables.
That is correct, but the game design itself can over ride or dictate things. For example a portal might be restricted by level, or part of a quest, or other factor. So in some cases it's a quest objective while another portal may not be quest related at all.
Also things like Progress >= 8 "Spawners will create these mobs"
Which don't exist otherwise, but again all ties back to the same INT
Also there are some distinctions. In the case of "breakable walls" it's not part of this system. It's a good example though.
- It establishes the player can break walls and should look for them
- It's fun to break into areas and see the effect
- It utilizes and helps the player understand the value of STR + the Vocation Bash
But in most cases that's just a fun little event to find a hidden grind area or shortcut
But why does the quest system need to know about specific actors is what i dont understand
Like cant the spawner not just have a set rquirement
It asks the quest system - are the requirements fullfilled? and if yes it spawns enemies
Seems more modular
That depends on the circumstance. For example a portal requirement may require a quest line. The spawns could change depending on quest progress. NPC text etc.
It's can in cases be used like an old school JRPG system in which you are locked out of areas intentionally until you follow the quest line
I agree with that, but I think that still fits the requirement based approach.
A portal can require a quest line, a spawner can change based on quest progress, and NPC dialogue can check quest stages.
My point is just that the quest system does not need direct references to those specific actors. It only needs to store and expose the quest state. The portal, spawner, or NPC can own their own requirements and query that state when needed.
So it can still support old-school JRPG-style progression locks, but without the quest system directly managing every world actor.
You could spawn gaurds that won't allow access until quest conditions are met. This would use the same systems as discussed.
That is what's being done. Patty's main point was trying to tie the data to the event. Which in many of these cases may not be feasible.
So the quest would "unlock" the portal for example. Which makes sense, but may not be needed.
Well one of the points. Patty will speak for himself I'm certain 🙂
It would depend on the quests but i'd argue that a quest system would need to know about a lot of actors. Some of the best quest systems I've made rely on event dispatchers which only work if the quest can get a ref. Of course there's ways to tag and get these actors without making a specific reference such as an actor manager type thing.
I think there is a strong value in "instance cheating" to save data in a sense. Because they can hold unique information. Such as the text response, hints, multiple out comes, visibilty, etc.
That was part of the first order problem though. How to manage and track so much information in a small amount of variables.
With a simple label/text/string attached to an array of structs all the save data can be pulled.
Im trying to wrap my head around a good architecture, both dont sound too bad, i have not done that amny quest systems so im unsure what the best way is
What would come to mind are more generic events in the quest system with a identifier "enemies killed input stage X"
For example
That's why I wanted a struct instead of just a map value. So more specific data can be handled.
But event dispatcher might work just as well
Even dispatcher would still need to pull the data. There is also a major difference between saved or temp info.
Instance Blue Prints could handle most anything. Change lighting, spawn special mobs, change assets.
Uh. From what I followed in this discussion it all just seems to end up at "it depends". It is better to just do the thing and see if it works instead of theorizing for hours, I think
You could use old school cheats and load a different copy of a burned down town
Not quite. The "how" is essential for this. And also why (why/pro's cons)
If you just did a string variable for each quest that would result in major problems. Such as a massive list of variables, and how to save them.
To me though, I don't think quests would normally generate much of their own data. In the event it does, its normally just an int or a float. For these, I just convert to a string and append together. The string then gets stored with the quest class during saving.
Like this.
That's really not much different. It does include a few key aspects if they are used in a game though. Such a quest completion list or ongoing quests.
I could place an Objective text in the struct for that though. And Status (ongoing, complete, na) etc.
Since some of mine may be more of puzzles than traditional "accept quest". Such as randomly finding a door and being given a hint on how to open it. That instance will give you a clue, but could also update the status to ongoing.
I presume you blocked that off as 1-500
PattyM suggest Uobjects so much my spidey sense thinks he might have a sponsorship with them 😉
For me I think id still handle it as a quest but one not visible to the player.
The door would have an overlap event that would add the quest. The quest would then keep track of what the player needs to do to unlock the door. Plus, you can have some sort of quest/task initializer event that can set the scene as it were. In the screenshots, I have one task enable a door so it can be interacted with then a listener that is informed when the repair has been made.
If the above would be a frequent type of quest, I could expose the tag used to get the relevant door so it can be subclassed.
UObjects are awesome. 😄 Actors are uobjects, Actor Components are UObjects. Even the actions you can perform in BT's are uobjects. 😛
I wish there was a way to make them default to instanced (when required) without C++ though. :/
I will way it's interesting to how different people approach things, like with quest systems we've been talking about
That would only require minor modifications that probably needs to be done anyway for player convivence. The door already has a collision overlap box which pulls the data and responds.
A -- It opens
B -- It posts a hint
I can simply update the struct to accommodate quest tracking
It is interesting. The hardest part I find is understanding the reasoning. It's not always easy to get the vision in a 30 minutes conversation to know why some choose to do something a particular way.
I'm too indecisive at times so I try to make my stuff as flexible as possible in case I change my mind. 😅
because they are awesome
The single best thing in the engine
Super easy to work with
Cheap
Wont break
Its like a Cow - chicken - sheep
These are the main classes for my quest system, 3 of which are uobjects.
That can be said about almost all the aspects at some level. A MAP, struct, data table, enum, array etc.
A struct is annoying to work with and prone to breaking
A map can only hold a key and a value
A uobject can do everything you want
Data Assets are just single instance uobjects. (like static meshes, textures etc..) Its nice to have helper functions to get specific data.
Technically maybe, I break structs quite often 😉
Get - variable you want
with a uobject
This is the sort of stuff I try to avoid. It's bitten me too many times. 🥲
It wont get any more convinient than that
I have heard of a few issues, but honestly never encountered a problem with them.
Yea it doesn't happen very often but when it does it can be a nightmare.
Plus you can add functions to C++ structs.
If it needed to be exposed to BP i think I'd struggle to pick lol.
BP structs are fine but you just have to avoid doing certain things otherwise very good chance things will break eventually
u objects all the way, every day
i just don see any pro that a struct has over a uobject
besides the minimal overhead in the object
One thing that I like about structs in C++ is you can have pointers to them. Unfortunately, you can't in BP. Its always a copy. 😕
C++ structs are better for sure there's no doubt about that
Does this apply to that?
Yeah, refs for structs are wonky. It seems like they exposed some operations but not others so it often breaks the link at some point anyway
Sort of but that's only for the specific index in the array. Once you try to store it in another variable it becomes a copy. You can use the (a ref) version and 'Set Member' to update the values in the struct in that specific index in the array.
Also I'm too in the club of never using BP structs after way too many issues with them
Maybe I got lucky so far, but this does update the value of the struct
Yea, in C++ you could store a ref to the actual pointer and pass it around if you needed.
I still use BP structs but try to keep them small and get very nervous if I ever need to remove/rename a property. Most of the time I'll just leave it. 😅
I was recently thinking about adding a little quest system to my current project. Mainly for collect type quests. I still need to decide how I want to handle it.
Flowgraph.
After you get used to it, it is just way too easy to add the struct as C++ class
References in BP are a lie.
True, plus you can always create it in BP and look at the header preview.
serializing is kinda pain tho
Ok, that the only really annoying thing with them
i just made a savegame object and use them as uobject but i think it will break gc
How so?
with pure bp
RIP
i hate it when 90% of serializing stuff isn't exposed to bp
im doing it like this, but i think bp constructed savegames won't get gc
Yeah. Specially since it's literally about 22 lines of code including the header, to save and restore an object. Or more accurately to write an object's properties to byte data, and then push byte data to an object. Doesn't necessarily need to be the same object, or even the same class to work.
i wish i can do this but im mostly modding game and i can only use bp 😭
They'll be collected if nothing references them. They're like any other UObject.
oh thanks, didn't know about that
I once made an inventory system where the inventory was a SGO. Not a bad option if you only need something simple.
A weird idea I've had is to use data assets as global properties. You just need to be aware that changes persist when playing in the editor. (granted you still need to actually save the data asset)
Hello, I have a custom Stat component that handles health and death among other things that I added to the base enemy BP in my game, I have set some logic for the "On Death" event of the enemy base and I want to call it with more logic on one child of it, the issue is that the event didn't appear by itself so I had to copy paste it from enemy base but now I don't have the parent On Death like begin play have Parent begin play and if I try to find it it finds nothing. How can I call the logic from the event that is in the parent in the child's on death?
Right click the on death node and add parent call. Having said that, if it's an event dispatcher, it should appear in the function list to override.
or add an empty event to the parent and call it in the ondeath. children would override this event - in case you need something done in the middle of parent event
Athough, with it being an event dispatcher, you can technically add a new one to the child and it'll call both anyway. (treated as two bindings)
add call to parent function is greyed
but I added it in the parent before adding it to the child
Recompile the parent then the child if you added it recently
Although, it being the event on a component... I never tried using call to parent outside of the thing the event belongs to
Hello everyone,
I’m trying to create a crack system using HISM, but it’s not working properly. What could be the reason?
I also asked Claude, but I didn’t get useful results. How can I implement this correctly?
What is a crack system?
Ah. Your issue is that you're using decals. You don't want decals. You want to set per instance data on the HISM instance and let your materials overlay a crack.
yea
I'm trying to add a decal to break a player block, but I just can't seem to do it xd
I show all the codes until the end of the video.
I mean, if you're dead set on using decals, it looks like your decals are too deep.
Adding things to HIM is very difficult and frustrating; there aren't even any resources available. Is there another good solution?
Need a few to get my editor open. Messing with code atm.
I wait u
Testing it with MAP Game Play Tag - Struct
I presume that will tie the Struct data to ONLY a specific tag?
Do you have a way to get the HISM instance at the grid position?
If you're talking about the system I created, it takes a long time to do.
I'm not sure what you mean?
HISM instances have an instance ID, an integer. Usually you'd map your XYZ IntPoint or whatever to one of these, so you can reference the HISM instance.
Are you asking if the Find will get parent tags as well, or only that specific tag?
That is makes a proper 1 : 1 ratio. Each Tag will contain it's own Struct data.
And I'm sorting out how to update the info in a struct (which should be tied to a specific game play tag)
Set member in a specific struct would be all that's needed in just a struct. However, because it's a map it needs to be asscociated to a specific tag. If it works the way I'm expecting.
Find returns a copy. Alter the copy, Add the copy back to the map with the same key.
Bit brutish, but BP is not nice with map data handling.
It's already heading in that direction, so I think you're giving irrelevant answers.
I think this would do?
That should find the struct using the specific game tag. Create it as a variable to reference. And then use the reference to update it?
Not quite. You still have to add it back to the map. Right now you're essentially doing...
StructCopy.Progress = 2;```
So to finish it you need to
MasterQuestArray.Add(QuestTag, StructCopy);
Sounds like you are saying it's more like this?
That should work, yeah.
When that's done without a MAP you don't need any of that. The set function by itself updates the struct.
The break seems like a ref not a copy
I could test it. If I can get things working. I blew up the project temporarly. Until I resolve some of the data changes. The game will just freeze.
I'll fix the grammar error while I'm at it
reference to the struct that you are breaking, but the struct that you are breaking is the copy of the found or default constructed value from map
map find returns a copy
I have to fix a few things, but the level does activate and updates the information as needed. If you try pull the lever a second time you get a message that it's already activated. When you go to the door it opens after the lever.
I pulled out the lever to adjust the hit box
completely out of the loop here dude, i just came to fix one misunderstanding
Just saying it works with the nodes above
That does point back to the specific map/game tag/struct though. Not just the membership update on the struct.
yo I need some help with a problem I am having, wondering if anyone would mind sitting in a call to check out my blueprints (a little too much to show in screenshots) . Been troubleshooting for 2 days and have no idea what I am doing wrong.
Depends what the issue is
it has to do with status effects and applying them to enemies. I can apply frost seperate from the other effects to an enemy but when I apply frost to an enemy that already has another effect on them it hard crashes.
Need a little GAS in your life.
idk GAS just seems like too much for what I wanna do
GAS is kinda perfect for buffs and debuffs. It just doesn't have continuous effects, only discrete.
Everyone says that. Then they need attributes. So you tell them to use GAS. They say they don't need all it's features. Then they need trackable removable buffs with states. So you tell them to use GAS. They say it's just too complicated and unncessary. Then they need a way to grant generic abilities to things without tying them to specific classes. You tell them to use GAS, and they're three years into their game and would love to change, but just can't consider putting in the effort to do it at this point.
why are people so reliant on GAS tho
Because it doesn't crash when you apply the freezing GE when something already has another GE..
GAS is pretty good at this stuff.
That's why.
If you don't want to rewrite GAS (because you will end up doing this) then just use GAS. It has most features people want.
I just seems counter intuitive when I already have a "working" system but this crash makes no sense
It's not a matter of reliance. It's a matter that it's a nice generic ability system with attribute, effects, abilities, and cues. It's already done for you and ready for you to just start using. It's a common framework that a lot of people already know so getting help with it's features and implementing things in it is easier.
Indeed. Tutorials be eerywhere.
Uhh free consulting
sounds awesome 😄
welcome to the internet
This thread is very good for answering a variety of complex issues. However, it's done with proper questions and images. So they can quickly be reviewed and addressed by those that wish to assist. Asking for personal help generally isn't fruitful here.
If it turns into actual work where you cant opt out whenever you want it gets annoying ^^
even just dming with someone becomes annoying fast
afterwards they use you as their personal help bot
real easy to ignore those people, If someone I asked for help said they dont wanna help then thats that
just show the bit of code where it's crashing
thing is im not sure what is freezing but it stops executing when it reaches the "Trying to freeze" Print String in BP_StatusEffectComponent
noooo I hate when my execution lines are easy to follow and organize
You really oughta rethink your approach here
Are your status effect actors polymorphic, are they all some subclass of BP_Debuff?
Do you mean the string prints or not?
Also did you check it by adding breaks (except inside the loop, breaks don't work correctly in loop) on each consecutive node to see at which point exactly it stops?
all status effects are child actors of status effect base
which is just a normal actor
Im close to just having an "does X status effect" bool for each effect on the weapons
Arguably the base wires are easier to follow because curves are more predictable, you don't have to follow them to guess where they are going. But it is a personal preference I guess
How many debuff types are you trying to have and how different are their actors, do they carry different particles effects and sounds and such or are they just containers for what could be a tiny bit of data?
the stauts effects usually just contain the Niagara system they want to change the characters System to and some nodes for applying damage or in this case ice buildup
for example here is my burning effect that works
to be clear the ice effect DOES work it just crashes when applied to someone that already has effects
Whenever you see the same code repeated with tiny changes that's a clue to do something different.
but same thing doesnt happen when I apply fire and poison. They both work in that instance
but its not the same code? each effect has different code for what it should do
here is my poison
exact same shape
this is objectively wrong
just have the one loop, checking how many instances of STATUSCLASS it has, spawning STATUSCLASS
electric nodes are the most beautiful graphs in the industry
not saying blueprints are good to be clear
How can personal preference be objectively wrong
Oh yeah that's gorgeous, let's just collide everything and make it impossible to follow at a glance
90 degrees manhattan style is dumb
user error
45 degrees sharp corners is so much better then splines
i can't believe im saying this but curves are just fucking ugly in 2D
I will try this and get back to you
usually im all about curves this is the solitary exception
subway grid > spaghetti
You may not like it, but this is what peak BP looks like
It is stupid that exec nodes aren't all at the same height within a node, but I prefer top left corner to be on the grid
Hahhahaha
Its just a different kind of ocd
THE LINE IS NOT STRAIGHT AND SO MUCH CRISSCROSSING
THE LINE NEEDS TO BE STRAIGHT
MAKE THE LINE STRAIGHT
Doesn't matter, everything for each execution is self contained. You can zoom in and see what every exec depends on without having to follow any spaghetti across the plate
they really messed up making data and execution both flow left to right
this just looks messier to me idk
Same shape. 😛
Fix it
It's just a lot of code and very dense, here's the same thing once translated to C++
I really need to learn code...
I hate seeing people use get blank with an index node.
Ah ye... the pleasure of cpp which just looks like a block
My c code looks like art compared to cpp
Does its job, top to bottom, and fast.
Here's 128 instances of the tire model in debug, don't remember the timings but it was well under 1ms for the sim
Let's see some.
void load_images(t_g *game)
{
int width;
int height;
game->wall_img = mlx_xpm_file_to_image(game->mlx,
"./tiles/GroundTile01.xpm", &width, &height);
game->floor_img = mlx_xpm_file_to_image(game->mlx,
"./tiles/BackgroundBlue.xpm", &width, &height);
game->collectible_img = mlx_xpm_file_to_image(game->mlx,
"./tiles/Cheese.xpm", &width, &height);
game->exit_img = mlx_xpm_file_to_image(game->mlx,
"./tiles/ExitPortal.xpm", &width, &height);
game->player_img = mlx_xpm_file_to_image(game->mlx,
"./tiles/Player0.25.xpm", &width, &height);
if (!game->wall_img || !game->floor_img || !game->collectible_img
|| !game->exit_img || !game->player_img)
{
ft_printf("Error: Failed to load one or more images.\n");
exit(EXIT_FAILURE);
}
}
void init_mlx(t_g *game, int rows, int cols)
{
game->mlx = mlx_init();
if (!game->mlx)
{
ft_printf("Error: MiniLibX initialization failed.\n");
exit(EXIT_FAILURE);
}
game->win = mlx_new_window(game->mlx, cols * 32, rows * 32, "so_long");
if (!game->win)
{
ft_printf("Error: Window creation failed.\n");
exit(EXIT_FAILURE);
}
}
void locate_player_and_collectibles(t_g *game)
{
int y;
int x;
y = 0;
while (y < game->rows)
{
x = 0;
while (x < game->cols)
{
if (game->map[y][x] == 'P')
{
game->p_x = x;
game->p_y = y;
}
else if (game->map[y][x] == 'C')
game->collectibles++;
x++;
}
y++;
}
if (game->p_x == -1 || game->p_y == -1)
{
ft_printf("Error: Player position not found in map.\n");
exit(EXIT_FAILURE);
}
}
..........................
Minilib x sucks hardcore
Ifanyone ever thinks about using mlx for anything .... just dont
That's just a bunch of small scopes really
most of my code looks like that
just the business end of physics devices can get real big
We had some insane restrictions
Functions cant be more than 25 lines
Cant declare and assign variables on the same line
I have this swinging arm overlay for my character, and while the animation plays the arm never goes back. I have the branch filter correct I belive yet the animation is not playing correctly
here's a gearbox model. Has 3 connections, rotational input, output, and a signal to shift the thing. Looks more like the typical nested code.
cant do that either
Line too long XD
Have you ever tried to write a function with max 25 lines without for loops without declaring and assigning on the same line and lines can only be like 40 letters wide
hahaha
That breaks your brain
Yeah, in 1997, in BASIC
why max 25 lines?
Their reasoning was, they want to teach us to write efficient code, they want that we really think how to do something
Tell them they are dumbasses
So I did the thing, but tell me how CharacterBase (Set in EffectBase) can be invalid for one effect but valid for the others? (I dont like using delay nodes but had to to make the cast valid)
Most of the time i was just fighting with this idiotic norm
Clean code is not efficient code. Clean code is shit code.
The rules were more strict than at nasa hahaha
Code that's like a choose your own adventure book where you gotta chase symbols all over the place sucks. Just write the thing to do the job top to bottom, and break out functions if it makes sense.
Clean code: Gee, I wonder how many virtuals and function call overheads we can make them suffer before they abandon this shit philosophy.
0 external libaries, if you want a external function you have to write it yourself
From scratch
Hm, not sure if it was asked. Why is the effect an actor and not a component?
Although to be fair nobody knew where speeds were going in the early 90s
umm idk, the Component is the manager which spawns the effects on actors should I make the effects components?
I wouldn't. But what you want is a way to modify an existing effect instead of just adding more actors.
As a dirty hack (since BP classes don't have static functions AFAIK), just spawn the thing, tell it to apply, and let that be the end of it. Let the effect see how many stacks are there and modify the existing (destroying self) if there's already one.
Virtuals would be AWESOME if computers actually performed like they do on academic CS paper. But they don't 🙁
Yeah, what Adriel said. Attaching more and more actors can get a little heavy
its not like the actors stay on forever they get deleted when the effect is complete
Especially that spawning an actor is also not a light operation
ballpark how many at once? 3, 10, 100?
well max that fire can go to is 24
ice and poison 1
well I have ice at 99 for debugging currently
thats a lot
Even then, you got particle effects clobbering each other, sound overlapping, etc.
the particle effects only effect a single system on teh base player
instead of spawning more systems
oh in that case why have actors at all
have a map of SomeIdentifier -> int
and drive it all off that. A poisoned burning frozen guy might look like;
Poison : 3
Fire : 5
Freeze : 12
so just dont spawn actors and handle all the logic in the status effect component?
I guess that makes sense
There are many many ways to do this
wait i got a nice simple setup
since your visuals are off on their own anyway
have an actor for the actual timed logic etc, but don't spawn it right away.
the applicator looks for an actor of EFFECTCLASS and adds 1 to its stack count if it exists, spawning it if it doesn't. The stack count lives in the effectactor
so you'd most have 3 actors for your 3 status effects
each of which manages its own logic, timing, and stack count
ApplyDebuff(DebuffClass) -> does target have a DebuffClass on it? -> Y -> add 1 to its stack
-> N -> spawn and attach it or whatever
TBF even in GAS you'd spawn an actor just for designer ability. Via cues. Make the effect stack, make it have an associated cue that spawns an actor that can get the stacksize and tune it's emitter parameters for the stacksize.
as a bonus visuals can go live in the effect again instead of having to have some polymorphic visualsmanager. A few actors is no problem, you just don't want gobs of them and especially not multiple of the same type.
I fear I would just get into the same issue in the effect actors with setting their attached actor variable
have an array ActiveEffects on WhateverEffectsCanBeAppliedTo
ApplyEffect(EffectClass) -> for each ActiveEffect in Target.ActiveEffects -> if ActiveEffect.Class == EffectClass -> ActiveEffect.AddAStack
-> SpawnEffect(EffectClass) -> add it to Target.ActiveEffects
You can have the management of Target.ActiveEffects happen on either side, doesn't really matter.
either applicator calls Target.RecieveEffect(EffectClass) which implements the above logic or the applicator can handle it all and target does nothing but sit there and take it
depends on if you want the logic to live in whatever is handing out effects or whatever is recieveing them
I'd say the receiver. Let any old thing just call Whatever.RecieveEffect
ok so unrelated to crash which I will test once I get the other effects up to date with new system but is this sorta what you were talking about?
(also that cast to node isnt good I know but I just did that for quick itteration)
this does work with the fire effect so far
forgot to include this
dont get attached actors
foreach over Target.ActiveEffects
Are YourBaseCharacter the only things that will have these effects applied to them?
Not at the PC rn but yeah base character mainly, I would have different implementation of some effects like freeze for enemybase (which is child of characterbase) so I can pause AI logic
Is there a way to make Set Timer by Function Name only begin when a certain condition is met? (while only firing the IA-Event once, rather than constantly triggering)
I'm trying to make a slide where, for the first 1 second of sliding, theres no friction, then it turns back on after 1 second.
I want it to only start counting up the seconds if the player is on the ground, so if they begin sliding mid air, it doesnt take away from the 1 second of no-friction until they hit the ground
I already made a previous version that works exactly like this, but it was more primitively coded, using tons of branches and a manual timer w/ multiple variables, So i'm trying to redo it with Set Timer by [...], but idk if it can work like this
?
You mean a branch infront or in the timer ?
if (not in air) - count
I have the IA_Slide set up with a "Pressed" trigger in the file so it only executes once when you hold the button down
if I put a branch in front of this Set Timer I assume it'll just check the time on the set timer once & then do nothing since it would be false (since the timer did not start yet)
I mean like, can I make this Set Timer node wait until you touch the ground before it fires (while only executing the IA_Slide trigger once
or do i need to set it to constantly trigger
also I did already specify all of this in the original comment btw
"Is there a way to make Set Timer by Function Name only begin when a certain condition is met?"
Yes if you add a branch infront of it
Ok I tried it and it did not work because the IA_Slide only fires once (like I said 3 times now) because it is specifically set up as a Pressed Trigger rather than constant (which I would like to keep it that way)
so when it checks the branch, only once, it returns false, and the timer does not start
......
Cant you just show your code ?
is this all you have ?
its hooked up to the trigger so it should fire nonstop
No idea how your begin slide looks like
Ah i see pressed trigger nvm
these two are being used, except the "SlideTimer Start / End" variables aren't doing anything since they're still a holdover from my old version (havent deleted them yet)
OK, new system and everything else seems to work fine again but when I try to add a freeze effect it is telling me the Character Base is not Valid. Which it IS valid for the other effects so I dont get why it could be invalid for this one. (I tried some solutions in freeze BP already with the cast nodes but that didnt really do anything) Getting CAST FAILED print string on freeze....
ok wait I figured it out, my CharacterBase var is not being set before freeze is executing. I will probably will just wait for effect execution until charbase is set in effect base by using functions instead of beginplay on the effects
Do I need to change it to be a constant trigger or is there like a "Wait for [condition]" nodethat would work with pressed-trigger
idk if ithe whole thing would break if I switched it to constant, but I think i'd probably have to rework it in some way if I did
Not directly ...
The setup is weird
If you want the timer to start specifically at the time when a condition is met you need a new event
Or a event dispatcher
And you call that event when the condition becomes true
So your movement comp would have to call the event
you can check on tick but thats dirty
you could also setup a check timer that checks ever 0.x seconds for the condition
after you pressed the input
actually I just thought of this too, I think this might possibly work
ignore the custom time delay macro , its basically just normal delay but works when time is dilated
thats in essence a check timer
just with a delay
The only problem i see with it is that you cant clear the delay
oh wait does my loop thing keep running when the key is released
there pretty sure that fixed it, IsSliding gets cleared when you let go of key
(it is getting progressively more convoluted)
i placed a print node right between the False and the Reroute and it doesnt print at all, but it still works somehow
ok so it does loop forever but only if I start sliding while in the air
wait nvm not forever, only until you touch the ground
once the branch is true it stops
but if it doesnt become true it will run untill you press input another time
I find it funny that the whole point of me remaking this mechanic was to clean up the messy code from the old version, and then it immediately became messy again
life
italian chefs be like
The mass amount of cross execution state there makes me want to detonate C-4 on that thing.
Haha and the 4 random comments in this piece of garbage 😄
I think i have created the most useful function ever conceived
"Variables" aka the only one who survived from the previous version
In cpp this would be clean ^^
a proper setter
Hey everyone, I have what seems to be a perfect ATV vehicle according to my tastes, EXCEPT: the sideways friction forces just get really oscillate-y and swervy at high speeds and I haven't figured out how to fix it yet without adding a whole undesired layer of complexity to the physics. Can someone help me figure out what is causing this swerviness at high speeds? I have a link to the sideways friction forces blueprint and a video of the effect itself.
https://blueprintue.com/blueprint/igsi87so/
https://drive.google.com/file/d/1WSNwgyBwuqpaoq51RxnwVNAS4M8xKnIU/view?usp=sharing
wait, I think i saw this question somewhere previously 😂
Haha in the would you rather subreddit
Hello can someone please help me with an error I am facing?
Im facing a problem where when i pick up the gun the character doesn't switch to gun animations
Please dm me if u can
my brother, all of these are already gettable parameters
This is an unreadable rat's nest but my hunch is that this is your problem
I tried to use a physics constraint between the capsule and the mesh to stop ragdoll bodies from flying away and keep them consistent when I simulate physic in multiplayer, but it’s not working.
When communicating between actors, do you guys like to access components on other actors using these, or prefer to add interfaces on the actors and not access their components directly?
I thought I would always use interfaces on actors, so seeing these functions exist I questioned myself
If you need some generic/ specific use stuff, I do interfaces. (say like UI text info, that'd be slightly unique per actor)
But, if its something more global (such as like health/ stats)
I just access components directly.
Neither. Library functions. Actual API. That's what your game should be using instead of direct getters or interfaces. If the library function uses them internally that's whatever, how the system works is up to the system, it's not the consumer's job(even in the same project) to figure out how to access your system past a generic API.
That didn't answer there question, of when each should be used, or why.
Cuz, interfaces are functions only, and no default code.
So, if its something more unique to each class, or only a small amount of classes have it, interface makes sense.
While a component makes the most sense if a ton of different classes share similar, or exact same logic, and need vars, and such.
Fair. I just took "communicating between actors" as like "What would I prefer to do from a line trace for some thing."
Depends a bit. You can get far with the GetComponent(s) functions, but they have limits. If you are always sure that a given Actor either has the Component or doesn't have it, then GetComponentByClass works well. But as soon as you have a case where the Actor you deal with needs to retrieve the Component from another Actor, you run into problems.
E.g., let's assume you have some HealthComponent. You put this onto a given Actor. Now that Actor, however, spawns some other Actors runtime, which are sort-of owned by the inital Actor. Let's further assume you want to damage the initial Actor if any of the spawned ones are hit.
If you simply do GetComponentByClass<HealthComponent>(), you'll get a nullptr back and your system might think that the HitActor isn't damageable.
If you, however, use an interface, then the HitActor can implement that and ask its Owner for the HealthComponent instead. That way you always get the right HealthComponent.
Encountered a lot of cases in the past. Just can't come up with a good example atm :D
I never thought about the issue of multiple actors sharing info. (But, I also can't think of any game that does this off the top of my head)
I've only ever seen a boss with multiple health bars (multiple heads, body, legs, etc for big bosses)
Technically the way I coded my stuff could support it, on some cases (most specifically damage)
Well, you could for example have a building system, where the built Actor has the HealthComponent. That built Actor might spawn other Actors, that make up the building or add custom functionality that is reusable (e.g. a door). Damaging those extra Actors should damage the building as a whole. That would be another example for this.
Oh, thats a valid case.
Just most games I play either have the entire thing be 1 actor.
Or, each actor does have a unique health, and destroying a core piece just destroys the rest, cuz its not held up anymore
Yeah, obviously "depends" on the game. It just happens more often than not, and it's not necessarily limited to something like a HealthComponent of course. You might come across it, you may not. I recently had it that people were expecting the HitActor to have a specific Component, but the design of the system by now changed and allow such "owned Actors" to be hit instead.
All the more reason for a solid API. 😄 Game code damaging the actors without a health component shouldn't need to change their callsite. Shouldn't care about the component or the interface. Then you can make whatever system changes you ever need to make the system work in whatever way you need without having to fix a billion callsites.
Lots of "should" (not literally). There is probably a world where there is no need for any should and the code is always perfect. I'm afraid it ain't this world though.
But still worth repeating constantly in a channel like this frequented by the newer people to coding in Unreal who rely constantly on shit Youtube videos telling them just to interface their interfaces to an interface to avoid casting.
Sure, but I doubt they actually know what you mean with "solid API". It's not like they instantly translate that to a correct solution. Googling that will probably also not help much. Might be worth a blog post with examples :D
hi everyone, The AI sometimes circles aimlessly around the point and can't reach the NavLink, I increased the radius to 111 and it still sometimes circles and can't reach it
someone can help?
Hello!! It's my first time using unreal engine and I wondered if someone could help me out? I want to implement a mechanic into my game where- if you click a button on the bottom right of the screen, it brings up a piece of paper and the player can type things on there, and there's check boxes that the player can check. Here are screenshots of the code :) I'm running into a problem though. When I open and then close the notes, and then try and click on the notes button again, nothing happens. Is anyone able to tell me how to fix this pls? Thank you sm!
someone can help?
- I have nav mesh
- Destination is Cube (Actor Location)
alwyas is aborted
it doesn't even work with that
Always Fail
I would try to disable the "Affects Navigation" setting of the cube mesh, cause it's currently cutting into your nav mesh
"Can ever Blabla Navigation"
Iirc
You can do what the person above said or make them move like right next to it (but not inside of it)
I tried to use a physics constraint between the capsule and the mesh to stop ragdoll bodies from flying away and keep them consistent when I simulate physic in multiplayer, but it’s not working. What did I do wrong?
How would I go about making a playable arcade machine in my game? I have the widget with the mini game in it that works and I have the arcade cabinet I would like to use, but I am unsure about how to set it up in a BP so the player can interact and play a couple of mini games in it.
yall whats wrong with my blueprint, everything is good but the drain for the player 2 is faster than player 1 or the host im lost
because you shouldn't do it like that
Is Battery visible to the client or just a behind the scenes thing that determines when the light goes out?
It can be this simple:
Input -> run on server
run on server -> set bSwitchIsOn //not the same as bLightIsOn
Tick/Timer -> if has authority -> update Battery based on bSwitchIsOn -> set bLightIsOn based on Battery and bSwitchIsOn //bLightIsOn should be replicated and repnotify
OnRep_bLightIsOn -> actually turn the light component on and off.
half the code, and it'll work
no its behind the scenes the client cant see it
You should only update the battery value on the server and have it replicated. Possibly with a rep notify so the client can update visuals.
Your current going from client -> server -> client -> server -> client.
The client should ask the server to turn on the flashlight, the server handles changing the values and replicates them. Client updates visuals when value changes are received.
"Bruh. I just hotjoined your game, why's it so dark, turn on your flashlight."
lol i fixed it thanks yall
Then what I posted will work just fine.
Should 'on-demand' widget classes generally be soft object references instead of hard ref's? I imagine any widget that needs to be on-screen all the time like a hud would be a hard ref but things like a pause menu, settings menus, in-game scoreboard ect.. are those types better off as soft ref's?
And just in general on soft ref's I imagine they add some latency when loading the thing, does that effect replication versus a hard ref?
It can depend on a lot of factors. Like where the hard ref is, how big it is, etc.
For a pause menu, it probably makes sense for that to be a hard reference from something world specific (like the hud). As opposed to a hard reference from something that is global to the whole game. Perhaps the pause menu has soft references to expensive sub menus though.
If the scoreboard only comes up at the end, a soft reference makes sense.
And if latency is a concern, you can always try to load it pre-emptively close to when you need it instead of immediately when you need it.
For UI, I don't believe replication is an issue. Generally UI's are local and represent replicated info and aren't replicated themselves directly. But I don't know a whole lot about MP stuff.
your networking shouldn't know or care about UI
Yeah I know in the case of UI, but in general for other things like actors using soft references, does soft ref's typically impact replication in any way or do they work the same way as a hard ref would do?
How often are you replicating this?
And you should never be replicating soft references to widget calsses over the network, really.
It isn't a scenario that I have actually ran into as of yet but I'm just wondering how they would work down the line for when I do eventually run into it lol
Yeah although I'm not talking about replicating widgets specifically, I know they're local so don't need replicating themselves but I mean other things that are using soft refs
I can't imagine any widgets being big enough to care about with that. Unless you have a widget that hard refs every mesh in your game or something like a bestiary
If it's settings and stuff what is there to load? It's just text and numbers and hooks into classes that should exist already.
I'd rather burn like 500KB holding the scoreboard BP in memory than wait on it to load every time I open it.
Is the load time that long typically? I haven't really had to use soft ref's for anything as of yet so I'm not familiar with their typical load times which I imagine depends on how big the thing being loaded is.
The reason I am actually looking at soft ref's in the first place is in attempt to kill a dependency chain that appears in my pawn class that shows in the size map, the chain goes like this: pawn class has a reference to its player controller class > player controller creates pause menu widget > pause menu creates settings menu widget > settings menu creates video settings widget > settings saved by the player are saved in the game instance > game instance calls a server travel function on a pre lobby game mode.. all of this is currently loaded in all the time when some of it doesn't need to be, especially the pre lobby classes which have nothing to do with my pawn class at all so there is no reason they should be dependent in any way
So I was gonna make the pause menu a soft ref so that chain disappears until its in use however if the load times are too long or causes horrible hitching when loading soft refs then that might not be the best approach lol
That sound effect will be getting nuked anyway cause there's no reason it should be nearly 200 MiB but regardless of that there is still no reason the pawn needs to know about any of those pre lobby classes
Async Loading isnt instant, and you also have to deal with the async logic. Its just the pros and cons.
It can be really quick, or it may take some frames. The only way to find out is to implement it.
@prime stump
Then you can make design choice. Wether to load it on loading screen instead of on demand.
I noticed the player controller doesn't seem to let me use 'Async Load Asset', instead it wants me to use 'Load Asset Blocking' which when I hover over it says it loads the soft object ref immediately but might cause hitching, but what I'm really interested is getting rid of that dependency chain I've got there, but i'm unsure of what the best approach is to take
why does game instance hard ref the level and assets?
The game instance casts to GM_PreLobby when a game starts which calls a function on the game mode that does server travel from pre lobby to the actual map and the game mode has the references to those sound effects for some reason as well as the PS_PreLobby & PC_PreLobby classes right at the bottom of the size map
Which all then links back to my pawn class because its player controller creates a pause menu lol
Are you trying to use it in a function instead of on the Event Graph? You can't use any latent async nodes in functions.
There's no reason the player controller should be unable to use 'Async Load Asset'
Ahh yeah I was in a function when I tried it, didn't try it in the event graph
So the question remains on what is the best approach to clean that dependency chain up, would interfaces maybe be better so instead the hard refs to game instance/game mode they can go through interfaces without having the dependency?
Seems like you either needs Metasounds or FMOD. No real reason to have a sound hard reffed.
That sound is being deleted from existence either way cause its huge lol but I'm more concerned about having pre lobby classes hard referenced to the pawn class when there's no reason they should be at all
What tells the GameIntance to tell the GameMode to do the travel thing?
The pre lobby's game state class when a lobby timer counts down, or from a widget when the host of the session manually starts the game, but its being done through an interface
But why through the GameInstance?
Both of those things have World context and can just get the GameMode itself.
An interface or doing things in native would be a solution to remove the game instance reference.
Or you could move the functionality entirely out of your game instance because it's a little weird that your video settings require that reference.
Main GI referencing asset sounds soo cooked.
I was under the assumption that the game instance is where session logic goes, but if i don't have to use that at all that might help
The reference from the GI to the PreLobby game mode also seems suspicious. But it's hard to give concrete solutions without access to the project.
(no I don't want a copy of your project to look at 😉 )
Video settings references the game instance because thats where all the settings are saved and loaded, which i was also under the impression was the best place to do that
Make a project child of UGameUserSettings. That's where that stuff should go.
That's a kind of vague misconception. Session handling is handled inside of an OSS, AKA UOnlineSessionSubsystem. Which is a GameInstance Subsystem subclass. But there's no real reason to need the game instance for anything session related.
Unless you're BP only. In which case RIP, cause you're doing multiplayer with your hands tied behind your back, your legs chopped off and your eyes burned out.
Well.. I am BP only so 😂
question how do I remove up a message listener handler from the gameplay message subsystem? (like stop the listener)
its gonna be though managing those memory dependency as well with only bp.
upskill or face the limit.
p.s doesn't take a lot to make a native class.
open up new world too. You can create your own game instance subsystem, world subsystem and pretty much remove the limit of bp canvas.
If you have a node like this, use the Async Action reference and use the "Cancel" function.
sanks
i did eventually figure that was the case but thanks anyway
fun fact: The developers on Ratchet and Clank: Up Your Arsenal had the issue of making a game for ps2. The ps2 hardware was limited so to tackle down performance one thing they did was to optimize their bullets.
Instead of making an actor bullet with collision that is shot out of a gun. They used 2d billboards that always face the player with something like a raytracing shot out of the billboard every frame, so as the bullet moves it shoots a raytrace to detect if there's anything in front of it, if nothing it moves forward again, if it hits something it explodes. This substitutes using an actor which in UE is a heavy object and collision is not necessary which further saves on performance
hello does anyone have a idea why this happens? I am making a camera zoom slider but for some reason it doesn't work
Make a print string right here
and print the value
It does get to 600 here but my camera arm length doesn't zoom out
It shouldnt go to 600......
I also tried setting the slider back to 1 but that didn't do it eather
Is there something behind the camera that the arm could collide with?
Why not try to use a lerp float instead?
The value from the "On Value Changed" should only output between 0.0~1.0
Then, use a lerp between your 300 and 600
(of 0 --> 300
if 1 --> 600)
Should be easier, and idk... maybe a bit more of a good practice?
Your clamp goes from 0 - 1 range
if it prints 600
everything higher than 0 will do the jump
then any further movement will do nothing
my camera is attached to a springarm which is then attached to my ball
Oh yeah, it seems you changed the range of the slidebar and it is not the default 0-1. So Blackhand is correct
I tried setting the slider value to 1 now because first I setted it too high but it still doesn't work :/
Want to DM?
I can help, it shouldn't take long.
sure no problem
I'm confused to how that's an example of messy coding. It looks more organized than Ashes of Creation accounting.
Are you actually asking or just making a joke?
It's just a joke. However, organizing and labelling projects correctly is worth the time. Sure you can avoid it, but it's not just for others or multi person projects.
Im not very deep in the Ashes of Creation game, are they that chaotic ?
It's dead.
i mean i personally find my red bull and cigarette fueled bp is pure art
....
Abstract art 😄
Luckily it poses no issue to Unreal or association to the engine though it was being done in Unreal 5. However, it was bad for the MMO industry and I would not be surprised if it leads to multiple criminal investigations.
Epic would never have bought them. Despite the "looking at it". Any business doing a large acquisition would have experts look into the accounting and feasibility. They wouldn't buy any of the garbage and would automatically be forced to not proceed upon seeing any information or it being witheld. It's in ligitigation, but the game isn't likely to ever go anywhere at this point for multiple reasons including it's reputation.
yo got my problem fixed looks like the do collision test on the springarm is the bitch of my problem haha
yay I hope so
There are lawsuits flying. In short, Steven and some other LLM people are fighting over it and it is a mess where the money came from and who did more bad things
Meh
So chances are near 0
I dont even know why im greedy for more assets lol
I collected terrabytes over the years
Riot is doing their MMO. The big question is which game engine they will use 😉 I'm guessing Godot!
Im really not interested in mmos
I dont think mmos are very good games
A relic of the past
Even tho many ppl seem to like them ..... i will never understand why
I don't think it's MMO's. It's the market not producing games. They are just a shell for gambling.
I have never played a single really good mmo 10 / 10
Plenty of singleplayer rpgs or coop rpgs
But mmos are so forgettable
Bad combat mediocore story
The only way to get 10/10 is go back 20+ years and play them at the time. And only the much older games.
BDO moved the bar forward. For inputs, responsive combat, and graphics (at it's release). It's just that they don't care about the game, it to is just a shell for gambling.
Luckily Unreal's enhanced input system makes those inputs rather easy. It feels so much better than 1,2,3,4,5
Yea, I know what you mean. I think the issue is down to all the compromises they have to make so it's actually playable (as an MMO). It ends up feeling bland as they all have to make the same compromises.
The only MMO I really got into was City of Heroes, played that for thousands of hours over the years
In relation to the prior conversation. I will work to divide "Events" vs "Quests". Even though some quests will use the same concepts such as unlocking portals and pathways. The main difference though is the Quest contains more data such as a Quest Log and thus the separation will make sense.
You could also do a unified approach. So you have an events object with a 'run event' function and when you setup a quest, you can define an event object that gets called when the quest is complete.
That way you could use the same event objects outside of quests as well. Just a thought
I've setup in my quest system that I can have things update on other quests when a quest is started, completed or failed. Took awhile to figure out how I wanted that to work
The more important distinction seems to be saved vs temp. As long as the Quest is maintained in a quest variable it's fine. Through game play tags, structs etc, I can manage whatever data I want.
The harder part may be more of the design side as to what needs to be saved. For example a lever sequence that opens certain paths. Should the player have to redo it every time they enter the map? What is least annoying on the player side will be the real question.
And "farm" prevention. Which I could test some placement tool for if needed.
Normally I tend to make things have states. Open/closed for example, then you'd just save the state and reapply on load. You can have fancy transitions when switching states during gameplay.
You can output the player location (x,y,z). However, is there a simple way to do that on a static mesh for example?
I'll have to open the editor. When placed will the location of the object already show the current (xyz) in the editor?
I'm not sure what you mean.
I don't really place items often using the coordinates in the editor, but they are there. Just usally for scaling purposes. I'll have to dive into what the events would be first though. I was thinking of randomizing their locations. But needing a way to identify location positions for that. Then probably just spawning some events at random locations upon entering the map.
Ahh, for dynamically spawned actors you'll need some sort of manager. You'll need to save its class and transform. If the actors also have additional data that can change at runtime, those would need to be saved as well.
Id probably make a struct that has a class, transform and a string.
The extra data can then just be converted to a string. There are other ways to handle this but how you'd approach it can vary depending on what the actors are and what not.
I would think a Game Play Tag MAP with a vector array would probably work. Except for overlap prevention. The BP instance would be built with a spawn on begin or construct. That would place it in rand(1,10) locations essentially. Or could be controlled by difficult or grouping. Such as 1-5 6-10 or a type of coding. Such as 13+ is sever difficulty or rare etc.
is anyone familiar with this error?
My guess is you have an infinite loop going on
Vanilla wow was an insane experience.
Only EVE really captures what an MMO could be IMO.
I tried to use a physics constraint between the capsule and the mesh to stop ragdoll bodies from flying away and keep them consistent when I simulate physic in multiplayer, but it’s not working. What did I do wrong?
As far as I'm aware, skeletal meshes ragdoll inside component space. The component transform would stay the same.
Would anyone happen to be knowledgeable about dynamic material instances? I'm spawning in a pet and using it to create a randomized color palette using linear colors and vector params. Right now I'm trying to save the linear colors and then apply them onto a different actor with the same mesh for a minigame and it does not seem to be applying the meshes. Any help would be greatly appreciated.