Realistically though. few dozen. Lets say...50? At a rate of fire of 1100 rpm. That's 18ish bullets per second. If you assume 2 seconds for your longest lifetime. That's up to 1800 bullets. Which is at the very least 3600 scene component transform updates with a collision and particle component. I can't say on modern hardware, but you'll have a lot of trouble on a console with that if it hit that target high.
#blueprint
1 messages · Page 231 of 1
yes, I was worrying about this
i'm a bit unsure about how to proceed
I have forgotten how to use unreal. What's wrong with the picture?
An Actor only moves once per frame as is. It is swept in a straight line from a to b in that frame. So you just have a ton of straight little lines over time. You can do the same thing with traces by simply tracing along it's velocity path each frame instead and making a single particle system to manage multiple bullets. So you have no scene component updates.
You're constantly setting the half height to 30. Both ways.
and I take this is more performance friendly than an actor, interesting
hi how do i add those dots between the blueprints lines
It's partially about the scene component transform updates. They cost way too much. For example a normal projectile usually has at least three things. simplified collision sphere, a visual mesh and some stream particle system.
You move that actor, you move three things. All of which triggers some bounds updates, the actual movement of the three, and some other code, overlap and hit code for the root component, etc etc. The trace simply queries and returns the data. How expensive it is after that is up to your checks you perform and damage application code.
If you mean this. It's a reroute node. You can double click an existing line, or drag off from a pin and type rer
thanks exactly what i needed btw im completely new to blueprints i have to ask bot to help me create serten stuff bc humans some times cant and theres no way im going to c++ thats so anoing il never learn that
Never say never. 😄 You'll find the wall that drives you to C++ at some point.
Ghislain Girardot recently uploaded a video explaining pooling. Definitely worth a watch. He's more of an artist but explains how you can instead use just data and use a particle to display the data. (as BP aproach)
Files are available as a Tier 1 reward on my Patreon: https://www.patreon.com/GhislainGir
X: https://x.com/GhislainGir
Mastodon: @GhislainGir@mastodon.gamedev.place
0:00 Intro
2:57 Object Pooling
6:51 Data-Oriented Design
9:43 Niagara Projectiles
12:12 Niagara Impacts
13:22 Outro
Hey! Quick video to mention different methods, all widely used i...
Ghislain is fantastic.
yea i know but blueprints seems more easyer just need to learn it and then latter i can do stuff on my own c++ its so complicated i dont understand a single word of it
Yea, he's one of the few I sub too. Great insights with his approaches.
thank you
btw im trying to make blocky world generator
The main issue is simply numbers though. If you have a need for a ton of them at once, actors will hit a performance wall a lot faster than traces will.
I don't do C++, i've tried myself but I end up with to many errors from the IDE that I end up giving up haha.
Have to ignore the error list. 😄 Only compile outputs matter.
You'll definitely need C++ if you want it to be performant. Loops in BP are slow and you don't have access to additional threads which can be very helpful for calculations.
I'd love UE to have a basic IDE built in.
would making a working system in BP and then remaking it in C++ later down the line be feasible approach?
but to ask a bot to help me with that he gives me over 100,000 errors
Yeah. But Epic won't. Cause the cost making one vs just paying for VS extensions or Rider. Plus programmers are already whiny and flame each other over ide choices. No point adding another one to the mix.
The guy in the video sets his up in BP. Watch the video, he explains a lot of the pro's and con's. It'll probally answer a lot of your questions.
True, one can dream lol.
Realistically. If you want simplicity and don't mind the cost. Just install VS normally for the toolchains, and then buy and install Rider. I used vanilla VS for a few months before trying to rider thing. Bought it right after and never reconsidered. Makes life easy.
Makes sense but I find it hard to spend money on something I don't know.
Yeah. 😄 I do get that. IMO I would stick to struct declarations and BPLibraries in VS for now if you want. And like I said, ignore the Error List thing. Only errors that matter are the compilers output.
hmm im gonna try it right now
yes the video was indeed very interesting
and I know using C++ for base classes is more performance friendly
but I really loathe C++ and would like to remake the system in BP, and later down if it seems to be harming performance I'd want to move it to C++
is such an approach feasible ? or should I write it in C++ from the start?
Converting BP code to C++ is fairly painless.
Does anyone know if there's a way to get all child gameplay tags of a parent tag?
Mostly just adding a new parent class and reparenting the BP, then moving the BP logic.
Quickly glanced, but I don't think tags save their child tags. I'm not seeing anything for it atm anyhow.
I didn't think so but wanted to make sure I wasn't missing anything.
The manager has some stuff, but it's C++ only. Not sure how accessible it is. But it doesn't look editor only.
I didn't know this existed. How do you add a gameplay tag to an actor? Or is this one of those, only useful if using C++ lol.
Yea it looks like it uses the gameplay tag interface which you can't add to BP's. :/
out of interest I want to use Behaviour Tree for a kind of dialogue system however I'm wondering the best way to do it. Is there a way I can spawn a AI Controller derived class on the fly ?? I know theres the spawn actor from class but if I do that do I still need to set the variables on it like location, rotation etc
?
A controller is a type of actor so you would normally need to use the spawn actor node. However, you might be able to use the 'Construct Object' node, however, I would imagine doing it this way might not work. I can only assume the Spawn Actor function does some addition stuff in regards to registering the actor to the world which the construct object probally wont do.
hmm I don't mind trying construct object, whats the difference does construct object kinda spawn it but it's not part of the world where as the spawn actor registers it in the world that it's part of ?
Actually, it wont let you.
fairs so it'll be spawn actor then
guessing I can leave it's spawn location to 0,0,0
Instead of AI Trees, consider using the newer StateTree
Or whatever it was. I think that was the name?
Oof
Hi guys. So I need to add an Actor component to a certain actor and then set its transform - why is the Set World transform node not taking this..?
I did this before with a static mesh component
kinda like this
but why can't I do the same with an Actor Component?
Because not all actor components have a transform. The actor component would need to be a child of scene component to be able to set it's transform.
If all the actor components will be a child of scene component, set that as the base class for the 'Current Component Actor' on you're structure, when you go to then add a component to that class, it'll default to scene component which you can set the transform of.
child of scene component
I don't understand this
That thing that I'm adding it to is a pawn that exists in the world - does that mean it is a child of scene component?
All these are actor components, scene component is a child of actor component that adds specific logic for it to exist in the world at a specific location. Unless the component is a child of scene component it won't physically exist in the world.
I think there is another question here, since he wants to set a relative transform, what exactly is there being transformed? I assume he has some kind of visual component as well, otherwise what is the point of his relative tranform?
do I create another set capsule half height?
and connect finished to it?
Well yes
It's a mesh
I fixed it anyway by using a static mesh instead
If the actor component itself is already a scene component then he should just cast it to scene component
Yeah
Better to just do this than adding a cast. The class would just need to be a base of scene component.
Even better =p
I need it to be a child of a pawn
A pawn isn't an actor component so can't be added to another actor.
No, you already have your node there for the lerp.
what is a good asset for interactable grass/foliage?
Wh!
You cant? I thought you could ?
Unfortunately not. :/ Not sure why though.
what is the overhead of blueprints compared to native code? if performance is critical do you use them at all?
So strange...
Anyone know whats happening here ? The EQS for some reason is returning some valid point closer to the camera
thats what it should be doing
The trade off is readability (in some cases) and usability. Blueprints is more accessible to none programmers.
so tracing from the testing pawn to the testing player actor which are blocked by a wall
This is a difficult question to answer because it requires a lot of context.
Intended hardware, what is the code in question doing? Etc etc.
I remember once seeing a type of unreal component that was used to store data in the form of a table which can be directly accessed by anywhere in the blueprint. But I forgot what its called can anyone tell me?
Nvm I found out its called data table
How do I create a readme inthe content browser?
The general answer is: a single blueprint node is quick to call. Many blueprint nodes strung together add up to overhead. The overhead comes from node connections. Blueprint cannot be compiler optimised -- every single node in your graph (in the execution path) is guaranteed to be run, and preparing to run a BP node is more costly than a native call.
It's not sensible to fully avoid Blueprint, but if performance is critical it can be good to try to move code into native by creating specialised nodes which reduce the node connections.
You can either create a native parent class, or use static BP libraries for that.
This (https://youtu.be/VMZftEVDuCE) is one of the gold standard explanations for BP/C++. It's well worth the watch, I think almost everyone will agree. If you haven't seen it I recommend watching it.
Note: He talks a bit about Blueprint Nativisation in this video, which you can disregard -- it's not a thing anymore.
ty for the info. mostly want to avoid cpu bottlenecking which is a common issue in many games, though seems less so in UE (depending on the game)
never seen the video before, and damn that's one good made video
Yes! The same guy has made two more: "From main() to BeginPlay", and one about replication I don't remember the name of. All three are equally good! Answered a lot of questions I wouldn't have known to ask otherwise.
yea, skipped over the examples, and that's a solid 10/10 video, great presentation and no voodoo/urban legends stuff 😄
How expensive are line traces?
Would creating a bullet drop off system by creating repeatable line traces for small distances and update a position vector be performance heavy?
They aren't.
Of course it all depends on context.
Are there 5 bullets doing that? 1000? 600000?
might as well use PredictProjectilePath to do it?
what is the most basic data type that can store any type of mesh? whether static, skeletal etc?
UObject probably.
UStreamableRenderAsset, but i dont think you can use it. Use UObject and cast accordingly to determine
Is there any already build name parameter that I could set? Or do I need to make one?
So, I'm thinking I need to move all my ability logic off my character blueprint now, while things are still early, since there's going to be a lot of it that gets traded out, equipping spells and whatnot, and doing it later will be a nightmare.
What're the arguments for actor components vs actors vs something else for each ability? I'm not sure how much of a practical wall stuff like a component not being able to add a timeline actually creates; are there easy ways to get whatever functionality I might need, or would it be less of a hassle if I just go with actors if I'm not sure what all I'll need for all of the character abilities?
When I've asked before, the answer was always that I was going to create a lot of problems for myself to little benefit setting up and using GAS without any CPP knowledge.
Lol, of course it was.
Anyone who has said that hasn't actually used GAS. You can use it just fine in BPOnly, except that you miss out on Attributes. And while they are fantastic to have and use and I do recommend them too, you don't need them specifically.
Cues, Abilities, Effects, all work fine in BP Only.
Might as well give it a try, then.
can anyone help me on maybe why my character is white in unlit mode
(metahuman)
pls
Why does it matter unless you're shipping a game without lights?
its just that it was fine before
it doesnt matter i suppose but its just weird to me lol
If it looks fine with lit mode. 🤷♂️
All of them. O.o
I would do a quick insights profile IMO. That tick cost is wild. And you have waaaaay too many characters moving around unoptimized.
you better get used to insight tho
- Build game
- Start insights
- Start game
- Play Game
- Close Game
- Double click entry in Insights to open it
not running in PIE ? is that big difference ?
You can do it that way too, but if you don't close editor after you'll end up with some massive profiles.
you can start/stop the profile in the bottom right of the editor
There was some start/stop commands though too, can't remember them right now.
that also launches insight
ah ok ill check :/
You have to be careful of things like this in editor though. Allll of this except like 0.15ms is editor.
Is there a way to search through all blueprints for the print string node?
FindInBlueprints
yeah but for instance
search in any blueprint for usage of print string, then click the binoccular to search in all BPs
its all red in the timeline really
but seems like "frame/Waitfortasks" is massivly using Ms
and fEngineLoop
you should scroll in on a problematic frame
Thank you!
keep in mind that launching, etc. produces spikes, they are irrelevant
yeah thats fine
shouldent i look on the "broken frames" (red ones)
why look on the ones that runs "fairly ok" ?
depens™️
No, you have an every frame problem. You're not looking for frame spikes, you're looking for something happening on all frames. Frame spikes have other shit happening besides the normal.
ah good point
ok so
ok so it seems the wait for tasks / feningeloopss/frame are the ones still super high ms
right
how do i narrow down the chokepoint
You should see something like this on your game thread.
thats what im seeing on my screenshot also right or what am i missing
Zoom in to some of those. Like...
You can see this is all CMC stuff
More after that and you'll see mesh updates.
That all looks fine. The landscape stuff looks painful. What's after landscape?
but how do u se its the landscape :/ ?
Hello so i have made a real time gizmo for playing in editor and i wanted to ask that, as you can see while changing the gizmo with the mesh the gizmo also changes but i want that after a change is made and as soon as i release the mouse button the gizmo should go back to its original position without affecting the mesh transform
there's 30ms tick time
check the biggest chunk first
4.2ms wont be the biggest chunk either (even tho, it's quite a lot of time...)
I'm assume the biggest will be slate. Editor profiled.
yeah exactly im zooming in on the 30 ms right ?=
you have to check the whole block which takes 30ms
what's below which takes the most time?
hey Do i need to initialise this on every level beginplay?
so it's most likely gpu bottleneck
Not unless you need a setting on every level's beginplay.
unless you do a lot of async stuff
so once its set in one level, that gets carried forward to others right?
No. But I also don't know what you're doing with it.
GameUserSettings exists long before a level does. And persists level loads. So if you set a setting, it will stay the same through all levels. If you get a setting and set a cached value to it in one level, the next level will not have that cached value.
this is my graphics settings page, pretty standard
If you call SaveSettings or whatever it is after the user changes something, then these will persist all levels and even persist after the user has closed the game and restarted it. They're saved to an ini file.
understood
is it possible to send this profile file that really small and you could look at it and explain what you think is the bad stuff or :/ ?
Sure. But before you do, try this.
Open a PIE instance. Start profile. Minimize all other editor windows except the PIE one. Play for a few seconds. Then stop the profile.
so now this is good?
Minimizing the other windows stops it from profiling a ton of editor slate.
That looks correct, yeah.
thanks man ❤️
i DMd u
This doesn't look at all like your StatGame. O.o
Can you screen your Stat Unit and Stat GPU?
Wait. Are you running this profile while you are playing in PIE? Or are you launching Standalone?
i played in pie
Wtf? There's nothing in this profile but wait time. 😂
Basically means your thread is idle waiting on something else.
You don't even have character updates, or player controller tick, or anything. O.o
so something could be "wrong" rather then badly done ?
Ah. I think I follow now. You have to actually start the trace, then click on your PIE window and play for a bit. If you don't focus the PIE window it seems to only profile the rest of the editor.
aha ok 1 sec
but wait
no i did play while tracing :/
i rann around for a few seconds now also
same as before :/
i dm´d u
also get sure to pick a frame from the time you played
so look at the trace at which time you run around in the game
authaer is looking at it
This is a bit painful here. This is all character movement mesh updates mostly.
atleast live debugging i hope .)
This mushroom thing in particular hurts per instance.
hmm so the npc anim bp being played all the time
i guess thats an easy fix really
since i activate the movement when close
You have a fuckload of slateprepass from widget UMG bindings. Unsure if this is editor or not.
And then something called Debugger. Which I don't know if it's an editor thing or something of yours.
how'd that happen 🫣
So I would also try to get a profile in a built game or standalone.
I'm bored atm. And tired of writing interaction action sorting code. 😂
I got 743 things you can look at, if you're hands are just tappin the desk /funny
Can be. In RS2 we disable them based on player's view using a subsystem. Cripples an older gen console without it.
even new ones if they're expensive
Lol. ATM I'm working on a contextual interaction action system. Like.. You right click on something in an RTS or strategy game, or look at something and open an use wheel in an FPS/TPS. Trying to make it game generic. Going well, but my brain is melting. I need easier things to do like profiling. 😄
I'm sort of surprised it's not something built in to get whats in the playerview and not (and if not, how far off are we etc)
i know i know, its just simple math
but.. the engine already does this like... 50 times already ?
why not pass that along 😛
the interactee should provide relevant contexts through some interface i reckon ?
OnInteract -> GetContexts->PassToHUD?
Dive into the many character and animation optimizations that you should be applying to your Unreal Engine 5 projects to ensure you are delivering a fluid 60 frames per second on consoles.
This talk will examine building from the fundamentals through to advanced methods, as we explore optimizations of animations, skeletal meshes, animation gra...
that talk was pretty good (and may help you to optimize stuff)
Oh come on man. You know me. 😄 Interfaces?
Actually right now my working model is basically a primarydataasset which is collected into a subsystem. Asset has two lists of gameplaytags, one for users one for target. And a simple function that takes an array of users and a target. Function gathers all same tags the users have into the same container, leaving out tags not all of them have. Then compares each asset to see if the users and target have all the required tags before dropping it into an array, then passing those assets back for display in UI like a wheel or list.
Each asset has a UObject associated with it that can be scripted in and ran either as an instantiated instance or on the object's CDO by passing in the users and target.
Not an actual interface™️
Sounds like a solid system already, where's the melt?
It's only brained. Still writing it. 😄 Semi sick this weekend so I'm not as sharp as normal. And of course I can't stop wondering about early optimizations, like mapping actions to tags to look them up faster than a full action iterator.
First off. Don't do this. It just complicates your code. Inputs should just simply call the Server function regardless of whether they're a listenserver or client. It'll work identical in both cases and run a function on the server. Which can then multicast.
What does PowerSwitchStopLaserEyes do?
IMO, you're multicasting way too much here. This Enum here should be an OnRep and set on the server when their power changes. You can stop powers when that OnRep runs, and all clients will know what the power is after that.
But I'm also confused by your multicast. It's checking on laser eyes if your enum == BoltThrowEquipped ?
I love GAS so much right now.
What would be the best practice in linking the safe actor to the NPC? I was thinking of a sphere collision and upon overlap use an interface, but is there a better way to do it?
I simply want to call functions on the NPC whenever the safe is interacted with.
Get a reference for the NPC in the safe actor.
How? When they are two separate actors.
Is there only one NPC of that class?
No, there are multiple types of NPCs. But these specific NPCs need to be linked to a safe.
So if you have multiple NPCs that all need to be linked to the safe, then I'd recommend a broadcast/event dispatcher.
In general a watch of https://www.youtube.com/watch?v=EM_HYqQdToE is in order.
Announce Post: https://forums.unrealengine.com/showthread.php?101051
This Training Stream takes a look at Blueprint Communication. We find that Unreal Developers of all levels can sometimes struggle through the concepts behind moving data between objects. So in this video we'll take a look at the different ways to make Blueprints talk to one an...
I think an event dispacher will not work as only a certain class of the NPC (the general store clerk) needs to be linked to its own safe actor.
There are other types of clerks that don't need this.
Does each NPC have its own actor, or are they all the same actor just with different variables?
They have a master class.
Okay.
make an NPC Reference variable on the safe, you can assign the NPC to the variable once both are placed inside the level
And how do I set that reference? As the safe actor is a totally different unrelated actor.
And there will be multiple clerks that need individual safes.
select the safe in the level and in the details panel set the NPC which should be assigned to it
What?
I think you should watch that video above. It's two hours that'll save you a lot of headache when referencing stuff later.
would anyone know how to get mouse world position while not actively pressing a button? basically i want my topdown character to always be oriented towards the mouse, this i have working, but it only works if i press a button on my mouse which is not ideal.
basically this returns false and doesnt give out a value if a mouse button isnt pressed
Thanks man, 10 mins in and just realized I've got to start searching for these types of tutorials
This is due to mouse capture. There is another function that gets hour mouse position on the viewport which you can then run through the other projection function... err.. Sec
This maybe? I can't remember off hand if this needs DPI scaled. Can test it in a few.
@rotund barnYeah, my bad. This function should be able to get you what you want without forcing mouse capture. This trace should get you the geometry under the mouse.
thank you very much!
folks, is this how im supposed to do delta seconds to make sure everything moves at the same rate no matter the players frame rate?
show me ya blueprints
Can anyone explain how I would link these two unrelated actors together. I want to be able to call functions on the NPC when the safe is being interacted with.
It's just confusing me as there will be multiple NPCs that need individual safes.
Event dispatchers seem to need a reference somewhere.
Are they both placed in the level?
Yes
Direct blueprint communication then.
How though
It's in that video I linked a bit ago. You put a reference on the safe actor's BP that is instance editable, and then select the safe in the level and set it to the NPC using the dropper.
Hey, i have a player start where the tag is 0 and the you see its location. but the printed string is not the location of the player start with the tag 0
I tried that and you can't do that lol
i print that
Hello
When you click on it opens the details for it, you can't click on one actor, then click another or am I missing something
but if i there is that PlayerStartPIE0
and the location match with that one, but the tag is None
FindPlayerStart is supposed to return the one with the tag into Incoming Name?
I'm trying to "Get actor location" on event tick to send to a server, but I can't figure if it would work or not. I have 2 quests that connect to a local dedicated server, but I cant see each other movements, does anybody if this strategy would work ? Thanks !
is None = 0 ?
You can. It's in the video. Sec
Two classes. The store person and the safe.
In the safe you make a pointer type to the store person, mark it instance editable.
Click the safe in the level, look at it's details panel.
Click the dropper, click the store person.
When I try that on the master character it says the clerk (a class) is not compatible and when I change it to a class reference that does not show anymore
Oh wait I got it working with an actor, that's good enough for now lol I'll use an interface now
You want the same thing I just showed. It does work if you set the variables correctly.
Why an interface? O.o
It only works with an actor (not the master NPC) so now I need to cast to the NPC class, which I don't want to do
You should be able to set it directly to the NPC's class.
But when I do that I can not pick actor from scene
The icon does not show
And you really shouldn't worry about casting at this point. Ignore the twits who repeat that bullshit. They don't even know how to conceptualize why they even think casting is bad, they're just repeating bullshit they've heard like sheep.
Icon?
Hi folks, hope it is a correct place to ask about anim bps:
I have a Lyra like setup with base anim bp and a layer. In a layer I am trying to access variables from base in thread safe way like this:
Unfortunately every time game runs I get folowing errors, but anim bp works and blendspace correctly changes ther pose. What am I missing here?
Is it possible to access the start and end points of a smart link in blueprints? I see the properties in the level but I want to get a reference to their location as a vector:
im trying to build a visibility system similar to darkwood or bullet echo, i cant find any tutorials on it and chat gpt isnt the best so if someone can point me in the right direction that would be great
For my problem yesterday, I wanted to do the blueprints super neat but I just ended up doing it super ugly 😂😭 but it works! 🤷
I have a niagara particle I am trying to implement in a blueprint, I can add it into the actor just fine but coming in at thescal set in the Niagar particle file and it will not use draw scale I set using a value passed to from a variable why can one not scale Niagara particle in blue print like legacy particles were?
ensure that your emitters are set to local space
ok, the other issue I am having is I cant seem to toggle visibility of niagra particle in blue print, if I have it set to visible it shows but if I add event triggered it refuses to set the vis of niagra particle on actor to hidden.
Any idea why spawning an actor from server would show in both game views but not play in editor?
ah sorry
They’re more likely to know
ty
i have a primitive component that IS the root of its actor, has collision preset to physics actor and is simulating physics in the check box, returning false with 'isSimulatingphysics' when i query on tick, no matter what i do i cant get physics to work with it, any ideas?
its being moved around the scene with set world location, ideally i'd like the sweep to stop it short of anything the actor touches, but even the sweep hit result is firing as false
Your checkbox is ticked but it’s printing false?
yes exactly
What’s the component ?
a primitive component with a static mesh assigned
Yes I mean what type of component, a static mesh?
oh right, yes a static mesh
Try using a capsule or other shape collision as its attach parent (or root) and simulating on that one instead. If it works, then you might not have proper collision set on the actual mesh asset
Regardless, iirc on character class the capsule component is the one that you set to simulate physics, not its skeletal mesh child component
here is one of the meshes it populates the static mesh with, this seems to be fine to me?
has both simple and complex collision bounds, and is set to block all
Maybe you shouldn’t have both
But I’d check with #chaos-physics maybe
Try a box collision as the root tho, given it’s just a chair
yeah i gave that a go but no cigar unfortunately
its very frustrating because i had it working at an earlier time before i decided to go with a different strategy
i've even rolled back to a previous push to check my values and everything is the same as it was when it was working
You moving it with set world location on tick?
Yeah that's right
That's a major red flag when working with physics. Ideally you would still use velocity or forced
Velocity would give you full control but not break simulation
Hmm is there any way to achieve blocking without physics?
Because I don't really need all if the benefits of physics
I just need the blocking
Can that be achieved just with collision?
Hmmm the more complex the shape the easier it becomes to let physics do it's job
But you could do manual sweep with a shapecast
BoxTrace would come fairly close in your case, but rough to get an accurate collision
It would pretty much end up being reverse logic from physics too. You would need to do a trace on tick with length = velocity * deltatime
So velocity needed either way
Unless you want teleporting? Then you would do sweep only before doing the teleport and no need for physics or velocity
I want to delete my playable character and respawn it to a checkpoint how can I do that?
and which class should be responsible?
Delete and respawn? So just respawn?
Checkpoints you can use a simple actor. You can let either PC or GM keep track of last checkpoint and then teleport/respawn player
Easiest would be to give an index to the checkpoint actor together with some overlap shape. Then on overlap you check inside the PC/GM if the last checkpoint index was lower than the current one and update if needed. Good idea to also save reference to the actual checkpoint actor. On respawn, you check if the reference is valid and use the location.
for this would you use the add force node?
I have a blueprint function (to create a widget etc) which accepts two arguments - 1. A soft class reference for the class of widget and 2. a pass-by-reference object reference to a variable of a type that's parent to all widgets I'm dealing with. I want to use the second variable to store a reference to the widget once its created. Is this possible, and if so how do I do that?
Yeah that should work fine, just make sure you tick on "Accel Change" for it to ignore any mass you want to use
And if you're doing this inside Tick, make a quick calculation between current velocity
So you don't make it launch itself into hyperdrive
i've also wondered if i could just stop flow to the set world location node if i detected an overlap between the selected actor and any other actors in the scene, in theory stopping it as it hits any walls or surfaces. but it seems i cant even generate overlap or hit ouputs
its like the mesh has absolutely zero collision properties even though it 100% does
Overlaps should work as long as none of the objects move too fast
If your objects move into eachother between frames overlap won't be able to adjust (low framerates or fast moving objects)
Hmmm okay that's odd
Should probably look into that first 😅
Can you show the blueprint setup for your mesh? collision settings
sure one sec
here are the collision settings for the static mesh
ive also tried it as world dynamic
these are the collision settings for the object i want it to collide with
That's player collision viewmode?
And if you set it to overlap all with generate overlap events on, it doesn't ever trigger the node?
Yeah but this one on overlapall
And then just use a printstring inside component begin overlap
Just as a quick test
yeah ive tried that test already :/
What kind of object is this?
just a normal static mesh
Are you doing these tests with the chair detached from any tick logic and trying to collide with player?
Or do you not have a "normal" player
No im not trying to collide it with the player
my pawn absically is just a floating camera with a point to click system
is basically*
I see, was basically suggesting just to test setup and not have any weird variables break it
I guess you could have your floating camera set on overlap with physicsbody (simple sphere collider if doesn't have one already) and then set your chair to overlapall
Just see if you can float inside it and trigger the overlap
the only problem with that is the chair is just one of hundreds of actors
Pretty much any way you can test a simple overlap with no extra logic
all different shapes and sizes
The others work?
nope
so the static mesh is just a dynamic variable that is assigned a mesh on selection from a library
so storing collision information inside the mesh is critical
it would be very untidy otherwise
this is the test i put together inside the spawnableactor bp
in theory if it overlaps with anything it should print
Yes basically
but yeah, it doesnt fire a thing
part of me is wondering if its bugged idk
also i just realised, i cant drag the colliding object into the level blueprint for some reason
to get a reference
i should be able to do that with a static mesh actor right?
Everything you should need for test:
Level blueprint is a bad idea anyway, especially if you have this many objects
What exactly do you mean to get a reference?
yeah 100% i dont have any logic in the level bp i just wanted to test the overlap on the static mesh in the scene
The pawn can be anything btw, just as long as the collision settings are similar
Oh it's not an actor?
Aah okay I thought your chair wasn't a normal actor
this is the 'chair'
Should work fine like this
In your case, the environment would be WorldStatic and your chair would use PhysicsBody
But them having eachother on overlap should give same result
Environment (WorldStatic) -> Overlap PhysicsBody
Objects (PhysicsBody) -> Overlap WorldStatic
And you can see I get the reference just straight from overlap event
😭
something has to be bugged
Something is wrong for sure
im wondering if it has something to do with the static mesh in the scene
because i should be able to drag it into the level bp to get a reference
but i cant
si si
And also on the chair? 🤔 damn
Yeah you should be
for these actors
yeah exactly this
but it wont let me do it....
maybe i just need to delete it
and add it again
Haha yeah I'm not sure at this point we've checked pretty much everything I can think off
Maybe the classic try turning it off and on again works 🤣
ahaha i wish, i've tried closing it down and deleting saved/intermediate etc
even that didnt work
You really shouldn’t use level bp
yes i know i dont have any logic in it, i was just using it as a testing measure.
and that indicated a corruption with the static mesh
read furthur up a bit to get the full context.
does anyone know why this applies damage multiple times per actor?
instead it works as if it applies damage per component
per mesh bone actually
well yes but why
since its linked to per actor
and no if I include the actor in a hit actor array it still applies multiple instances of damage per single frame
so this still aplies multiple instances of damage per actor
as if it was checking per bone not actor
I'm at a loss
the function Synth Tasks is returning an array of a custom struct(FTaskData) that is defined in C++(as blueprinttype), but I can't figure out how to access individual Struct instances and values inside them(I am new to blueprint scripting).
that's not how those things work
it doesn't care what you link to the event parameters
the event fires one time for each hit bone
You're not using the ignore list though. Least not here. You should break this into parts. Gather all hit things. Filter hit things to not hit duplicates, apply damage to hit things.
Start with a ForEach loop by dragging off of that array pin. Then you can drag off of the ArrayElem pin and break it if you need access to the properties in the struct.
hi, what would be a good way to do a NPC without using character & character CMC ?
or is that the most common one or whats good practice ?
Wait on my new NPC movment component coming soon™
really ? revolution is near ?
In all seriousness though, CMC is your only option if you plan to allow your NPC to move responsively
it is!
if you want like super simple movement and don't want to use CMC for whatever reason then you would have to use splines
nah if its worth it its worth the dollars
nah it's gonna be free, I'm just burned out maybe in like a month or two it'll be on the marketplace and github
Depending on your settings.
Navmesh walking is pretty cheap. And TBH CMC itself is rarely the major cost as much as moving the character itself and the 513 scene component people put on shit.
well i cant seem to be using more then 8x npcs without it ruining the preformance
you should be able to do atleast 100 characters with cmc active without dipping under 60fps
unless you have like a really bad cpu I think
Yeah. Usual initial cost is shadows on the skeletal meshes.
hmm really
yeah, 200 was the limit before I even hit like 33 fps
and that's what sparked the 7 month journey of creating my own movement component
Never assume where a performance problem is coming from. 😄 You'd be shocked where the real costs are. Like someone leaving collisions enabled on a cable component that does nothing but visually sit there as a power pole and it eating 0.5ms frame time for.. nothing.
Gotta use that good old profiler
hm interessting
I still use session front-end, I don't like unreal insights because I'm old and don't wanna learn it when session front-end did the deed just fine
It's really easy to use
but that not available on 5.2 + right ?
Can't use it in recent versions though, can you?
No, I downloaded 5.2 just to continue using it. But it's not tied to unreal, you can rip the program out of the files and then delete 5.2
And still use it for all previous and future versions
Also if you have the source version of unreal you can just simply enable it through a command in the build.cs
Which is super weird
wow that seems strange
Probably just intending to deprecate it out as an unsupported tool.
My character uses multiple textures and I'm wanting to change them all together (randomly)...
This obviously isn't the correct method (since it doesn't work).... Someone wanna educate me?
you can't use both outputs of the random node to get the same result
promote the random array index to a variable and use a get node to get the value (with the stored index)
Trying now, thank you
???
Nah, I'm getting the same results..... 🤔
Ok, I got it, thank you!
So.. I'm getting a crash when converting spinbox field to int (only in the shipping build) does anyone have any idea why?
Seems to be working now as intended..... Thank you!
Okay but how do I break it. There's no option
Does your C++ defined struct have UPROPERTY markers on it's properties?
it does
Any able to help, would this return the degress the play is in terms of from the forward vector of the actor
?
This is just the struct. The internal properties need marked as
UPROPERTY(BlueprintReadOnly)
or
UPROPERTY(BlueprintReadWrite)
oh okay. thanks!!
🥳
is it possible to change the position/rotation/ boxextent of a triggerbox at runtime ? im did that and now it only overlaps on the client but not on the serverdie anymore. the change in locaiton is only happening on the serverside via authority
It is. But you should probably do it on all machines via replicated properties, so that everyone is in sync.
ohh isnt this done aways since the actor has authority
and if this the reason, shouldnt it trigger on the server and not on the clients ?
but ill try that, thanks
Depends. If you change it's size on the server. And the client walks into it locally and it's not changed for them, it'll trigger overlaps for them but not the server.
yes
do u need to replicate characters so that it compoents gets updated ?
ny understand was so far that replication is only needed for variables but ye componets are variables as well and it makes sense
What is the triggerbox for exactly?
detecting balls, which leave its area
Are the balls replicated?
yes
it worked before and it works when i just place new triggers via bpactor
aka they trigger on the server and client
What happens when they're detected as leaving? Is this something that could just be simply ignored on the client?
yep
the trigger is invisible and the server handls the stuff, but there arent many triggers anyways and it doesnt happen often
Your overlaps can probably just check if they're on the server or not then. If not do nothing.
yes but the problem is that the server doesnt trigger
currently trying to use debugdraw on server via a timer to see where it is on the server
mmmh visuallogger might be even more useful for this
then ill add replication, shouldnt be to hard
im also using ATriggerBox, which is not replicated at first glance, still the trigger changes on the clients
but again thx i think u pushed me on the right track
its really strange, it seems that the actor just exists on the client
beginplay only gets called on the client
but i dont how that could happen, since i just added them using the leveleditor
might be related to using levelstreaming, since it started to be a problem that they dont trigger
but i already moved the actors back on a single map and the problem is still there
found another strange problem
when i add timerfunction to them in begin play
the timer function only gets called on clients. with LocalRole = None and Remoterole == ROLE_Authority, which looks find in my opinion, but shouldnt it be always executed on the server aswell ? like always ?
Is the timer gated by anything?
no
i just had the idea, that it might come from listenservers maybe.. but beginplay still runs when i press play and clients beginplay after loading
its part of a lyraproject. ill test this outside and in a clean project and look step by step what this problems causes
but still, its strange it doesnt get called on the server still
aka maybe it shows itself as client ?? but again doesnt make sense rly
a clean project will help defnetly and then implment the movement of the trigger zone step yb step ensuring it works after each step
if u want i can pm u what was the reason for the problem, maybe its just a bug, something with CDO and using it with levelinstances or so, but i think/hope or dont hope i can replicate the problem
but ill rewrite the class and also for example not use a triggeractor and instead directly using a boxcomponent etc and then also experiment with replicating it, but i dont think that is the problem, after there is also a problem with the timer function
Hey, I'm spawning an actor that has the projectile movement component, however the faster my player character moves, the more offset the spawn location is (in the velocity vector direction). A debug sphere at the spawn location shows that it should be correct, disabling the PMC also spawns it at the correct location - only when activating it does the offset happen. Does anybody know what might be the issue?
how to access a variable of a widget within a widget switcher?
is blueprints actually good? can i make decent games with just blueprints?
Sure, it's been done.
Blueprints are pretty capable.
Some things are a little annoying to do in BP, and most people recommend defining structs and enums in C++ for stability, but if you want to avoid C++ entirely it's certainly possible.
🔼 💯 🔼
thanks
Yeah sure you can. BP structs and enums are a bit fragile, so ideally should be defined in C++.
However, games have and continue to release in pure BP, you just have to be realistic on your scope. You aren't making some 144km^2 open world survival RPG in just BP, the save system alone would hang your game for considerable lengths of time.
For a lot of projects indie's could feasibly attempt, such as game jam games, and smaller scale releases, BP is absolutely feasible.
That being said, the engine is designed to use both side by side, C++ is very powerful, and how much you use is up to you, but it's a skill you should definitely have in your pocket when working with the engine, even if you just use it once in a blue moon. BP doesn't have everything, and if you run into something that you need in BP that isn't there, there's no workaround, you would need to expose it yourself.
Some people choose to use C++ just to expose things to the editor, and then to define structs and enums, others do most of their code in C++, and both are perfectly valid. As you increase in your game's complexity and have more complex things happening frequently, you'll find C++ becomes more necessary. For example, if before you load into your game, you're generating and chunking out a dungeon with 1000 rooms with loot, enemy spawns, corridors etc., there's no doing that in bp quickly, if at all. Same for multiplayer games, so much of that isn't exposed to bp, and bp is too slow at handling, that unfortunately C++ becomes a requirement outside of the most barebones games.
TL;DR: If you scope reasonably enough, pure BP is absolutely feasible and has been done many times. Consider learning C++ still though, as it's a great skill to have and allows you to unlock more of the engine.
(Also read the #rules on crossposting)
so the problem is the only problem is only the initial value is not correct on the replicated playerstates ?
small reminder bp struct hides alot of stuff that otherwise you have to implement yourself in c++ like
inherits FTableRowBase (to be able to use in DataTable)
GetTypeHash (to use the struct as a key of a map or in a set)
operator== (properly compare struct with unique identified properties)
StructOpsTypeTraits like Serialize/NetSerialize
I'm having a problem that I can't seem to wrap my head around I think its possible that there are multiple things going on and thats what makes it confusing. I was wondering if I could get some advice.
I'm trying to save a variable. there are signs that the variable is saving and signs that its not.
If I'm correct, if a variable is not saved it will not survive a level transfer?
I have two variables here. The first is equipped weapon which is of the class "weapon base". Under it I have an array of "owned weapons" again a weapon base reference but an array
I'm then saving "Equipped Weapon" into a struct with the variable "weapon base class reference" am i doing something wrong
What is not saving?
the first variable shown "equipped weapon"
Where are you saving it?
within my save system.
so the problem is I go into a game mode and set my weapon. I save all my variables then transfer back to the previous game mode. when I debug key to check if the item is equipped it tells me it is. escape out and play level, or try to equip a weapon again, nothing is there
So it is saving and loading fine? Based on the debug key. What does that do differently than your equipping?
but if that was the case
then if i escape out again and go back in to test without trying to equip again shouldnt it still be there?
this is why i'm confuesed
like if i check with debug key and immediately hit escape. then test again, I would think the item should still be there.
What does your escape do?
Dunno. Maybe it's not reloading it correctly?
I'm wondering the same. If that is the case then there must be a second bug
I’m struggling to set up a system in UE5 using blueprints and could really use help with the entire process. Here’s what I’m trying to do:
The idea is for the player to gather parts to repair a damaged circuit board. They would walk up to the circuit board, left click on it, and the camera would move closer to focus on the board. Then, the mouse cursor would show up, and the player would need to click on certain highlighted spots on the circuit board (white if they have the parts, red if they don’t). Once all the correct parts are placed, something like a door or gate should open.
Could anyone help me with this?
is there a way to switch videos on a plane in the level in real time?
By plane, you just mean a flat polygon?
yeah
It should have a material on it that has a texture parameter in it. You set the texture param by making it a dynamic material instance. And you can set the texture param to a different media texture. Or you can make the media player writing to that texture change it's track that it's playing.
Hello guys, im creating an inventory system and it works, the only problem is that in the first place i always start with an empty slot and then when i take something it adds in front of it as shown in the screenshot, any ideas? im really new to this kind of things so any help would be really appreciated! (i think that the problem is with the resize logic that is set to 1 so it sets an empty slot but if i set it to 0 i can't even take items by pressing E and nothing shows in my inventory as i don't have it)
gonna try this
Anyone here know why this won't run?
anyone knows a fix for this?
Supposedly it's better for performance than casting
Essentially it works the same way
It isnt
The problem with a cast is it's hard reference (the blue pin) making a dependency on the class. If this is a class with assets, you can have a bad time with memory.
Since you're still using the blue hard reference, you've incurred all of the bad, and none of the good
Casting is fine, don't believe people that don't know what they're talking about, stating otherwise :P
Idk, I'm following a course online and apparently there's no solution to this
Basically I can't move my character at all because it's getting stuck at some point
Ok, I got it to spawn a character but now I have this error
Blueprint Runtime Error: "Accessed None trying to read property CallFunc_GetLocalPlayerSubSystemFromPlayerController_ReturnValue". Node: Add Mapping Context Graph: EventGraph Function: Execute Ubergraph BP Player Base Blueprint: BP_PlayerBase
You removed the IsValid?
Is there a way to stop widget component from trying to create dynamic instances of the dynamic instances it creates?
I just learned that if you create an interface with an event / function in it, you can call it without using the check does implement interface as if the actor doesn't implement that interface it doesn't execute anyway.
So what would be the reason for the node does implement interface to exist in the first place then ?
Blind firing is usually a good source of unexpected behavior.
like what ? In this case it explicitly says that it doesn't fire if it doesn't implement interface which to me is the same as adding the does implement interface check
From the image, I'm not seeing much other than a trace sending an event to any collision, not much to go on there. But in general, it's good to keep things within expected parameters.
That's because in the image there's not much besides what you cited, it was just an example given on youtube that I screenshot.
I still don't understand what you mean with your last sentence
For example, when you fire a projectile, and you want it to pass through a bunch of objects but stop at a specific type. Whether it's implementing an interface or on a different collision channel, you'd design it with specifics, as opposed to broad target.
if I want it to stop at specific type, I would rather use casting than interfaces
Maybe if you want to know if an actor has that interface, but don't need to call any of its events/functions
Alright but what would be an example where you would need to know if it has that interface but not call any of its events/functions ?
I don't know, but it's better to have the option and not need it than to need it and not have the option ¯_(ツ)_/¯
I saw this hideous practice from Smart Poly channel
is this acceptable frame drop? it only happens for like a split second. its looping through hundreds of parts(i think about 600+ as of now), spawning different actor classes, then dynamically attaching them to sockets on each mesh it spawns. if not is there something i can do to fix it (use cpp, async, etc.). this is running on Radeon VII graphics card (fairly old now, about rtx 2080 performance) and linux.
blueprint loops are way slower, you most likely will get significant performance boost doing it in cpp
for the meshes, you can async load them
You could try your hand at putting it on another thread using FRunnable in cpp
Not sure if you can multi thread in BP
Ok, I figured cpp would offer more performance. Was just thinking ehh, it's just a split second. Although it does annoy me when I see it. I guess I'll go learn cpp. Thanks!
“I guess I’ll go learn cpp” lol that’s the spirit! Best of luck. The CPP discord here is an awesome resource.
Appreciate the support lol
Also here might be a very relevant resource for you:
The Object PoolPattern:
Software Design Patterns are like a guide on how to write good code, whether you're using Blueprints or C++, knowing good software practices is a MUST!
This video goes over the Object Pool Pattern which is used to optimize performance and memory by reusing objects in your game.
Download the project files and support my ...
(In blueprints)
This actually looks useful, greatly appreciated. I'll try this route first and if it doesn't work I'll go cpp
is there a way to switch videos on a plane in the level in real time?
Yes, you just change the media source that is pointed by the material
i tried that im not sure it crashes
Get in a habit to show what you have
this is my material and it's simply a texture sample from a Media Texture
and how to point to different movie file.
@gaunt stirrup look above, that's all I have and it work
where is this
2nd screenshot
do you mind if i can see more of the node structure
what does open file connect to
Already left home
It should be a function inside media player
From your media player variable, drag and type open file
Specify the file path to the movie you want to play
The return value output the result of the open file. If it failed for any reason, e.g. provided invalid path, it will return false.
You can do what ever you want with that information.
E.g. displaying error msg, asking to input again etc.
Is there a way that I can reset to it's construct state, without actually reconstructing it?
Doubt it in blueprint. Maybe you can just delete the actor and just spawn a new one at the same location.
How would I go about using AI move to with flying object like for example if I wanted a drone to crash into a car
whats wrong with doing it off level blueprint beginplay?
so this keeps counting up as I change items (expected) as I change the mesh then change the mat from the old item to the new one.
that said I dont want stack over flow how can I make sure the old instances are deleted ?
(check back tomorrow its 1 am lol )
I was wondering what is the best way to handle a bullet tracer effect? Call Of Duty MW3 has a tracer bullet effect that plays on every bullet fired, and it can be seen by all clients in game. But surely spawning in a actor or multi casting a niagara system on every single bullet fired for all clients would seem taxing on the server
You can't have a reference to level bp from other blueprint classes. The communication is one way.
The use case is very minimal and even at best still questionable.
It's something that is left as a legacy.
Could go on with more reasons to not use it but it's exhausting to list them all the time.
When an object is not reachable anymore, garbage collector will do the work.
Though you don't always need to create a new material and can just use existing one or use pooling.
how to use list view widget to have a list of buttons and each one has similar functionality with different variable inputs
Technically you can, (I figured out how to do it the other day) but regardless it's still better to avoid where possible.
In case you're interested, you have to get the level script object but you can't type cast to the specific level so you'd have to use BPI.
Hello again, for another question
I finally got my bp to spawn a laser that changes its color when overlapping on a specific mesh. However it works once then it stops, while having the pending kill or garbage error message. So the vfx is recasted but the bp destroyed it and won't respawn it. Looks like that currently :
If I don't put the end on Completed the laser won't despawn after release. Rn I don't know how to make the laser actually respawn.
Just plug in a break struct of the datatable row type.
oh thank you
.
If I want to give my Character a weapon (through a selection menu)
Is it a good idea to use a ChildActorComponent? or is there a better way to do it?
Guys, Your save system saves even when you hit escape on while play testing and go in again. right? Like I'm not going crazy here?
It saves when it's told to save. 🤷♂️ This is normally an auto save (every few minutes) and then a player instigated save when they click save in a menu.
i understand
But like if it saved like say I went to a new level and you can see that it saved. Then I hit escape. Then I hit begin play again. The save data should still be there right?
Yea, it'll be in the saves folder.
okay, so something broke with my save system and I have no clue what could be causing it. Its saving fine. I can open a new level and my save data is fully intact. I can do this multiple times. switch game modes, switch levels. Everything saves fine. BUT when I hit escape and then begin play my entire save system is wiped. Does anyone know what could be going on here or what could potentially be causing this. Because I'm like 500 hours into my project and I dont have a clue whats causing this.
How do you know the data is wiped? Have you checked to see if the relevant files are in the saves folder?
I mean its just an educated guess. All of my party members stats including health, levels, goes back to default
but when i'm switching levels it does not
it never used to do this
so its retaining the data on open level, but begin play its gone
It's most likely because you're looping through the items currently in the inventory and then setting all of the elements to one you've picked up? Beyond that I'm not sure.
Personally, I wouldn't recommend using structures for items as they don't tend to scale well. (Become a pain to work with as things get more complex)
If the system is still in its infancy, perhaps using ubojects? I have a series showing how to make on using them.
https://www.youtube.com/playlist?list=PLcwVLBaUNnHoujbPwOAdMgNtq1ShoHIGc
The data could be there but not being applied correctly on begin play.
I'm terrified I've bricked my project and I have no clue what could be causing the issue. the event begin play is the same whether i'm switching levels or backing out of testing and clicking play again. I just have no clue why it suddenly is not working.
The load order could be different. Adding to that, it could be that you start in the editor from a different level than what's denoted in the save which could mess things up depending how it's being handled.
For example, you start a new game in Level 1, transition to level 2, save, close out and restart in level 1. What should happen in this instance? All the data is from level 2 but should this still be applied or ignored?
So i had this thought. and I had added a new level. But I then tested it without going to the new level at all. just starting on the level that was working previously. Backing out then clicking the play button again. and its still to working
I've also tried clearing the save data on begin play then testing it and it still doesnt work
How are you handling loading and applying the saved data?
oh boy
i can post it
but nothing on the load side has been altered except adding additional variables
its a bit messy haha
hey im using gamepad to controll the mouse cursor by its not moving x/y its moving weirdly since the joystick values
what modifiers to i need :/ ?
Probably the same ones you'd use for character movement.
ah true
Most likely this. As a guess, it would only apply the data if you've saved previously.
but thats been that way for hundreds of hours and has never caused an issue
I see where you are going
and i get the logic you are following. but this has never broken it before
Follow the logic. Logic states it shouldn't have worked in the first place.
The fact it did work previously would be the bug lol.
I'm like 98% sure I dont think this is the issue, but am fully aware that I might just be dunning kruger over here. So I'll give it a go. what do you think needs to be done to stop the issue?
As a guess though, the default value for the var was probally true but has since been set to false.
oh
so you think i accidentally clicked false on the variabl?
i'll give that a try
to clarify this should be false
The issue would be default value. If it only gets set to true after you've saved, it'll never load the data. You'll need some check on begin play to determine if the data should be loaded or not.
Do you save the value with the save?
but wouldnt that be the case even when opening levels in testing?
like shouldnt that be a problem with just tranistioning period. not just clicking play
That depends where the logic is. If it's in the game instance, it persists between level changes.
it is in the game instance
so you are saying that its saving in the game instance which is allowing it to load properly until I exit out and start a new test?
it also looks like a load order issue. 😛 When playing in the editor, the map/level is loaded before the game instance. This means that all the begin plays for things placed in the level will trigger before the init is run on the game instance.
In a build, the game instance is the first thing created though.
sigh. I'm having a hard time following. this is one of my weaker areas in BP
I appreciate the lengths you are going to help me
so how do you suggest I tackle the issue
Save systems are a pain to be honest. :/ Most of the issues I have with saving/loading are load order issues.
it does seem like you might be on to something
is it a problem with this. or is it a problem with where I am saving
So you have 3 possible scenarios.
1: Actors load before the game instance.
2: Actors load after the game instance but before the data has loaded.
3: Actors load after the game instance and after the data has loaded.
I would tackle this by using an event dispatcher that is called by the game instance when it's data is loaded.
The actors would then get the game instance, if it's not valid (most likely the case when playing via editor), have it check again the following tick.
If it is valid, check if the data has been loaded, if it has, do it's thing. If not, bind to the event dispatcher which when called will then tell the actor to do it's thing.
could i test this with a simple delay?
like the code i just posted
putting like a 3 second delay first
Probably.
i'll try that. i appreciate your help. I'm having straight panic attacks over this haha
That code I sent last was the last save / load thing I added to the game. Its in the game mode bp. could this be any part of the issue?
its possible, add some print strings to see the load order.
i'm not sure I follow with the print strings. Its only loading the party data. nothing else should be loaded
Add a print string on the completed pin for when the data is loaded and add a print string to the begin play to the other actors to see what prints first.
I think this lead me in the right direction. at least for now 😂 . I really appreciate your help, I was super panicking. Gonna go sub to your youtube now. Thanks for being a good human!
Any idea about that ?
Try replacing this with an isValid node instead.
Working well, thanks !
I believe so. It wouldn't surprise me if it doesn't fire though if the game is paused or input mode is set to UI only.
Sir. Do you have time to talk about CommonUI and how it will revolutionize your life? Just ten minutes of your time, Sir.
he waat ?
im trying to detect a click on umg with gamepad
you have a better way :/ ?
Depends on what you're doing specifically. Like clicking a button, or?
yeah
Yeah, you really should use CommonUI then. It does a thing where when you're using a Gamepad, it'll move around an invisible cursor on top of the widget that gets focused. So you can do your hovered code for both mouse and gamepad on hovered events instead of having to have special ones for focus as well. And the accept button simulates a mouse click.
I wrote out a separate extention to it for work to imitate Ubisoft's cursor a bit. So that analog stick will move around a visible cursor, but if you use DPad it'll snap back to buttons for easy navigation.
It bugs me that input actions don't trigger when in input mode UI only. :/
How do you mean?
Input actions only trigger inside widgets (including commonUI) if the input mode is set to game or game & UI. If it's just UI only, they don't trigger.
Input actions only trigger on the game input. :/
Hi friends, what is the best place to keep a savegame in a multiplayer game? It should be player specific, so GameInstance is not the right place, but GameState gets switched out between menu and gameplay, so I'd have to duplicate code and re-load the savegame every time. 🤔
What type of data?
that's a very open ended question. The saving it self is just the process of writing data to a storage.
Who's saving, who keep the file it all depends on the game.
Each player has a profile file that contains metaprogression that gets accessed during gameplay, and I also need to smuggle their character/loadout selection between menu and gameplay. 🤔
Before you think about Unreal Engine, just ask your self, when a player saves, where do the save file get stored
are they going to be stored locally in each machine or the server will keep them on the cloud, etc.
@steady night The easiest way to detect a button press or click in UI is to use the OnPreviewKeyDown (for keyboard or controller keys) or OnMouseButtonDown functions. You can find them if you hover over the Function heading in your blueprint, and then clicking on the override dropdown. CommonUI has some quirks to wrap your head around if you're a beginner, so I don't usually reccomend people start with that. Try those two function with regular widgets first and see if they work for you.
Locally, I'm aiming for P2P MP
If it's relevant to gameplay, it should be stored server side anyway. Otherwise people could easily modify their own saves.
I don't want to run a server for a game that is 90% likely to flop lol
that's assuming one have the money for online data base
If there is multiplayer, it will be in the form of discord meetups, and if someone cheats then they get kicked out of the community
as long the save file is in the client's machine, you can't prevent cheater anyway.
but yes, don't worry about cheaters soo much. Especially if you just start with multiplayer.
make a fun co-op game, if people cheat, let them cheat.
It's competitive but there is no rank or anything at stake
If I want to see how things are working at lower framerates, is setting the t.maxFPS console variable to 30 or 60 a good way to do that? If things still look good at t.maxFPS = 30, can I reasonably assume the packaged project on a weaker machine will look about the same?
blueprint, competitive and listen-server doesn't go along well
My issue is that it is recommended to put save related code into GameState but if you need to access it both during gameplay (metaprogression stats) and in the menus (unlockables) you have to duplicate that code with small changes between the two 🤔
if you want the path of least resistence for local save file, just have it in a game instance
Wait. I'm confused by this. You're talking about the triggering action on buttons?
Cause the default is that they work in Menu. O.o
Just the input action events.
I hate this naming overlap. Are you talking about CommonUI input actions or enhanced input actions?
Isn't there just a singleton game instance that all players connect to? 😮
all players? 😮😮😮😮😮😮
This is a complete misunderstanding
are they not the same thing?
every player run their own instance of the game, every player have their own game instance
I thought the point of a game instance was that there was only the singleton 😮
Oh. 👶
No. And as much as I love EI InputActions. I won't use enhanced input support for CommonUI. It is still a buggy mess right now. The Legacy datatable Input actions work just fine though.
But see. I have this widget here that pops up to show something's info. Still in testing mode atm. But it'll set it menu
I have a little button here with a triggering action and a print on it's clicked.
I am apparently indeed an idiot. Thanks @frosty heron
not an idiot, a lot of gotchas especially in multiplayer.
took long time for me to grasp the basic of it.
Print is me pressing G, not clicking the button. For clarity. 😄
Ahh, yea I was referring to the other input actions. 🙃
I'm still stuck prefexing my blueprints with BP_ 😢
and WBP for widget blueprint lmao
That's normal then. And it's nothing to do with CommonUI or EnhancedInput.
Gameplay inputs don't run when in UI Only mode. And that's all CommonUI's Menu mode is. It sets your playercontroller's input mode to UIOnly.
AHAHA BOOMER I use WB_ for widgets
So I was today years old when I learned BP_ is bad practice
Yea, still bugs me though lol.
yeah nice but how can i convert that to where its clicking or how do i use it
😄
"W_" for widgets.
"W_Menu" for activatable widgets.
"CB_" for buttons. (CommonButton)
"CB_TV" or "CB_LV" for tileview/listview buttons
"B_" for any Actor, Component or UObject blueprint
"**D_" for definitions like WD for WeaponDefinition
It's much better to let UE decide a name for you. 🤷♂️
@forest spade
Discord and it's underscore formatting. :/
Ben's over here on a project that isn't over ten thousand assets. 👀
Naming stuff like this also helps me find my own shit. Other people don't generally prefix stuff, so it makes it much easier to not go to old deprecated blueprints I can't delete because... 🤷♂️
textures
it's close to a million i guess
kinda impressive how well UE handles that amount
How much diskspace does your main project use? :P
1.3TB
Not as bad as I expected
Got me beat there. Not necessarily main but largest is 334gb for me. 😄
i thought it was around 500GB or smth -_-
I find it odd that epics experimental 'Common Conversations' plugin opts to have the conversations flow down instead of left to right. 🤔
my own stuff is 222GB
so 1.1TB from 3rd party assets
they are symlinked to the main project, so i can check the size "independent"
if my project ever get that big, do I need to do anything different with my source control? (using azure dev ops)
well, you should certainly exclude all the asset packs 😄
make sense
or add them if you have enough space 🤷
shouldn't make much of a difference, since they would most likely be only pushed once
but collab work is pretty much impossible at that point
so any project with more than one person wouldn't do what i did
they would migrate the assets that they need
🗒️
also i strictly keep them separate to some point
the cyan ones are 3rd party, so i know that nothing project specific should go in there
How do I call super in a blueprint?
rightclick the node, add call to parent
Thank You!
I'm still stuck on that last thing, aka playing sound only when grabbing an object. I havt his base, I'm unsure what to do afterward.
Very interesting case:
I have a collider on my camera at a specific distance. It is set to overlap all.
When it overlaps, it sends a BPI message to turn on custom depth pass to trigger a highlight.
When it ends overlap, it sends the same message to turn off the custom depth pass.
If I don't move my pawn and turn the camera and therefore the probe onto the object, nothing happens. Even print string wont detect it.
I have to input a slight movement to detect it.
Same with end overlap.
What is going on??
hierarchy for ref
when turning only
after slight movement
and turning away
the item variable is valid and I created a array of size 30 with all values null. When I try to set the first index value to the item. Its not working at all. Afterwards if I try to retreive it. Its still null. I think the problem is that the array element is a copy of the value and not the original one but even when I use 'Get' its only showing the option to get a copy and not reference how do I tackle this?
Or maybe that the array is creating each object as well when I resize it instead if an array of null? What should I do?
Aaaaaaahhhhhhhhhhh!
Nvm
I need to use soft reference right😭
You need to set array element if you want to update the item stored in the array.
But I am iterating over them
I don't know where to place it
I need to place the item to whichever first index is null
is there a way to disable widget mouse input
You'd use the array index from the loop. If it's not valid, you know it can be replaced.
Thats what I am doing but the problem is. When I do set it, and try to retrieve it its still invalid
You're not setting the array element.
I am see, I set by ref here
Again, you need to use set array element.
So I don't need to use soft object reference for it?
I will try that!
how do i disable widget input? from my mouse
The first one will loop though until it finds the first invalid entry and then sets the element to the item.
The bottom one doesn't loop at all and just checks the length of the array to determine if a new one can be added. For this though, you wouldn't pre size your array will null entries.
So?
Can you provide more context for what you're trying to do?
No.
when someone clicks ready it doesnt allow them to click anything else in the widget until level changes
thats what im trying to do
Any idea about that ?
Ohh. Ok. So whats the difference between hard and soft references? It confuses me a lot
A soft ref is just directions to the something while a hard ref is that something. When you resolve a soft reference, it attempts to find the thing and returns it if it does.
A hard ref would normally force it (and all the assets it uses and references) to be loaded.
So a variable with hard reference can still hold a null?
Just change whats shown on the screen to something thats not clickable. (Like a 'Waiting' screen)
Yes. I think of them as boxes that can fit a specific type in it. Until the thing has be put in it, it's null.
Thank you so much!
its just changing widgets for a player1/2
So you want it to block for all players when 1 player clicks a button?
just block all input after player1 selects their character
i tried getting rid of the mouse cursos
just for player 1?
for the player (local multiplayer)
friends, i yet again come for help. Im atttempting to make my suicide bombot go to whatever friendlynpc/player is closest to it... however i cant get the check for whats closest to be true.
I know its in the comparison (did i even compare correctly?) that i went wrong... but i dont know wheeeeere
disable input has its own thang, but i also am joining this convo late
I'm not familiar with handling inputs for local multiplayer, it might be best to ask in #multiplayer.
its more a blueprint problem
That's for an actor not a widget as far as im aware.
https://forums.unrealengine.com/t/umg-disable-enable-receiving-input-for-specific-widgets/322997 is this close ?
You're comparing relative and world locations. You probally need to swap the relevative location to with world location.
Hi, sorry to ask but did you get this fixed? I'm getting the same issue when using PCGs
thanks again, patty! comin in clutch twice in a row.
chance i could beg again? The unused Move Component To worked everytick/chased player - however now its somewhat inconsistent - and only goes to the last known location so to speak, no longer chasing.
yeah i just removed unnecessary amount of trees and bushes and grass. some instances had 45k which was way too high
sorry i lied, thats my updated code - and with that it starts to come to me but then ticks a different npc thats close and switches to them, regardless of if im closer or not
mmm, changed code around a tad its the coillision causing an issue. it just goes after whoever the latest collision is not whoever is closest 😂
Hey everyone, got a really annoying problem where my game can't package due to an "Unknown Error". I've attached the full error report which I've looked through but can't find anything useful in terms of fixing it. Any help would be greatly appreciated, these are always the most stressful errors, right when you're close to being done. Thanks for reading
Look at the bottom, you need to change your include order which is possibly causing the compilation error on your game module
Thanks for responding, sorry for sounding dumb but what and where is an include order?
You set it in your target.cs for the game target.
Thanks again, found the file, what would you recommend changing it to? Never messed with C++ so I don't know how this has screwed up
How do I attach an actor to my hand socket without spawning it? I have its reference already and it exists.
I tried directly using attach actor to component but its bugging out the whole character. The speed, texture and everything. And really weird effect.
Like this but you need to disable the collision when you attach it so it's collision doesn't affect the character.
That's how you do it. Be sure to turn off collisions. Can't see why the texture would be weird though... *Also didn't see Patty's answer. Sorry for the double ping.
my onKeyDown ovveride function dosent work at all, game mode is Ui&game and focusable and the widget is set to "isFocusable"
what am i missing ??
I just figured out the error is not from the attachment but due to another mesh whose render pass was set to false. Which I did so it only cast shadow but it not visible. Its working for skeletal mesh but not for static mesh? And I did disable the collision. The weird part is that if I call equip then call unequip and again call equip it works the second time. However the component is not attaching.
I did so it only cast shadow but it not visible. Its working for skeletal mesh but not for static mesh? And I did disable the collision. The weird part is that if I call equip then call unequip and again call equip it works the second time. However the component is not attaching.
You'll have to show how you're currently handling it.
I was trying but my setup crashed I'll send it in a min
Hey everyone, does someone know if there is an easy way to connect this code when a key is pressed instead of the delay node?
This is my unequip
And this is equip
And my hierarchy
Toggle visibility from inventory is a node that just remove visibility, collision so that its not intractable in the real world anymore
Is this on a player character?
Nop, it's in an actor blueprint
